3 ms·
A programming language and toolset that could transpile to human readable code for just about every popular/mainstream language out there. The closest I've seen
by dougk16 10y ago
A programming language and toolset that could transpile to human readable code for just about every popular/mainstream language out there. The closest I've seen is Haxe. This would be great for sharing business logic between different platforms. Right now it's a fragmented mess of tools of various quality, many using regexes to get you only 90% there. For example pretty much everything can transpile very well to Javascript, so no problem there. But what if I want to write common code for iOS, Android, and the web? I've never figured out a good solution here besides contortions with C/C++ or Javascript that introduced more problems than it was worth. Either that or you have to go all-in with a big framework like Xamarin.
I think part of the problem is that there isn't a demand, and, if I may rant a little, the reason there isn't a demand is that most developers do not separate business logic and platform-specific stuff (rendering, I/O, etc.) in the first place, whether from lack of skill/experience (which everyone including me is guilty of early in their careers), or the fact that the framework/platform you're working in "discourages" it.
- tluyben2 10y agoWhat is wrong with C++ for that? Works fine but maybe you have a specific case? What about C# or F#? That works fine as well for that purpose.
- dougk16 10y agoHaving done a few years of cross-mobile C++, we get into opinion territory perhaps, but it was never a smooth experience for me. Apologies, but don't have time today to go into too much justification for my opinion. It can be the lesser evil (e.g. you have an existing greater-than 10K LoC C++ codebase that you don't feel like porting to both Java and Swift), but, let's say I want to write a few methods, a few hundred lines of business logic, to validate user input on all three platforms. Sure I can bring out the C++ hammer but I've found that decision comes with more tool-fatigue overhead than it's worth, especially on Android. And I don't know the C++->Javascript story that well, that may be smoothing out these days. But even if all that worked smoothly, what if I want to move my logic to PHP as well? I know, now I'm getting crazy, but that's what the poster asked for :)