Jelly: a recreational programming language inspired by J
github.com
github.com
Python3 based programming language for "golfing" (I had to double check it was code golfing, there's probably actual golf scorekeeping or course design DSLs by now).
I'll never hate on esoteric programming language concepts, even with minimal usecase. A brainfuck compiler was the second I ever installed, after a borland C++ IDE student license at age 15. But I don't see much use case, or even justification. Code golfing by macro-ing common math operations in python is nifty - and like many projects, inevitable in the "infinite monkeys with typewriters" sense, but altogether not that interesting. I guess it's in the OG spirit of HN, high concept nerd shit only programmers care about, but if someone beat my python code golf submission only because they used some obscure Unicode character that I don't know how to type that combines 3 math operations into one, I'd mentally call them a try-hard and move on with my life.
edit: but I'm also a hypocrite because I've been obsessed with Lisp (mostly just R7RS scheme) for the past year and what is that other than over-macro-ing your code
life ← {⊃1 ⍵ ∨.∧ 3 4 = +/ +⌿ ¯1 0 1 ∘.⊖ ¯1 0 1 ⌽¨ ⊂⍵}
And the explanatory video behind it (quite approachable!) https://www.youtube.com/watch?v=a9xAKttWgP4As mentioned I've become a fan of Scheme. The definitive text for learning it is probably SICP, in which Sussman and Ableson call programming a form of magic - calling out certain incantations, knowing their meaning, use, and producing data manipulation from them. I find this accurate, but as an English speaker, I think I just prefer the Latin Vulgate versions, and not the runespeak of the forgotten gods. I guess maybe I was a bit harsh to say there is no use case. Perhaps there is, for someone with a deeper cognitive and memorization pool than I. For me, though, interpreting such an incantation would be the equivalent of breaking down each operation into it's C-like forms. If it were broken down for me on the screen, I could back-reference each step, and view each incantation within the framework of the larger piece. Mentally interpreting the above would require me to do the same, but with each step stored in my own mental stack memory allocation, which would quickly overflow and crash.
Perhaps not, as mentioned I never tried APL, but I doubt I have the capacity to keep it all straight.
I'm sure you can handle it.
Or is this the exact opposite, operating at the highest level of abstraction?
It's not as abstract as possible or anything. Most directly, there are abstractions like algebraic datatypes or macros that APL doesn't have at all. And there's a sense in which APL is very concrete: it tends to use first-order functions instead of higher-order ones like Replicate[0] instead of filter. For me the fact that an array oriented program tends to handle just a few arrays at a time makes it easier to understand what's going on. I think there are also ways in which APL programming is low-level. Going back to Jelly, it's actually a stack machine, same as Java object code, or Forth. Modern APL has tacit programming[1], which has a similar mix of mathematical purity and machine-like shuffling. I think the way APL handles array axes is similar. They are numbered, so to work with them you have to keep track of the ordering. Something like einsum that names them would be higher-level.
Machine code can be practical. To me, code golf is just pure programming, for no practical purpose. It's not for everyone, or even most people. It's more like art than practical programming. Except it can be competitive? Not sure really.
It can also be fun just to build something, without the risk that you might accidentally get a significant number of users.
Next, array languages abstract away the execution strategy of loops. You as a programmer do not pick whether you use an accumulator or divide-and-conquer in your loops. Some good parallel libraries like Rust's rayon arguably have this feature in the imperative model, but it's not exactly a language feature of Rust.
W.r.t. machine languages, array programs do not have typing information which I think is the case for all modern intermediate representations.
Designing golfing languages is a game as well. Code golf uses byte counts, not character counts, so that there's a limit on the number of 1-byte operations (users of unicode-based languages count in UTF-8, or define a custom encoding to fit every character used in a byte). At that point it becomes important to pick out more useful operations, something that Jelly is known for being very good at.
The convention is that only programs in the same language compete with each other: everyone knows that it's nearly impossible to use fewer characters in Python than Jelly. Although most code golf is casual with no prizes. If you come up with something clever you can show it off and maybe people will appreciate it.
[0] https://codegolf.codidact.com/posts/281956#answer-281962
Interesting concept, not unlike dumping thousands of hours into Factorio, or some forth compiler, etc. Being clever for the fun of it.
$ jelly eun '“3ḅaė;œ»'
Hello, World!
Surprisingly concise and obtuse, even for an APL language.