Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to babaska? #247

Open
arichiardi opened this issue May 24, 2020 · 6 comments
Open

Move to babaska? #247

arichiardi opened this issue May 24, 2020 · 6 comments

Comments

@arichiardi
Copy link
Collaborator

arichiardi commented May 24, 2020

I have been flirting with the idea of moving away from boot for my blog but not from perun.

The main advantage that I see there is startup time and possibly, but not sure about that, rendering time.

I am thinking some code could be created to handle the tasks and use the same Java libraries for it.

Mainly asking feedback on this, not sure it is worth it also but boot's maintainance could also be a factor here.

Thanks!

@allentiak allentiak changed the title Move to babaska Move to babaska? May 24, 2020
@allentiak
Copy link
Contributor

Ciao, @arichiardi!
Thanks for bringing this up!

Please read my answer in #241 (comment)_

Best,
Leandro

@arichiardi
Copy link
Collaborator Author

After closer inspection I am not sure it is possible to run arbitrary Java libs in babashka but I might be wrong.

@arichiardi
Copy link
Collaborator Author

arichiardi commented Dec 22, 2020

Let me ask directly to @borkdude.

We have dependencies in here like:

perun/src/io/perun.clj

Lines 403 to 404 in 7d48f73

[com.vladsch.flexmark/flexmark "0.40.16"]
[com.vladsch.flexmark/flexmark-profile-pegdown "0.40.16"]])

or [org.asciidoctor/asciidoctorj "2.0.0"] and even [org.apache.lucene/lucene-analyzers-common "8.4.1"]

If we built a classpath with those in it, would babashka be able to use them all?

It's a long shot and sorry about a bit of newbie-ness here 😄

@borkdude
Copy link

@arichiardi Babashka is only able to use Java classes that have been explicitly added into the native image. If you want to create something like babashka, but for static site generation, you will probably have to make your own GraalVM native-image project. Bootleg has done something similar: https://github.com/retrogradeorbit/bootleg

At work we are currently migration away from boot and running some tasks in a separate JVM, while also still using boot in another one. We use this babashka script for it:

#!/usr/bin/env bb

(ns dev (:require [clojure.string :as str]))

(require '[babashka.process :refer [$ destroy-tree *defaults*]])

(alter-var-root #'*defaults* assoc
                :out :inherit
                :err :inherit
                :shutdown destroy-tree)

(defn cljs []
  ($ "./clojure" "-A:frontend:cljs/dev"))

(defn less []
  ($ "./clojure" "-A:frontend:less/dev"))

(defn clojure []
  ^{:inherit true} ($ "./boot" "dev"))

(cljs)
(less)
(-> @(clojure) :exit (System/exit))

@arichiardi
Copy link
Collaborator Author

If you want to create something like babashka, but for static site generation, you will probably have to make your own GraalVM native-image project.

Thank you for confirming that's what I was thinking too.

@arichiardi
Copy link
Collaborator Author

Bootleg has done something similar

Thanks for the heads up, however perun here does a lot more nice things than just rendering (atom, lessc, ...). That's why IMHO is worth keeping it going 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants