Live data from Hacker News

For modern development Javascript indeed is a shit language

live.julik.nl

191–200 of 243 posts

Re: For modern development Javascript indeed is a shit language

#191
post #66

Earlier quoted context omitted.

> I think it would be fun to take another run at the same problem — attempt to find a minimal, readable, and easier-to-learn language that fits in the same role as JavaScript — but to do so with a much more radical design. Do you think ClojureScript could fit this category? We have teams that use it in production without any significant problems at all.

It certainly could, and particularly so if you come from a Lisp background. But it also connects to a larger universe of Clojure libraries and practices, and a vast history of Lisp tradition — most probably for the best. In that sense, it might be more of a maximalist approach than what I'm looking for. (And (of course) readability is in the eye of the beholder ;)

Have you seen Wisp? [1] It's a minimalist approach with Clojure syntax. For me it may be the next step after CoffeeScript, which I believe has subtly brainwashed me into loving the lambda.

[1] https://github.com/Gozala/wisp

Re: For modern development Javascript indeed is a shit language

#192
post #145

Earlier quoted context omitted.

> No dammit, javascript does not coerce numbers to strings when comparing them, a "weak typing" implementation would behave exactly as he wants. Please note that I wrote it's a broken implementation over weak typing, not of weak typing. The typing system is fine, at least as far as this matter is concerned, but the standard library is badly applied over it.

> Please note that I wrote it's a broken implementation over weak typing, not of weak typing. But weak typing is a complete red herring, as I noted previously the behaviour of the default sort function is independent from the typing system, you could have a default sort function doing more or less the same thing in a very strict statically typed system. Haskell's `sort` is defined (more or less) as sort :: Ord a => […

Yes, of course it is a red herring! OP's rage was against the JS community taking it as an excuse for shity implementation, that's all I was trying to clarify...

Re: For modern development Javascript indeed is a shit language

#193
post #126

Earlier quoted context omitted.

- GWT - Dart - ClojureScript

Every single one of these compile to the JavaScript runtime. (Dart has a native VM in Chromium, but AFAIK it is a long way off from the real world)

Right and ClojureScript, for example, has full goroutines in it (i.e. core.async) if doing standard callback based async in JS isn't your thing.

Functionally, it makes little to no difference whether you're writing something that compiles down to JS or writing something that compiles down to its own runtime (assuming you turn source maps on your browser).

Re: For modern development Javascript indeed is a shit language

#194

Earlier quoted context omitted.

Without Python, Ruby, Javascript and Lisp, we are sort of running out of dinamic languages options.. But the funny thing is the one that got left out, is the one that is faster than Javascript: Lua

Is it really faster than Javascript though? http://benchmarksgame.alioth.debian.org/u32/benchmark.php?te...

This is for the lua interpreter. aka the PUC-Lua You should compare it to Luajit, wich is a proper JIT compiler as V8..

The benchmark game used to have Luajit, but they take it out for no reason..

You can download the scripts and run in you local machine against V8, using Luajit for real comparison..

http://luajit.org/

Also this link compare a lot of language implementations in different benchmarks than the ones in shootout

http://attractivechaos.github.io/plb/

edit: also see this blog post about benchmarks; if i am not mistaken, this guy is behind V8 and Dart VM's implementations

http://mrale.ph/blog/2011/05/12/dangers-of-cross-language-be...

Re: For modern development Javascript indeed is a shit language

#195
post #89
post #64

Earlier quoted context omitted.

Why? Sorting strings is a far more common thing to do than just sorting numbers, so it makes sense to use simple string comparisons as the default algorithm. Rather than come up with something that first evaluates the types in the list and then tries to figure out what to do.

No, it makes sense to sort strings when you get handed strings, and sort numbers when handed numbers. Period. Default behavior is now exactly as expected by 100% of developers. Your creativity as a language designer should only come in to play when dealing with sets of mixed type.

So how should [1, "a", 2, 3] be sorted by default?

Re: For modern development Javascript indeed is a shit language

#196

I've been meaning to pick up Dart for a new app, but there aren't any great frameworks for Dart apps yet. It seems Angular is being ported though.

Dart doesn't really need "frameworks" in the way that JavaScript does. The core libraries are very rich:

  * dart:async give you Futures (Promises in JS, no need for Q) and Streams
  * dart:core and dart:collections give you real data structures like List, Map, Set, Queue, LinkedList, LinkedHashMap, etc. Much more comprehensive than underscore.js
  * dart:html is much improved over JS's DOM, and have most of jQuery's functionality (see ElementList).
  * New and upcoming standards like Shadow DOM, custom elements and template binding let you declaratively define your HTML template in HTML with data-binding, which is the foundation of frameworks like Ember, Angular, Knockout, etc.
  * Polymer is a JS and Dart library for helping you write custom elements.
Also, the package system in Dart, pub, is very similar to npm and encourages smaller, focused packages rather than sprawling frameworks.

Check it out, it's a very nice language and environment. But I'm on the Dart team, so I'm obviously biased.

Re: For modern development Javascript indeed is a shit language

#197

Earlier quoted context omitted.

I'm pretty sure that the parent comment's author is aware of this. It does not change the fact that it's broken.

I don't know - it's just a default general API, obviously it's not going to match everyone's use case. I would say that even relying on sort made by someone else is already not fit for many use cases. If such a petty and trivial "problem" is what you have against Javascript, then you are basically saying it's a good language :--)

Yet somehow it works just fine out of the box in plenty of other languages, including Python, Erlang, Clojure, Ruby, etc.

Re: For modern development Javascript indeed is a shit language

#198
post #195
post #89

Earlier quoted context omitted.

No, it makes sense to sort strings when you get handed strings, and sort numbers when handed numbers. Period. Default behavior is now exactly as expected by 100% of developers. Your creativity as a language designer should only come in to play when dealing with sets of mixed type.

So how should [1, "a", 2, 3] be sorted by default?

Both Python and Erlang would return [1,2,3,"a"], Ruby and Clojure won't allow the comparison. Either of these approaches makes more sense than JavaScript's.

Re: For modern development Javascript indeed is a shit language

#199
post #179
post #157

Earlier quoted context omitted.

Here are a couple : Saltarelle - C# to JS compiler: http://www.saltarelle-compiler.com/documentation/supported-c... Funscript: http://funscript.info/samples/simpleasync/index.html

Thank you! Are there any non-ms solutions?

Funscript is not really MS - it's done by a third-party developer, and F# itself is open-sourced under a very liberal license, and runs well on Xamarin/Mono in OS X.

I don't think there are direct equivalents in other languages, although similar approaches exist. Checkout Elm for example:

http://elm-lang.org/Examples.elm

Re: For modern development Javascript indeed is a shit language

#200
post #175
post #9

Earlier quoted context omitted.

> why not instead dissect what we do with them: programs, and find ways to improve them ? The way to improve a lot of programs is to write them in a different language.

Another way is to fix/tune the algorithm

That may hit an upper bound, above which you have to rewrite in a different language. That upper bound may be quite low.
Post reply on HN