Fork me on GitHub
#babashka
<
2022-01-17
>
thumbnail11:01:52

----- Error --------------------------------------------------------------------
Type:     clojure.lang.ExceptionInfo
Message:  Could not resolve symbol: seq_1085
Phase:    analysis
I'm trying to port an internal tool to babashka; but ran into this error. There's quite some code and no stacktrace. Where should I begin my search 😅. I'm on babashka 0.7.3 🙂

thumbnail12:01:23

Also, I'm trying to use https://www.threeten.org/threeten-extra/ but a simple add-deps + import doesn't work :thinking_face:. Not sure where to start (probably it's incompatible with graal?)

borkdude12:01:44

Sorry for that error message, I don't know what happens there without having a repo I can reproduce with

1
borkdude12:01:06

Can you give more info than "doesn't work"?

borkdude12:01:23

Ah yes: > ThreeTen-Extra provides additional date-time classes that complement those in https://docs.oracle.com/javase/8/docs/api/java/time/package-summary.html.

borkdude12:01:34

bb doesn't load Java classes, only built-in ones

borkdude12:01:45

in bb java.time is available

thumbnail12:01:55

yeah doesn't work is quite vague I agree 😬. It can't import / find the java classes. > in bb `java.time` is available The thing with threeten is that it provides the 'missing' java.time classes (such as YearWeek) for which there's no real replacement 😅. Is there a workaround, or is it just 'though luck' 😛 ?

borkdude12:01:19

no workaround unless you build your own version of bb with this included

1
borkdude12:01:09

if this is a shared clj/bb library then you can use reader conditionals for bb

borkdude12:01:25

#nbb is a different story, there we can use any library from npm, but in bb it's a closed world, no JVM available to run bytecode

thumbnail14:01:42

> if this is a shared clj/bb library then you can use reader conditionals for bb Oeh! Actually it is a cljc project, so this is a very good option

dabrazhe13:01:26

Perhaps far-reaching, but can babashka interface with python libs/code? Some of the python libraries are too large to rewrite in clj.

borkdude13:01:06

@dennisa kind of :) you can build yourself a python pod to expose whatever to babashka: https://github.com/babashka/pods/blob/master/examples/pod-lispyclouds-sqlite/pod-lispyclouds-sqlite.py Another option is to use GraalVM CE to interface with Python from Clojure using the Polyglot API, or use libpython-clj. The latter options will use a full JVM, without the good startup of babashka.

1
borkdude13:01:25

also you could shell out to python of course

thumbnail14:01:03

Hmm, could it be that babashka doesn't do clojure.core/*assert* *?*

borkdude14:01:53

hmm, currently not exposed. could do that.

$ bb -e '(assert nil "foo")'
----- Error --------------------------------------------------------------------
Type:     java.lang.AssertionError
Message:  Assert failed: foo

borkdude14:01:21

is this in a library you are loading?

borkdude14:01:24

you could maybe file a bug about this and meanwhile work around this by using:

(intern 'clojure.core (with-meta '*assert* {:dynamic true}))

1
thumbnail14:01:36

> is this in a library you are loading? Yes; I'm trying to use an internal lib which uses nedap/speced.def. Which relies on this *assert*. I'll give it ago; thanks for the patience 🙂

thumbnail14:01:37

That worked!

borkdude14:01:35

oh lovely. feel free to post issues about anything you stumble upon and feel free to bother me about it

1