News for hackers. Stuff that matters.
Re:Pike Programming Language by em-bee on Saturday May 21, 2022 @03:43AM (#31456056)
the 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 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.

Re:Pike Programming Language by BuGlessRB on Saturday May 21, 2022 @09:54AM (#31457934)
On 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).

Re:Pike Programming Language by em-bee on Saturday May 21, 2022 @12:29PM (#31459286)
interesting, is there more documentation, examples?

are there similar systems in other languages so people can get an idea what to compare it to?

btw, welcome to hackernews.

everyone, if you didn't already recognize the nickname, BuGlessRB is famous for being the creator of procmail :-)

Re:Pike Programming Language by BuGlessRB on Saturday May 21, 2022 @03:02PM (#31460782)
I have several active implementations now (in active use for the past 2 years), I guess I could easily water some of those down into a few examples.

With regard to similar systems... Good question. Comparable solutions:

- Ruby Passenger daemon. Almost feature parity with the Enterprise version, except for the "cool robot logo".

- Python Flask framework.

- Apache with mod_php or php-fpm.

- Roxen.

With respect to procmail, yes, indeed, and I picked up its maintenance again, and released a new version recently.

Re:Pike Programming Language by BuGlessRB on Saturday May 21, 2022 @10:00AM (#31457994)
Another related note, I created Remixml, a descendant of RXML in Roxen, but now Javascript based (client side or NodeJS):

https://www.npmjs.com/package/remixml

Re:Pike Programming Language by em-bee on Saturday May 21, 2022 @12:34PM (#31459323)
nice, i have been waiting for someone to make that. it's the logical next step of the evolution for RXML