4 ms·
While as you point out there's not necessarily an academic difference, the notion that your target language will itself require a compiler and/or runtime is use
by reikonomusha 11y ago
While as you point out there's not necessarily an academic difference, the notion that your target language will itself require a compiler and/or runtime is useful to know up front. Transpilers also usually attempt close to 1-to-1 translation. Functions become functions, constants become constants, etc.
As someone who has written many compilers before, I'd almost feel it would be a slight disservice to call a transpiler a compiler, mostly because their architecture and goals are often different.
- hellofunk 11y agoI think the distinction is useful too, as it gives you a better idea of where a language actually sits in a development workflow.
- progman 11y agoThen why not just use the term "translator"?
- reikonomusha 11y agoTranslate usually means something bijective.
- meric 11y agoI think it's fine to call it a compiler if it compiles a language to another of a lower level of abstraction, which may be true with compiling lisp to javascript, depending on if macros and read macros were implemented. There's just no way a programmer can manipulate the reader in javascript.
- 0_00_0 11y agoEval? Code as as string, parse, analyze, etc. Then code gen the JS you need into a string. Eval the string.