News for hackers. Stuff that matters.
Re:Compiling dynamic programming languages by n4r9 on Monday September 03, 2018 @06:22AM (#17901679)
I think the use of the word is fine. Whilst "compile" is often used to refer to programs whose target language is assembly/machine code, it generally refers to any translation from one computer language to another [0].

A "transpiler" is therefore a specific type of compiler.

[0] http://www.compilers.net/paedia/compiler/index.htm

Re:Compiling dynamic programming languages by alangpierce on Monday September 03, 2018 @12:39PM (#17903506)
Just going off of Wikipedia[1], "A source-to-source compiler translates between programming languages that operate at approximately the same level of abstraction", so at least by that definition, you probably shouldn't call it a "transpiler" if you're compiling from dynamic-typed code to static-typed code.

I view "transpiler" as a recent informal term to be a little more precise/honest when describing compilers targeting JS, but not one that people should feel obligated to use in place of the more generic term "compiler".

[1] https://en.wikipedia.org/wiki/Source-to-source_compiler

Re:Compiling dynamic programming languages by pulsarpietro on Monday September 03, 2018 @06:44AM (#17901747)
Yeah, that is what I was taught as well. From one abstract machine to another.

If we think about it javac would not be a compiler otherwise :-)

Re:Compiling dynamic programming languages by eatonphil on Monday September 03, 2018 @08:51AM (#17902304)
The reason I'm comfortable calling BSDScheme in particular a compiler is because ultimately you get a small binary you can bring to another machine without a runtime. Javac may get you bytecode, but you're still dependent on a JVM. This is the most useful distinction for most users, not if it compiles straight to assembly or not.

In the case of JSC, a binary is produced currently but it must be launched by a Node app. So it doesn't exactly meet my criteria. But being able to produce embedded V8 code will not be significantly more difficult for these examples. (Recreating Node's stdlib would of course be difficult but that's separate.) I'm hoping to have a Node-independent target soon.

Re:Compiling dynamic programming languages by pulsarpietro on Tuesday September 04, 2018 @06:33AM (#17907988)
I depend on the JVM in my mind traslates to "my target is the JVM"

You are "dependent" if you want on the RunTime (rt.jar). The way it was explained to me, and the model which I sticking to in my mind is:

Abstract Machine/language + RunTime = Level of the onions of a computer.

Assembly/CPU + libc Bytecode/JVM + rt.jar

The language manipulates the resources provided by the machine (registers, stack-machine etc etc).

My recollections are fading though - but I found this model to be good enough to explain me well how a computer works.

Re:Compiling dynamic programming languages by earenndil on Monday September 03, 2018 @04:08PM (#17904598)
You always need something on which to run your program. If you compile your program on openbsd, then you need another openbsd machine to run it, you can't run it on windows. How is something like the jvm different from an os?
Re:Compiling dynamic programming languages by pjmlp on Monday September 03, 2018 @12:43PM (#17903528)
The majority of comercial JDKs also compile to native code.
Re:Compiling dynamic programming languages by stochastic_monk on Monday September 03, 2018 @08:59AM (#17902340)
I still think it would have been much clearer had the title stated that transpilation was its mechanism.

I don’t know D enough to know whether GC is enabled in this project, which is a major weakness in many dynamic languages that one might imagine aot compilation could eliminate.