
Introducing Clochure: a better Clojure - old_sound
http://clochure.org/
======
Wilya
> The [] keys are closer to the central row of your keyboard than the less
> comfortable ().

> You don't need to hold the shift key to type [] therefore you can code
> faster.

That's true only for a standard US-qwerty keyboard layout. My [] are located
at altGr + (). These guys clearly haven't though i18n through. And if there
are such blatant omissions on their front page, who knows what's lurking in
the code ?

~~~
pseut
Even for US keyboards, the obviously better step is to replace "(" and ")"
with "9" and "0" -- familiar key location but without the shift key. Plus you
avoid using the pinky finger which is an ergonomic win.

Edit: note that there might be a small tradeoff in readability.

~~~
leoc
I've said it before: j and k are the obvious replacements if you want to
ruthlessly Huffman-code your Lisp-typing experience. I, mean how often do you
_really_ see j or k inside the text of an atom? Not very often.

~~~
pseut
> _how often do you really see j or k inside the text of an atom?_

Just enclose j and k in parentheses on those rare occasions. Problem solved.

------
SeoxyS
I got really excited for a second, and then I realized it was April 1st.

Clojure is a language I absolutely love, but have abandoned for practical
reasons. (Debugging Clojure is an absolute nightmare, and the tooling doesn't
quite agree with me. The JVM is the biggest hurdle in making Clojure useful
for me: it causes slow startups times, a bloated environment, and makes it
hard to deploy in our production environment.)

So my immediate though when I read "a better Clojure" was: somebody wrote an
LLVM front-end for Clojure and turned it into a fast language compiled to
native code.

------
nswanberg
The post is meant to be a joke, and isn't a bad one as such things go, but its
fun to note that square brackets and Lisp go back quite a ways, and were a
feature of M-expression syntax. [1]

It is also interesting to note the reasons why Mathematica's syntax, which
shares some similarities to Lisp, uses square brackets instead of parenthesis,
specifically to avoid ambiguity when using parenthesis to denote grouping
terms. [2]

[1]: <http://en.wikipedia.org/wiki/M-expression> [2]:
[http://reference.wolfram.com/mathematica/tutorial/GettingUse...](http://reference.wolfram.com/mathematica/tutorial/GettingUsedToMathematica.html)

------
thejsjunky
I'll cop to it: this had me going for a couple hundred milliseconds.

~~~
dilap
It took me about 5 seconds. One of the few April fool's day web-jokes that's
both plausible + hilarious. :)

(Also, maybe I'm insane, but I think I _do_ find the square brackets a bit
easier to read...)

~~~
crazygringo
I was actually totally surprised I find it _waaay_ easier to read. I'd never
have guessed.

Something about vertical lines being easier to "separate out", while
parentheses, being curved, blend in more with the letters. Who'd have thought?

------
TylerE
This actually makes a certain sense. Especially the whole "no need to use
shift to type the single most common character in your code" thing.

~~~
DennisP
Now you've got me thinking. The brackets still require a pinky stretch. But
suppose you start with a TrulyErgonomic keyboard:
[http://www.trulyergonomic.com/store/index.php?route=product/...](http://www.trulyergonomic.com/store/index.php?route=product/product&path=82&product_id=69)

Map the end key to (, and the left arrow to ), and you're hitting both
characters with your thumbs.

Then maybe map brackets to PageDown and the down arrow, and braces to PageUp
and up arrow for an easy reach with the ring finger. Or those big
delete/backspace keys in the middle could be useful.

No self-respecting vim user needs any of these keys.

~~~
TylerE
Even with a standard keyboard you can use left and right ALT, which would be
the same sort of thumb action.

------
overloaded
From the logo I was expecting Japanese brackets:

    
    
        「「MyObject alloc」init」
    

For the vacillating, have the best of both worlds:

    
    
        〔〔MyObject alloc〕init〕

~~~
fosap
I'd like to see a lisp that allows all the kinds of different brackets. (
〖〗〘〙〚〛〈〉() [] <> and maybe more.) I think i can make the code easier to read.
All we would need was a emacs script. When the cursor is on the closing
bracket there could be a drop down menu. But aside from Haskell Language
creators seem to be god dammed afraid of unicode in the language.

~~~
callmecosmas
Racket allows for (), [] or {} in code and it seems that in practice [] is
used to distinguish some syntactic forms that have nested parens from normal
function calls such as the let and cond forms. So instead of

    
    
      (cond ((...) (...))
            ((...) (...)) 
            (else ...)) 

you get

    
    
      (cond [(...) (...)]
            [(...) (...)]
            [else ...]) 

which seems to me to be more readable. See here for an example
[http://docs.racket-
lang.org/reference/if.html?q=cond#%28form...](http://docs.racket-
lang.org/reference/if.html?q=cond#%28form._%28%28lib._racket%2Fprivate%2Fletstx-
scheme..rkt%29._cond%29%29)

------
therockhead
First of April is such a pain.

~~~
pmelendez
Funny thing... is that the discussion is actually turning serious... so my new
guilty pleasure is to read serious discussions about April fools' jokes

------
alberich
> Easier to read, compare: (+ (expt 2 30) 2) with [+ [expt 2 30] 2].

Really? So now... in place of "lots of irritating superfluous parentheses" you
get "lots of irritating superfluous square brackets"?

meh

~~~
muraiki
Note the date.

------
pmelendez
Beware fellows... This is the best discussion to tell who is a skimmer and who
is a reader in HN :)

