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.
- Bump edamame to 1.3.23
- #889: allow
(def foo/foo 1)when inside namespacefoo - #891: reset file metadata on var when it's re-evaluated from other file
- #893: expose
sci.async/eval-formandsci.async/eval-form+ - Improve
sci.async/eval-string, respect top-leveldoforms - Add experimental new
:static-methodsoption to override how static methods get evaluated. - Expose
destructure - Macroexpand
(.foo bar)form - Optimize
deref,swap!,reset!for host values - Add
timemacro to core namespace - #896: allow
catchto be used as var name
- #888: add
eval-string+with explicit initial:nsand explicit last active:nsin return value - #683: better error message when trying to recur across try
- #884: preserve error location in future with
:sci/error - #886: support
:require-macrosin CLJS
- #874: Keyword arguments as map support for CLJS
- Mutable deftype fields can be marked as such with
^:volatile-mutablein CLJS - Fix
.toStringimplementation ondeftype - Resolve JS library alias via imported 'class'
- Fix babashka issue 1501: equals on deftype
- Honor
:ns-aliasesfor built-in libs - Fix issue with copy-ns + protocol
- Support
:sci/macrofor 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
- Add
sci/add-js-lib!for adding js libraries including corresponding:js-libsinit 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-watchandremove-watchonsci.lang.Var - #648: implement
*loaded-libs*and(loaded-libs) - Expose new
parse-next+stringfunction - Support qualified method names in
proxywhile ignoring the namespace - Support
readwith non-indexing reader, fixes babashka/babashka#1465 - Improve top level macro expansion error location
- Fix pprinting vars
- Add
reader-conditionalto core vars - Fix #babashka/1482: make loading of libs thread safe
- #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
caseperformance - #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-seqas macro - Implement
nsas macro - #844: Don't resolve
cljs.core/incin JVM env - Add
caseas a macro andcase*as special form, rather than havingcaseas special form - Implement
andandoras macros - Implement
fn,defnanddefmacroas macros, while keepingfn*as special form - Implement
loopas macro, while supportingloop*as special form - Implement
letas macro, while supportinglet*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
- #817: mutation of
deftypefield 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
throwin stack trace - Drop name metadata from conditionally defined var
- Implement
in-nsas function rather than built-in (@SignSpice) - #832: reload analyzer API within CLJS to ensure
ns-publicsandresolveare available - Optimize analysis and evaluation of
fn - Add more docstrings to built-in (core) macros and vars (@mhuebert)
- Add
array
- 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->symbolAPI function insci.core - Add new
resolveAPI function insci.core - Expose
*print-namespace-maps*fromsci.core(@ghoseb) - Internal simplifications for
and,oranddo
- #791: Fix friendly arity exception messages for Clojure 1.10, 1.11 (@lread)
- #794: Support for
IPrintWithWriterfor custom types in CLJS - Add
ns-unalias(@eerohele) - Resolve record name with dot:
Foo. - Implement
addWatch/removeWatchnoops 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
demungein 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
deftypemutable fields for CLJS sci.ctx-store: a place to store the context so it's available forsci.configsto use. See docs.- Make loading
cljs.analyzer.apimore 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 ifsci.core/enable-unrestricted-accesshas been called. - Don't eval metadata on
defnexpression - Add
hash-combine - #729: mutable fields in deftype
- #767: Reduce advanced compiled JS output with about 20% (~900kb -> ~740kb)
- #768: copy
:dynamicmetadata incopy-ns - #771: Fix
orwith more than 20 args
- Fix
sci/copy-ns*, the name was not copied correctly :(
- Support globally valid
:ns-aliasesfor mapping e.g.clojure.testtocljs.test - New
copy-var*API function - #755: make
sci.lang.Varpart of public API - #755: make
sci.lang.Namespacepart 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-methodandprint-dupmethods, don't allow by default - #733: do not allow to change meta on built-in macro
- Various
defrecordimprovements (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 viaextend-{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
- #711: support
*print-dup* - #712: destructuring in protocol impl not working
- #715: allow property access on vars in CLJS
- Add
->Eduction - Expose
print-err-fnin SCI core API - add
:namemetadata via helper functions and use metadata for var names - Improve error reporting for
let*andtry - #714: Improve instance member call parity with Clojure/JVM
- Default
*read-eval*/sci/read-evalto false - Expose
all-nsandfind-nsinsci/core - Fix for
copy-nswhen var has no metadata - Add
add-classandadd-importAPI functions insci/core sci.async: EXPERIMENTAL namespace for async evaluation in CLJS
- Restore compatibiliy with self-hosted CLJS (e.g. planck)
- Add CLJS
*print-err-fn*var
- #382: Add
*clojure-version*and(clojure-version) - Support
:sigson protocol map - Add
unchecked-dec
- #689: Reified object doesn't get handled for fallback protocol impl
- #692: extending
Objectwith protocol doesn't work on records - #693: extend protocol to
IRecorddoesn't work on SCI records - #695:
(identical? [] [])works - #700:
loopdoesn't expand in fully qualifiedlet - #696: add
let*special form - #702: require
cljs.analyzer.apiforsci/copy-ns
- #665: expose
*assert* - Drop location metadata from symbols
- #687:
declareas macro - #684: support
print-methodon records
- Fix #680: allow expression in class position of
newin JS targets - Performance improvements
- #416: mutable arrays for bindings. Takes care of approx. 2-4x speedup in loops (depending on environment).
- Performance improvements for varargs function invocations.
- Remove
:disable-arity-checksoption. 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.
- Feature: add
halt-when,pop!,array?,js-delete,object?andundefined? - Feature #616:
:as-aliassupport - Fix #498: Cannot recur from non-tail position
- Fix #653: Improve error message for higher order function arity exception.
- Fix #655:
merge-optsshould 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/Reflectwhen calling instance function, adds compatibility with GraalVM JS Polyglot - Fix #673: use
js/Reflectwhen calling constructor, adds compatibility with GraalVM JS Polyglot - Fix #677: Fix
macroexpandfordefrecord - Fix function with arity 15
- Fix macro which expands in
defrecord+ protocol which invokes record constructor
- Prefer metadata implementation override over
extend-protocol#378 - Prefer metadata implementation in
extendextend-protocol#378 - Make constructors in CLJS more dynamic #624
- Support Object toString override on defrecord #627
- Bump edamame to
0.0.18 - Add
copy-nsmacro clojure.core/readimprovements #663clojure.core/readcan read with standardPushbackReader- 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
doseqandforas normal macros (@erdos) - Fix
declarewith dynamic var #630 (@erdos) - Support
ns:requirewith string instead of symbol (@djblue) - Add
inst-ms - Fix
resolveon class method (should returnnil) #647 - Support getting instance fields from JVM classes
- Add
to-array-2d,aclone,reduceandamap#650 (@MrEbbinghaus)
This release focuses on:
- Improvements regarding CLJS compatibility (interop, js literals, printing via
*print-fn*) - Adding more dynamic vars related to printing
- Exposing
sci/stacktraceandsci/format-stacktracefor 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-checksafter merge-opts - Add
*flush-on-newline* - Add
*print-readably* - Support
:clojure.core/eval-filemetadata - 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 APIsci/print-fnrather than*out*#365 - Make stacktrace logic public #590
- Use
IllegalArgumentExceptionincasewhen 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_VARSenvironment 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
internin core API - Several fixes regarding
try/catchin CLJS #583, #584, #585 caseexpression generated by macro doesn't work correctly #586
- Fix metadata on non-constant map literal expression #546
- Support
:reload-all#552 - Support new kwargs handling from 1.11.0 #553.
- Allow dynamic
:docondef/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-fnandbound-fn* - Add arg count check for
clojure.core/for
- Detect cyclic load dependencies #531
- Add
force - Add
dissoc!(@wilkerlucio)
- BREAKING: Do not merge ex-data into sci error #534 (@GreshamDanielStephens)
- Pick fn arity independent of written order #532 (@GreshamDanielStephens)
(instance? clojure.lang.IAtom 1)returnstrue#537- Fix
ns-unmapon referred var #539
- if with falsy literal returns nil #529
- 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-clojuremacro #519 - Syntax quote resolves referred var incorrectly #526
- Priorize referred vars over vars in current ns #527
- Improvements for using
typeondefrecord#492 - Deref vars at analysis time that have
:inlinemetadata 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
Thanks for contributing to this release:
@lread, @patrick-galvin, @SevereOverfl0w, @djblue, @kwrooijen, @sogaiu, @joinr, @RickMoynihan, @galdober
- Removed
:realize-maxand:preset :termination-safe. In the light of #348 it would be misleading to claim that sci can guarantee termination within reasonable time.
- 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
forkAPI 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-levelwhich can be used withsci.core/bindingto control the dynamic var equivalent in sci programs - Support calling
symbolon a var #453 :disable-arity-checksoption: 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
- 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
->andas->as normal macros #390, #462 (@kwrooijen) defnshould 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
use120175f - 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
Thank to @jeroenvandijk, @jjttjj, @justone, @sogaiu and @armincerf for contributing.
- Implement hierarchies (
deriveetc.) #237 - Implement multimethods #236
- Add
ns-interns,ns-imports,ns-refers,ns-map,all-ns - Add
do-template - Add
clojure.ednnamespace - Add
promiseanddeliver(@jeroenvandijk) - Add
:readersoption to support data readers (@jjttjj) - Add
tagged-literal - Add
when-someandif-some(@justone) - Add
re-matcher - Add
re-groups(@sogaiu) - Implement
read-string+eval#285 - Add
ns-unmap(@sogaiu) - Support
*print-length*#294 - Add
whilemacro #296 - Add
clojure.repl/find-doc#304 - Add
clojure.repl/apropos#317 - Add
memoize - Add
load-string#307 - Add
clojure.repl/pst - Add
with-bindingsmacro #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,initandeval-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-arrayandshort-array - Add support for
*print-level*
- 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
requirecan now be used as a functionfind-nsshould returnnilfor non-existent namespace #299- Mark
dotimesas termination-safe #298 - Fix metadata on syntax-quoted values #301
- Add support for
:refer :allin namespace form #297 - Support
:renamein:require#303 - Add support for
use#302 resolvecan now be used a functionloopbindings can refer to previous ones- JS interop improvements #312
- Fix handling
atomwith metadata #314 - Fix unqualified binding of
whenandnthinformacro - More JS interop improvements (@jeroenvandijk)
- Fix for variadic recur #321
- Fix for associative destructuring (commit)
- Add syntax check for
nsmacro: 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
NullPointerExceptionoccurs - Support alternative field access syntax
(. Integer -SIZE)#339 - Check syntax of
defand report too many arguments #340 - Fix alternative field access syntax
(Integer/SIZE) - Fix resolving var from other namespace via refer
Details about releases prior to v0.1.0 can be found here.
- Do not merge ex-data into sci error #534
- Removed
:realize-maxand:preset :termination-safe. In the light of #348 it would be misleading to claim that sci can guarantee termination within reasonable time.
:rowand:colmetadata have been renamed to:lineand:columnto be more compatible with Clojure.
- macros provided via options (functions marked with
:sci/macrometadata) now have two additional arguments at the start:&envand&form.