1

Just recently had an argument on whether javascript in node.js was interpreted vs compiled. I was arguing that it was an interpreted language whereas she was arguing that it was compiled since she had to restart the node app to see changes to the js code.

I was thinking it was not considered compiled because it didn't have a traditional compile step before running, although I guess technically the v8 engine compiles it dynamically at runtime.

She was saying that the definition of dynamically interpreted runtime means that it has to be monitoring the file system for changes to the source files and updates the runtime accordingly - is that indeed the definition?

Does the definition of an interpreted language require file monitoring for live updates? What definition includes such a feature?

What's the correct definition?

MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
  • Short answer is, she is more correct than you are. – Brian Oct 05 '15 at 22:28
  • although by that definition, wouldn't traditional javascript also be considered compiled? Also, you can have an interpreted language that doesn't monitor the code files for live reloading right? – MonkeyBonkey Oct 05 '15 at 22:31
  • You should read the answers to the same question here. http://programmers.stackexchange.com/questions/138521/is-javascript-interpreted-by-design – shafeen Oct 05 '15 at 22:31
  • "compiling" often means you translate the code to other representation (machine code or byte code) and then execute that representation. A language is not interpreted or compiled, (there are C interpreters), but an _implementation_ of the language can be interpreted or compiled. BTW the definition of dynamically interpreted runtime she said is completely wrong. – Bryan Chen Oct 05 '15 at 22:35
  • while you could say that v8 makes javascript a compiled language - I feel like that goes against the broad definition of javascript being an interpreted language.. – MonkeyBonkey Oct 05 '15 at 23:19

1 Answers1

0

I would propose that since you can run node with breakpoints, change the code (and in-memory data) on the fly, and continue running, that's probably proof enough that it can be run ad-hoc (interpreted).

Technically, though, every programming language is a compiled programming language, whether it is traditionally compiled or not.

Dan Crews
  • 3,067
  • 17
  • 20