r/programming • • Dec 23 '12

What Languages Fix

http://www.paulgraham.com/fix.html
445 Upvotes

294 comments sorted by

View all comments

26

u/SirClueless Dec 23 '12

Another interesting family of languages:

  • JavaScript: Netscape is boring.

  • CoffeeScript: JavaScript is a kludge.

  • Dart: JavaScript is a kludge, and it's slow.

And a recent trend in programming languages:

  • Go: C++ is a kludge, and it takes forever to compile.

  • Rust: C++ is a kludge, and it's not safe to use.

59

u/boa13 Dec 23 '12

JavaScript: Netscape is boring.

This does not make sense. Especially since JavaScript was invented at Netscape by Netscape for Netscape, at a time when Netscape was leading the way.

I suggest:

  • JavaScript: We need a scripting language for web pages. Hurry, now.

28

u/flying-sheep Dec 23 '12

Having read its creator's explanation of how it went, it was exactly that, combined with “oh, and make sure it kinda looks like Java”

7

u/chwilliam Dec 23 '12

Where's the "kinda" here? It's not even close. I always assumed they called it JavaScript just to latch onto the Java hype train.

7

u/munificent Dec 23 '12

Where's the "kinda" here? It's not even close.

Eich originally wanted to make a Scheme. Given that, JS syntax is a hell of a lot like Java. It has almost the exact same expression syntax, same operators, same precedence. Same statement/expression distinction, semicolons as terminators, same control flow structures.

1

u/TinynDP Dec 28 '12

It looked like LISP, until the very last minute, where they added curly brackets and such that to make it look half-way like Java.

4

u/[deleted] Dec 23 '12

JavaScript was rather:

  • If you keep using Scheme for web scripting, we'll fucking kill you.

Netscape has initially had a scheme dialect for scripting, but had to change to to something more "java like" after Sun applied significant pressure on them to jump on their newly started Java bandwagon. The pressure was so large, that they made Netscape not only change the syntax, but to even brainlessly squeeze the name Java into it.

The early JavaScript versons were BTW written in Common Lisp and are still available from Mozillas repositories.

5

u/MachaHack Dec 23 '12

AFAIK, the name Javascript was actually Netscape management trying to cash in on Java's popularity at the time. Not pressure from Sun.

1

u/[deleted] Dec 24 '12

The early JavaScript versons were BTW written in Common Lisp...

Wow, so ClojureScript isn't as outlandish an idea as it sounds?

12

u/cogman10 Dec 23 '12

Typescript: JavaScript is scary, let's make it less so by adding classes

7

u/[deleted] Dec 23 '12

And modules. Let’s not forget that.

<script type="application/ecmascript" charset="UTF-8" src="in.js"></script>
<script type="application/ecmascript" charset="UTF-8" src="the.js"></script>
<script type="application/ecmascript" charset="UTF-8" src="right.js"></script>
<script type="application/ecmascript" charset="UTF-8" src="order.js"></script>

7

u/trapxvi Dec 23 '12

LiveScript: CoffeeScript has broken scoping and needs more Haskell.

6

u/dysoco Dec 24 '12

I'd say something more of:

Go: C++ failed to improve C.

And maybe:

D: C++ needs more template stuff.

5

u/ThisIsDave Dec 23 '12

Doesn't JavaScript have shockingly good compilers for most tasks these days?

21

u/smog_alado Dec 23 '12

The compilers are very good but only because lotst of people spent lots of time on it. Javascript is still very complex and hard for optimize.

To give an idea, the JIT compiler for Lua has comparable performance to the Javascript JITs but its developed by one guy.

5

u/gsnedders Dec 23 '12

Only for short-lived scripts where compilation time is a luxury you cannot afford. There's a lot more that could be done for longer-lived scripts.

→ More replies (7)

2

u/tonygoold Dec 23 '12

Google's Closure Compiler makes it possible to write large-scale applications in Javascript, if you don't mind annotating everything with JSDoc comments. It doesn't just verify and minify your code, it actually compiles it into more efficient Javascript.

3

u/[deleted] Dec 24 '12

Clojurescript: I don't like Javascript, let's just transcompile everything from Lisp.

0

u/[deleted] Dec 23 '12

[deleted]

1

u/cogman10 Dec 23 '12

I think the popularity of dart will be surprising to you. Already dart vm is 2x faster than v8 (impressive for such a young language) and my bet is that once their crosscompiled javascript gets fast enough, it will become quite a popular language.

0

u/[deleted] Dec 23 '12

[deleted]

→ More replies (2)

2

u/eikenberry Dec 23 '12

For Go and Rust I'd add "and VMs are expensive."

1

u/A_for_Anonymous Dec 24 '12
  • Rust: C++ is a kludge, and it's not safe to use, and Dart is a toy for Java programmers.

3

u/cogman10 Dec 24 '12

Rust and Dart really aren't competing languages. Rust is looking to be a new systems language while dart is looking to be a new web language.