Nibbles Home

Nibbles is a code golf language for mortals (it aims to be good at code golf while remaining relatively simple). It is also purely functional, statically typed, and fully lazy. Syntax is Polish (prefix) notation. Each instruction is half a byte when automatically converted from ascii to the binary form.

Currently there are 85 ops which is far fewer than other competitive competitive golf languages which are typically around 400 ops. There are some special rules explained in minutiae, but overall the core language is simple too. Most of the work on the implementation is for static type analysis, error handling, and managing the automatic conversion between the literate and binary form. Things that you don't have to think about!

In my experience on golf.shinh.org nibbles is about 25% shorter than GS2 on non trivial problems. Also now that it has optional identifiers in the literate form it is much easier to write. I don't yet know how it will compare to Jelly/etc, but I suspect it will highly depend on what percentage of the problems involve prime factors and such (having ops for such built in is against the goals of nibbles)...

Example: FizzBuzz

This program appears as 28 characters here, but each takes only half a byte in the binary form (except for the digits and string text). It is trivially encoded as 18 bytes. That's pretty decent considering 8 of those bytes are for the text FizzBuzz.

$?,:^-~%$3"Fizz"^-~%$5"Buzz"

Resources

The tutorials can teach you the language.

Also check out the Why page if you're interested in the ideas behind Nibbles.

Where to Golf?

Good places to use Nibbles for competing online are:

Feedback?

Bug reports, pain points, suggestions, and code reviews are appreciated (I'm new to Haskell), make a push request or email me at image of email

News