/studyq

Tutorials, puzzles, exercises, essays and other study resources for the q programming language

Primary LanguageqCreative Commons Zero v1.0 UniversalCC0-1.0

Maintenance

studyq

Tutorials, puzzles, exercises, essays and other study resources for the q programming language

Most users of q encounter it as a means of querying large kdb+ datasets. But it is also a general-purpose programming language (PL) of great power and expressiveness, and a direct descendant of both APL and Lisp, early PLs that stamped their influence on the many PLs that came after them.

If you find the verbosity of ‘high ceremony’ languages comforting, you will not like q. But if you like coding at a high level of abstraction but also in sympathy with the metal (q’s Unique Selling Point is its speed) you may find q’s terse expressions utterly addictive.

Long experience with ‘scalar’ languages train the brain to break problems into loops. Most q operators iterate implicitly

q)1 2 3 + 4
5 6 7

so novice q programmers (qbies) have a certain amount of unlearning to do. You may experience this as a mental decluttering that leave you more mental space to consider algorithms and strategies.

Gods and mortals

Prior experience with its ancestor languages APL, k, and Lisp made q a familiar environment for many of its early adopters. Their need for training was minimal, and documentation little more than a memory aid.

Marvelling at bafflingly terse q solutions, qbies dubbed early adopters “the q gods”. The expression honours the skill – but also places it out of reach. With grim humour, a popular textbook for the language took the title Q for Mortals – how the rest of us can scrape by when using the language of the gods: a traveller’s phrasebook for Coding Heaven.

This repository is a Promethean project. (In Greek legend, Prometheus brought fire from the gods down to Earth.)

Like any other language, q yields to study and practice. It is not reserved to a race of divine creatures.

Go for it.

Contribute

Much of the content here first appeared at code.kx.com/learn. It is reproduced here in the hope of engaging more contributors.

You are welcome to post solutions (e.g. to Project Euler problems) without comment or explanation, but we strongly prefer discussion, particularly exploration of alternatives.