Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?


Do 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#.


Well, 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.


I was unaware of that. I'm still betting they didn't go that way initially because of the inherent difficulties of autogenerating C# code.


> 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.


From the linked HN comment:

> the C# code was not human-readable




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: