Wednesday, May 23, 2007

Reformed Curl

This is the post, or an effort to recreate the shattered post, on LcurlR.
Here is an LcurlR
{ some-curl-code }

which you could think of as
lCurl some-curl-code rCurl

Now that my wit has been relegated to the universal bit bucket, I will keep this short.
Here is a Curl snippet:

{curl 1.0 applet}

{let name:TextField = {TextField max-chars = 30, value = "My name"},
address:TextField = {TextField max-chars = 60, value = "12635 Somestreet"},
city:TextField = {TextField max-chars = 50, value = "Plymouth-or-Gardena"},
state:TextField = {TextField max-chars = 20, value = "MN-or-CA"},
zip:TextField = {TextField max-chars = 14, value = "55441-or-90245"}
}


Because RSI is a reality and not just a TLA, here is the same snippet in LcurlR
{LcurlR 3.0 applet}

{let name:= {TextField max-chars = 30, value = "My name"},
address:= {TextField max-chars = 60, value = "12635 Somestreet"},
city:= {TextField max-chars = 50, value = "Plymouth-or-Gardena"},
state:= {TextField max-chars = 20, value = "MN-or-CA"},
zip:= {TextField max-chars = 14, value = "55441-or-90245"}
}

If you are stilll not convinced of the virtues of LcurlR syntactic sugar over Curl try
{define-proc public
{sphere-vertices-normals hres:int, vres:int}:
({Array-of FloatDistance3d}, {Array-of FloatDirection3d})
let vertices:{Array-of FloatDistance3d} =
{{Array-of FloatDistance3d}.from-size
(hres + 1) * (vres + 1),
{FloatDistance3d 0f(m), 0f(m), 0f(m)}
}
let normals:{Array-of FloatDirection3d} =
{{Array-of FloatDirection3d}.from-size
(hres + 1) * (vres + 1),
{FloatDirection3d 0, 0, 0}
}

Programmers will tell you that their editor has a customizable code-completion feature. But what it may not have is a hi-lite option for all those type declarations which are otiose.
Lets start here:
let vertices:{Array-of FloatDistance3d} =
{{Array-of FloatDistance3d}.from-size

versus
let vertices:=
{{Array-of FloatDistance3d}.from-size

Without some such sanity I cannot see Curl regaining a foothold in small companies which might otherwise be tempted to use Curl for their own web needs. Small companies understand the cost of RSI.
Curl may continue in Japan. Making a language needlessly difficult to read and write is the very essence of Nihon-go and the barriers to the gai-jin.
China might change. Vietnam might embrace LcurlR. Or Sri Lanka with its plethora of alphabets.
Perhaps Curl can wait for the SemanticWeb and a new Google. Until then, try a google on 'curl' and tell me then that a name is just a name. Then try a Google on 'LcurlR'
I rest my case { embrace {reformed {curl LcurlR }}}

No comments: