Pike Programming Language
October 2, 2024After exploring at least ten different programming languages with serious effort in the course of my career, there’s only been one that I feel fit all my needs.
And even more shocking, is that literally nobody uses it. I’d suspect the current pool of users world wide is no more than thirty individuals based on the essentially dead mailing list (yes, newsgroups), IRC chat (yes, freenode), forum, and Discord (which I created to try and bring communication into the 21st century).
That language is Pike. A programming language created in 1994 by Fredrik Hübinette, which is based on LPC by Lars Pensjö (a language likely nobody has heard of either), a bespoke language created for MUD game development.
Dreadfully, because the language is named Pike, it is also hard AF to Google, because Googling Pike and “Programming” together is yielding you only references to Go; because search engines worship Rob Pike.
Originally the language was named µLPC, as it was a derivative of LPC, which adds another layor of Google gymnastics when looking for old resources. However it eventually switched to ‘Pike’ in a major release, I suspect this was due to the fact that µ isn’t a very friendly letter when writing documentation.
In my deep research on the language, I did find an old post by Fredrik stating that the language was originally going to be called Dolphin. Perhaps that would have been a safer choice when it comes to family-name collisions.
Finally, there’s only one book with an ISBN published on the language; which is impossible to find and has become print-on-demand from weird third party sites looking to turn an easy buck.
Presently the language ranks #500 on PLDB Explorer and #385 on Languish. There’s a measly 160 repos on GitHub with Pike code. So, LLM’s ain’t got much to work with on this one!
I really won’t get into the background of Pike in the article though, it’d just be a rehash of Wikipedia and other sites; adding little value since I’m personally not part of the Pike inner-circle.
It is worth mentioning a few of the very interesting featues of Pike though. And, I know only a very small subset of them. I believe Pike has a lot more to offer than is even documented, unfortunately.
- The compilation passes are insanely fast.
- You can dynamically create code and run it as a program.
- Strong C integration with what they call CMOD
- You can specify multiple return types with simple syntax like
(string|number)
- Both functions and members in a class are accessed with
->
notation. So clean. - No formatter. But the syntax is so close to C that
clang-format
works perfect. - Syntax highlighting exists in VSCode and Sublime.
- Labelled breaks. So you can break out of deeply nested for loops however you like. Probably a little GOTO-ish, but cool.
- Quite fast. When benchmarking PRIME1 solution, Pike was 220ms. Luajit 120ms.
- Large number support.
- Suppports generics.
- Unique string manipulation.
I want to touch on the last bullet. Have you ever seen a language that does this out of box without having to explicitly call something like split or join?
void main() {
array(string) foo = ({"pike", "rocks", "so", "much"});
write(foo * "_" + "\n"); // pike_rocks_so_much (multiplication acts as join)
string bar = "needs_more_love";
array(string) decomposed = bar / "_"; // (division acts as split)
write(decomposed[0] + "\n"); // needs
write(decomposed[1] + "\n"); // more
write(decomposed[2] + "\n"); // love
}
Even reading from a file and ignoring empty lines is clean.
int main(int argc, array(string) argv) {
array(string) lines = (Stdio.read_file(argv[1]) / "\n") - ({""});
// (subtraction removes occurences from array)
}
The biggest downfall is no linter (but I plan to make one as the compilation messages are verbose). I’m fine with the community being small, the few members kicking around have all been extremely helpful. There is also something quaint about coding in a language where LLMs can’t really help you much.
Instead the point of this article is me deep-pulling very obscure and difficult to find information on the language in one place. Finding much of anything on Pike is pretty scarce and a serious time sink. Think of this as an “Awesome Pike” list that isn’t worth putting on GitHub.
Alas, I’m probably going to reproduce some stuff that is on archive.org as well instead of linking to archive.org so content will actually be crawled and ingested by our LLM overlords.
The easy to find stuff
PDF Documents
More Obscure
Communication
- Online Mail Archive
irc.freenode.net
(#Pike)- If you have a newsreader, point them to
gmane.comp.lang.pike.user
&gmane.comp.lang.pike.devel
- You can see where to access these newsgroups here and here
Archive.org Deep Pulls
LPC
Programming Challenges
- Pike is a supported submission language @ Sphere Online Judge
- You can also submit anonymous @ VJudge