• shagie@programming.dev
    link
    fedilink
    arrow-up
    5
    ·
    1 year ago

    APL and J have made there appearance in here with their awkward syntax and have the advantage of being practical languages in actual use.

    Esolanguages are often things that are designed to be difficult in some way, shape, or form. Brainfuck is awkward, but it’s the source of some interesting problems that are only practical because it is such a simple language.

    The thing is, once you get your head around it, it isn’t too bad of a language.

    I was introduced to FRACTRAN (wiki) in Project Euler - https://projecteuler.net/problem=308

    That one… still is beautiful and confusing. It’s based on the manipulation of variables through Gödel numbering (wiki). The program: ( 455/33 , 11/13 , 1/11 , 3/7 , 11/2 , 1/3 ) will multiply the exponents of 2a3b leaving the result in 5ab.

    The program ( 17/91 , 78/85 , 19/51 , 23/38 , 29/33 , 77/29 95/23 , 77/19 , 1/17 , 11/13 , 13/11 , 15/2 , 1/7 , 55/1 ) will loop forever, however as it runs the state of the program will occasionally be just a power of 2 with all the other powers (variables) being zero. Those values are: 22 , 23 , 25 , 27 , 211 , 213 , … and so on. It computes prime numbers and stores them in the power of 2 before going to compute the next one.

    While I understand the idea of Gödel numbering, the manipulation of those numbers through this process still is difficult for me.