Page 1 of 1

Add JavaScript!

Posted: Fri Jan 11, 2013 4:46 am UTC
by lamefun

JavaScript is the programming language of the future, the programming language for people, the official programming language of the planet Earth!


Re: Add JavaScript!

Posted: Fri Jan 11, 2013 4:52 am UTC
by kharnov

I thought that was supposed to be Java.

In any case, we're likely adding Lua support for custom scenarios.


Re: Add JavaScript!

Posted: Fri Jan 11, 2013 7:25 am UTC
by KenuR

Oooh that's good, I have experience with lua.


Re: Add JavaScript!

Posted: Sat Jan 12, 2013 5:43 pm UTC
by velociostrich

I don't think any JavaScript interpreter could be fast enough for our needs, though there was a modified version of Sauerbraten called Systensity that had Google's v8 interpreter zip-tied and duct-taped to it. My problem with JavaScript is the mutability of every function/object; you need a hash table for every instance and every class, and somehow you need to store all that data in a readily mutable way, which means linked lists that get changed a lot. I think a simpler language would be much more appropriate for us considering that performance is a serious issue.


Re: Add JavaScript!

Posted: Sat Jan 12, 2013 6:15 pm UTC
by lamefun
velociostrich wrote:

I don't think any JavaScript interpreter could be fast enough for our needs, though there was a modified version of Sauerbraten called Systensity that had Google's v8 interpreter zip-tied and duct-taped to it. My problem with JavaScript is the mutability of every function/object; you need a hash table for every instance and every class, and somehow you need to store all that data in a readily mutable way, which means linked lists that get changed a lot. I think a simpler language would be much more appropriate for us considering that performance is a serious issue.

The problem is, JavaScript has been prescribed for PEOPLE by the Global Government and there's a possibility that all other languages and platforms except HTML5 and JavaScript will be banned.


Re: Add JavaScript!

Posted: Sat Jan 12, 2013 7:52 pm UTC
by velociostrich
lamefun wrote:

The problem is, JavaScript has been prescribed for PEOPLE by the Global Government and there's a possibility that all other languages and platforms except HTML5 and JavaScript will be banned.

Is there a reason you like to waste our time?


Re: Add JavaScript!

Posted: Sat Jan 12, 2013 8:45 pm UTC
by Superuser

LOL. JavaScript is an {
abomination
}
of a language (so many curly brackets!).

ON a more serious note, since you intend to integrate some form of scripting, what do you think of Ruby? I won't even link you to it, it's so famous as it's so excellently designed. The 'poor performance' of Ruby is a long-running myth that is no longer true as of Ruby 1.9, which uses merged the reference implementation with YARV and made some changes to the syntax. It also started working well with Unicode, and no problems exist with that.

Ruby is probably the most well-designed language I have ever used. Please take a look at using it instead of Lua for scripting! Much friendlier than Lua's ubiquitous but difficult-for-newbies C-like syntax, too. Not to mention that Lua does not support objects.


Re: Add JavaScript!

Posted: Sun Jan 13, 2013 1:25 am UTC
by Fuma
velociostrich wrote:

I don't think any JavaScript interpreter could be fast enough for our needs, though there was a modified version of Sauerbraten called Systensity that had Google's v8 interpreter zip-tied and duct-taped to it. My problem with JavaScript is the mutability of every function/object; you need a hash table for every instance and every class, and somehow you need to store all that data in a readily mutable way, which means linked lists that get changed a lot. I think a simpler language would be much more appropriate for us considering that performance is a serious issue.

With a modern JIT compiler ( Mozilla's Jaeger/IonMonkey, Webkit's DFG, Google's V8 ), JS is one of the fastest dynamically typed languages available.
The way you describe JS working is completely and totally wrong to a modern implementation of the language.

Using an interpreter will of course be a lot slower than using a JIT, but this is true for all languages, not just JS.

The biggest problem with JS is its lack of a standardized way to communicate with C code.
Lua is much better in this respect.