Skip to content

Babashka compatibility#242

Open
borkdude wants to merge 8 commits intoEngelberg:masterfrom
borkdude:bb-compat-2
Open

Babashka compatibility#242
borkdude wants to merge 8 commits intoEngelberg:masterfrom
borkdude:bb-compat-2

Conversation

@borkdude
Copy link

@borkdude borkdude commented Mar 23, 2026

Hi @Engelberg. In this PR I've added babashka compatibility. The main difference with JVM Clojure is that it doesn't support the AutoFlattenSeq deftype stuff as of today. This PR relies on changes that are only available in the master branch of babashka. I've added a Github test runner to verify that everything works. If you would like to have any changes to this, please let me know!

borkdude added 7 commits March 6, 2026 14:33
Changes across 5 files to make instaparse loadable from source in babashka:

- auto_flatten_seq.cljc: For :bb, use plain vectors with metadata markers
  (::afs, ::dirty) instead of custom deftype. Extend ConjFlat protocol to
  PersistentVector. Skip JVM-only macros (compile-if, mix-collection-hash-bc).
- gll.cljc: Skip Segment deftype (use plain strings like cljs). Add :bb
  branches for text->segment, sub-sequence. Preserve existing metadata in
  safe-with-meta for :bb (merge instead of replace) to keep AFS markers.
- cfg.cljc: Use edn/read-string for safe-read-string in :bb.
- core.cljc: Skip IFn implementation on Parser defrecord for :bb.
- reduction.cljc: Remove debug instrumentation.
Wrap Parser records in callable fns for bb (IFn via fn + metadata),
unwrap in parse/parses. Add bb.edn with test:bb task. Skip
round-trip-test and print-test (require record printing) and
StringBuilder test (bb text->segment only supports String) in bb.
@borkdude
Copy link
Author

Sorry, I realized that there was already a test runner in CircleCI. Moved the test-bb job there.

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

Successfully merging this pull request may close these issues.

1 participant