Showing posts with label server-side. Show all posts
Showing posts with label server-side. Show all posts

Friday, December 10, 2010

node.js REPL

I do like the node.js REPL.
The classic test is to enter 3 > 2 > 1

But consider this
/opt/curl/surge/8/bin/curl --shell
Entering 3 > 2 >1 gives a much better response.

Curl is an expression-based language - can you name another in which 42 > x > 0 evaluates to a success?

But let's stick to curl for now:  enter the string exit
Now that is a respectable result.  Douglas Crockford, applied science is not a popularity contest.

Simulate loosing your bearings for a moment and enter exit()

Are you convinced that JavaScript variables should always use var?  If so, enter
let answ:int = 42
Note the echo behavior is not annoyig.  To see answ enter answ or {value answ}
To change the value of answ, try
{set answ=65565}
So I such an
ln -s /opt/curl/surge/8/bin/curl xcurl
since the folks as curl.com failed to protect Curl from cURL.

And an icurl.sh gets you your rlwrap xcurl --shell

And to exit the REPL
{exit}
When Crockford talks about the origin of JavaScript and the involvement of SUN, he leaves out a few details.  His audience may not need to know about Self or Strongtalk.
But when Crockford lays out the weaknesses of JavaScript prior to ECMAScript5 he neglects to mention Curl.  Just as he neglects to mention Rebol or Io.  But at a GoogleTechTalk?  Were those talks intended to be misleading? Biased?

I do like JavaScript just as I do like Python (for my own needs.)  But Python is wrong for applications which must be tamper-proofed on the server-side.  Python dynamic objects in that regard are scary.  JavaScript is worse.  And Curl is (for now) absent on the server-side.

As for node.js, Curl has offered event loops in closures since forever.  and for generators, see RolledRandom at curl.com