4 ms·
The only language I can think of that has pulled off “compiles to another totaling language” and gained mainstream adoption is typescript, and I’m sure it would
by philosopher1234 2y ago
The only language I can think of that has pulled off “compiles to another totaling language” and gained mainstream adoption is typescript, and I’m sure it wouldn’t have done so if it were possible to run in the browser otherwise.
Can anyone think of another example?
- elliotlarson 2y agoElixir compiles to Erlang, I think.
- toolz 2y agoNot exactly correct, it does have "core erlang" as a compilation step, but they both have that as a compilation step ultimately compiling to beam bytecode.
- giancarlostoro 2y agoCorrect Elixir runs on the BEAN.
- ARandomerDude 2y agoCoffeeScript was pretty popular about 10 years ago and did this.
- tylerhou 2y agoC++ used to compile to C.
- furyofantares 2y agoC++ is for sure gonna be the biggest example. I think Objective-C too. There's other successful but not "mainstream" languages that might count or semi-count, like Clojure targeting the JVM (though not Java) and being able to use Java packages, or ClojureScript targeting JavaScript.
- michaelsbradley 2y agoNim compiles to C by default, and it seems most Nim devs stick with that default. Nim hasn’t gained mainstream adoption, though.
- hiccuphippo 2y agoNot exactly the same but a few languages compile to llir which then is compiled by llvm to machine code.
- dhosek 2y agoThere’s web2c which transpiles Pascal-Web to C code. And in the 90s, Eberhard Mattes, to enable his port of TeX and friends to OS/2 and DOS wrote a Pascal to C compiler (I remember when it was first released, there was speculation that it might have been a pirated commercial implementation because how could one guy manage this, but that was short-lived as people realized it was faster than any of the commercial versions.)
- zem 2y agohaxe is not quite "mainstream adoption" level but it has a decent amount of stuff done in it clojurescript is fairly popular too.
- doctor_eval 2y agoI like your take but - not that this was important to TypeScript - JavaScript was literally the assembly language of the web (asm.js) until WASM came along. There was no other target that TypeScript could compile to. I guess that’s why TypeScript simply added types to JS, rather than being a wholly new language, which in turn made it compatible and familiar to potential adopters. It also solved a big problem caused by the growing size of client code bases. All of that said - this train of thought lead me to discover AssemblyScript! https://www.assemblyscript.org/ https://www.assemblyscript.org/