13 ms·
The Pike Programming Language
- macintux 4y agoHaven’t figured out what its value proposition is, but the about page has more details than the homepage. https://pike.lysator.liu.se/about/ https://pike.lysator.liu.se/about/
- LargoLasskhyfv 4y ago1998: https://www.linuxjournal.com/article/3012 https://www.linuxjournal.com/article/3012 > The Roxen Challenger HTTP Web Server is a marvel ahead of its time. That's a bold, hard-to-prove statement for a web server when compared to the amazing success of the Apache HTTP Server. Before you stop reading, you should consider that there is nothing wrong with having two subtly different, yet very good tools.
- WalterGR 4y ago> you should consider that there is nothing wrong with having two subtly different, yet very good tools. It's amusing that this needs to be said when writing for a particular audience.
- nazgulsenpai 4y agoI don't follow; are you implying Linux users (the particular audience) don't like having multiple tools for specific use cases or that the author's statement goes without saying?
- cschep 4y agoOften when there are two (or more) very good tools for a single task (e.g. editing text) there breaks out a Holy War, rather than people being happy for each other to use their preferred, each excellent in their own way, option. Seems to me this is what the parent comment is nodding to.
- WalterGR 4y agoPrecisely. Checking more recent comments, it looks like a Holy War has broken out over whether there should be Holy Wars. Priceless!
- IshKebab 4y agoWell it is wrong. There is something wrong with having two subtly (depending on how subtle it is) different tools. There's duplication of effort, community split, interoperability hassles (depending on the something), extra support burden if other people have to support both, etc. I don't think anyone would agree that having 110V, 220V, 50Hz and 60Hz is good. Or subtly different railway gauges. Or Windows and Unix style line endings. There are a couple of upsides too - increased competition, backup in case one project goes in a crazy direction, etc. But it's silly to pretend there's nothing bad about it. Though anyway in this case I think "a marvel ahead of its time" is not a "subtle difference".
- em-bee 4y agoroxen and apache were not two subtly different tools, they were, and still are, miles apart. the way you use them and develop for them is completely different. roxen not only replaces apache but also perl, php or any other language that you develop your websites with. therefore roxen does not even compete with apache, but it also competes with laravel, django or rails. the fact that those later frameworks need apache to serve their content is rather incidental. rails was first released in 2004. django in 2005, laravel in 2011. i used roxen (and it's predecessor spinner) in 1994!! that's literally a decade earlier. i think the only possibly competing tool available at the time was cl-http in lisp[0]. (AIDA/Web for smalltalk was created in 1996, as was WebObjects, Java EE came in 1999. that's all i could find so far) [0]: at the time i was looking for a better alternative to the available ncsa and cern webservers. i remember ordering a student version or something like that of franz lisp so i could try it. and i was put off by having to write lisp code just to serve static files. that was what made me keep looking until i found spinner.
- macintux 4y agoI wasn’t trying to denigrate it: I was genuinely curious what it’s good or bad at. Every language has a reason to exist, although for many it’s simply because it can.
- randallsquared 4y agoRoxen was definitely far easier to use than Apache, but PHP was a second-class citizen on Roxen, and "Roxen including RXML and Pike" was directly competing with "Apache plus mod_php" (and/or ColdFusion? I never used that, so not sure) though I don't know that the creators understood that at that time. There were a number of contributions to Roxen's oblivion, to include RXML was a very high level XML-based scripting language, but you had to drop to Pike to do some things; PHP was a single language that was clunkier than Pike but didn't seem like two separate languages to learn. Since Roxen started so early, there was some terminological divergence already in 2000 between it and the rest of the webserver world. Roxen created a 2.x of the web server and RXML syntax that was notably nicer and more modern-seeming, but also much slower for some use cases, so some Roxen 1.x users resisted upgrading -- so much so that when the company gave up, the community-maintained Roxen, Caudium, was based on 1.x, not 2.x, even though 2.x had been out for many years. From the outside perspective, Roxen seemed to treat consulting or enterprise sales as its bread and butter, in which the webserver was a sort of force multiplier or secret sauce, which directly conflicted with a goal of growing the Roxen user community.
- em-bee 4y agoI don't know that the creators understood that at that time yes, this is right, this was not well understood. part of the problem was that the concept of web development frameworks was not established yet. later it would have been easier to say that roxen competes with frameworks such as django or rails, but at the time roxen was promoted as a webserver, and so people expected a drop-in replacement for apache. in fact, roxen might have done better if it had been using apache as a http protocol frontend. in a sense roxen/pike suffers the same challenge as smalltalk and lisp do today. you can do powerful things in those languages and environments, but they don't fit into the mold of what everyone else was doing. you kind of have to give up your existing ecosystem and start from scratch learning new tools and concepts. RXML was a very high level XML-based scripting language, but you had to drop to Pike to do some things; PHP was a single language that was clunkier than Pike but didn't seem like two separate languages to learn. i wouldn't see it that way. anyone who learned programming could see that html/xml/rxml was not a programming language but sophisticated markup. for some time there were two camps, those that wanted code and markup mixed in one file, and those that wanted to keep it separate. php favored the mixed approach and python went for the latter. roxen with pike also was firmly in the latter camp. however it seems that it took a while before the latter approach became more popular and by that time multiple alternatives such as python and ruby were available. Caudium, was based on 1.x, not 2.x, even though 2.x had been out for many years. i was part of that team. the primary issue was not performance, but compatibility. roxen 2 could not handle some of the more complex rxml people had created with roxen 1. the most notable reaction i remember that per hedbor, the primary developer of roxen, was disappointed that we had forked roxen 1 and not roxen 2. he was understandably and rightfully proud of his work. but unfortunately it took some time before roxen 2 was able to achieve enough compatibility with roxen 1 to make a lot of old rxml work in roxen 2. another notable detail is that the fork was lead by his very brother david. and for the curious, the name caudium came from us looking up the word "fork" in a latin dictionary. we didn't find a nice sounding translation, but there was this reference of a roman town near a river-fork whose name we all liked, so that is what we picked.
- diggernet 4y agoThat's a great question. I know I'm looking forward to reading HN thoughts on it. For my part, as someone who has only dabbled in it, I can say that it appeals to me though I have difficulty elucidating why. I think partly because it is well suited to creating servers, due to its background in MUD and WWW servers.
- forgotpwd16 4y agoIt's a descendant of a language used for multi-player adventure games originating in early 90s. Guess its value will be it being a C look-alike scripting language. According to its comparison page compared to Python "is faster, has a more advanced type system, and better support for OOP".
- em-bee 4y agothe key value for me is that i can replace compiled code at runtime. this allows to build large long running systems that can be changed without needing to restart. this is a feature that comes out of LPC which was designed for online games where it was necessary to add new content and fix bugs while the game was running since the developers of the game were the advanced players themselves. roxen uses that to allow reloading modules. the way it works there is that any currently active instances keep running with the old version, but new instances get the new version. since modules are freshly instantiated for each http request this works very well. there is also open-sTeam which went a step further to use proxy objects, that is, any sTeam object is a proxy to the actual pike object, so my code will only reference sTeam objects which allows the pike objects in the background to be replaced without my code needing to update the object reference because the proxy handles that behind the scenes. open-sTeam is not actively developed anymore by its original developers, but there is a copy of it here: https://gitlab.com/societyserver/sTeam https://gitlab.com/societyserver/sTeam and i still maintain and use it for myself. (i have added a half-assed REST API so i can do modern web development with it. (realss.com is an example of that. i can connect to sTeam using vi to update the text content and custom code (which is stored inside sTeam as source too)) besides in pike and LPC i have only seen the ability to update code at runtime in smalltalk and lisp. i am not aware of any other language offering something like that.
- BuGlessRB 4y agoOn a related note, I have created the SPike daemon: git://devel2.cuci.nl/spike . It's written in Pike, is being actively maintained, with roughly the following featureset: - Meaningful error messages on compiled modules. - Smart auto-recompilation of modules (mtime based). - Auto-fallback to last-known-good modules on compilation failure. - Two classes for module development: Spike.Base and Spike.Site + Spike.Base implements a log() and listenport() primitive. + Spike.Site adds filesystems, databasepools and a configuration system per site. - Live configuration reload through SIGHUP (no downtime). - Integrated HTTP and WebSocket dispatch engine. - Transparent proxy support. - Auto-gzip compression on both static and dynamic content. - Integrated and configurable logging mechanism to syslog. - Completely Shuffler-ised (maximal offloading of communication overhead to pure C and the kernel). - Less filling: 29KB of source code (single file).
- tored 4y agoGood question, perhaps strictly typed dynamic C like language with an event loop and a large standard library.
- tpmx 4y agoWe built the Opera Mini server infrastructure based on Pike, starting back in 2004-2005 with a team that initially mostly came from the Roxen/Spinner days (a separate company). I started working there in 97, and I was kinda late to the party - it started out in 93/94. I still miss working with this language. It just makes so much sense to me. The way I think of it is as a quite a lot more performant version of Python with a C-like syntax and a much more consistently designed - while still very rich - standard library. The downside is of course that compared to Python, Pike is now almost completely unknown. The ecosystem is tiny, etc. We really sucked at marketing the language in the early critical days and then after a while kind of gave up and focused on using it to build commercial systems instead.
- nerdponx 4y agoIs Go the spiritual successor to Pike?
- tpmx 4y agoI doubt that Pike was on the Go designers' radars - but to me personally, it certainly feels so. Go is now my favorite language. Who knows though, the Pike language's main creator has been at Google since well before Go got started.
- 2143 4y agoIn the excellent GOPL book [1], there's a part called "The Origins of Go" in the Preface that lists languages which had an influence on Go (there's an accompanying diagram). You can see this part of the book (including the aforementioned diagram) in the official sample at [2] (page xii). The languages are: ALGOL 60, Pascal, Modula-2, Oberon, Object Oberon, Oberon-2, CSP, Squeak, Newsqueak, Alef, and C. [1] The Go Programming Language, by Alan A. A. Donovan and Brian W. Kernighan https://www.gopl.io/ https://www.gopl.io/ [2] https://www.gopl.io/ch1.pdf https://www.gopl.io/ch1.pdf
- LinuXY 4y agoI have fond memories of learning Pike and Roxen as a kid by perusing the Stellar Crisis source code (released, 1993!) I think there's still some servers around today. https://strategywiki.org/wiki/Stellar_Crisis https://strategywiki.org/wiki/Stellar_Crisis
- xscott 4y agoYeah, in that same year I was using "LPC" in an LPMUD called "Lost Souls". I think that's a precursor to Pike, but I'm not certain about the family tree. I had learned Basic when I was young, and my coursework had pushed me to learn Pascal and C, but I really think it's LPC that pushed me towards a career in programming.
- abathur 4y agoYes, I am also under the impression that Pike grew out of LPC (and I, too, really cut my teeth on LPC).
- tpmx 4y agoYeah, it did. https://web.archive.org/web/20100204062426/http://pike.ida.liu.se/about/pike/history.xml https://web.archive.org/web/20100204062426/http://pike.ida.l... https://en.wikipedia.org/wiki/LPMud https://en.wikipedia.org/wiki/LPMud
- classichasclass 4y agoAnother Roxen user by way of LPC (even have the T-shirt!). Back in the day, gtext was the bomb. Nothing looked as good.
- avgcorrection 4y agoI was sort of curious about how active this community is. - News sidebar: 2022, 2022, 2021. So it’s not dead. - “Development”. Stuff about policies and getting write access. Taking legal action if you violate the LICENSE. Wait, do they use Subversion? No they use Git. - Where’s the repo? A page about read-write access. Doesn’t seem like I can get simply read access. (A HTTPS link is more convenient for me for read access, which is how I access all Git repositories which aren’t owned by any of my online accounts.) - Issue tracker. Latest issues updated 1 month, 3 months, and 5 months ago. - Forum is a mailing list. You can subscribe. No web archive apparently. - There is a graph of lines of code added/deleted every week “since it first became version controlled” (Highcharts). It’s empty. - There’s some heading “Contributors with a Github account” with nothing beneath it. I won’t criticize an apparently university-managed homepage for any of this. But what am I supposed to learn from it in this context? Is this perhaps yet another “remember this, fellow in-the-knowers?” HN submission?
- diggernet 4y agoNah, it's more of a "I wonder what folks have to say about this rarely-mentioned project" HN submission. For the repo, I found that the Development page has a tab (at top left, doesn't really look like a tab, so easy to miss) named "GIT". That page has links to what looks like a self-hosted GitLab, as well as a GitHub mirror.
- tored 4y ago- repo https://pike.lysator.liu.se/development/git/ https://pike.lysator.liu.se/development/git/ - git mirror https://github.com/pikelang/Pike https://github.com/pikelang/Pike - web mailing list https://www.mail-archive.com/pike@roxen.com/ https://www.mail-archive.com/pike@roxen.com/ But yes the web page is stale, it has been for a long time.
- xrd 4y agoI worked at Real Networks back in the end of last millennium. They were big fans of Roxen and Caudium. I loved developing in Pike. It was way ahead of it's time for sure.
- sigzero 4y agoPike looks pretty clean as a language. Nice.
- svieira 4y agoThe module system is quite interesting - basically, every unit of compilation (Pike seems to use a file for this purpose) is loadable and treatable as-a-class (Pike calls classes `Program`s): https://pike.lysator.liu.se/docs/tut/oop/programs.md https://pike.lysator.liu.se/docs/tut/oop/programs.md
- em-bee 4y agoyes, that is one of the interesting aspects of pike (and also LPC). in difference to java which requires class boilerplate in each file, pike just takes the file name as the class name and the functions and variables inside as the class definition. as a beginner i learned to use inheritance simply for composition, and i didn't even realize that this was supposed to be object oriented programming. it only hit me a few years later when i realized how roxen handled requests and managed modules. i literally woke up one morning and "got" object oriented programming. btw: generally i remember calling the source class, and the compiled objects program
- keyle 4y agoFor a moment I thought this was Rob Pike's offshoot baby language frustrated by Go or something :)
- Blackthorn 4y agoLPC taught so many non-programmers how to code working games it's incredible.
- chadcmulligan 4y agoCan you use it as an embedded scripting language? Couldn't find anything on the web site.
- garrypettet 4y agoTake a look at Wren if you want a similar looking embeddable scripting language. It was created by Bob Nystrom (who now works in Dart). It’s a lovely language. [1]: https://wren.io https://wren.io
- chadcmulligan 4y agoYes thanks, wren is very nice too, though its at 0.4, I would like a 1.0, though I'm not sure how seriously to take the versions.
- tored 4y agoInteresting question, pike has a stable C API for creating C modules Step by step instructions https://pike.lysator.liu.se/docs/cmod-step-by-step/ https://pike.lysator.liu.se/docs/cmod-step-by-step/ What is CMOD? http://wiki.gotpike.org/index.pike?page=PikeDevel/C%20Modules/CMOD http://wiki.gotpike.org/index.pike?page=PikeDevel/C%20Module... Calling pike functions from within C/CMOD code http://wiki.gotpike.org/index.pike?page=PikeDevel/C%20Modules/Calling%20Pike%20Code http://wiki.gotpike.org/index.pike?page=PikeDevel/C%20Module... example https://github.com/pikelang/Pike/blob/master/src/modules/Inotify/inotify.cmod https://github.com/pikelang/Pike/blob/master/src/modules/Ino... I guess it is more of packaging issue of using pike in that manner, perhaps this is something for the pikers to explore. Could be a great way to revitalize the language, the world could need a embeddable strictly typed C like dynamic language.
- chadcmulligan 4y agoThere is a need I think, Wren is the only one. Lua and javascript are king of the hill, but both have their quirks. Though Pike isn't on ARM either (from what I can see), so probably a bit of work.
- forgotusername6 4y agoThe link to the documentation section from the about page doesn't work
- em-bee 4y agothat looks like a typo. the link at the top works though: https://pike.lysator.liu.se/docs/ https://pike.lysator.liu.se/docs/
- em-bee 4y agoprevious discussions: https://news.ycombinator.com/item?id=20366388 https://news.ycombinator.com/item?id=20366388 https://news.ycombinator.com/item?id=9268778 https://news.ycombinator.com/item?id=9268778
- ur-whale 4y agoNice, but it still has semicolons.
- BuGlessRB 4y agoI'd call that a feature. I hate the ambiguity that semicolon-less Javascript creates (a newline in the wrong spot, and your code starts to misbehave).
- em-bee 4y agowhy specifically call out semicolons? what about braces and c-syntax in general? i love pike, but the c-syntax is not my favorite part. i am more partial to minimalist syntax like smalltalk or lisp. python is nice too, but still to verbose. that said, pike at least is really copying c-syntax directly with some extensions, and not just confusingly pretending to look like c-syntax as eg. javascript is doing.
- ur-whale 4y ago> what about braces and c-syntax in general? I miss braces when I code in Python. Specifically because their absence makes code hard to read and navigate. I've never missed the lack of semicolons, and hate to have to use them when I switch back to languages that requires them.
- deleted 4y ago[deleted]
- shp0ngle 4y agoAh I thought it will be a pun on Rob Pike and Go, but it wasn’t.