• 2 Posts
  • 756 Comments
Joined 2 years ago
cake
Cake day: September 24th, 2023

help-circle
  • For bare metal definitely get a microcontroller and do some fun electronics project.

    Easiest to get into is Arduino, but don’t stick with that because its only redeeming feature is that it’s easy to get into. The IDE sucks, the build system sucks, the APIs really suck, and the code quality is very low (probably because it’s easy to get into so you get a lot of inexperienced people doing stuff).

    After Arduino I would recommend either going to the Nordic nRF5x series - you can do some cool Bluetooth stuff, or even make you your own radio protocol since the radio peripheral is fully documented… Or ESP32 with Rust and Embassy is probably the most modern and slick way to do microcontrollers.

    It does require learning Rust but Rust is really really good so you should do that anyway.

    There are some extremely good videos on YouTube about that: https://youtube.com/@therustybits

    I would probably still start with Arduino though since you know C. Just don’t stay there for too long.






  • In my experience a lot of these old projects really go out of their way to dissuade contributions anyway. Lots of naysaying “it’s always been like that”, ancient infrastructure - e.g. insisting on git send-email patches, etc.

    Usually the only way it gets resolved is when someone writes a more modern competitor and it starts gaining traction. Suddenly all those improvements that people tried to do and were told were impossible and stupid aren’t such a bad idea after all.

    I don’t think that’s the case with Unity but it probably is with things like GCC, sudo, sysvinit, X11, etc.




  • They don’t really let you do anything you couldn’t do in Python, they just let you write more elegant code.

    Personally I find ML-style languages to be difficult to read. They deliberately leave out a lot of the punctuation that makes code readable leading to code that just looks like a stream of words.

    Rust is I think the best option here - it steals most of the good ideas from functional programming but has saner syntax.

    Also you seem to be conflating pure languages with functional languages. I also made this mistake because Haskell is probably the best known functional language and it’s also pure… But they’re different things. OCaml is functional and not pure. You can use mutable variables to your heart’s content.

    TL:DR learn Rust not Haskell or OCaml.






  • Using a function is strictly worse than figuring out the formatting at compile time (something Zig also does).

    The derives are just shortcuts. You can write everything out long-hand like you would in C++ or Python too if you really want.

    Honestly both of these complaints are essentially “why does Rust use macros to make writing code better/easier?”.





  • Try interacting with anything that uses u64 and you’ll be a lot less happy!

    Anyway JavaScript does have BigInt so technically you are choosing.

    that insanity is how C and Intel handle NaN conversions.

    It’s not actually quite as bad as the article says. While it’s UB for C, and it can return garbage. The actual x86 conversion instruction will never return garbage. Unfortunately the value it returns is 0x8000… whereas JS apparently wants 0. And it sets a floating point exception flag, so you still need extra instructions to handle it. Probably not many though.

    Also in practice on a modern JS engine it won’t actually need to do this operation very often anyway.