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 ;)
For modern development Javascript indeed is a shit language
191–200 of 243 posts
Re: For modern development Javascript indeed is a shit language
#192Earlier 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 => […
Re: For modern development Javascript indeed is a shit language
#193Earlier 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)
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
#194Earlier 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...
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..
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
#195Earlier 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.
Re: For modern development Javascript indeed is a shit language
#196I'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: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
#197Earlier 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 :--)
Re: For modern development Javascript indeed is a shit language
#198Earlier 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?
Re: For modern development Javascript indeed is a shit language
#199Earlier 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?
I don't think there are direct equivalents in other languages, although similar approaches exist. Checkout Elm for example:
Re: For modern development Javascript indeed is a shit language
#200Earlier 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