Announcement

Collapse
No announcement yet.

Rust Porting Begins For Intel's "e1000" Linux Network Driver

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • quaz0r
    replied
    Originally posted by Volta View Post

    I think (and hope) it's not such common when value equals 1. I've just check and incrementation and decrementation in C like way is not possible in Rust. WTF?

    I'm not used to beg someone to 'let' me something. The one who chose this word must be some kind of beta. I'd prefer something like: auto name_of_var. 'Let' is completely unintuitive. Thanks for explanation btw.
    this guy wins best comment. some legend tries to correct him by saying gross syntax is quite common actually, ... lmao yeah no kidding. somebody promote this legend to chief detective

    Leave a comment:


  • oleid
    replied
    Originally posted by Weasel View Post
    That's exactly the problem. Let should only be used for functional languages, which Rust is not. There's a reason they're so cryptic for programmers instead of math nerds. Keep that shit away from structured languages.
    You mean programmers cannot adapt and learn?

    Leave a comment:


  • oleid
    replied
    Originally posted by Volta View Post

    I think (and hope) it's not such common when value equals 1. I've just check and incrementation and decrementation in C like way is not possible in Rust. WTF?
    You mean i++. Or was it ++i. Actually it is very common in code bases to require "one operation per line", so that "++i" has to live in it's own line.

    Originally posted by Volta View Post
    I'm not used to beg someone to 'let' me something. The one who chose this word must be some kind of beta
    That betas were mathematicians. In mathematics it is very common to start a proof with "Let".

    Leave a comment:


  • darkonix
    replied
    Originally posted by Weasel View Post
    That's exactly the problem. Let should only be used for functional languages, which Rust is not. There's a reason they're so cryptic for programmers instead of math nerds. Keep that shit away from structured languages.
    Basic used the let keyword to assign too. That was in the late '60s. It was not a functional language, no sir.

    Leave a comment:


  • dragon321
    replied
    Originally posted by kpedersen View Post

    Exactly. So my point is that perhaps Rust's strengths are not ideal here. It will all just be bindings and unsafe {} sections.

    In practice they are 100% equally as safe. Which is completely "unsafe" because all bets are off. Arguably the extra code needed for the Rust bindings "abstractions" open up a potential for more complex data marshalling issues and reduction of type safety.

    But that's the point of unsafe block in Rust. It's not like you are not supposed to ever use it and if you do then you are using Rust in wrong way. The point of unsafe is to have block of code that is separated from safe code. Instead of having all your code as "unsafe" (in Rust terms) like you would with C, you have only parts of the code as unsafe. So instead of having unsafe code you have safe code with unsafe parts. That separation is one of the Rust strength as well.

    Leave a comment:


  • dremon_nl
    replied
    Originally posted by Volta View Post
    but it has SIX string types same time. I can't figure out who their target developers are.
    It can be indeed confusing when people are coming from other languages but it makes sense when you learn it.

    Leave a comment:


  • dremon_nl
    replied
    Originally posted by Weasel View Post
    Except auto is only used when the type is not specified. And it means automatic type deduction. You don't type it when you specify the type.

    In Rust you have to specify both let and the type of the variable if you don't want an automatic type deduction. Which is just cringe.

    Also in JavaScript you can use "var" as well, AFAIK. Which is infinitely better than "let".
    "let" in Rust is not equal to "var" in other languages because it's also a pattern matching operator. For simple cases it looks like a variable declaration but it can do more. It can be also combined with "mut" to declare a mutable variable. The "<type> <name>" prefix notation for variable declaration which is used in C and C++ is horrible for many reasons. It's good that newer languages don't follow it.

    Leave a comment:


  • Volta
    replied
    Originally posted by mdedetrich View Post
    Considering when on the topic of Rust you spent your entire time constantly negatively criticising it without giving it a benefit of a doubt
    It's probably the first Rust topic I decided to post something against Rust.

    (like all of the software engineers much smarter and with more knowledge on this topic then you) I can safely say that it represents reality quite well.
    Rust somehow forces you to became better developer and that's probably good. It's against duplication (and that's sometimes good as well). However, it's also matter of taste. While it's C like language (or tries to be) its syntax is far from C. It's against duplication, so we can't use ternary conditional operator, but it has SIX string types same time. I can't figure out who their target developers are.

    Leave a comment:


  • reba
    replied
    Originally posted by Weasel View Post
    Also in JavaScript you can use "var" as well, AFAIK. Which is infinitely better than "let".
    Since the introducion of "let" (and "const") you should never use " var" anymore in JavaScript as those are block-aware, which "var" is not and thus is garbage. Pretty docs for more info.

    Also using let/var/val is important as it is a variable declaration which should not be mixed/overloaded with a variable definition.
    Writing a definition/initialization/assignment "i = 1;" without a specific declaration "dcl int i;" is just bad code and a programming language that allows this is a bad code language. Always use declarations, even bash does this (keyword "local") and IntelliJ complaining to you if you don't do it (rightfully so)
    Last edited by reba; 19 September 2022, 04:56 PM.

    Leave a comment:


  • bug77
    replied
    Originally posted by Weasel View Post
    Except auto is only used when the type is not specified. And it means automatic type deduction. You don't type it when you specify the type.

    In Rust you have to specify both let and the type of the variable if you don't want an automatic type deduction. Which is just cringe.

    Also in JavaScript you can use "var" as well, AFAIK. Which is infinitely better than "let".
    Go has worked hard to do away with any unnecessary cruft. And even in Go, you still have to write var i int. Seriously, it's just a style choice, let it go people...
    every language has quirks, if you adapt, you wouldn't be bothered if you had to declare variables using [<###>].

    Leave a comment:

Working...
X