[HN Gopher] Turnstyle - An esoteric, graphical functional language
___________________________________________________________________
Turnstyle - An esoteric, graphical functional language
Author : JNRowe
Score : 132 points
Date : 2024-08-21 17:49 UTC (23 hours ago)
(HTM) web link (jaspervdj.be)
(TXT) w3m dump (jaspervdj.be)
| rosshays wrote:
| Worth maybe calling out that there is a few academic language
| implementations using this name (turnstile, turnstile+)
| https://docs.racket-lang.org/turnstile. It's not a standalone
| language but worth pointing out
| lolinder wrote:
| This is an esolang and that's an academic language. I'm pretty
| sure neither one cares to optimize for searchability.
| dacapoday wrote:
| Is it similar to https://github.com/mxgmn/MarkovJunior
| oneearedrabbit wrote:
| While both MJ and Turnstyle are Turing-complete, Turnstyle
| shares more similarities with Piet (mentioned by the author),
| Wireworld, and, of course, Conway's Game of Life.
| smusamashah wrote:
| I didn't understand the lagnuage but the examples look amazing.
| Are there any others like that?
| drdeca wrote:
| This seems cool, but I'm having difficulty understanding the
| specification. It would be nice if there were some examples of
| e.g. 2+3 , (lambda f. lambda x. (f (f x)))(lambda y. (y+2)) 3 ?
| lifthrasiir wrote:
| `2 + 3` would be internally `((prim(3, 1) 2) 3)`, which can be
| composed of following fragments (where `^>v<` indicates the
| direction and the position of the current turnstile):
| AA prim(3, 1): >BBB
| C literal 2: AvB
| CC literal 3: AvB
| CCC A (prim(3,1) 2):
| >*****prim(3,1) *
| * 2
| A ((prim(3,1) 2) 3): >*****(prim(3,1) 2)
| * * 3
|
| So assuming that each distinct letter corresponds to a distinct
| color, one possible encoding would be: A
| A BB >>BBBBBCCCCCD B C AD B
| C D CBD DCA AAA BB
|
| The specification allows for a simple "identity" pattern which
| can be used to extend otherwise overlapping patterns here. The
| following, if I did everything right, would be more compact but
| much harder to decipher: CADABB
| >>BBCD CBDCAD AAABBD
| lifthrasiir wrote:
| I'm a bit confused about what really is being interpreted here,
| because my reading of the specification indicates that the entire
| image is read as a single expression in the lambda calculus but
| the graphic interpreter _looks_ like a procedural execution at
| the first glance. Is it just a visualization of beta-reduction in
| progress?
|
| EDIT: I think I got it and I think calling this as an "encoding"
| is a misnomer. The program starts with a single term
| `turnstyle(x, y, dir)` which gets lazily evaluated to the actual
| term. So not only the evaluation might be lazy, but the parsing
| is also lazy and this is a key point of this esolang which should
| be highlighted more in my opinion.
___________________________________________________________________
(page generated 2024-08-22 17:01 UTC)