Skip to content

An experimental non-deterministic concatenative golfing language

License

Notifications You must be signed in to change notification settings

AlephAlpha/Nekomata

Repository files navigation

Nekomata

Nekomata is an experimental non-deterministic concatenative golfing language.

The implementation of non-determinism is based on the paper KiCS2: A New Compiler from Curry to Haskell.

The language is still in an early stage of development. The custom code page is incomplete. The semantics of some built-ins are not clear. The syntax is still subject to change.

Name

Nekomata (猫又) are a kind of cat monster in Japanese folklore that have two tails. Just consider a non-deterministic cons list where the head is deterministic but the tail has two possible values. Doesn't it look like a nekomata?

This name is also inspired by Cat and Kitten. Both are concatenative languages.

Documentation

Like the language itself, the documentation is also incomplete. You can find it in the doc folder.

There are also some example programs in test/Eval.hs. These examples are based on challenges from Code Golf StackExchange. But there aren't any explanations.

You can also search for Nekomata on Code Golf StackExchange to find some examples. Most of them come with explanations.

Influences

Nekomata is influenced by the following languages:

  • Curry. Curry is the first non-deterministic programming language I've learned. Nekomata is lazy, purely functional, and non-deterministic like Curry. The implementation of non-determinism is also inspired by Curry's KiCS2 compiler.
  • Brachylog. This is a declarative logic golfing language based on Prolog. I think it's the first golfing language that uses non-determinism. Nekomata's syntax and choice of built-ins are heavily influenced by Brachylog. For example, Nekomata uses superscript letters for particles (called "Metapredicates" in Brachylog), though particles in Nekomata come before the arguments instead of after them.
  • Vyxal, Jelly, 05AB1E, Husk, Thunno 2 and other golfing languages. They influence Nekomata's choice of built-ins. When I don't know what built-in to add to Nekomata, I usually take inspiration from existing answers on Code Golf StackExchange in these languages.
  • Joy, Kitten, Factor and other concatenative languages. They influence Nekomata's syntax and semantics.
  • Julia. In Julia's REPL, some Unicode characters can be entered via tab completion by a long name starting with \. Nekomata borrows this idea.

Online interpreter

Nekomata is now on Attempt This Online!

The version on ATO is not always up-to-date. You can check the version by passing the -h flag.