Also, love the name :)
The Earl Grey programming language
71–80 of 137 posts
Re: The Earl Grey programming language
#72"Oh god, do we need another language that compiles to javascript?!" —Everyone, probably
Re: The Earl Grey programming language
#73What was the inspiration to create yet another compile to JS language?
I guess I wanted macros and pattern matching without Lisp syntax, and I wanted to retain and use the JS/node ecosystem. There's also a few language features I couldn't find anywhere else that I wanted to try out (my % operator, ad hoc exception classes, some pattern matching features like coercion and "match" inside a pattern to define sub-patterns, the each operator, some features of the macro system that I have yet…
> Earl Grey's % operator can be used to easily build HTML, DOM, virtual DOM, and other things:
Re: The Earl Grey programming language
#74Re: The Earl Grey programming language
#75Earlier 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.
Re: The Earl Grey programming language
#76Earlier 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.
Re: The Earl Grey programming language
#77The "fact(match)" is very strange. In Haskell you have "lambda-case" and in Ocaml you have "fun" as syntaxes to define lambdas that pattern-match on the argument. That said, I really like the inclusion of async and a DSL for documents. These two are things that benefit a lot from having language support.
"fact(match)" is just making use of a generic feature: the "match" keyword in a pattern dictates that the body defines a sequence of sub-patterns to match at that position. An argument uses pattern syntax, so it works there, but it works in other situations, for example this contrived example: f(x, y) = match x: {m, n} -> match m: n + y else -> m + n + y n -> n + y Can be rewritten: f(match x, y) = {match m, n} -> n…
Re: The Earl Grey programming language
#78Earlier quoted context omitted.
JS is the new JVM. Write once, run anywhere is still the dream, I'm glad new programming languages are taking advantage of JavaScript's versatility.
> Write once, run anywhere is still the dream More like "write once, run in the browser". I don't think most compile-to-js languages care too much about "anywhere", they are just trying to get nicer alternatives in what is basically a platform (the browser) closed to anything except JS.
Re: The Earl Grey programming language
#79This language has it down to a tea.
Re: The Earl Grey programming language
#80Earlier quoted context omitted.
I guess I wanted macros and pattern matching without Lisp syntax, and I wanted to retain and use the JS/node ecosystem. There's also a few language features I couldn't find anywhere else that I wanted to try out (my % operator, ad hoc exception classes, some pattern matching features like coercion and "match" inside a pattern to define sub-patterns, the each operator, some features of the macro system that I have yet…
What does the % operator formally do? All I could find in the documentation was : > Earl Grey's % operator can be used to easily build HTML, DOM, virtual DOM, and other things:
tag.xyz %
property = value
child1
child2
Will produce the data structure: {tags = {"tag", ".xyz"}
props = {property = value}
children = {child1, child2}}
as an instance of the ENode class. Then, transformer functions can process the data structure to generate HTML or other things, e.g. require: /html
html(thing)
==> child1child2