Hacker Newsnew | comments | ask | jobs | submitlogin
wslh 1381 days ago | link | parent

It's a shame that somebody point at this obvious feature on 2010. Javascript lacks a lot of features from scripting languages.


jmillikin 1381 days ago | link

Javascript is a scripting language -- and off the top of my head, I can't think of any scripting language with modules (maybe VBScript?)

-----

lunchbox 1381 days ago | link

Python, Perl, Ruby, Lua, R, Matlab, etc...I can think of more that do than don't.

-----

jmillikin 1381 days ago | link

None of those are scripting languages, except maybe Matlab -- I haven't used it enough to say.

Just because a language is dynamically typed doesn't make it a "scripting language".

-----

silentbicycle 1381 days ago | link

What? Lua isn't a scripting language? Can you flesh that out a bit?

(So is TCL, but I don't think it has a module system.)

-----

jmillikin 1381 days ago | link

Lua is a full programming language -- you can use it to write a complete application without depending on external third-party tools.

I usually take "scripting language" to mean "a language only suitable for combining pre-written components", since that seems to be the only useful definition. Other definitions are too broad (containing such languages as Python, Java, Haskell, and Forth) or too narrow (excluding QuakeScript, JavaScript, or Bash).

In particular, I refuse to call any language a "scripting language" merely because it uses dynamic typing, implicit compilation, or high-level concepts.

-----

catch23 1380 days ago | link

I think your definition is wrong, just go with wikipedia's definition: http://en.wikipedia.org/wiki/Scripting_language

Javascript can be run at the command-line just like ruby, python, and the rest. You can write a full application in pure javascript without depending on external third party tools too -- see stuff like nodejs.

Also, I don't know of anyone that would consider Haskell to be a scripting language. If we consider Haskell a scripting language, we might as well consider Java, C, C++ to be scripting languages too...

-----

jmillikin 1380 days ago | link

According to the Wikipedia definition, Haskell is a scripting language (it can be dynamically typed, interpreted, embedded, etc). That's why I don't think it's a useful definition.

How do you write a full application in JavaScript? The language doesn't even define any way to open a file. NodeJS is a third-party tool -- it's not part of the JavaScript language.

-----

silentbicycle 1380 days ago | link

While I agree that "scripting language" is a bit loosely defined (though nothing like "object-oriented"), Lua was written with a "hard and soft layers" (http://c2.com/cgi/wiki?AlternateHardAndSoftLayers) approach in mind. To me, that seems like the defining characteristic of a scripting language.

I'm not saying Lua isn't a full programming language - it's actually my language of choice for day-to-day hacking, supplemented with C as necessary. It was clearly designed to accommodate projects where it isn't primary language, though.

-----

melvin 1381 days ago | link

Dynamically typed, no. Interpreted, yes.

-----

jmillikin 1381 days ago | link

JavaScript is typically implemented with a JIT compiler, just like Java or C#. Python, Ruby, and Lua use virtual machines (like Java used to be).

-----

jonhohle 1381 days ago | link

That's why I've always maintained that Java is a scripting language ;)

-----

catch23 1380 days ago | link

typically? JIT for javascript is only a semi-recent innovation. I'd say most javascript runtimes pre-2009 didn't have a JIT.

> (like Java used to be)

So Java doesn't run on a virtual machine anymore?

-----

tung 1381 days ago | link

Lua has packages.

http://www.lua.org/pil/15.html

-----




Lists | RSS | Bookmarklet | Guidelines | FAQ | DMCA | News News | Feature Requests | Bugs | Y Combinator | Apply | Library

Search: