HackerTrans
TopNewTrendsCommentsPastAskShowJobs

finiteparadox

no profile record

comments

finiteparadox
·ปีที่แล้ว·discuss
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.
finiteparadox
·ปีที่แล้ว·discuss
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.
finiteparadox
·ปีที่แล้ว·discuss
This sort of flow works well for me with obsidian+paperpile+latex
finiteparadox
·ปีที่แล้ว·discuss
[flagged]
finiteparadox
·ปีที่แล้ว·discuss
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...