This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-23
Channels
- # announcements (7)
- # babashka (11)
- # babashka-sci-dev (1)
- # beginners (8)
- # biff (1)
- # calva (8)
- # chlorine-clover (3)
- # cider (9)
- # clj-kondo (16)
- # cljdoc (9)
- # clojure (79)
- # clojure-australia (1)
- # clojure-dev (5)
- # clojurescript (24)
- # data-science (3)
- # datomic (2)
- # emacs (54)
- # fulcro (1)
- # graalvm (1)
- # jobs (5)
- # lsp (25)
- # malli (7)
- # meander (10)
- # off-topic (44)
- # other-languages (8)
- # portal (10)
- # remote-jobs (1)
- # sci (1)
- # shadow-cljs (6)
- # vim (4)
Can babashka use any clojure library as long as the library doesn't use any of the features called out https://book.babashka.org/#differences-with-clojure? e.g. I'm trying to use https://github.com/clojure/algo.monads but I have an error.
{:deps {org.clojure/algo.monads {:mvn/version "0.1.6"}}
:tasks {:requires [[clojure.algo.monads]]
hello (println "hello")}}
gives
C:\Users\richie\project>bb hello
----- Error --------------------------------------------------------------------
Type: clojure.lang.ExceptionInfo
Message: Could not resolve symbol: clojure.lang.Compiler/specials
Location: clojure/tools/macro.clj:32:19
Phase: analysis
----- Context ------------------------------------------------------------------
28: ; it impossible to shadow them by macro definitions. For most special
29: ; forms, all the arguments are simply macro-expanded, but some forms
30: ; get special treatment.
31: (def ^{:private true} special-forms
32: (into #{} (keys clojure.lang.Compiler/specials)))
^--- Could not resolve symbol: clojure.lang.Compiler/specials
33: ; Value in Clojure 1.2 and 1.3:
34: ; #{deftype* new quote & var set! monitor-enter recur . case* clojure.core/import* reify* do fn* throw monitor-exit letfn* finally let* loop* try catch if def}
35:
36: ; The following three vars are constantly redefined using the binding
37: ; form, imitating dynamic scoping.
It should work with this new Windows binary: https://ci.appveyor.com/api/buildjobs/ilnqd28j97c3lwn1/artifacts/babashka-0.7.4-SNAPSHOT-windows-amd64.zip
I've implemented some checks in bb/SCI for recur
in non-tail position. There is one edge case. This was previously possible:
(fn [] (try (recur)))
but in Clojure it's forbidden. What should I do in SCI? Now it throws.Is there a reason not to keep Clojure semantics? Backwards compatibility for existing bb/SCI code?
(fn [] (try (recur)))
is also not allowed in CLJS, so I'd say not allowing it is more in line with the reference implementations@maximilian is killing it lately. he's added cycle detection to bb.edn in clj-kondo.