babashka

m3tti 2025-12-09T15:43:48.232339Z

if i have a script like this

#!/usr/bin/env bb

(require '[app.routes :as r])
(r/route)
is it possible to require this namespace? if it resides in app/routes.clj?

2025-12-17T17:29:35.253209Z

im curious what you mean by cgi? what is your vision for this? @mathaeus.peter.sander

m3tti 2025-12-17T17:55:49.844659Z

In the past perl and php were just cgi languages and evolved later in fastcgi or other tech to devolop rich webappa. My idea is like i saw in an aeticle to uae babashka just like that. Build a simple script to generate rich webapps like it was done at the beginning of the web. Simple and easy ;)

🚀 2
borkdude 2025-12-09T15:45:18.276129Z

yes, but you need to add the local directory to the classpath, either via bb.edn or some other way

m3tti 2025-12-09T15:46:48.467909Z

yeah i'm currently working on my cgi idea 😄 and i would like to use plain clojure syntax. So i have this as main.clj file and everything else is "normal" clojure syntax with namespaces and stuff. so i have to find a way to easily add the classbath.

borkdude 2025-12-09T15:48:09.431039Z

you can do it like this:

(babashka.classpath/add-classpath ".")

m3tti 2025-12-09T15:52:46.919429Z

are there any downsides? performance wise or something like that. I have something in the back of my mind that there was something with dynamically creating stuff in clojure

borkdude 2025-12-09T15:53:12.035409Z

no performance issues

❤️ 1
m3tti 2025-12-09T15:53:39.991539Z

than i might release something new based on babashka 😄 for the brave hearts out there

borkdude 2025-12-09T15:53:50.393219Z

for the brave and true \m/

m3tti 2025-12-09T15:59:51.759069Z

wow it works 😮 my idea works 😮

m3tti 2025-12-09T16:10:21.785649Z

maybe if someone is interested 😄 here my current work in progrress https://github.com/m3tti/babashka.cgi