6 ms·
For those in the comments just wanting a quick rundown: Python3 based programming language for "golfing" (I had to double check it was code golfing, there's pr
by desine 5y ago
For those in the comments just wanting a quick rundown:
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
- mlochbaum 5y agoCode golfing is a game, and golfing with Jelly (Husk, etc.) is a version of it that some people find more fun. Most of the time it's not just a matter of picking the one crazy function that obviously solves the problem, although that does happen. I'd say there's usually more room for creativity when using a golfing language, because more strategies can be competitive instead of some being ruled out because the syntax for them is awkward. A typical golf is [0]. The components aren't complicated, and you can probably see there are a lot of ways to approach the problem. 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 https://codegolf.codidact.com/posts/281956#answer-281962
- desine 5y agoThis makes sense. I've done some code golf challenges but never fell into the culture. Anywhere in computer science that there is a culture, development of culturally specific tools comes into play. Perhaps I commented too quickly as an outsider, but perhaps @singlow is also correct that the title needs a bit more explanation. I thought I was going to get either jealous or sweet treats from a github repo
- sgrove 5y agoSeems then you'll probably dislike apl - here's the full implementation of Conway's Game of Life in 53 characters: life ← {⊃1 ⍵ ∨.∧ 3 4 = +/ +⌿ ¯1 0 1 ∘.⊖ ¯1 0 1 ⌽¨ ⊂⍵} And the explanatory video behind it (quite approachable!) https://www.youtube.com/watch?v=a9xAKttWgP4 https://www.youtube.com/watch?v=a9xAKttWgP4
- desine 5y agoProbably not. I've heard of it, never looked too in depth. As 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.
- sgrove 5y agoThat's fair! It's just a DSL with all the tradeoffs that implies (and what lisp is generally quite good at).
- smabie 5y agoIt's just a programming language. Like natural languages, what once seemed foreign and inscrutable before you learn it becomes natural and (not quite) effortless after. I'm sure you can handle it.
- deleted 5y ago