Liking cljdoc? Tell your friends :D

Changelog

For a list of breaking changes, check here

SCI: Configurable Clojure/Script interpreter suitable for scripting and Clojure DSLs

SCI is used in babashka, nbb, clerk, joyride and many other projects.

Unreleased

0.15.60-replikativ.2

  • Security / sandbox fix: copy-time fork policy no longer depends on mutable metadata. A Var's copy-time fork fn runs inside a fork's copy section, under the source world's publish and slot write locks. It was read from the Var's :sci.impl/fork-fn metadata, which interpreted code could set with def, defonce, intern (a with-meta / vary-meta symbol), or reset-meta! / alter-meta! followed by a root bind, unbind or watch registration, including by upgrading an existing descriptor. Agent code could thereby run arbitrary code under the copy locks during every fork and change what a fork's child received. A Var's copier now comes only from SCI's own registrations (*loaded-libs*, CLJS type data, ClojureDart method tables) and from the host's new :fork-fns option. The :sci.impl/fork-fn metadata key is ignored, with no compatibility path: whoever installs a namespace does not prove who wrote its Vars' metadata.

  • Security / sandbox fix: :sci/built-in has trusted provenance. It is a flag of the Var or namespace object. Write protection, a Var's home, whether a fork processes a Var's value, and :allow (which implicitly permits non-built-in Vars) read the flag, never the stored metadata; metadata reads report it in every world.

    • Host constructors set it from their construction metadata: new-var, new-dynamic-var, new-macro-var, create-ns, and SCI's own tables. (copy-var / copy-var* produce non-built-in Vars, as before.)
    • Host code may set or clear it afterwards: sci/alter-var-meta!, sci/reset-var-meta!, and on the JVM alter-meta! / reset-meta! called with no SCI context bound (CLJS's alter-meta! writes the object field directly and does not change the flag). Clearing a built-in Var still requires the write check, as before. An :unrestricted evaluation may set it (e.g. to make Vars loaded from source read-only) but not clear it: the flag is shared by every context holding the object, so one unrestricted context must not unprotect a shared Var for the others. A fork whose stored metadata predates the flag keeps it.
    • On the JVM, interpreted metadata can neither set nor clear it, through def, defonce, intern, ns, alter-meta! or reset-meta! (its :sci/built-in is replaced by the flag's value). A host function that interpreted code calls runs with that code's context and is treated the same; interpreted code the host runs with no context bound (e.g. a host callback) counts as host code, which can set but, through the write check, not clear the flag.
  • Security / sandbox fix: interop cannot reach SCI's internal members. sci.lang.Var and sci.lang.Type are in the default :classes, and their public Java methods include unchecked engine mutators (the built-in flag, a primary world's root and metadata mirror, a Var's or Type's home, Type data, thread-bound state); their constructors take that state. A restricted context could, e.g., clear a core Var's flag by interop and rebind it for every context (also in 0.15.60-replikativ.1, through the mirror methods). Reflective interop now treats sci.lang.Var, Namespace, Type and the interfaces of SCI's internal protocols as closed, also through type hints and Class/.method / Class/new values. On these classes an instance call may only resolve to:

    • java.lang.Object's methods (toString, hashCode, equals, getClass);
    • the public Clojure read/call interfaces clojure.lang.IDeref (deref), IFn (invoke, applyTo, call, run) and IMeta (meta), which take the same checked, world-relative paths as a deref, call or meta (no bypass of :allow / :deny: interop needs the Var first);
    • read-only accessors: getName, and a Var's hasRoot, getRawRoot, toSymbol and its immutable fields sym and ns (a namespace, whose interop stays closed).

    Everything else is refused: IReference (alterMeta, resetMeta), bindRoot, setVal, unbind, the internal protocols, constructors, other fields and static members. instance?, type hints and host :classes override fns keep working. On CLJS (where sci.lang.Var was never in the default :classes), member access, method calls, set! and construction on a SCI Var, namespace or Type (or their constructors) are refused, except toString.

  • CLJS: interpreted alter-meta! of a type, and a direct sci.impl.deftype/-create-type call, can no longer replace the type's JS prototype, the operand of the fixed type-data copier.

  • The copy-section participants and their rule (no user code, waits only on leaf locks) are documented in sci.impl.world. The locks are blocking and non-fair: waiting under them is acyclic but has no time bound.

  • New :fork-fns option of init and merge-opts: a map from SCI Var to a one-argument copy-time fork fn, run on the Var's value while a fork copies the source (instead of Forkable / :fork-fn processing after the copy). It is trusted host code: it must not block, take a lock or run interpreted code. It is lineage policy (every fork and sibling of the context), installed when the host calls init / merge-opts: installing the same fn again is a no-op, a different one is refused, and nothing an evaluation does installs or changes one. A :standard context ignores it.

  • Migration: an embedder that marked host Vars with (alter-meta! v assoc :sci.impl/fork-fn f) passes them as :fork-fns {v f} to the init or merge-opts call that installs them. For example, Vars whose values must stay shared by every fork (because host functions rebind those same Var handles dynamically):

    (sci/merge-opts ctx {:namespaces {'clojure.test test-namespace}
                         :fork-fns {test-out identity, report identity}})
    

    Without the migration those Vars' values get the default fork processing, which refuses unmanaged mutable host values: the fork fails rather than running the old copier. sci/intern follows the evaluation rule for :sci/built-in (use new-var for host built-in Vars). A sci.lang.Var / sci.lang.Namespace built with its positional constructor (host code) takes one more argument, the built-in flag; use sci/new-var and sci/create-ns. Interpreted interop on SCI Vars, namespaces and Types outside the allowed read/call set above is refused.

  • Known issues: on CLJS, aset and aget are default SCI core functions, so interpreted code can read and write SCI's internal object fields (e.g. a Var's metadata or built-in flag) by property name in any default context, as in earlier releases; goog.object and js/Object functions can too where the embedder allows them. The :sci/built-in and interop guarantees above are therefore JVM guarantees. ClojureDart was not built or tested for this release.

0.15.60-replikativ.1

  • Merge upstream SCI 0.15.60 and master through be4048ec (the Env record, #1144); see the 0.15.60 section below for upstream's changes. All of them apply to forkable worlds too:
    • Built-in interface methods of a deftype/defrecord (IDeref, IFn, Object, Inst, ...) are stored in its Type metadata, which is world-local type data, so a fork's methods diverge from its parent's (previously they shared the process-global host multimethod table). As for a Var, a call on an instance uses the type's definition in the world it runs in, if that world has one; otherwise (a parent or sibling of the defining world, a host call) the definition of the type's home, the world that evaluated the deftype/defrecord (also one analysed in a parent inside a fn and evaluated in a child; analysis only declares a type). A change from a world without the definition (defmethod, alter-meta!, CLJS extend-type) copies it first and never changes another world's type (on CLJS: its JS prototype). Once the home is retired, user methods (deref, invoke, a deftype's toString/hashCode/equals, inst-ms, a CLJS IPrintWithWriter) are refused with the retired error, also for a key in a host collection; printing (also sci.pprint) falls back to the default form (#object[user.D 0x… "retired SCI world"], #user.R{…}) without calling user code, also when the home is retired while printing; record hash/= stay field-based. An instance does not retain the world that constructed it. A deftype defines exactly the type its analysis created (also when delayed inside a fn, called from another namespace, or when the name is redefined meanwhile), in its own namespace; only that definition elects the home, atomically. Registering an existing type (init/merge-opts :namespaces) never defines it in a world nor changes its home. A world's own definition counts also before a home is elected. User printers write straight to their destination, as upstream; the fallback form applies when the home is already retired (a built-in #object form falls back on any retirement met while it is built), and only on the engine's own retirement refusal.
    • The :unrestricted requirement for built-in multimethods and the :deny checks on namespace introspection (ns-publics, ns-interns, ns-refers, ns-map, find-var, intern, alias, require :as, refer :rename) hold in forked worlds and on read-only host namespaces.
    • The faster closure copies, multi-arity dispatch, inlined evaluation and try extent keep the forkable function paths: an interpreted function still selects the active world's slots.
    • The context's :env holds an Env record on the JVM; a fork's namespace snapshot keeps that record.

Known issues

  • A forkable primary that received another context's SCI type through :namespaces and changes it (defmethod print-method, alter-meta!) also changes it for the defining context (the type's host field is shared; as in 0.15.59-replikativ.9).
  • A saved positional factory (->R) or a fn using (R. x) constructs the current definition of R after R is redefined, while a saved map->R keeps the old one; the generated import of a deftype resolves the name when it runs (as upstream SCI).
  • A user printer (print-method, pprint dispatch, CLJS IPrintWithWriter) that meets a retired world after it started writing propagates the refusal and may leave partial output (as before); print-dup of SCI type instances is not readable back (as upstream).
  • On ClojureScript an interpreted fn compiled by the JIT and called from the host does not enter its world: it reads a world-local Var's host root and is not refused after its world is retired (see doc/fork-state-audit.md).

0.15.60

Highlights

Breaking

  • Minimum Clojure version is 1.11.1
  • extend-type, extend-protocol and extend on clojure.lang/IDeref, IAtom, IAtom2 and IFn throw is not a protocol on the JVM

Sandboxing

  • #1134: :deny also applies to ns-publics, ns-interns, ns-refers, ns-map, find-var, intern, alias, require :as and refer :rename
  • Document why sandboxing on a JavaScript host is unsafe
  • Without :unrestricted, adding a method to a built-in multimethod such as clojure.lang/deref or inst-ms* throws unless the dispatch value is a type, and methods, prefers, prefer-method and remove-all-methods on them throw
  • A static method used as a value ((let [f Integer/toHexString] ...)) obeys :static-methods config, like a direct call: denied when unlisted on a closed class, overridden when an override is configured

Performance

  • Speed up evaluation (up to 25% on the JVM) and emit less code per node (0.6 MB off a babashka binary)
  • Speed up calls to multi-arity fns (about 20% in a native image)
  • Speed up calls to interpreted fns (about 8% in a native image)
  • Speed up calls to a named fn that does not refer to its own name
  • Speed up let, calls of local fns and creation of closures (about 4% on malli validators in native bb)
  • Speed up closures that capture locals (up to 21% on the JVM, 24% on malli validators in native bb)
  • Speed up binding (about 4x on the JVM, 2x in native bb) and try without a catch (about 4x)
  • Speed up try with catch (about 4x in a native image)
  • Speed up try with finally if :interrupt-fn is set (about 15% in a native image)
  • Speed up analysis of fn params (up to 27% on the JVM)
  • Speed up analysis of closures (about 7% on the JVM)
  • Speed up analysis of do bodies (about 4% on the JVM)
  • Allocate up to 15% less when analyzing symbols on the JVM
  • ns-map is 6x faster and ns-refers 60x

Clojure 1.13

  • Clojure 1.13 map destructuring as of clojure/clojure 33fb064d (1.13.0-alpha11): :req!, :excess and :missing directives, :defaults removed. Adds the selector macro to clojure.core.
  • A qualified key in :ns/keys keeps its own namespace: {:foo/keys [bar/x]} looks up :bar/x, not :foo/x
  • :ns/keys qualifies unqualified keywords after &: {:foo/keys! [a & :b]} selects :foo/b
  • merge returns the other argument unchanged if one argument is nil (Clojure 1.13)

Enhancements / fixes

  • Fix #1135: ns-unmap of a default clojure.core refer stops it from resolving
  • Fix #1136: ns-refers and ns-map leave out vars excluded by :refer-clojure
  • Fix instance? on a protocol returning true for a type the protocol is extended to, such as nil or Object, on the JVM
  • instance? on a marker protocol implemented in a deftype body returns true, on the JVM
  • satisfies? on a marker protocol implemented in a deftype body returns true
  • extends? returns false for a type that does not implement the protocol
  • extend-type of a record to Inst no longer makes a record with the same name in another context satisfy Inst
  • deftype, defrecord and reify accept clojure.lang.IBlockingDeref
  • deftype and defrecord methods for built-in interfaces such as IDeref, IFn and Object no longer stay in memory after their context is gone
  • An excluded or unmapped clojure.core macro such as fn throws Unable to resolve symbol instead of No matching clause
  • A macro var in call position expands, in analysis, macroexpand-1 and macroexpand: (eval (list #'when true 1))
  • Fix stack overflow in clojure.walk/macroexpand-all on a reify form
  • for, if-let, when-let, if-some, when-some, when-first and condp name their internal locals with __, like Clojure's auto-gensyms
  • ns-aliases keeps the alias of a removed namespace
  • A var created by intern has the unqualified symbol, as in Clojure
  • import is a macro that expands to (do (clojure.core/import* "pkg.Class") ...)
  • Copy :added and :deprecated into the metadata of built-in vars
  • clojure.repl/print-doc is a private var, so ns-interns of clojure.repl returns only vars
  • clojure.repl/doc on &, catch and finally prints the docs of fn and try
  • read at the end of a LineNumberingPushbackReader reads the underlying stream once
  • Fix the location of a top-level symbol followed by a newline or the end of input when reading from a LineNumberingPushbackReader

0.15.59-replikativ.9

  • Read-only host namespaces (off by default): a namespace whose object carries :sci/built-in metadata, e.g. (sci/create-ns 'lib {:sci/built-in true}) as the :obj of its :namespaces or add-namespace! map, refuses new names from def/declare/intern, deftype/defrecord, and refuses ns-unmap, remove-ns and require with :reload/:reload-all. Unrestricted contexts and the host (add-namespace!) may still extend it.

  • Forks and retirement never wait for an evaluation. Evaluation takes no world lock; a fork excludes only slot writers for the length of its copy (primary realization, cells, lazy caches and the namespace environment, which is now copied at the same cut) and may be called from inside an evaluation of the same interpreter. A fork is a cut between individual publications (a def, namespace, type or method is never torn); delays and lazy sequences being realized fork as pending; a Future held in the world that is still running at the cut forks as a completed future whose deref throws ex-data {:type :sci/forked-future} (realized?/future-done? true, future-cancelled? false); one completed before the cut forks as its value or failure. Only trusted futures (exactly FutureTask or CompletableFuture, or a clojure.core/future whose delegate is one of those) are asked whether they are done; any other Future forks as forked. Host futures are not part of the consistent cut: each is classified when the copy reads it. The parent's task is never waited for, re-run or changed.

  • retire! closes a world at once: new evaluations and forks are refused, running evaluations (also the caller's own) finish against it. A per-world in-flight count clears the retired world's cells and caches when the last evaluation leaves (at once if none is running); the small closed world stays for Vars whose home it is, so their access is refused, never answered from a fallback (also when read through a related world that never had the Var's value). A Var interned, or a volatile created, in a forked world keeps its value only in that world's slots (a host deref of such a volatile outside any world reads nil).

  • No user code runs under a world lock: alter-meta!, alter-var-root, validators and swap functions run before the slot commit (q7). Watches and a validator on the context's :env atom never run inside a publication either.

  • A still-mutable primary's volatile writes are slot sections, so the first fork's realization reads a consistent set of roots.

  • Retirement waits for a fork copy in progress before releasing caches.

  • Concurrent definitions of one Var never mix one's value with the other's metadata.

  • SCI-owned fork state (loaded libs, type data) is snapshotted with the cut.

  • Slots are written before a namespace mapping publishes their handle (deftype at analysis, intern of a new Var, create-ns, add-namespace!), and def analysis no longer overwrites a concurrent publication to the same namespace.

0.15.59-replikativ.8

  • Reduce managed sequences in validated segments while preserving selected-world projections, cancellation checkpoints, and early termination.
  • Avoid repeated negative JVM protocol hierarchy scans on ordinary sequence tails, retaining live external extensions and explicit adapter behavior.
  • Hold the source world's read extent through direct host reducing callbacks.

0.15.59-replikativ.7

  • Keep native namespace Var imports independent of the first interpreter's lifetime, including alias-first registration. Retiring an interpreter no longer prevents a new unrelated interpreter from initializing.
  • Add sci.core/fork-recovery? so embedding construction owners can identify unpublished fork cleanup receipts through the public API.

0.15.59-replikativ.6

  • Make lazy sequence realization and core lazy producers fork-local without forcing pending values during forks.
  • Add explicit interpreter-world retirement (sci.core/retire!) and failed-fork cleanup recovery (sci.core/recover-fork!). Embedders must retire owned interpreters after their actual work has finished; see doc/managed-laziness.md.
  • Preserve native lazy failure behavior across Clojure versions and adapt trusted native macro syntax for forkable interpreters.

0.15.59-replikativ.5

  • A static method used as a value obeys :static-methods config like a direct call: unlisted methods on closed classes are denied (babashka/sci#1118).

0.15.59-replikativ.4

The .3 tag passed its test jobs but did not publish to Clojars because its deployment metadata named the wrong credential variables. This release corrects that metadata and contains the same interpreter changes.

  • Preserve :allow and :deny when merge-opts receives no replacement permission lists (babashka/sci#1119).

  • Keep closure creation and binding-conveyor-fn on direct paths in the default :standard runtime. Forkable mode retains function provenance for host callbacks, with fewer duplicate registrations on the JVM.

  • Incorporate upstream SCI changes through bdc4203c after 0.15.59.

  • Speed up try with finally if :interrupt-fn is set (about 15% in a native image)

  • Copy :added and :deprecated into the metadata of built-in vars

  • clojure.repl/print-doc is a private var, so ns-interns of clojure.repl returns only vars

  • read at the end of a LineNumberingPushbackReader reads the underlying stream once

  • clojure.repl/doc on &, catch and finally prints the docs of fn and try

  • Speed up binding (about 4x on the JVM, 2x in native bb) and try without a catch (about 4x)

  • Clojure 1.13 map destructuring as of clojure/clojure 98d735fa: :excess and :missing directives, :defaults removed. Adds the selector macro to clojure.core.

  • Minimum Clojure version is 1.11.1

  • merge returns the other argument unchanged if one argument is nil (Clojure 1.13)

  • A macro var in call position expands, in analysis, macroexpand-1 and macroexpand: (eval (list #'when true 1))

  • Fix stack overflow in clojure.walk/macroexpand-all on a reify form

  • for, if-let, when-let, if-some, when-some, when-first and condp name their internal locals with __, like Clojure's auto-gensyms

  • ns-aliases keeps the alias of a removed namespace

  • A var created by intern has the unqualified symbol, as in Clojure

  • ns-map is 6x faster and ns-refers 60x

  • import is a macro that expands to (do (clojure.core/import* "pkg.Class") ...)

  • Fix the location of a top-level symbol followed by a newline or the end of input when reading from a LineNumberingPushbackReader

  • Fix instance? on a protocol returning true for a type the protocol is extended to, such as nil or Object, on the JVM

  • instance? on a marker protocol implemented in a deftype body returns true, on the JVM

  • satisfies? on a marker protocol implemented in a deftype body returns true

  • Add forkable interpreter worlds for Vars, namespaces, dynamic bindings, SCI mutable values, and application-defined host resources.

  • Add explicit continuation-context capture and retargeting so an embedding can resume a suspended computation independently in related forked worlds.

  • Add with-detached-context for recursively constructing an independent SCI interpreter without inheriting the caller's execution-local world.

0.15.59-replikativ.2

  • Rebase the forkable-worlds distribution onto upstream SCI 0.15.59.
  • Honour :static-methods config for static methods used as values (babashka/sci#1118).

0.15.59-replikativ.1

  • Introduce forkable interpreter worlds and continuation-context retargeting under org.replikativ/sci.

0.15.59

  • Fix babashka#1874: defmethod, prefer-method, remove-method and get-method with a sci interface such as clojure.lang.IDeref dispatch on the class
  • Fix interop with a false argument: (Boolean. false) picked the String overload
  • Cache resolved JVM instance methods per call site for performance
  • Fix babashka#2030: aset on a primitive array was reflective and 170x slower than aset-double
  • Bump edamame to 1.6.44
  • Fix #1094: a call to a multi-arity fn created a new fn for the called arity on every call, 25x slower than a single-arity call in CLJS
  • Calling a multi-arity fn with fewer args than its variadic arity takes throws Cannot call f with n arguments
  • CLJS: creating a closure inside a jitted fn is 4x to 9x faster, and creating a multi-arity fn compiles instead of escaping to the interpreter

0.15.58

  • Support async functions by adding :async true in the attr map of defn.

0.15.57

  • Clojure 1.13 map destructuring: :keys!, :syms!, :strs!, & inside a directive, :select, :all and :defaults. Adds req! and some-vals to clojure.core.
  • More CLJS JIT performance improvements. Up to 20x on arithmetic-dense code for >2 arity. Keyword lookups, instance? and js globals no longer fall back to the interpreter.
  • Expose clojure.core/Inst and clojure.core/inst-ms* on the JVM, so defrecord, deftype, reify, extend-type and extend-protocol can implement inst-ms* and have inst-ms and inst? pick it up. On CLJS Inst was already exposed as a native protocol.

0.15.56

Highlight:

ClojureScript: JIT compilation.

SCI on CLJS compiles interpreted function bodies to JavaScript at runtime via js/Function. This is enabled by default and needs no configuration. When JIT is enabled, loops and numerical computations become much faster (and, in unrestricted contexts, JS interop too).

(require '[sci.core :as sci])

;; a tight numeric loop, evaluated by SCI (:advanced build)
(sci/eval-string "(time (loop [i 0 j 10000000] (if (zero? j) i (recur (inc i) (dec j)))))")
;; interpreter:  ~175 ms
;; JIT (default):  ~7 ms   — over 20x faster

When eval is unavailable (e.g. under a Content Security Policy) SCI falls back to the interpreter. Results, error messages and error locations should be identical. And of course, it works under :advanced compilation.

You can turn JIT off at runtime with js/globalThis.SCI_DISABLE_JIT = true before loading SCI, or in your Google Closure compile settings with :closure-defines {sci.core/disable-jit true}

  • Errors thrown inside a loop now report a located stack frame for the loop form instead of a frame without location (all platforms, including babashka)
  • New :unrestricted option on init and eval-string: when true, evaluated code may mutate built-in vars and CLJS instance interop skips :classes checks. The option applies only to the context it was passed to: a nested eval-string without it is sandboxed, also inside an unrestricted context. This replaces enable-unrestricted-access!.
  • BREAKING: enable-unrestricted-access! now throws. Use the :unrestricted option instead. The old function set a process-global flag that leaked into nested contexts.
  • BREAKING: the sci.impl.unrestrict namespace and its *unrestricted* dynamic var are removed. As with all sci.impl namespaces, do not rely on them: they are implementation detail.
  • #1063: CLJS: set! on a deftype field accepts ^:unsynchronized-mutable and ^:volatile-mutable
  • #1063: CLJS: deftype and defrecord fields are JS accessors on the type's prototype: (.-field x) works on instances, (set! (.-field x) v) mutates deftype fields
  • Bump edamame to 1.6.42
  • Munging fixes around (set! ...)
  • set! now returns value like CLJS

0.14.55

ClojureScript: native protocol support (#639). SCI code can implement CLJS protocols on deftype, defrecord and reify, and host code calling protocol methods on such instances dispatches into the sci implementations. Works under :advanced compilation.

  • #639: implement CLJS protocols like ILookup on deftype: host get, assoc, count, satisfies? etc. work on SCI instances
  • Most cljs.core protocols are available in SCI now by default, including their method fns (-lookup, -conj!, ...).
  • IDeref, ISwap, IReset and IPrintWithWriter implementations now also work from host code: @, swap!, reset! and pr-str on SCI instances
  • copy-var on a protocol var and copy-ns protocol publics produce working protocol entries instead of inert copies

0.14.54

  • ClojureDart support. See the Flutter REPL example.
  • Instance/static method+field overrides and :closed allowlist for :classes. See docs.
  • Improve performance for instance method interop: 1.6x on babashka.
  • Fix self-require (a namespace requiring itself, e.g. via :require-macros for its own macros) being reported as a cyclic load dependency

0.13.53 (2026-06-20)

  • Security fix (sandbox escape): a string type-hint (e.g. ^"some.Class" x) bypassed the :classes allowlist. resolve-type-hint called Class/forName directly, loading and static-initializing any class on the classpath at analysis time, even when it was not in :classes. This affects you only if you use SCI to evaluate untrusted code and rely on :classes to sandbox it — upgrade to 0.13.53. Trusted-input usage (e.g. ordinary babashka scripts) is unaffected.
  • sci.interrupt now provides :interrupt-fn aware re-matches/re-find/re-seq (JVM only)
  • Fix #1044: add sci.interrupt/interrupt! to throw an interrupt that sandboxed try/catch cannot catch. See docs.

0.13.52 (2025-06-16)

  • Add :interrupt-fn option: a zero-arg function called on every interpreted fn entry. See docs (@whilo)
  • Fix copy-var incorrectly setting :sci.impl/inlined on functions whose unqualified name collides with a clojure.core/cljs.core inlined var (e.g. a third-party get), causing with-redefs to be bypassed babashka#1979 (@verberktstan)
  • Fix CLJS regression where a defrecord/deftype type symbol referenced via a namespace alias (e.g. (instance? r/Foo x)) failed to resolve nbb#410
  • Fix recur with 20+ args in loop #1035
  • if-let, if-some, when-let and when-some now validate that the binding vector contains exactly two forms #1037 (@vieirandre)
  • recur now throws on mismatched argument count #1034 (@vieirandre)
  • ancestors, descendants and parents now normalize SCI types in hierarchy lookups #1033 (@vieirandre)
  • Support IFn on defrecord, deftype and reify #808, babashka#1386, nbb#408
  • Add test for defrecord/deftype in namespaces with special characters like + babashka#1868
  • Fix .sym on user-defined vars returning qualified symbol instead of unqualified, matching Clojure
  • def now replaces var metadata instead of merging, matching Clojure semantics. Previously, (declare foo) (def foo 42) would leave :declared true on the var's metadata.
  • Fix deftype and defrecord inside non-top-level forms (e.g. let, testing) #1936
  • Add ns field to sci.lang.Var for compatibility with code that accesses .ns on vars
  • ns-aliases now returns identical namespace objects as find-ns
  • alias now accepts namespace objects in addition to symbols
  • copy-var and copy-var* now preserve :private metadata
  • Add proxy-super, proxy-call-with-super, update-proxy and proxy-mappings
  • Support functional interface (FI) adaptation for instance targets (e.g. (let [^Predicate p even?] (.test p 42)))
  • Infer type tags from let binding values to binding names (e.g. (let [^String s "foo", q s] (.length q)))
  • Fix read with nil or false as eof-value throwing instead of returning the eof-value
  • Fix letfn with duplicate function names crashing with ClassCastException
  • macroexpand-1 now expands (ClassName. args) to (new ClassName args), matching JVM Clojure
  • Fix ns-map not reflecting vars that shadow referred vars (e.g. (defn inc ...))
  • deftype and defrecord no longer create vars for the type name — types are stored in the namespace's :types map, matching Clojure where deftype/defrecord create class mappings, not vars. (resolve 'Foo) returns a sci.lang.Type (not a var), and #'Foo throws "Unable to resolve var" as in Clojure.
  • defrecord now expands to deftype* (like Clojure), with factory fns (->Foo, map->Foo) emitted directly in the macro expansion
  • Fix .getName on custom types (sci.lang.Type) to return the fully qualified name (e.g. "user.Foo"), matching Class.getName() behavior. Also adds alter-meta! support on types.
  • Fix incorrect type hint causing method resolution failure: (let [^String x (StringBuilder. "hello")] (.capacity x)) now falls back to the actual runtime class when the type hint doesn't match
  • deftype now macroexpands to deftype*, matching JVM Clojure, enabling code walkers like riddley
  • case now macroexpands to JVM-compatible case* format, enabling tools like riddley and cloverage to work with SCI
  • #1935: support source for built-in vars by preserving :file, :line, :column metadata in copy-var
  • Preserve :tag metadata in copy-var
  • Support :copy-meta-from option in public copy-var API
  • Fix NPE in resolve when called at runtime (e.g. inside a macro body during code walking) by skipping analysis-only idx machinery
  • Fix .method on class objects (e.g. (.getDeclaredField String "value")) routing to static instead of instance method path
  • macroexpand-1 of (.method ClassName) now wraps class targets in identity, matching Clojure behavior
  • macroexpand-1 now accepts an optional env map as first argument, like cljs.analyzer/macroexpand-1
  • Store current analysis context during macro invocation, enabling tools like riddley to access outer locals
  • Support #564: this-as in ClojureScript

0.12.51 (2025-02-07)

  • Support async/await in ClojureScript. See docs.
  • Support hashCode on deftype
  • Fix #931: support multiple catch in combination with ^:sci/error

0.11.50 (2025-12-23)

  • Add support for :refer-global and :require-global
  • Add println-str
  • Fix #997: Var is mistaken for local when used under the same name in a let body
  • Fix #1001: JS interop with reserved js keyword fails (regression of #987)
  • sci.impl.Reflector was rewritten into Clojure
  • Fix babashka/babashka#1886: Return a map when dissociating a record basis field.
  • Fix #1011: reset ns metadata when evaluating ns form multiple times
  • Fix for https://github.com/babashka/babashka/issues/1899
  • Fix #1010: add js-in in CLJS
  • Add array-seq

0.10.49 (2025-08-22)

  • Fix regression introduced in #987
  • Fix #963: respect :param-tags on qualified instance method

0.10.48 (2025-08-21)

important

This release contains a potentially breaking change for CLJS, see #987

  • Add *suppress-read*
  • Add load-reader
  • Fix #872: *loaded-libs* is now the single source of truth about loaded libs
  • Fix #981: respect type hint on instance method callee
  • Add core dynamic vars like *warn-on-reflection* and bind them during load-string etc. such that set!-ing then in a future works.
  • Fix #984: support alternative set! syntax in CLJS
  • Fix #987: method or property name in interop should be munged
  • Fix #986: preserve error location for js static method
  • Fix #990: fix merge-opts with :bindings + deprecate :bindings (replaced by :namespaces {'user ...})

0.10.47 (2025-06-27)

important

This release contains a security fix

  • Security issue: function recursion can be forced by returning internal keyword as return value
  • Fix #975: Protocol method should have :protocol var on metadata
  • Fix #971: fix satisfies? for protocol that is extended to nil
  • Fix #977: Can't analyze sci.impl.analyzer with splint

0.10.46 (2025-06-18)

important

Important change regarding sandboxing!

When SCI is used to produce a function that contains operations on the context, like ns, def, intern, ns-unmap etc. this function no longer holds on to the context it was produced in. Example:

(require '[sci.core :as sci])
(def f (sci/eval-string "(fn [x] (intern 'user 'foo x))"))
(f 1) ;;=>
Execution error (IllegalStateException) at sci.ctx-store/get-ctx (ctx_store.cljc:30).
No context found in: sci.ctx-store/*ctx*. Please set it using sci.ctx-store/reset-ctx!

You can make these functions work by executing them within the scope of a sci.ctx-store/with-ctx:

(def ctx (sci/init {}))
(def f (sci/eval-string* ctx "(fn [x] (intern 'user 'foo x))"))
(sci.ctx-store/with-ctx ctx
  (f)) ;; works

This change was necessary to remove a bunch of "magic" from SCI where functions that operated on the context closed over the context. This is no longer the case. The reason that this feature was removed is that these special functions took one extra argument, the context and therefore didn't work properly with with-redefs where the user would substitute a function with the expected number of arguments. I.e. this wouldn't work in SCI (and babashka) before the change: (with-redefs [intern my-intern] (intern 'foo 'bar)) since intern took an extra (unexpected) context argument.

Functions that escape SCI evaluation that do not work on the context, e.g. assoc, still work as before:

(require '[sci.core :as sci])
(def f (sci/eval-string "(fn [x] (assoc {} x x))"))
(f 1) ;;=> {1 1}

Other changes and fixes in this release:

  • Fix #957: sci.async/eval-string+ should return promise with :val nil for ns form rather than :val <Promise>
  • Fix #959: Java interop improvement: instance method invocation now leverages type hints
  • Bump edamame to 1.4.30
  • Give metadata :type key priority in type implementation
  • Fix #967: ns-name should work on symbols
  • Fix #969: ^:clojure.core/eval-file metadata should affect binding of *file* during evaluation
  • Sync sci.impl.Reflector with changes in clojure.lang.Reflector in clojure 1.12.1
  • Fix :static-methods option for class with different name in host
  • Fix #973: support with-redefs on core vars, e.g. intern. The fix for this issue entailed quite a big refactor of internals which removes "magic" injection of ctx in core vars that need it.
  • Add unchecked-set and unchecked-get for CLJS compatibility

0.9.45 (2025-03-11)

  • Fix #942: improve error location of invalid destructuring
  • Add volatile? to core vars
  • Fix #950: interop on local in CLJS
  • Bump edamame to 1.4.28

0.9.44 (2024-10-17)

  • Fix #917: support new Clojure 1.12 Java interop: String/new, String/.length and Integer/parseInt as fns
  • Fix #925: support new Clojure 1.12 array notation: String/1, byte/2
  • Fix #926: Support add-watch on vars in CLJS
  • Support aset on primitive array using reflection
  • Fix #928: record constructor supports optional meta + ext map
  • Fix #934: :allow may contain namespaced symbols
  • Fix #937: throw when copying non-existent namespace
  • Update sci.impl.Reflector (used for implementing JVM interop) to match Clojure 1.12

0.8.43 (2024-08-06)

  • Fix shadow-cljs warnings

0.8.42 (2024-07-23)

  • Fix #626: add cljs.core/exists?
  • Fix #906: merge-opts loses :features or previous context
  • Fix #923: check for duplicate keys in dynamic set or map literals
  • Fix #919: :js-libs + refer + rename clashes with core var
  • Add hash-ordered-coll
  • read-string should use non-indexing reader for compatibility
  • Bump edamame

0.8.41 (2023-11-24)

  • Bump edamame to 1.3.23
  • #889: allow (def foo/foo 1) when inside namespace foo
  • #891: reset file metadata on var when it's re-evaluated from other file
  • #893: expose sci.async/eval-form and sci.async/eval-form+
  • Improve sci.async/eval-string, respect top-level do forms
  • Add experimental new :static-methods option to override how static methods get evaluated.
  • Expose destructure
  • Macroexpand (.foo bar) form
  • Optimize deref, swap!, reset! for host values
  • Add time macro to core namespace
  • #896: allow catch to be used as var name

0.8.40 (2023-06-28)

  • #888: add eval-string+ with explicit initial :ns and explicit last active :ns in return value
  • #683: better error message when trying to recur across try
  • #884: preserve error location in future with :sci/error
  • #886: support :require-macros in CLJS

0.7.39 (2023-03-07)

  • #874: Keyword arguments as map support for CLJS
  • Mutable deftype fields can be marked as such with ^:volatile-mutable in CLJS
  • Fix .toString implementation on deftype
  • Resolve JS library alias via imported 'class'
  • Fix babashka issue 1501: equals on deftype
  • Honor :ns-aliases for built-in libs
  • Fix issue with copy-ns + protocol
  • Support :sci/macro for copy-ns and copy-var for copying macro functions
  • Fix #876: SCI analysis too eager when looking up class
  • Optimizations with respect to looking up static fields

0.7.38 (2023-02-07)

  • Add sci/add-js-lib! for adding js libraries including corresponding :js-libs init option
  • Speed up Java interop around 5x by caching method lookups
  • Allow destructucturing in CLJS defmethod
  • #862: fix JS constructor from class in CLJS namespace
  • Improve error location in macroexpansion
  • #867: Support add-watch and remove-watch on sci.lang.Var
  • #648: implement *loaded-libs* and (loaded-libs)
  • Expose new parse-next+string function
  • Support qualified method names in proxy while ignoring the namespace
  • Support read with non-indexing reader, fixes babashka/babashka#1465
  • Improve top level macro expansion error location
  • Fix pprinting vars
  • Add reader-conditional to core vars
  • Fix #babashka/1482: make loading of libs thread safe

0.6.37 (2022-12-20)

  • #839: Performance improvement for method calls in CLJS, like (Math/sin) and (.substring "foo" 0 1), around 5 - 7x faster
  • Performance improvement when calling anonymous fn
  • Improve case performance
  • #855: Property access in JS doesn't throw when intermediate value is nil
  • #842: Error metadata missing on some interop calls (@bobisageek)
  • #856: fix #queue [1 2 3] literal
  • Implement lazy-seq as macro
  • Implement ns as macro
  • #844: Don't resolve cljs.core/inc in JVM env
  • Add case as a macro and case* as special form, rather than having case as special form
  • Implement and and or as macros
  • Implement fn, defn and defmacro as macros, while keeping fn* as special form
  • Implement loop as macro, while supporting loop* as special form
  • Implement let as macro, while supporting let* as special form
  • Fix js type hint on await (@mhuebert)
  • Convert libsci scripts to bb tasks, include in CI multi-os (@ikappaki)
  • Bump edamame (Clojure parser)
  • Fix benchmarking code
  • Fix for SCI_ELIDE_VARS

0.5.36 (2022-11-14)

  • Revert commit that fixed #832 since it caused more issues than it solved. See here for workaround.

0.5.35 (2022-11-14)

  • #817: mutation of deftype field should be visible in protocol method
  • #816: restore recur target exception in do
  • #819: don't use metadata in record implementation
  • #831: preserve location of throw in stack trace
  • Drop name metadata from conditionally defined var
  • Implement in-ns as function rather than built-in (@SignSpice)
  • #832: reload analyzer API within CLJS to ensure ns-publics and resolve are available
  • Optimize analysis and evaluation of fn
  • Add more docstrings to built-in (core) macros and vars (@mhuebert)
  • Add array

v0.5.34 (2022-10-18)

  • Performance optimizations for let (up to 8x faster)
  • babashka/babashka#1340: Add arglists/docstring to protocol methods (@bobisageek)
  • #801: preserve location metadata for vars defined in macro-expansion
  • Add new var->symbol API function in sci.core
  • Add new resolve API function in sci.core
  • Expose *print-namespace-maps* from sci.core (@ghoseb)
  • Internal simplifications for and, or and do

v0.4.33 (2022-09-15)

  • #791: Fix friendly arity exception messages for Clojure 1.10, 1.11 (@lread)
  • #794: Support for IPrintWithWriter for custom types in CLJS
  • Add ns-unalias (@eerohele)
  • Resolve record name with dot: Foo.
  • Implement addWatch / removeWatch noops on SCI vars to prevent segfault in native images
  • Improvements to error locations in exceptions
  • Fix type hints on locals with same names (@lread)
  • Add demunge in CLJS (@sirwobin)
  • #785: satisfies? finds protocols that have no methods (@lilactown)
  • #781, #782 and #783: extend protocols to JS built ins using CLJS "type symbols", fix extending protocols to default and Object (@lilactown)
  • Add keyword-identical? in CLJS
  • Fix deftype mutable fields for CLJS
  • sci.ctx-store: a place to store the context so it's available for sci.configs to use. See docs.
  • Make loading cljs.analyzer.api more reliable
  • Don't partial-ize ctx-needing vars that aren't built-in
  • #774: make interpreter stacktrace available on exception if annotated with ^:sci/error
  • Allow unrestricted access with set! in CLJS if sci.core/enable-unrestricted-access has been called.
  • Don't eval metadata on defn expression
  • Add hash-combine
  • #729: mutable fields in deftype

v0.3.32

  • #767: Reduce advanced compiled JS output with about 20% (~900kb -> ~740kb)
  • #768: copy :dynamic metadata in copy-ns
  • #771: Fix or with more than 20 args

v0.3.31

  • Fix sci/copy-ns*, the name was not copied correctly :(

v0.3.30

  • Support globally valid :ns-aliases for mapping e.g. clojure.test to cljs.test
  • New copy-var* API function
  • #755: make sci.lang.Var part of public API
  • #755: make sci.lang.Namespace part of public API
  • Add add-namespace! API function
  • Fix invalid arity problem in CLJS macros with arity >= 20
  • Bump edamame to v1.0.0
  • #762, #731: print via global print-method and print-dup methods, don't allow by default
  • #733: do not allow to change meta on built-in macro
  • Various defrecord improvements (equality, metadata preservation)
  • #738: dotted simple symbol should remain unresolved
  • #741: preserve closed over value analysis when using fixed + varargs arity
  • #739: satisfies? does not recognize marker protocol on record
  • #740: simple-dispatch on records
  • #743: satisfies? of marker protocol via extend-{type, protocol}
  • #744: syntax quote for records should return class representation
  • #745: syntax quote of imported class
  • #747: provide default pprint impl for SCI records
  • #748: fix async refer
  • #757: fix simultaneous async evaluations
  • Record types are now an instance of sci.lang.Type
  • #763: record in syntax quote resolves to sci.lang.Type
  • #751: defprotocol returns symbol

v0.3.5

  • #711: support *print-dup*
  • #712: destructuring in protocol impl not working
  • #715: allow property access on vars in CLJS
  • Add ->Eduction
  • Expose print-err-fn in SCI core API
  • add :name metadata via helper functions and use metadata for var names
  • Improve error reporting for let* and try
  • #714: Improve instance member call parity with Clojure/JVM
  • Default *read-eval* / sci/read-eval to false
  • Expose all-ns and find-ns in sci/core
  • Fix for copy-ns when var has no metadata
  • Add add-class and add-import API functions in sci/core
  • sci.async: EXPERIMENTAL namespace for async evaluation in CLJS

v0.3.4

  • Restore compatibiliy with self-hosted CLJS (e.g. planck)
  • Add CLJS *print-err-fn* var

v0.3.3

New

  • #382: Add *clojure-version* and (clojure-version)
  • Support :sigs on protocol map
  • Add unchecked-dec

Enhancements

  • #689: Reified object doesn't get handled for fallback protocol impl
  • #692: extending Object with protocol doesn't work on records
  • #693: extend protocol to IRecord doesn't work on SCI records
  • #695: (identical? [] []) works
  • #700: loop doesn't expand in fully qualified let
  • #696: add let* special form
  • #702: require cljs.analyzer.api for sci/copy-ns

v0.3.2

  • #665: expose *assert*
  • Drop location metadata from symbols
  • #687: declare as macro
  • #684: support print-method on records

v0.3.1

Enhancements

  • Fix #680: allow expression in class position of new in JS targets
  • Performance improvements

v0.3.0

Enhancements

  • #416: mutable arrays for bindings. Takes care of approx. 2-4x speedup in loops (depending on environment).
  • Performance improvements for varargs function invocations.

Changes

  • Remove :disable-arity-checks option. Arity checks are now always taken care of by the host environment and SCI does not do any special handling. This means that in JS environments there will be no arity checking regardless of this option. This change was introduced for better performance.

v0.2.9

  • Feature: add halt-when, pop!, array?, js-delete, object? and undefined?
  • Feature #616: :as-alias support
  • Fix #498: Cannot recur from non-tail position
  • Fix #653: Improve error message for higher order function arity exception.
  • Fix #655: merge-opts should overwrite existing var
  • Fix #660: In JS you can throw and catch anything
  • Fix #664: cannot take value of macro ->
  • Fix #659: meta evaluation order (@erdos)
  • Fix #666: use js/Reflect when calling instance function, adds compatibility with GraalVM JS Polyglot
  • Fix #673: use js/Reflect when calling constructor, adds compatibility with GraalVM JS Polyglot
  • Fix #677: Fix macroexpand for defrecord
  • Fix function with arity 15
  • Fix macro which expands in defrecord + protocol which invokes record constructor

v0.2.8

  • Prefer metadata implementation override over extend-protocol #378
  • Prefer metadata implementation in extend extend-protocol #378
  • Make constructors in CLJS more dynamic #624
  • Support Object toString override on defrecord #627
  • Bump edamame to 0.0.18
  • Add copy-ns macro
  • clojure.core/read improvements #663
  • clojure.core/read can read with standard PushbackReader
  • Support *read-eval*
  • Support *default-data-reader-fn*
  • Support *reader-resolver*
  • Intern fails to rebind a referred var if already present in config #637
  • Support adding protocol for satisfies check #638
  • Add reader-conditional?
  • Add CLJS random-uuid?
  • Add clojure.test/test
  • Expose doseq and for as normal macros (@erdos)
  • Fix declare with dynamic var #630 (@erdos)
  • Support ns :require with string instead of symbol (@djblue)
  • Add inst-ms
  • Fix resolve on class method (should return nil) #647
  • Support getting instance fields from JVM classes
  • Add to-array-2d, aclone, reduce and amap #650 (@MrEbbinghaus)

v0.2.7

This release focuses on:

  • Improvements regarding CLJS compatibility (interop, js literals, printing via *print-fn*)
  • Adding more dynamic vars related to printing
  • Exposing sci/stacktrace and sci/format-stacktrace for getting a stacktrace from a SCI exception. This allows you to build an error report like babashka and similar tools built with SCI.

The changes per issue:

  • Fix function reference equality #587
  • Don't convert Clojure values to JS values automatically in interop #602
  • Calling comment with 49 (or more) args fails in CLJS #603
  • Fix stacktrace for invalid import #589
  • Add js-keys
  • Support create-ns
  • Varify more core vars (@bobisageek)
  • Fix constructor call of class added via imports
  • Keep :disable-arity-checks after merge-opts
  • Add *flush-on-newline*
  • Add *print-readably*
  • Support :clojure.core/eval-file metadata
  • reify form from macro doesn't evaluate correctly #609
  • Handle js literals in the same way as ClojureScript #610
  • Control printing in CLJS via *print-fn* and via API sci/print-fn rather than *out* #365
  • Make stacktrace logic public #590

v0.2.6

  • Use IllegalArgumentException in case when providing duplicate dispatch values
  • Improve error message when protocol not found for class
  • Add thread-bound? predicate #560
  • Allow set! to mutate objects in CLJS #563
  • Experimental SCI_ELIDE_VARS environment variable for smaller CLJS bundle size
  • Support trailing metadata in defn #567
  • GC improvement: don't hang on to all external bindings in closure
  • Several performance improvements
  • Expose intern in core API
  • Several fixes regarding try/catch in CLJS #583, #584, #585
  • case expression generated by macro doesn't work correctly #586

v0.2.5

Enhancements / fixes

  • Fix metadata on non-constant map literal expression #546
  • Support :reload-all #552
  • Support new kwargs handling from 1.11.0 #553.
  • Allow dynamic :doc on def/defn #554.
  • Fix metadata on nested evaluated map #555
  • Bug with protocol methods in record where later arg overrides "this" #557
  • Support :rename in :refer-clojure #558
  • Add aset-..., delay?, bit-clear
  • Add bound-fn and bound-fn*
  • Add arg count check for clojure.core/for

v0.2.4

New

Enhancements / fixes

v0.2.3

Enhancements / fixes

  • if with falsy literal returns nil #529

v0.2.2

Enhancements / fixes

  • Fix error reporting in case of arity error #518
  • Shadowing record field names in protocol functions #513
  • Fix destructuring in protocol method for record #512
  • Faster processing of maps, sets and vectors #482
  • Prioritize current namespace vars in syntax quote #509
  • Fix ns-publics to not include refers #520
  • Add refer-clojure macro #519
  • Syntax quote resolves referred var incorrectly #526
  • Priorize referred vars over vars in current ns #527

v0.2.1

Enhancements / fixes

  • Improvements for using type on defrecord #492
  • Deref vars at analysis time that have :inline metadata in Clojure #483
  • Keep only location metadata for seqs and symbols #488
  • Conditionally defined vars should not have metadata #496
  • Fix interop on map #506
  • Performance improvements #500, #502, #504
  • Fix shadow-cljs warnings #499

v0.2.0

Thanks for contributing to this release:

@lread, @patrick-galvin, @SevereOverfl0w, @djblue, @kwrooijen, @sogaiu, @joinr, @RickMoynihan, @galdober

Breaking changes

  • Removed :realize-max and :preset :termination-safe. In the light of #348 it would be misleading to claim that sci can guarantee termination within reasonable time.

New

  • Add class?, iterator-seq, remove-watch, realized?, clojure.walk/macroexpand-all, find-var, lazy-cat, bound?, *print-namespace-maps*, get-thread-bindings, var-get, var-set, with-local-vars
  • Add fork API function #369
  • Add API functions for parsing code and evaluating forms: sci.core/reader, sci.core/parse-string, sci.core/parse-next, sci.core/eval-form #404
  • Support implementing IDeref, IAtom, IAtom2 (and CLJS equivalents) #401
  • Add API vars print-meta, print-level which can be used with sci.core/binding to control the dynamic var equivalent in sci programs
  • Support calling symbol on a var #453
  • :disable-arity-checks option: when used, sci behaves similarly to CLJS/JS by not checking the provided number of arguments and allowing less or more for single and fixed arity functions #460

Enhancements / fixes

  • Alter-var-root uses thread-bound value to update #359
  • Eval metadata on var created with defn #371
  • Metadata fn on var f fails if referring to f #363
  • Fix missing protocol methods #367 (@patrick-galvin)
  • Support multiple methods of protocol on defrecord
  • Allow re-binding of core vars with clojure.core/with-redefs #375
  • Fix false dynamic binding #379
  • Don't eval record returned from reader function #386
  • Implement -> and as-> as normal macros #390, #462 (@kwrooijen)
  • defn should not introduce local for name in body #384
  • Fix wrong arity in error message when calling macro #392
  • Throw when trying to redefine referred var #398
  • Fix for use 120175f
  • Fix importing protocol classes from namespaces with hyphens #410
  • Performance enhancements #415, #452, #468, #470, #472, #473, #475, #478, #480
  • Support top-level do emitted from macro #421
  • Support map constructor for maps #431
  • Partial support for multiple reified classes 323a257
  • Fix calling literal symbol babashka/babashka#622
  • Allow user-defined vars when def is allowed #434
  • Fix default destructuring with false #436
  • Fix reflection warning in multimethods code #437 (@galdober)
  • Support nested libspecs #399
  • Aliases in protocol functions should work #440
  • Allow users to override :line metadata #443
  • Support second arg (env) in resolve
  • Preserve and eval reader meta on coll literals and functions #447, #448
  • Fix #js object reading #449
  • Support unmap for imported classes #432
  • Fix for reader conditional parsing borkdude/edamame#65
  • Dotted field access for JS interop #450
  • Syntax checks for binding #458
  • Add boolean? to constant check #465 (@kwrooijen)
  • Check macro var value at analysis time #467
  • Excluded clojure var still gets resolved to in syntax quote #466

v0.1.0 (2020-06-16)

Thank to @jeroenvandijk, @jjttjj, @justone, @sogaiu and @armincerf for contributing.

New

  • Implement hierarchies (derive etc.) #237
  • Implement multimethods #236
  • Add ns-interns, ns-imports, ns-refers, ns-map, all-ns
  • Add do-template
  • Add clojure.edn namespace
  • Add promise and deliver (@jeroenvandijk)
  • Add :readers option to support data readers (@jjttjj)
  • Add tagged-literal
  • Add when-some and if-some (@justone)
  • Add re-matcher
  • Add re-groups (@sogaiu)
  • Implement read-string + eval #285
  • Add ns-unmap (@sogaiu)
  • Support *print-length* #294
  • Add while macro #296
  • Add clojure.repl/find-doc #304
  • Add clojure.repl/apropos #317
  • Add memoize
  • Add load-string #307
  • Add clojure.repl/pst
  • Add with-bindings macro #289
  • Add ns-resolve
  • Add clojure.core/read #317
  • Add remove-ns #318
  • Add requiring-resolve #316
  • Add tagged-literal? function (@armincerf)
  • Support with-redefs #325
  • New create-ns, new-macro-var, copy-var, init and eval-string* API functions
  • Add enumeration-seq
  • Add bean
  • Support GraalVM java11 #332
  • Support *print-meta* #334
  • Support clojure.core/intern #336
  • Defprotocol and defrecord support #279, #319
  • Add double-array and short-array
  • Add support for *print-level*

Enhancements / fixes

  • Elide metadata from function results (this makes calling evaluated functions from JavaScript easier) #259
  • Eval metadata on vars (e.g. (def ^{:test (fn [] \"foo\")} x)).
  • Syntax check on amount of args for if (@jeroenvandijk)
  • Support namespace metadata #269
  • require can now be used as a function
  • find-ns should return nil for non-existent namespace #299
  • Mark dotimes as termination-safe #298
  • Fix metadata on syntax-quoted values #301
  • Add support for :refer :all in namespace form #297
  • Support :rename in :require #303
  • Add support for use #302
  • resolve can now be used a function
  • loop bindings can refer to previous ones
  • JS interop improvements #312
  • Fix handling atom with metadata #314
  • Fix unqualified binding of when and nth in for macro
  • More JS interop improvements (@jeroenvandijk)
  • Fix for variadic recur #321
  • Fix for associative destructuring (commit)
  • Add syntax check for ns macro: first arg is required and should be symbol
  • Fix dynamic binding for functions
  • Fix parser line numbers when using shebang
  • Remove Java API, don't include AOT-ed sources in release
  • Preserve location information in error when NullPointerException occurs
  • Support alternative field access syntax (. Integer -SIZE) #339
  • Check syntax of def and report too many arguments #340
  • Fix alternative field access syntax (Integer/SIZE)
  • Fix resolving var from other namespace via refer

Prior to v0.1.0

Details about releases prior to v0.1.0 can be found here.

Breaking changes

Unreleased

  • enable-unrestricted-access! now throws. Use the :unrestricted option of init or eval-string instead.
  • The sci.impl.unrestrict namespace and its *unrestricted* dynamic var are removed. Do not rely on sci.impl namespaces: they are implementation detail.

0.2.4

  • Do not merge ex-data into sci error #534

>= 0.1.0

  • Removed :realize-max and :preset :termination-safe. In the light of #348 it would be misleading to claim that sci can guarantee termination within reasonable time.

v0.0.12

  • :row and :col metadata have been renamed to :line and :column to be more compatible with Clojure.

v0.0.11

  • macros provided via options (functions marked with :sci/macro metadata) now have two additional arguments at the start: &env and &form.

Can you improve this documentation? These fine people already did:
Michiel Borkent, Christian Weilbach, Bob, Lee Read, Stan Verberkt & Antoine Belvire
Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close