10
hinst
2y

I started learning Rust and now I know the answer to the question "What would a programming language look like if the engineers were tasked with designing a bad programming language on purpose"

Comments
  • 3
  • 2
    It can't be worse than php, can it?
  • 7
    . 🍿
  • 3
    Ummm… what? You trippin?
  • 0
    @t3b4n narrator: but it can.
  • 0
    Shots fired. 🍿
  • 1
    Curious to know why since I like a lot of Rust design. Don't like the overly political environment it has though.
  • 1
  • 4
    Some things are really weird tbh or hard to grasp (like that enums are more what unions are in most modern languages).

    But aside from that, I regard it as a unicorn language with a ridicules learning but a similar ridicules reward for surviving it.

    As far as I understand it, the language took some good things from ancient languages (fortran, haskell, ...) as well as some "university languages". That combined with the borrow checker makes the language pretty hard and unfamiliar initially.

    Btw, someone made a talk, where he took bad parts from many languages and made up a new worse one. Funnily enough he didn't take anything from rust and even praised it: https://youtube.com/watch/...

    Edit: Little tip. Use rust-analyzer over the offical rust extension (which usually is outdated rls). For example in vscode. Not sure if intellij uses the r-a by default.
  • 1
    @t3b4n it can, I can do what I want in php without overly confusing compiler bitching syntax because guess what? php is for web development...... your question makes no sense
  • 2
    The answer to a better c++ is not Rust, it is honestly learning proper c++. Rust has no space in: game development (C++ is still king here) low level development (C reigns here), application development(go, java, c#, c++ and many other live here) etc

    I don't get the appeal of rust, by the time I am done learning how to program in Rust I can just get good with the proper new standards of c++.

    As a web developer, Go makes way the fuck more sense, garbage collected I know. But I don't get the examples that I see "say you forget to free memory when you use malloc" then....just don't fucking forget?

    "Say you forget to do x when you are working with multiple threads" ok, then just don't fucking forget?

    like I don't get it, Rust seems to appeal to people in high level enterprise development scenarios, for which getting a job is hard, if you forget the cases in which Rust protects you then you are a noob, so, don't apply for those jobs?
  • 0
    It would probably look like JavaScript
  • 6
    Rust does many things right.

    Borrow checking isn't just about memory safety. One of rusts approaches is in general concurrency and preventing data races (not race conditions).

    Grumpy me doesn't like _everything_ Rust has - but one must admit that attacking the 3 hardest things in programming (owner / lifetime handling, concurrency and memory safety) in a language is no small feat.

    Yes, understanding the borrow checker is hard - but the same is true for understanding and preventing any of the 3 problems it solves.

    I still dislike the (necessary) of unsafe + but it seems to have gotten better the last years.

    Plus rust does has a nice evolving model and a root foundation of splitting things logically up:
    - core
    - alloc
    - std

    Many cargo packages adapted to only rely on the rust core/alloc part - no_std .

    It's one of the things that makes rust very viable for writing firmware / kernel / bootloader code.

    An interesting nitbit - cause firmware / kernel / bootloader's are another security nightmare.

    So saying that the language was intentionally designed to be bad - nope.

    It's hard and I don't like the syntax - but Rusts base principle and foundation is very solid and tried from the beginning to not only incorporate other languages features / styles, but also maintain a strict course of being as universal usable as possible.

    Last but not least - Rust links statically, which is possible with Go, too.

    Meaning that you can easily distribute a single binary without any form of dependencies.

    Static linking has it's downsides, yes.

    But if you look at e.g. prometheus exporters and other critical stuff, it has the very highly favored upside that distribution becomes far more easy.

    Which is for security and critical things like monitoring really important.

    Replacing a single binary is a lot easier than having to update a whole system and playing whack a mole with dependencies and possible runtime errors ;)
  • 0
    Everybody hates Rust when first learning it, been there too. People hate what they don't understand. But you get over it. You got this!
  • 1
    @12bitfloat not everybody, but I guess it’s easy to get frustrated when learning Rust. I like to apply this thinking to all learning that it can be applied to: first understand, only then learn. Learning something hard gets much less frustrating when you get the whys behind it all.
  • 0
    Actually, if you really want a prime example of a bad language on purpose, try MUMPS.
Add Comment