Move Lang
movelang.org
movelang.org
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.
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!
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?
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.
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?
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… 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")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.
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.
I think the new home is http://hackety-hack.com/
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"));
}it will always win in terms of code generated
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 ;-)
Oh yeah, and no semicolons.
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...
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) print [1,2,3].unique()
whoops.