News for hackers. Stuff that matters.

finiteparadox

Re:Multi-Stage Programming with Splice Variables on Tuesday July 01, 2025 @08:01AM (#44433009)
I think you are missing the point a bit. With staging you can build up arbitrary levels of compile time abstractions and be sure that they will not appear in the final executable. Of course, an optimising compiler will reorder/rearrange code regardless. But it won't reintroduce all the abstraction layers that have been staged away. After enough abstraction layers, without staging even a compiler that optimises aggressively won't know to evaluate them away.

Let's put it another way: do you think there is utility in macros at all? And do you think that type safe code is better than untyped code? If you say yes to both, you must also think that staging is useful, since it basically gives you type safe macros. Now lots more things can be macros instead of runtime functions, and you don't need to deal with the ergonomic issues that macros have in other languages. For a more real world example, see Jeremy Yallop's work on fused lexing and parsing.

Re:Multi-Stage Programming with Splice Variables on Sunday June 29, 2025 @10:43AM (#44413563)
The point is that compiler optimisations are a black box and not guaranteed. They can be very brittle wrt to seemingly harmless source changes (even something as simple as making an extra intermediate assignment). You are at the mercy of the 'fuel' of the optimisation passes. With staging you get to control exactly what gets inlined/partially evaluated. Of course, to get good results you need to know what to optimise for.
This sort of flow works well for me with obsidian+paperpile+latex
A combination of staging and effects might be a candidate. Any other candidate will probably be staging + X.

https://se.cs.uni-tuebingen.de/publications/schuster19zero.p...

Re:There’s no such thing as a tree (phylogenetically) on Thursday March 09, 2023 @03:30PM (#35086255)
If tree is a category, does it have limits?
Incredible, one would expect this to be theoretically possible since Typescript's type system is Turing complete, but it is certainly different to see it done in practice. Wow!
Re:Why asynchronous Rust doesn't work on Thursday March 11, 2021 @06:46AM (#26422994)
This is just plain wrong. There's nothing you can do in C/C++ (or C+, as you put it) that you can't in rust, when it comes to parallelism. There's always unsafe if you really need it.