Live data from Hacker News

Vyxal: A code-golfing language experience

github.com

21–30 of 32 posts

Re: Vyxal: A code-golfing language experience

#21
post #11

Earlier quoted context omitted.

Does that output a string of bits, or decimal numbers?

It 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.

[deleted]

Re: Vyxal: A code-golfing language experience

#22

Huh, once you add a compiler step to turn normal code into "golfed" code, it feels like a different thing, with the goal being to write a compact bytecode format. This 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.

In my golf language, called stax, each program expressible in plain ASCII has a corresponding representation in a single byte character set. [0] The only reason a program wouldn't start in plain ASCII is the contents of string literals.

The alternate representation generally saves ~15%, as measured in bytes. However, I totally understand the argument about human-unreadable "golfed" code, which is why you can always use the plain ASCII representation if you want.

For instance, you can print fibonacci numbers in an infinite loop using this program. [1]

    10Wb+Q
It pushes one and zero to the stack. Then `W` repeats the rest of the program forever. `b+` copies the top 2 elements from the stack and adds them. `Q` peeks from the stack and prints to output. This program packs down to `╪Ç►╢0` for a savings of 1 byte (using the languages own impractical character encoding).

[0] https://github.com/tomtheisen/stax/blob/master/docs/packed.m...

[1] https://staxlang.xyz/#c=10Wb%2BQ&i=

Re: Vyxal: A code-golfing language experience

#24
Since version 3 was rewritten from Python to Scala, does that mean it drops support for Python FFI? Does it replace it with Java FFI?

Python FFI in Vyxal was neat because you could trivially import python libraries like sockets, or start doing FFI to C libraries with calls to Python's ctypes. It was a mess but it's satisfying just how many different cross-cutting concerns you could glue together with very little code, when most other esolangs don't provide much of a standard library.

Re: Vyxal: A code-golfing language experience

#26
> Vyxal aims to bridge the gap between simplicity and "golfability".

With code golfing languages, there are inherent tradeoffs between code size and usability/fun. IMO the most important features for minimizing length (assuming the only rule is the interpreter must be published before the challenge) are:

* (in Vyxal) Efficient syntax. Not sure what state of the art is anymore but stack-based seems reasonable.

* (in Vyxal) String compression

* (not in Vyxal) Efficient encoding; Huffman coding at a minimum but ideally arithmetic coding using sophisticated machine learning to predict the next command. It's super inefficient to have each command be 1 or 2 bytes regardless of frequency.

* (not in Vyxal) Huge numbers of builtins; Vyxal has "only" ~560. Ideally every past code golf question and every OEIS sequence are their own builtin.

Vyxal might hit a sweet spot, but I'm skeptical that it actually score as well as other languages with more of these features.

Re: Vyxal: A code-golfing language experience

#27

I 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…

> I think the size of the interpreter for Vyxal should be included in the scoring, if we're going to be really consistent about this.

Code Golf categories are arbitrary anyways, and can be as strict or as permissible as the golf course designer likes. If you need the most raw representation of code size, how about a code golf category where you have to design the smallest physical computer that can perform a certain task?

> Who can make it the smallest?

I noticed that in Vyxel 2 the language allows you to grab arbitrary Python modules and make calls, but this doesn't seem to be available anymore in Vyxel 3. So I'm thinking you can make a smaller Vyxel 3 implementation than 2. Either way, both reference implementations are fairly large runtimes.

Re: Vyxal: A code-golfing language experience

#28
post #17

Earlier quoted context omitted.

Any defined runtime seems fair, though a real computer will always seem more canonical. The two parts that seem unfair to me: 1. There's hidden bits of information based on choosing one language over another that can't be counted. Imagine a family of 26 languages that are the same except the first letter is different etc. 2. Some of the golfing is in how good the language you picked is in their bytecode and not how c…

My motivation in defining BLC was to have the simplest measure of the complexity of things. That includes binary strings, natural numbers, tuples, lists, sets, and functions of those, as well as languages (according to their interpreter) and formal systems (according to their theorem enumerator) [1]. [1] https://gist.github.com/tromp/86b3184f852f65bfb814e3ab0987d8...

How does it compare to BrainPhoque, the language used in Learning Universal Predictors (Hutter 2024) to approximate normalized Solomonoff induction?

Re: Vyxal: A code-golfing language experience

#29
post #3

> 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…

> 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

Hmm, 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.

Re: Vyxal: A code-golfing language experience

#30
post #28
post #17

Earlier quoted context omitted.

My motivation in defining BLC was to have the simplest measure of the complexity of things. That includes binary strings, natural numbers, tuples, lists, sets, and functions of those, as well as languages (according to their interpreter) and formal systems (according to their theorem enumerator) [1]. [1] https://gist.github.com/tromp/86b3184f852f65bfb814e3ab0987d8...

How does it compare to BrainPhoque, the language used in Learning Universal Predictors (Hutter 2024) to approximate normalized Solomonoff induction?

BP is like a slightly messier BrainFuck. Its alphabet size of 17 is rather odd. Its spec (Section E.2 of [1]) says

> programs containing unbalanced parentheses are made valid, in particular by skipping any additional ].

But that still leaves programs invalid programs like "[[[[".

From a theoretical viewpoint, its biggest flaw is the lack of an input tape, which makes it a non-optimal description method in the sense of [2]. In particular, while BLC programs are at most a constant larger than BP ones, the reverse is not true.

The version of BF that I interpret in [3] is still optimally universal, because its program delimiting fist unbalanced ] is followed by its binary input.

[1] https://arxiv.org/html/2401.14953v1

[2] https://gist.github.com/tromp/86b3184f852f65bfb814e3ab0987d8...

[3] https://gist.github.com/tromp/86b3184f852f65bfb814e3ab0987d8...

Post reply on HN