News for hackers. Stuff that matters.
Re:Move Lang by there on Monday March 14, 2011 @03:45AM (#2321682)
Move is primarily aimed towards people not previously familiar with programming computers.

i am familiar with programming computers and the brackets, carets, and parentheses needed in the 3-line demo on the home page put me off.

Re:Move Lang by middus on Monday March 14, 2011 @07:11AM (#2322027)
This is really a problem. I have taught a lot of beginners in a university environment and many of them already have problems with the different C-style brackets: ( [ { } ]). Some of them asked me "Where do I find the curly ones?" AFAIK they are not even printed on many Mac keyboards.

Just imagine the hell you get into when you're using a caret/circonflexe - a character a lot of people never use at all. Imagine them finally finding the key, hitting it just to find out that in most environments they'll have to hit the space key to make it appear. A teacher's nightmare!

Re:Move Lang by kqueue on Monday March 14, 2011 @03:47AM (#2321685)
hello = ^(name){ "Hello "+name } repeat {times: 3} ^{ print hello {name: "John"} }

The syntax makes no sense. How can this be aimed towards people not previously familiar with programming computers?

And how can this be considered intuitive?

>When creating a function, we can specify function arguments, which are sorrounded by parentheses and put in between the "^" and the "{". These "arguments" are just like variables, but which are only available inside our function.

What's wrong with python for newbie programmer?

Re:Move Lang by exit on Monday March 14, 2011 @04:22AM (#2321751)
the code you pasted was presented on 3 lines originally:

hello = ^(name){ "Hello "+name }

repeat {times: 3} ^{

  print hello {name: "John"}
}

what doesn't make sense about it? it clearly does make some kind of sense since move has a working parser.

> What's wrong with python for newbie programmer?

nothing wrong with it, but nothing demanding it either.

i use python daily and wish it had anonymous function constructions, like javascript or, apparently, move. i think it's healthier for new programmers to appreciate code as data as soon as possible.

Re:Move Lang by endtime on Monday March 14, 2011 @04:48AM (#2321792)
>i think it's healthier for new programmers to appreciate code as data as soon as possible.

Disagree. It's important for new programmers to feel comfortable and not confused. Code as data is a relatively overwhelming concept and I don't see any benefit to introducing to someone who doesn't even know the basics yet.

I do wish Python had real anonymous functions too - I use them all the time in CoffeeScript - but I don't think their absence makes Python a worse languages for beginners.

Re:Move Lang by latch on Monday March 14, 2011 @04:41AM (#2321781)
Maybe it's because we know how to program, but I agree that the syntax looks confusing/poor. But then, the example is confusing. Why are we building a function for what should ultimately be:

do three times print "Hello John end

I guess my point is that, if the goal is to target new developers, why show "advanced" topics (like method) for an example that doesn't even need it?

Re:Move Lang by rimantas on Monday March 14, 2011 @05:15AM (#2321836)
Well, in Ruby:

  3.times do
    puts "Hello John"
  end
Or

  greeter = lambda {|name| 3.times { puts "Hello " + name}}
  greeter.call "John"
Not sure, what Move offers there…
Re:Move Lang by bergie on Monday March 14, 2011 @05:19AM (#2321839)
The CoffeeScript example would be:

    for number in [1..3]
        console.log "Hello, John"
Again, quite a bit simpler than Move. And runs everywhere with a browser :-)

...and if you want to do it exactly as in the example, then:

    hello = (name) -> "Hello, #{name}"
    for number in [1..3]
        console.log hello("John")
Re:Move Lang by krakensden on Monday March 14, 2011 @04:58AM (#2321811)
"Move is primarily aimed towards people not previously familiar with programming computers."

And your lede is creating a function? Your demo should be:

print "Hello John"

Really, seriously, no one who isn't a programmer cares about functions.

Related: http://shoesrb.com/ needs some love.

Re:Move Lang by telemachos on Monday March 14, 2011 @08:35AM (#2322206)
> Related: http://shoesrb.com/ needs some love.

I think the new home is http://hackety-hack.com/

Re:Move Lang by jashkenas on Monday March 14, 2011 @10:22AM (#2322563)
For the curious -- I was wondering what the initial example:

    hello = ^(name){ "Hello "+name }
    repeat {times: 3} ^{
      print hello {name: "John"}
    }
... compiled to as JavaScript. Here's the output, which you can reproduce by calling "move.compile()":

      "use strict";
      var Move, _MoveKWArgsT, Text, extend, create, print, repeat, after, JSON,
        hello;
      Move = __move.runtime, _MoveKWArgsT = Move._MoveKWArgsT, Text = Move.Text,
        extend = Move.extend, create = Move.create, print = Move.print, repeat =
        Move.repeat, after = Move.after, JSON = Move.JSON, require = Move.require;
      return hello = function (name) {
        name !== null && typeof name === "object" && name.__kw === _MoveKWArgsT 
          && (arguments.keywords = name, name = name.name);
        return "Hello " + name;
      }(repeat({
        times: 3,
        __kw: _MoveKWArgsT
      })(function () {
        return print(hello({
          name: "John",
          __kw: _MoveKWArgsT
        }));
      }));
For comparison, here's what the same example in CoffeeScript:

    hello = (name) -> "Hello " + name
    for i in [1..3]
      print hello "John"
... compiles to as JavaScript (which you can reproduce in the "Try CoffeeScript" console):

    var hello, i;
    hello = function(name) {
      return "Hello " + name;
    };
    for (i = 1; i <= 3; i++) {
      print(hello("John"));
    }
Re:Move Lang by itsnotvalid on Monday March 14, 2011 @11:19AM (#2322808)
The very first part of it is really the injection of Move specific functions like 'repeat' and 'after'. It's just that they are injected as functions instead of being replaced directly in code.

Then it does the enabling of the ability of calling via hello 'x' or hello {name:'x'}, some syntactic sugar.

As my limited knowledge of coffeescript goes, you advocates on having the generated script as readable as possible, so these kind of sugar may irritate you ;-)

Re:Move Lang by _tef on Monday March 14, 2011 @10:58AM (#2322701)
coffeescript is only a syntactic change and introduces no new semantics.

it will always win in terms of code generated

Re:Move Lang by afshin on Monday March 14, 2011 @04:11AM (#2321731)
This language seems an awful lot like JavaScript, except you can set default values for arguments, all arguments get passed in via an object literal, and "function" is called "^"

Oh yeah, and no semicolons.

Re:Move Lang by bergie on Monday March 14, 2011 @05:39AM (#2321866)
Why is a good question here. You already have a cleaner syntax for generating JavaScript:

http://jashkenas.github.com/coffee-script

Re:Move Lang by loup-vaillant on Monday March 14, 2011 @06:46AM (#2321973)
The syntax is more cumbersome than actually needed. It probably should use mandatory indentation as well. We lovers of curly brackets may not like that, but it makes things easier for beginners.[1] In this case, the first listing would have looked like that:

    hello = ^name -> "Hello " + name
    repeat {times: 3}
      print hello {name: "John"}
Or, without the keyword arguments:

    hello = ^name -> "Hello " + name
    repeat 3
      print hello "John"
(the last line is meant to be a function. Indentation is used instead of ^{}) Note that for a syntax that use juxtaposition for function application, I was very surprised to see that

    print hello "John"
    
    ==  print (hello "John")
    !=  (print hello) "John"
It looks like a misfeature (doesn't work well with currying), but maybe there's some justification?

(Edit: the language does look very simple, and I like that. Very good for "I'll show you programming in 10 minutes". For that purpose, fixing the syntax would make it even better.)

[1]: http://okasaki.blogspot.com/2008/02/in-praise-of-mandatory-i...

Re:Move Lang by itsnotvalid on Monday March 14, 2011 @10:49AM (#2322657)
Sounds like Coffeescript to me.

Since the reference part points to ECMAScript (without being in the syntax of ECMAScript), I am simply guessing that it is extremely similar to coffeescript that entails a nearly one-to-one bindings to JavaScript.

However I am in no way seeing it sigificantly easier to code than JavaScript itself, given that it's again prototyped language, and it again subjected with the same problems JS has.

There is some interesting aspects of this language though, e.g.

  after {delay: 3000} ^{ print "3 seconds later" }
the thing is after returns an "executor" function which get called with a lambda function. If the same thing has to be written in coffeescript:

  after({delay: 3000}) () -> alert "3 seconds later"
looks not as elegant, as the parameter of the first function call can't be passed without parentheses.

(implementing "after" in coffeescript)

  after = (a) ->
    a? and typeof a == "object" and (arguments.keywords = a;a = a.delay)
    if a
      if typeof a isnt "number"
        throw new TypeError '"delay" argument must be a number'
    (fn) -> setTimeout(fn,a)
Re:Move Lang by StavrosK on Monday March 14, 2011 @07:21AM (#2322059)
As an aside, who creates all these great-looking websites? I keep seeing very beautiful websites and yet all mine look like crap... Where are all these people with fantastic design sense hiding?
Re:Move Lang by _tef on Monday March 14, 2011 @10:48AM (#2322651)

    print [1,2,3].unique()
whoops.