Re:The Shen programming language
by SamReidHughes on Sunday October 16, 2011 @10:29AM
(#3117373)
Instead of lambda expressions, it has slashdot expressions.
[ Parent
| on HN ]
I found this really odd. Any idea what the reasoning behind the "slashdot" is?
On a side: I like Haskell's take on lambda syntax (prefix with "\", e.g. \x y -> x + y).
If you squint (a lot), /. looks like a lambda.
Why don't we stop fucking around and just use λx y→x+y?
I agree. It's sometimes a pity that even with full unicode support nowadays we still resort to 'ASCII art' to express syntax in programming languages, reducing legibility. This is not so much a problem of US keyboards, because code editors could easily support the extra characters as part of the language support.
You can just configure your editor to figure out when \x y -> x + y is equal to λx y→x+y and replace the symbols as appropriate.
I have Emacs set up to do this for Haskell, so I really have the best of both worlds (mostly): I can type the former expression but it looks like that latter.
Re:The Shen programming language
by pavpanchekha on Sunday October 16, 2011 @09:01PM
(#3118812)
Because typing a lambda is not obvious on US keyboards.
I use RFC 1345 digraphs in vim to type unicode characteres. In RFC 1234, λ is l* and → is ->. To type the above, I just input l_*x y -_>x+y where _ means backspace. This is easy to learn, fast to type, and covers most of the useful unicode characters.
A shame, too. At least decent editors make this a tad easier. DrRacket, for example, binds lambda to Ctrl+\. Racket accepts both "lambda" and "λ" as the same thing, so it's up to personal preference.
Re:The Shen programming language
by pavpanchekha on Monday October 17, 2011 @12:25PM
(#3121129)
I'm well aware of how DrRacket works; nonetheless, telling a newbie to type "lambda" will lead to typing, and telling them to type a lambda will lead to griping.
Also, the difficulty of typing lambdas also means that writing blogs about code, or documents, or emails, will require even more pain.