4 ms·
> Vyxal is an stack-based esoteric array language that is dedicated to dominating competition in code golf challenges. This means that it strips away all need f
by tromp 3y ago
> Vyxal is an stack-based esoteric array language that is dedicated to dominating competition in code golf challenges. This means that it strips away all need for boilerplate, long function names and impractical source layouts.
> Functions are a core part of Vyxal. They are first class objects, meaning that you can have functions on the stack, functions can take functions as arguments, and functions can return functions.
This is actually all you need for writing very compact code.
If you were to strip away all other features of Vyxal, namely variables, stacks, numbers, strings, lists, and all control flow, and have only functions from functions to functions, plus some way to use these for input and output, then you have Binary Lambda Calculus [1].
The Vyxal code for the infinite list of Fibonacci numbers is 13 bytes long.
In comparison, the BLC code is only 78 bits, or just under 10 bytes: 010101000110100000000001011011001010111110111101110000111110011110100000100010.
Or graphically [2]:
┬─┬ ────┬─┬──────── ─ ┬
└─┤ ────┼─┼─┬─┬──── ┬ │
│ ──┬─┼─┼─┼─┼─┬── │ │
│ ┬─┼─┼─┼─┼─┼─┼── │ │
│ └─┤ └─┤ │ ┼─┼─┬ │ │
│ │ └─┤ │ ├─┘ │ │
│ │ │ ├─┘ │ │
│ │ ├─┘ │ │
│ ├─────┘ │ │
└───┤ │ │
└─────────────┤ │
└─┘
[1] https://www.ioccc.org/2012/tromp/hint.html https://www.ioccc.org/2012/tromp/hint.html
[2] https://tromp.github.io/cl/diagrams.html https://tromp.github.io/cl/diagrams.html
- mikewarot 3y agoDoes that output a string of bits, or decimal numbers?
- tromp 3y agoIt computes a list (as nested pairs in the standard lambda calculus representation) of Church numerals (the standard representation of natural numbers). See also the discussion of the 167-bit primes program output in the first link, which gives an impression of the overhead needed for output in decimals.
- omoikane 3y ago> strips away all need for boilerplate Looks like this includes special optimizations for common problems including hello world (kh) and fizzbuzz (kF), but not 99 bottles of beer. https://vyxapedia.hyper-neutrino.xyz/elements https://vyxapedia.hyper-neutrino.xyz/elements
- aqfamnzc 3y agoHmm, that doesn't seem fair. At that point, why not encode a huge library of programming challenges into the language spec to beat all the challenges with just a couple of chars? Oh well, I suppose it's not really a competition in the usual sense so it doesn't really matter. And code golf language comparisons are kind of apples-to-oranges huh.
- nextaccountic 3y agoWhat about getting a large set of programming challenges as input and finding an esoteric standard library using some optimization algorithm, when combined, can solve any challenge in minimal program size Such standard library could contain weird operations that, while not specifically solving a single program, would each be pretty hard to grasp in order to use to do something useful