Post

the wild thing is that while there's good reasons to not use one language across your entire software stack from bare metal microcontrollers to web front-end, the one language you can do this with and have it not be an objectively stupid choice is probably rust.

Orual@nonbinary.computer

legit I use (micro)Python a fair bit for rapid prototyping on embedded, especially if I *know* for sure i am going to throw away the prototype or perf just does not matter one bit. if I think the prototype might become production I will often try and write it in rust.

9 reposts73 likes

i remember sitting in a room (i think it was in Columbus, OH) in 2017 where we wrote “embedded” “wasm“ “network services” on a whiteboard. truly unreal to see something succeed so much

yep. it blows my goddamn mind sometimes. and like, for the many flaws of rust and the missteps, it's just gonna get better at this, i think.

I'm garbage at writing Rust, but I can guide Claude to do some pretty good test-driven development by writing things in Python first and asking it to implement in Rust. I'm sure this is not a revolutionary observation, tho.

reference counting is wonderful. Rust is not actually a hard language. There are some things it makes you think about, but if you want to write good code that runs fast and is reliable you should already be thinking about them.

None of the challenges in this were down to the Rust language. It was entirely maturity of the framework, the challenges of browsers, and someone not having done the grunt work already like they did in JS. Rust made it, if anything *easier*. weaver.sh/did:plc:yfvw...

weaver.shWriting a Web-based Editor from ScratchAt some point a while back I decided that I was going to write the front end of Weaver in Rust. I'd looked through the various 'fullstack' web application fr...

rust gives you plenty of ways to avoid having to fuss with lifetimes if you don't want to. and IMO lifetimes are about as easy as monads, and neither is nearly as hard as everyone else makes them out to be.

I'll be honest, I didn't think I'd ever see anyone claim that Haskell is easier to adopt than Rust :berk:

yeah that might be another you could do it in, though i don't know if there's a version of it that'd run well on a microcontroller off-hand, or how well the web/wasm targets work, assuming those exist.

Melange and js_of_ocaml are pretty great. Def a lot better than what Haskell has in terms of bundle size but IMO the way forward for full stack OCaml is more like the Elm approach: wrapping an optimized JS or WASM runtime with a safe blanket of OCaml in which apps are built

It's...okay. the problem is it's a lot heavier than embedded rust. but also is there any in-browser swift stuff? bc that's the icing on the cake for rust, that there's real libraries and frameworks that are usable *all* the way up and down the stack.

is there a version of clojure that compiles to native instructions that could run on bare metal? i thought it was a JRE language

JRE includes binary assembly format specification for zero register big endian stack machine. This machine is usually implemented by an emulator and/or JIT-compiler in software, but hardware can & does implement it natively.

Any ARM processor that includes ARM9EJ-S extensions 'is' a hardware java machine. Which amusing is a lot of modern smart phones as javacard stuff was wildly successful for SIM cards & cell network identification.

partially the thing is that there is a *very* narrow set of languages that actually meet this. like depending on whether you count a vm that's written in another language or not, you lose python (micropython itself is also very much not iso normal python) and most JVM stuff, and BEAM, Lua, etc.

pretty much the only other reasonably non-obscure languages I can think of that you could technically do this in (bc you can run anything in wasm, the embedded/no-os target is the tricky bit) other than Rust are C, C++, Go, Objective-C, and Swift. Kotlin *might* bc it has a native target for iOS.

That makes sense, I also learned today that I internalized a misunderstanding of graal as being cooler than it is (which admittedly is still pretty cool)