• 2 Posts
  • 393 Comments
Joined 1 year ago
cake
Cake day: June 20th, 2023

help-circle








  • It sounds like he uses Rust and has some issues with it. IDK about green threads but Ada has had tasks (implemented in gnat with posix threads) from the beginning. If you pin a CPU core to a task and don’t use gc in it, that can handle your realtime stuff. Or these days, it’s becoming more common to use an fpga for cycle level timing control.

    Note that traditional Forth cooperative multitaskers used a few hundred bytes of code or even less. This stuff doesn’t have to be bloaty.

    Added: I’ve also seen a Boehm-style conservative GC in a few hundred lines of Forth. Using something like that in Rust could work nicely for lots of things.

    Anyway, you can have a soft realtime gc with pauses in the low milliseconds (Erlang has that). That’s OOMs lower than most internet ping times, so plenty fast enough for web servers. Which are all full of JS bloat now regardless.






  • Basically the variables like “greeting” in the program occupy memory locations, like “location 3”. Symbol resolution is when the compiler sees a name and figures out the associated location. Normally that is done with something like a Python dictionary (in the old days you’d have to implement the dictionary yourself, which was an exercise in its own right).

    Slightly complicating the python example, there can be local and global variables in separate locations but with the same name. So the compiler has to figure out from context which one you meant. That too is an exercise.





  • I think everyone likes to glue down batteries now because that helps the phone’s drop protection. The adhesive strips aren’t so bad since you can heat them a little / use a spudger to get the battery out. It’s worse when they make it very hard to get to the battery, or make you unglue delicate parts like the screen. You are probably right to be pessimistic though.


  • Check ifixit before you buy a phone, to make sure diy battery replacement is not too difficult. Then you don’t have to worry as much. Just figure on a swap or two during the phone’s lifetime.

    Other than that, keep charge level between 20% and 80% as someone said. But I think in that range, it’s ok to fast charge within reason.

    Supposedly starting in 2027, all phones sold in EU will have user replaceable batteries.