Live data from Hacker News

The Earl Grey programming language

breuleux.github.io

101–110 of 137 posts

Re: The Earl Grey programming language

#102

Earlier quoted context omitted.

It's more a question of readability than writeability Something like: result = balance-sheet - ledger-total + discount-total Is harder to read than result = balanceSheet - ledgerTotal + discountTotal

But see, being used to hyphens in variable names, I must tell you I can't figure out which one I find easier to read. On one hand, the presence of hyphens and subtraction is a tad confusing, but on the other, I find "balance-sheet" to be generally nicer to read than "balanceSheet", so it feels like a tie to me. Then, on the other hand, you have things like "xs.for-each(x -> x + 1)" vs "xs.forEach(x -> x + 1)", where…

> I find "balance-sheet" to be generally nicer to read than "balanceSheet"

Me too, and I've wondered if it's because it's activating the same part of my brain that gets aggravated when people decide to use capitals on seemingly random words within the sentence.

Re: The Earl Grey programming language

#104

Earlier quoted context omitted.

Just wondering though, how often do people write subtraction as "stuff-thing" instead of "stuff - thing"? I find myself typing the latter almost systemically, so hyphens never get in my way, but of course it's all too easy to be blind to the habits of others.

If you have `stuff - thing` it’s no big deal, but once you start having `(a0-b0)/(a1-b1) + (x0-y0)/(x1-y1)` or whatever, then being able to save all the spaces starts to be kind of nice, especially if your math expressions get to be 60 characters long. There are a few times where I’ve definitely ended up with more readable code by using the presence or absence of a space as a way to group expressions. Also, I general…

I gave these kind of semantic spaces meaning when I wrote another implementation of AsciiMath[1] because I found it so intuitive. So `1-2 / 3-4 = (1-2) / (3-4)` but `1 - 2/3 - 4 = 1 - (2/3) - 4` like you'd expect.

[1]: http://runarberg.github.io/ascii2mathml/

Re: The Earl Grey programming language

#105
post #15

fact(match) = 0 or 1 -> 1 n -> n * fact(n - 1) why not simply fact(0 or 1) -> 1 fact(n) -> n * fact(n - 1)

I think the first one is a single function that has pattern matching for the parameter while the second one is defining the function twice and relying on the language to call the right one based on the parameter. I think in Erlang the function identification is the name and the arity and this is as close I know of what you would like to have.

I'd imagine you could compile them both down to the same thing, as there has to be a conditional at some point to determine what code to run (unless there was some kind of dynamic dispatch), I think it's just a matter of preference

Re: The Earl Grey programming language

#108
post #81

I love the name but it will get mixed up a lot on Google searches. Just like it was with the TV series "24" that matched every 24 that was to be found online.

I typed 'earl grey language' and the first three results refer to this, the HN article is in fifth position.

The same as typing '24 tv series' will mostly return relevant results.

Post reply on HN