Hacker News new | ask | show | jobs
by bilekas 2309 days ago
Comparing javascript to C# is really not appropriate here, for so many reasons. I do think you know the main differences between interperated, transpiled and compiled for starters, but the "right tool for the job" is far more important.

Being fashionable is also not exactly fair, it was very flakey before jQuery created some entry level standard, because of its popularity it grew to what it is today, if thats 'fashionable' then I support it.

2 comments

> Comparing [JavaScript] to C# is really not appropriate here, for so many reasons. I do think you know the main differences between [interpreted], transpiled and compiled for starters...

Are you saying there is a fundamental difference between JavaScript and C# in this regard? I don't think there is.

Each language has a compiler that compiles source code to bytecode. Each has an interpreter that can directly execute that bytecode, and a Just In Time compiler that can compile the bytecode into native machine code.

These languages, along with Java, are pretty much identical with regard to these distinctions.

Transpiled and transpilation are ugly and unnecessary words. They are just a fancy way of saying compiled and compilation.

Some make a distinction between a transpiler and a compiler; however this is a distinction without a difference. A compiler transforms source code into object code. The source code or the object code may be a "low level" language like bytecode or machine code. Or either may be a "high level" language.

For example, TypeScript has a compiler that compiles TypeScript code into JavaScript. [1]

The original implementation of C++ was Cfront, a compiler that compiled C++ code into C code. [2]

For that matter, "machine code" on modern CPUs is a high level language of its own, which bears little resemblance to the low level operations that happen within the CPU.

[1] "The command-line TypeScript compiler can be installed as a Node.js package." https://www.typescriptlang.org/

[2] Personal discussion with Bjarne Stroustrup on BIX around 1985 when I called Cfront a "preprocessor" and he chewed me out and told me it was a compiler just like any other compiler. Also: "Cfront was the original compiler for C++... which converted C++ to C" https://en.wikipedia.org/wiki/Cfront

I am old. I have no idea what interperated is :)
:) Not sure if you're joking or not, so I'll be more rude and ask if you've ever written a compiler for the fun of it.. That will gauge your real age ;)
I'm not sure, but that person may have been attempting to make a joke about your misspelling of "interpreted".
ah.. Well colour me silly! ;) Well played!
On a more serious note: an excel macro language like VBA pretty much needs to be interperated or the compiler needs to be hidden away like VBA does. As user you shouldn’t have to deal with a compiler step. You can do this with C# pretty well as you can with other languages.

Personally I think it would be really cool if they used TypeScript instead of JavaScript.