4 ms·
What's to love about this language: - 'function' renamed to 'fn' - syntax for message passing (a la Go's channels) - syntax for promises - synt
by tinco 12y ago
What's to love about this language:
- 'function' renamed to 'fn'
- syntax for message passing (a la Go's channels)
- syntax for promises
- syntax for currying (!)
- everything that coffeescript has
In my opinion that seems to satisfy everything a modern Javascript programmer could want from a new language. I'm a CoffeeScript person myself and I love my super succinct code, but I'm also aware many people are turned off by lack of braces, and possibilities of ambiguity.
That and the fact that I've noticed my colleague has been rewriting callback code I wrote into ugly promise-like objects so they could be more powerful, so I think it's a good time to be exploring for nicer ways of dealing with the issue, preferably with some sugar.
- alongub 12y agoYou forgot that Spider embraces JS prototypes instead of just adding classes, ES6 target, explicit global scope usage, string interpolation, splats, `for-in` and `for-of`, list comprehensions, existential operator, ranges, and much more. Take a look at http://spiderlang.org/ http://spiderlang.org/ :)
- rattray 12y agoThat all went under "everything Coffeescript has". Perhaps he was less excited about the class thing or having to ::call globals.
- tinco 12y agoSorry, I edited the last list entry to "everything Coffeescript has" was "syntax for lambdas" before. He is correct, all the features CoffeeScript has are pretty much essential and are in fact in this language, so I edited it to reflect that.
- jamesfisher 12y agoSyntax != semantics. The JavaScript problem is not a syntactic one. Baking "channel <- message" into the syntax only introduces unnecessary syntactic complexity; why not just `put(message, channel)`?
- munificent 12y agoIn an implementation that follow's Go's semantics, both reading and writing from a channel can be a blocking operation that causes the current "thread" to suspend until the channel is ready to receive or provide a value. That in turn means you need to compile it to something like the CSP-transformed JS you use for async/await. It's not just a little bit of sugar for a method call. The compiler needs to be aware of it so it can transform the code appropriately. However, from looking at the code, it looks like spider currently only does this for channel reads. Writes are always non-blocking, which limits their usefulness.
- robotresearcher 12y agoFunction calls can block the thread too. Parent was questioning the need for the programmer to have a different syntactical interface to channels.
- bollix 12y agoRenaming 'function' to 'fn'? So much of this is down to fashion. Are programmers really bound by their typing speed? No. The only real thing that matters with a language is "can I run this on hardware X", and "How fast does it run / how much memory". Syntax is utterly irrelevant (Unless you're into fashion). Lisp is just basic with a different syntax...
- orbitur 12y agoI don't know if it's fashion, really. A lot of web developers aren't using IDEs like WebStorm, so they're missing out on autocomplete for a lot basic tokens, like "function". I know when I started working on Angular apps after living in my Xcode bubble for so long, the first item on my list was to find a good IDE for web development. Sublime is good, but it's not that good. I don't type very much, I hit Tab key.
- jfoutz 12y agoSo do you bother with assembly or just go with straight binary?
- bollix 12y agoassembly -> binary is an encoding not a syntax. That's like asking an author if he writes using the alphabet or ascii. Programming language debates are like asking Charles Dickens why he wrote in English rather than Russian. Would his books have been any different in Russian? No - it's irrelevant.
- icebraining 12y agoLanguage in literature is certainly not irrelevant. Any translator (or even bilingual person) will tell you that some concepts are very hard to translate, because the target language was shaped by a different culture. And in scientific and other non-fictions texts - which are closer to programs than literature - this was doubly so, as the number of important scientists and philosophers writing in non-native languages shows.
- deleted 12y ago