Live data from Hacker News

The Earl Grey programming language

breuleux.github.io

111–120 of 137 posts

Re: The Earl Grey programming language

#111
post #96

Now add an absolutely vital library called Milk and watch tea lovers everywhere shudder.

Made correctly, earl grey (really any black tea) needs some milk fat to neutralize the tannic acid or it could turn your stomach.

...now it occurs that maybe the GP comment meant shudder in a good way. In which case, well played. Quite cricket, my good man.

Re: The Earl Grey programming language

#112
post #77

Earlier quoted context omitted.

Is there any other language that does this? For me the second example doesn't look better than the first one.

I haven't seen the feature elsewhere. The second example looks better to me (syntax highlighting helps) and reduces redundancy and indent, but I guess views may vary on this. Good to know!

If your goal is to reduce redundancy than I think a "lambda-case" syntax might be a better fit. As a bonus it also lets you use this feature on anonymous functions!

https://downloads.haskell.org/~ghc/latest/docs/html/users_gu... http://stackoverflow.com/questions/1604270/what-is-the-diffe...

Re: The Earl Grey programming language

#113
post #61

Earlier quoted context omitted.

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.

In haskell you can write exactly the following: fact 0 = 0 fact 1 = 1 fact n = n * fact (n-1) It works as you would expect and really they aren't that dissimilar.

Small correction, fact 0 = 1

Re: The Earl Grey programming language

#114
High-level comparison with Haxe:

EG and Haxe share: - compiles to Javascript - Macros - Pattern Matching - async/await (Haxe requires a 3rd party macro lib, but it integrates well)

EG has: - cleaner syntax - document-building DSL - "One of EG's primary goals is to be as compatible as possible with existing JavaScript libraries and frameworks and the node/iojs ecosystem." (Haxe makes compromises here to support other platforms)

Haxe has: - static type-checking - dead-code elimination - support for more platform targets (PHP, Python, C#, Java and more) - years of experience

Re: The Earl Grey programming language

#115

Earlier quoted context omitted.

I'd love to hear why people prefer underscores over hyphens. I think I grew out of syntax fanboy-ism, but C and python __private__, _special_variable are everything but readable to me. They break the visual line too much. Even historically it was a weird symbol, originally a line break that made it into non-space separator in PL/1, then almost everywhere. Before that it was pure formatting, a typewriter glyph to be o…

> I'd love to hear why people prefer underscores over hyphens. Because I like subtraction.

It's funny in the end. Parts of languages syntax reinforce other parts. In lisps you cannot write a-b as an arithmetic expression. Sequences of characters are symbols, and that's it. But also, lispers don't really care about infix notation[1] they have abstract polyadic operations: - + / * all take a list of zero or more arguments. (- x y z ...)

[1] And IMO people shouldn't, basic arithmetic isn't that frequent or complex enough to need such a dedicated treatment. But that's another lisp thing, you care more about having DSL opportunities for anything rather than a fixed set.

Re: The Earl Grey programming language

#116
post #96

Now add an absolutely vital library called Milk and watch tea lovers everywhere shudder.

Made correctly, earl grey (really any black tea) needs some milk fat to neutralize the tannic acid or it could turn your stomach.

I've thought milk in tea was so silly for years, and you've changed my mind in one sentence. Thank you, did not realize there was a practical reason for making it... taste worse.

Re: The Earl Grey programming language

#120
post #96

Now add an absolutely vital library called Milk and watch tea lovers everywhere shudder.

Made correctly, earl grey (really any black tea) needs some milk fat to neutralize the tannic acid or it could turn your stomach.

I had actually noticed that I didn't feel great after drinking earl grey without milk, but never realized why. Thanks for mentioning this!
Post reply on HN