------
SolarNet
I know it's a joke, but why are languages so damn stuck on syntax. Why can't
it be a one line change for person A to have () and person B to have [] (and
person C have <>, or {}), and then have tools which automatically translate
between them.

The same goes for every other syntax problem out there. Python and choosing
between tabs, spaces, and smart tabs. The C family and choosing between where
the damn braces go. Different keyword symbols (to support different
languages!). Different symbol naming styles. All at the whim of personal
preference.

We have the technology and (computer) science (more the mathematics really) to
build such systems, why don't we!?

/rant

P.S. This is actually what I am working on... When I'm not busy... which is
never.

~~~
danneu

        > why are languages so damn stuck on syntax. 
        > Why can't it be a one line change for person A to 
        > have () and person B to have [] (and person C have <>,
        > or {}), and then have tools which automatically 
        > translate between them.
    

Aren't languages stuck on syntax because syntax is what's standard? It's the
terms in which a language is defined and it's what we must agree upon before
we can even start building our own abstractions or swappable gylphs for the
parts we don't like.

Fortunately you can use technology to compile your personalized syntax to the
standard syntax.

We already do that. In fact, entire communities are built around custom syntax
layers.

I imagine someone would only map "()" to "[]" because "()" is either
unfamiliar or harder to type.

The superior solution is to learn "()" so that it becomes familiar or map "[]"
to "()" respectively.

In both solutions you have an end result that does not distance the source
code in the editor from the source code you're pushing to your repository, and
that's the kind of thing we seem to optimize for as developers.

Obviously I have no idea what you actually had in mind, this is just what came
to mind when I read that bit.

------
columbo
It's a great start, but I think <> would have been more appropriate, you could
call it clomuretext.

------
loumf
Of course, PG covered this in the Arc FAQ

 _Why not use some other delimiter than parentheses?_

 _We tried various possibilities. Square and curly brackets lose because they
are less directional than parens (left and right differ in fewer pixels); <
and > lose because they don't wrap around enough to enclose expressions longer
than tokens._

<http://www.paulgraham.com/arcfaq.html>

------
nollidge
Everybody check the calendar.

~~~
swixmix
April 2 in Japan. (Yet another i18n problem to consider.)

------
tcdowney
They totally had me with this.

"So on the eve of April 1st we sat down in a brainstorm session with a team of
PLT experts."

------
mseepgood
What a missed opportunity. Reverse polish notation doesn't need any
parentheses and it works well for Forth. Why do all Lisps make the same
mistake?

------
michaelwww
I most comfortable programming in Morse code and this doesn't have anything
that might tempt me to switch.

------
kailuowang
One thing to add is that [] is much closer to the right pinky finger, which
immensely boost the typing speed comparing to (). Now that's what I call a
true re-thinking in code productivity. If we go another step further we might
consider using ; ;+ 1;- 3 2;; I am liking it already.

------
jonahss
Finally a language I can get behind. I was never able to get into closure, but
couldn't put my finger on the reason why. If only more languages could
redefine themselves to be more usable and admit they have been outdated for
years.

------
smrtinsert
After using TCL for several years and actually liking it, I have to admit the
brackets look better. Plus lately I'm all about anti-rsi and shift parens is
getting to be a major hassle.

------
djhworld
This is one of the better pranks I've seen today, this bit especially made me
chuckle

> It compiles faster, since the compiler don't need to differentiate Java
> parentheses from Clojure ones.

------
dannowatts
even knowing it's April fools, I wanted to believe this. even with some of the
crazy reasonings

so... maybe it will be a project that has legs, after the holiday has passed!

------
prezjordan
Had me going for a while. In all seriousness, you can type clojure with square
brackets, no? IIRC in Racket they are transferable.

~~~
tomku
No, square brackets in Clojure are vector literals. They are equivalent in
Racket, though.

------
ruttiger
April Fool's ruins the internet for a day.

------
asperous
I honestly think if they replaced the parenthesis with indentation they might
actually be onto something

------
middayc
there actually is a concrete language where this (from clochure ex.)

    
    
      (+ (power 2 30) 2)
    

and this

    
    
      + power 2 30 2
    

both work and mean absolutely the same. so if parens are the problem ...

~~~
drivers99
Or in forth, which uses reverse polish notation:

    
    
      30 2 power 2 +
    

(a constant gets pushed onto the stack. functions like "power" and "+" operate
on the stack)

So this also works:

    
    
      2 30 2 power +
    

Although I don't really use it anymore, my calculator (an HP scientific
calculator) also uses reverse polish notation, so you can keep intermediate
values on the stack, and do complex calculations without using parentheses at
all. This is also good for keeping people from asking to borrow your
calculator in math class. :)

What is the syntax that you posted? It looks just like RPN in reverse. Ok,
that was a stupid question. I just figured out that is just "polish notation."
It must keep a stack of operations that don't have their operands yet.

------
fictorial
I really just need to turn the computer off on April 1 every year. Argh!

------
rayiner
Check out clojure source in the git repository...

------
sergiotapia
Well `[]` _is_ easier to type than `()`.

------
weejud
[] is harder for me to read than ()

~~~
pekk
This is a fine self-parody

------
desireco42
OK you got me with this :)

------
jsgrahamus
April Fool's?

------
stefantalpalaru
The next logical step is replacing all the square brackets with accolades
(same time next year).

------
finishingmove
lmao

