6 ms·
Weird that the label specifies "ahead of time", which is implicit in "compiler", but does not mention that it is a Javascript-to-C++ translator rather than a no
by marssaxman 11y ago
Weird that the label specifies "ahead of time", which is implicit in "compiler", but does not mention that it is a Javascript-to-C++ translator rather than a normal machine-code-producing compiler.
- coldtea 11y ago>specifies "ahead of time", which is implicit in "compiler" Well, not that implicit, seeing that we also say "JIT compiler".
- spacemanmatt 11y agoDoesn't that demonstrate the parent's point if we need to qualify it with "JIT" because "compiler" connotes if not implies AOT?
- zem 11y agoNo, it means that "compiler" now refers to both JIT and AOT compilers, so you technically need to disambiguate, even though AOT is enough in the majority that you can leave it to be assumed in practice.
- jestar_jokin 11y agoJava compiles to its own bytecode ahead of time. The standard JVM also makes use of JIT to compile hot code paths to machine code. Python compiles to its own bytecode, but only when a script is first interpreted. Haxe compiles to many different source code languages ahead of time, including C++, Python, Java, JavaScript, and C#. It also compiles to a custom "Neko VM" bytecode. So, "compiling" isn't necessarily ahead of time, depending on what level of "compilation" you're talking about.
- marssaxman 11y agoIt's not necessarily done ahead of time, but if someone says they've written a "compiler", without qualification, I'm going to understand that as a program for taking source code as input and producing an executable as output, because that is the platonic form of a "compiler". Of course there are other sorts of programs which still qualify as a "compiler", but I'd generally expect that if someone is going to add qualifiers to "compiler", they would start with the qualifiers which distinguish their tool from the platonic compiler. In this case the authors have added a qualifier which is included in the platonic compiler form, without mentioning a significant way their project differs from the platonic compiler form, and that struck me as amusing.
- ant6n 11y agoA compiler is a translator. It translates programs from one programming language to another. You always want to compile to the easiest target language that solves the problem well and allows you to do the optimizations you want to do. By compiling to C++, they can focus on static typing and closures etc., but don't have to worry about generating machine code, and register allocation and whatnot. Back in school, I worked on a project to compile Matlab. We picked Fortran as the target, because it was very similar in terms of operating on matrices. But it's typed, and had a few very fast compilers available.
- marssaxman 11y agoOf course. I've written a compiler myself which used C++ as its output language. It just amused me that the authors made a point of specifying one characteristic of the program which is generally assumed as the default, while making no mention of another, far less common characteristic which effectively defines the scope of their project.