▲ | int_19h 2 days ago | |||||||
> I've been using it as an experimental backend for my language project with great results. One annoyance that I've ran into when using Zig as a transpiler backend is the lack of unstructured goto. Many languages don't need that, but if you're dealing with the one that does, converting such code is non-trivial. | ||||||||
▲ | olivia-banks 2 days ago | parent | next [-] | |||||||
Yeah, this is one of the bigger pain points (that and no dynamic stack allocation). I got around this by defining anonymous functions and then calling between them (using `@call(.always-tail, ...)` where possible to avoid stack-frame overhead). Eventually, I restructured my IR to allow for more imperative code-generation, which I believe will lead to slightly better optimizations by the compiler. | ||||||||
▲ | hansvm a day ago | parent | prev [-] | |||||||
Labeled switches come pretty close. Is there a particular case you have in mind where they don't suffice? | ||||||||
|