Husk

From Esolang
Jump to navigation Jump to search

Husk is a prefix-based (similar to Pyth) golf language related to Haskell.

The language is strongly typed(values are not malleable).

Most builtins have more than one independent overload of different type and different order (unlike Pyth, which requires operands to be entered in a specific order). The compiler uses heuristics to make the program well-typed: it chooses between overloads of builtins, and by inserting parenthesis and default values with certain restrictions. The language uses an 8-bit source character set unique to it.

It is optimized for Code Golf SE golf rules, so there are no IO operations, only pure functions. However, a langauge without IO is untestable, therefore IO is taken via command-line arguments and is accessible via one of the superscript number instructions.

Design Principles

Husk is (the only) golfing language which fully embraces the functional paradigm. This means that there are no explicit loops, no variables, no specific structure to a Husk program other than the functions, combinators and their parameters.

This makes Husk extremely strong on simpler challenges while still keeping it competitive on harder tasks.

Husk is "lazily" evaluated i.e. It doesn't evaluate expressions until their value is required in the program. This makes Husk work strangely at times, and sometimes wrong looking programs work perfectly.



External Resources