4 ms·
What I always fail to understand about Wasabi: why did they keep the code in the source language and compile to CLR object code, instead of running the same par
by derefr 11y ago
What I always fail to understand about Wasabi: why did they keep the code in the source language and compile to CLR object code, instead of running the same parser with a different codegen target, to transform the PHP wholesale into valid C# once, and then overwrite the codebase with that?
- nchelluri 11y agoDo you really want to inherit autogenerated code? I doubt the autogenerated C# would be nearly as easy to understand or read as the original Wasabi code. I also think writing CLR object code, if it's anything like writing assembly, would be much easier to generate than C#.
- derefr 11y agoWell, it is what they eventually did, after ten years. With tons of tweaks to make it spit out natural-looking outputs. I just don't understand why they didn't go that way from the start.
- nchelluri 11y agoI was unaware of that. I'm still betting they didn't go that way initially because of the inherent difficulties of autogenerating C# code.
- taspeotis 11y agoFrom the linked HN comment: > the C# code was not human-readable
- thedufer 11y ago> to transform the PHP wholesale into valid C# once I'm not quite sure what you mean; PHP was only ever a target; there was no source in PHP. It was something VBScript-esque being compiled to both ASP (later C#) for Windows and PHP for Linux. This started, of course, long before Mono.