← Wed, Dec 2 digest

Show HN: Code like a Viking (Hávamál programming language)

read article ↗ hn thread ↗

Hávamál is a new puzzle programming language inspired by APL and Joy where code must follow traditional Icelandic poetic metre and alliteration constraints.

summary is enough The concept is a delightful esoteric diversion, but the short summary captures the core mechanics without needing to dive deep.

summary

Triggered by Advent of Code, a developer created Hávamál, an esoteric programming language based on stack processing where programs must be written in the ljóðháttur poetic metre with strict alliteration. The language uses a dataset of modern Icelandic inflections to provide a rich vocabulary of commands and nouns, ensuring valid code reads like traditional poetry. Features include automatic memoization and priority queues to handle typical puzzle requirements. The project includes an online playground and is designed to make solving algorithmic challenges an exercise in literary style.

key points

  1. Hávamál is a concatenative stack-processing language inspired by APL and Joy, with a simpler internal representation called Kjarni.
  2. Programs must adhere to strict ljóðháttur poetic metre and alliteration rules to be valid.
  3. Built-in features like automatic memoization and priority queues allow it to handle complex puzzle requirements.

who should read it

Esoteric language enthusiasts and functional programming hobbyists looking for a creative coding challenge.

discussion warm

consensus

Commenters enjoy the creative concept, comparing it to other poetic and historical esoteric programming languages like Goethe and Fjölnir, while discussing linguistic nuances between Old Norse and modern Icelandic.

pushback

Some point out that modern Icelandic isn't strictly the language of Viking cultures, though the author clarifies the choice was practical for leveraging inflection datasets.

best comment by joisig ↗

You're right, but the two are pretty close, most verses of the original Hávamál read as straight Icelandic with some spelling differences and some ancient words that have fallen out of use or have new meanings these days (source: I'm an Icelander).

The main reason to go with modern Icelandic rather than actual Old Norse was to be able to use BÍN (Beygingarlýsing íslensks nútímamáls) which is credited in the repo and on the playground page. It is a dataset that allows working with Icelandic in all its various declensions and such. The language extracts the Heiti and nouns from that dataset in …

The author explains the practical dataset constraints behind choosing modern Icelandic over actual Old Norse.

Generated by an LLM from the article and thread. Check the sources before relying on it.