46 likes
·
521 reads
7 comments
This is brilliant. Exactly how I try to write functions in JavaScript. I love how you assign with arrows which means = can be used for comparison.
Hi
This is great! You practically just created a language that I love to use called Erlang, you should check it out here erlang.org/doc/getting_started/seq_prog
It has pattern matching, arrow function definitions, list head/tail slicing, tuples, immutability, recursion instead of loops, and some other things. You practically built it👍
Cool! I have heard a lot about it, but never looked too deeply into it. I'll definitely give it a look now. Thank you!
this suffers from the same thing that all "terse" languages like this does; it becomes an impenetrable obfuscated mess to untangle for anything that is not trivial.
RegEx, List Comprehensions, etc all suffer from the same thing. A human can only hold so much "state" in their brain. Making languages that are this terse impossible to read and reason about without an extreme amount of effort.
Your last example is proof of this and you imply the same thing saying you had to solve it with pencil and paper to verify it works.
You are absolutely right!
The pencil and paper exercise was primarily to step through the recursive steps and check that things would unwrap as I expected, given that I don't have a compiler. Secondarily, it was fun. Or maybe it was the other way around?
Karl Hepler it is a nice exercise and would make a nice "domain specific language" approach for sure.