babashka

borkdude 2025-07-14T22:08:38.353539Z

Nice article by @robbie.huffman about writing CGI scripts directly with babashka: https://blog.nundrum.net/posts-output/2025-07-09-clojure-cgi/

😊 2
3
escherize 2025-07-14T22:30:20.619239Z

Cool post, reminds me of https://github.com/jaidetree/clj-cgi-example

escherize 2025-07-14T22:31:23.374899Z

the blog post for it is dead, but it's on https://web.archive.org/web/20241117085046/https://eccentric-j.com/blog/clojure-like-its-php.html

Nundrum 2025-07-14T22:39:05.871769Z

Thanks! I hadn't seen that before. And now it has me wondering if could use this or Phel for making Nextcloud apps 😅

borkdude 2025-07-15T06:52:41.392269Z

What about also posting this to #news-and-articles @robbie.huffman ?

Nundrum 2025-07-29T14:30:08.116569Z

@j.s Maybe someday I'll try it again. The last time I couldn't figure out what the model was behind NC. It was much more complex than expected. But they have added a lot more documentation since my last attempt.

😄 1
Nundrum 2025-07-15T12:26:17.377939Z

Sure! Why not?

borkdude 2025-07-15T12:26:37.485189Z

Go ahead! :)

Nundrum 2025-07-15T12:26:57.849729Z

Just did! 😄

borkdude 2025-07-15T12:27:25.767079Z

If you mention the title along with the link, it's a bit friendlier to people following that channel

Nundrum 2025-07-15T12:28:03.016969Z

It looks like Slack pulled in the title and description?

borkdude 2025-07-15T12:28:34.106109Z

not for me

borkdude 2025-07-15T12:29:16.956289Z

Take an example of the link above

Nundrum 2025-07-15T12:29:58.306679Z

how odd!

jasalt 2025-07-28T09:23:06.410699Z

@robbie.huffman NC app with Phel should work as output is simply transpiled PHP. It takes some experimentation though depending how NC does "plugins". I managed to get it working with WordPress pretty well with most pain being Composer support v.s. WP which just generally sucks. It is pretty minimal and might give hints on what the integration needs. https://github.com/jasalt/phel-wp-plugin Also take into account that by default the transpilation happens during runtime / request, if you don't transpile ahead-of-time using export (I haven't gotten to that yet).

jasalt 2025-07-28T09:25:24.936149Z

Basically, the "main" file WP runs during plugin init has following:

use Phel\Phel;

$projectRootDir = __DIR__ . '/';
require $projectRootDir . 'vendor/autoload.php';

Phel::run($projectRootDir, 'phel-wp-plugin\main');
Something similar would probably be the case for other systems also.

jasalt 2025-07-28T09:30:32.272049Z

Other way around, a Phel script can bootstrap WP environment by requiring wp-load.php which can nice to "REPL into" or use for Phel unit test runner and stuff..

jasalt 2025-07-28T09:39:39.172199Z

Should be possible to have CGI style bb scripts working as part of / alongside PHP webapp too but with WP stuff on managed hosts running other than PHP-FPM in ports 80 & 443 is pretty much blocked. Invocating subprocesses is also (again if supported on hosting) but there's bit of overhead, same with IPC sockets etc. With lower level languages you could build PHP extensions (e.g. C, Janet, Rust) but adding those is also blocked on managed hosting, runtime overhead would be less.

Casey 2025-08-18T08:43:26.639389Z

What's old is back, I love it!

john 2025-07-16T14:16:33.926259Z

What's this about next cloud apps?

Nundrum 2025-07-16T14:20:51.855099Z

Just wondering if a NC app could be made with Babashka or Phel: https://phel-lang.org/

👀 1
john 2025-07-16T14:22:58.682909Z

I was just about to install NC and I didn't know about the apps thing. Nice, I'll check it out

Nundrum 2025-07-16T14:28:15.635659Z

I've been running Nextcloud for over a decade, so feel free to PM me with questions.