you are viewing a single comment's thread
view the rest of the comments
[–] 34 points 9 months ago* (17 children)

What type of fun are you after?

https://images.prismic.io/sketchplanations/281df432-3a48-4e78-ac58-1ff835091f99_SP+582+-+The+fun+scale+-+revised.png?auto=format%2Ccompress&fit=max&w=1920

Type 1 is probably python.

Type 2 is probably rust or c.

Type 3 is one of the esolangs. Uiua. Or assembly.

  • source
  • hideshow 17 child comments
  • [+] [S] 8 points 9 months ago (13 children)
  • [–] 3 points 9 months ago (6 children)

    I'm curious what you mean by the payoff being a ways away. Do you feel you don't understand some aspect of Rust well enough to write anything in it?

    As a tangent to that and your original question what languages do you already know? Understanding where your knowledge is lacking could help provide better answers as what languages someone enjoys learning/using tends to change a lot as they become more experienced and start to develop an appreciation for the more complicated problems more involved languages help solve.

  • source
  • parent
  • hideshow 6 child comments
  • [+] [S] 3 points 9 months ago (5 children)
  • [–] 6 points 9 months ago (1 child)

    Aaaah, yeah. You're struggling with thinking in terms of types and scopes and probably also a tiny bit of stack vs. heap allocation. Javascript side steps most of the concurrency problems by having a single threaded runtime, and of course is a garbage collected language so you never really need to worry about memory management either.

    Rust is a much more powerful language, but of course with power comes responsibility. The compiler believe it or not is actually helping you a lot even though it probably doesn't feel like it. In something like C you'd probably be able to successfully compile those programs that Rust refused to build but then you'd get crashes and weird bugs when you ran the program with very few clues on where you made a mistake.

    Fundamentally here's the difference. Javascript is making the tradeoff that it will worry about a lot of the details for you, but it will get them wrong a lot and performance will suffer as a result. It also doesn't give you a lot of ability to express your problem well due to its incredibly primitive type system which will lead to a lot of bugs that are very hard to diagnose.

    Rust on the other hand says you need to worry about the details but it will give you some tools to make managing them easier to the point where you can ignore them a lot of the time. E.G. most of the time you can just stack allocate your variables and not worry about heap allocation and the headaches that can introduce. But the tradeoff for that is you can get some of the best performance out there and its advanced type system lets you model problems in ways that make bugs far less likely and much easier to diagnose and fix.

    Rust doesn't let you write code that works 90% of the time but fails 10% of the time, it forces you to write it in a way that works 100% of the time. This is particularly true for concurrent code where Rust prevents (mostly) race conditions that nearly every other language lets you write. If you're thinking some code that should work isn't compiling it's almost certainly because that code would fail with some kind of race condition under concurrency. The good news is once you start to understand where these problems crop up it's usually easy to resolve them by putting a Arc or RwLock wrapper around something or maybe just a simple .clone() if you don't mind the performance hit.

  • source
  • parent
  • hideshow 1 child comment
  • load more comments (1 reply)
  • [–] 2 points 9 months ago (2 children)

    Once it clicks, rust can be type 1, it certainly is for me. But it's definitely a long and hard type 2 to get there.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 5 points 9 months ago (4 children)

    Go is probably the best in terms of time it takes to learn and building something fun. It replaced Python in that regard for me.

  • source
  • parent
  • hideshow 4 child comments
  • load more comments (-1 replies)