Vyxal: A code-golfing language experience
1–10 of 32 posts
Re: Vyxal: A code-golfing language experience
#2This one seems mostly like a workaround for having to type weird Unicode characters, so it still seem "fair" to me whatever that means.
But I wonder how much a normal java program can be auto golfed by playing with the bytecode output.
Re: Vyxal: A code-golfing language experience
#3> 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.htmlRe: Vyxal: A code-golfing language experience
#4Re: Vyxal: A code-golfing language experience
#5On the other hand, if you're going to allow plaintext to be compressed into bytecode, why not include a Huffman encoder as part of the flow? The FizzBuzz example has a string splitter in it (apparently, I haven't read ALL the docs), just to get around quoting some strings, but quotes might be less than a byte if you do them enough, etc.
Lastly, who can make the smallest Vyxal executable? Let's use Jart's excellent Acutally Portable Executable[1] format as a kicking off point. That seems like the best way to make it work for almost anyone. If not, then maybe DOS/Windows/Arm/VAX/PDP-11/Z80 categories might be needed?
A Vyxal compliance suite of tests is required to enable all of the above. Who can make it the smallest? ;-)
Re: Vyxal: A code-golfing language experience
#6I think the size of the interpreter for Vyxal should be included in the scoring, if we're going to be really consistent about this. On the other hand, if you're going to allow plaintext to be compressed into bytecode, why not include a Huffman encoder as part of the flow? The FizzBuzz example has a string splitter in it (apparently, I haven't read ALL the docs), just to get around quoting some strings, but quotes mig…
But an interpreter in what language?
Re: Vyxal: A code-golfing language experience
#7I think the size of the interpreter for Vyxal should be included in the scoring, if we're going to be really consistent about this. On the other hand, if you're going to allow plaintext to be compressed into bytecode, why not include a Huffman encoder as part of the flow? The FizzBuzz example has a string splitter in it (apparently, I haven't read ALL the docs), just to get around quoting some strings, but quotes mig…
> the size of the interpreter for vyval should be included in the scoring But an interpreter in what language?
Compared to code golfing, where finding a language with the closest built ins for the task is a good bit of the strategy
Re: Vyxal: A code-golfing language experience
#8> 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 functi…
Re: Vyxal: A code-golfing language experience
#9Earlier quoted context omitted.
> the size of the interpreter for vyval should be included in the scoring But an interpreter in what language?
the demoscene version is assembly on a specific machine, which seems very fair to me. Compared to code golfing, where finding a language with the closest built ins for the task is a good bit of the strategy
It seems a little biased toward imperative languages. The earliest models of computation, namely combinatory logic with S & K, and the lambda calculus, date back to 1920s, and being exceedingly simple, can easily be implemented in any modern functional language. But not so easily in an imperative one, which have no support for closures.
On the other hand, implementing an imperative language in a functional one is relatively straightforward.
Re: Vyxal: A code-golfing language experience
#10> 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 functi…
Looks like this includes special optimizations for common problems including hello world (kh) and fizzbuzz (kF), but not 99 bottles of beer.