News for hackers. Stuff that matters.
Re:Introducing Spider 0.1 by tinco on Friday November 28, 2014 @11:22AM (#8671337)
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.

Re:Introducing Spider 0.1 by jamesfisher on Friday November 28, 2014 @11:53AM (#8671433)
Syntax != 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)`?
Re:Introducing Spider 0.1 by munificent on Friday November 28, 2014 @01:32PM (#8671724)
In 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.

Re:Introducing Spider 0.1 by robotresearcher on Friday November 28, 2014 @02:35PM (#8671909)
Function calls can block the thread too. Parent was questioning the need for the programmer to have a different syntactical interface to channels.
Re:Introducing Spider 0.1 by bollix on Friday November 28, 2014 @01:44PM (#8671748)
Renaming '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...

Re:Introducing Spider 0.1 by cheepin on Friday November 28, 2014 @02:31PM (#8671896)
For me, it's not really about the amount of typing I have to do. In my opinion, function is so annoying because it takes up way more horizontal space on the screen than it needs to, especially if you get a number of them together.
Re:Introducing Spider 0.1 by oalders on Friday November 28, 2014 @02:56PM (#8671977)
I think "horizontal spam" is a helpful designation for this particular problem.
Re:Introducing Spider 0.1 by orbitur on Friday November 28, 2014 @01:51PM (#8671775)
I 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.

Re:Introducing Spider 0.1 by Rusky on Friday November 28, 2014 @02:54PM (#8671966)
It's not just fashion or typing speed- syntax affects how readable code is. Common tokens that don't have a lot of meaning intrinsic to the program being written should be smaller or you get mired in bureaucracy when trying to read it.

Which of the following is clearer?

    plus(new vector(5, 3), scale(3, new vector(7, 3)))

    new vector(5, 3).plus(new vector(7, 3).scale(3))

    <5, 3> + 3 * <7, 3>
Re:Introducing Spider 0.1 by bollix on Friday November 28, 2014 @02:56PM (#8671976)
Probably the second one, but they all look basically the same to me. Perhaps programmers should get better at reading code.

The last one is least readable IMHO. It's like a regexp. It's the most ambiguous and has the most potential for errors also.

It's hard to typo "function" and have a program still compile/run. It's a lot easier to typo "fn" and still have the program compile/run. Smaller tokens mean more potential errors.

Re:Introducing Spider 0.1 by jfoutz on Friday November 28, 2014 @02:22PM (#8671860)
So do you bother with assembly or just go with straight binary?
Re:Introducing Spider 0.1 by bollix on Friday November 28, 2014 @02:54PM (#8671964)
assembly -> 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.

Re:Introducing Spider 0.1 by icebraining on Friday November 28, 2014 @03:49PM (#8672116)
Language 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.

Re:Introducing Spider 0.1 by evanspa on Friday November 28, 2014 @02:55PM (#8671974)
I'm with you. My favorite language is Blub.
Re:Introducing Spider 0.1 by alongub on Friday November 28, 2014 @11:27AM (#8671351)
You 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/ :)

Re:Introducing Spider 0.1 by rattray on Friday November 28, 2014 @01:42PM (#8671741)
That all went under "everything Coffeescript has". Perhaps he was less excited about the class thing or having to ::call globals.
Re:Introducing Spider 0.1 by tinco on Friday November 28, 2014 @06:22PM (#8672493)
Sorry, 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.