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.
cljs.core/exists?
merge-opts
loses :features
or previous context:js-libs
+ refer
+ rename
clashes with core varhash-ordered-coll
read-string
should use non-indexing reader for compatibility(def foo/foo 1)
when inside namespace foo
sci.async/eval-form
and sci.async/eval-form+
sci.async/eval-string
, respect top-level do
forms:static-methods
option to override how static methods get evaluated.destructure
(.foo bar)
formderef
, swap!
, reset!
for host valuestime
macro to core namespacecatch
to be used as var nameeval-string+
with explicit initial :ns
and explicit last active :ns
in return value:sci/error
:require-macros
in CLJS^:volatile-mutable
in CLJS.toString
implementation on deftype
:ns-aliases
for built-in libs:sci/macro
for copy-ns and copy-var for copying macro functionssci/add-js-lib!
for adding js libraries including corresponding :js-libs
init optiondefmethod
add-watch
and remove-watch
on sci.lang.Var
*loaded-libs*
and (loaded-libs)
parse-next+string
functionproxy
while ignoring the namespaceread
with non-indexing reader, fixes babashka/babashka#1465reader-conditional
to core vars(Math/sin)
and (.substring "foo" 0 1)
, around 5 - 7x fasterfn
case
performancenil
#queue [1 2 3]
literallazy-seq
as macrons
as macrocljs.core/inc
in JVM envcase
as a macro and case*
as special form, rather than having case
as special formand
and or
as macrosfn
, defn
and defmacro
as macros, while keeping fn*
as special formloop
as macro, while supporting loop*
as special formlet
as macro, while supporting let*
as special formawait
(@mhuebert)SCI_ELIDE_VARS
deftype
field should be visible in protocol methodthrow
in stack tracein-ns
as function rather than built-in (@SignSpice)ns-publics
and resolve
are availablefn
array
let
(up to 8x faster)var->symbol
API function in sci.core
resolve
API function in sci.core
*print-namespace-maps*
from sci.core
(@ghoseb)and
, or
and do
IPrintWithWriter
for custom types in CLJSns-unalias
(@eerohele)Foo.
addWatch
/ removeWatch
noops on SCI vars to prevent segfault in native imagesdemunge
in CLJS (@sirwobin)satisfies?
finds protocols that have no methods (@lilactown)Object
(@lilactown)keyword-identical?
in CLJSdeftype
mutable fields for CLJSsci.ctx-store
: a place to store the context so it's available for sci.configs
to use. See docs.cljs.analyzer.api
more reliable^:sci/error
set!
in CLJS if sci.core/enable-unrestricted-access
has been called.defn
expressionhash-combine
:dynamic
metadata in copy-ns
or
with more than 20 argssci/copy-ns*
, the name was not copied correctly :(:ns-aliases
for mapping e.g. clojure.test
to cljs.test
copy-var*
API functionsci.lang.Var
part of public APIsci.lang.Namespace
part of public APIadd-namespace!
API functionprint-method
and print-dup
methods, don't allow by defaultdefrecord
improvements (equality, metadata preservation)satisfies?
does not recognize marker protocol on recordsatisfies?
of marker protocol via extend-
{type
, protocol
}sci.lang.Type
sci.lang.Type
*print-dup*
->Eduction
print-err-fn
in SCI core API:name
metadata via helper functions and use metadata for var nameslet*
and try
*read-eval*
/ sci/read-eval
to falseall-ns
and find-ns
in sci/core
copy-ns
when var has no metadataadd-class
and add-import
API functions in sci/core
sci.async
: EXPERIMENTAL namespace for async evaluation in CLJS*print-err-fn*
var*clojure-version*
and (clojure-version)
:sigs
on protocol mapunchecked-dec
Object
with protocol doesn't work on recordsIRecord
doesn't work on SCI records(identical? [] [])
worksloop
doesn't expand in fully qualified let
let*
special formcljs.analyzer.api
for sci/copy-ns
*assert*
declare
as macroprint-method
on recordsnew
in JS targets: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.halt-when
, pop!
, array?
, js-delete
, object?
and undefined?
:as-alias
supportmerge-opts
should overwrite existing var->
js/Reflect
when calling instance function, adds compatibility with GraalVM JS Polyglotjs/Reflect
when calling constructor, adds compatibility with GraalVM JS Polyglotmacroexpand
for defrecord
defrecord
+ protocol which invokes record constructorextend-protocol
#378extend
extend-protocol
#3780.0.18
copy-ns
macroclojure.core/read
improvements #663clojure.core/read
can read with standard PushbackReader
*read-eval*
*default-data-reader-fn*
*reader-resolver*
reader-conditional?
random-uuid?
clojure.test/test
doseq
and for
as normal macros (@erdos)declare
with dynamic var #630 (@erdos)ns
:require
with string instead of symbol (@djblue)inst-ms
resolve
on class method (should return nil
) #647to-array-2d
, aclone
, reduce
and amap
#650 (@MrEbbinghaus)This release focuses on:
*print-fn*
)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:
js-keys
create-ns
:disable-arity-checks
after merge-opts*flush-on-newline*
*print-readably*
:clojure.core/eval-file
metadata*print-fn*
and via API sci/print-fn
rather
than *out*
#365IllegalArgumentException
in case
when providing duplicate dispatch valuesthread-bound?
predicate #560set!
to mutate objects in CLJS #563SCI_ELIDE_VARS
environment variable for smaller CLJS bundle sizedefn
#567intern
in core APItry
/catch
in CLJS #583, #584, #585case
expression generated by macro doesn't work correctly #586:reload-all
#552:doc
on def
/defn
#554.aset-...
, delay?
, bit-clear
bound-fn
and bound-fn*
clojure.core/for
force
dissoc!
(@wilkerlucio)(instance? clojure.lang.IAtom 1)
returns true
#537ns-unmap
on referred var #539refer-clojure
macro #519type
on defrecord
#492:inline
metadata in Clojure #483Thanks for contributing to this release:
@lread, @patrick-galvin, @SevereOverfl0w, @djblue, @kwrooijen, @sogaiu, @joinr, @RickMoynihan, @galdober
: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.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
fork
API function #369sci.core/reader
,
sci.core/parse-string
, sci.core/parse-next
, sci.core/eval-form
#404IDeref
, IAtom
, IAtom2
(and CLJS equivalents) #401print-meta
, print-level
which can be used with
sci.core/binding
to control the dynamic var equivalent in sci programssymbol
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->
and as->
as normal macros #390, #462 (@kwrooijen)defn
should not introduce local for name in body #384use
120175fresolve
boolean?
to constant check #465 (@kwrooijen)Thank to @jeroenvandijk, @jjttjj, @justone, @sogaiu and @armincerf for contributing.
derive
etc.) #237ns-interns
, ns-imports
, ns-refers
, ns-map
, all-ns
do-template
clojure.edn
namespacepromise
and deliver
(@jeroenvandijk):readers
option to support data readers (@jjttjj)tagged-literal
when-some
and if-some
(@justone)re-matcher
re-groups
(@sogaiu)read-string
+ eval
#285ns-unmap
(@sogaiu)*print-length*
#294while
macro #296clojure.repl/find-doc
#304clojure.repl/apropos
#317memoize
load-string
#307clojure.repl/pst
with-bindings
macro #289ns-resolve
clojure.core/read
#317remove-ns
#318requiring-resolve
#316tagged-literal?
function (@armincerf)with-redefs
#325create-ns
, new-macro-var
, copy-var
, init
and eval-string*
API functionsenumeration-seq
bean
*print-meta*
#334clojure.core/intern
#336double-array
and short-array
*print-level*
(def ^{:test (fn [] \"foo\")} x)
).if
(@jeroenvandijk)require
can now be used as a functionfind-ns
should return nil
for non-existent namespace #299dotimes
as termination-safe #298:refer :all
in namespace form #297:rename
in :require
#303use
#302resolve
can now be used a functionloop
bindings can refer to previous onesatom
with metadata #314when
and nth
in for
macrons
macro: first arg is required and should be symbolNullPointerException
occurs(. Integer -SIZE)
#339def
and report too many arguments #340(Integer/SIZE)
Details about releases prior to v0.1.0 can be found here.
: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.:row
and :col
metadata have been renamed to :line
and :column
to be
more compatible with Clojure.: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, Bob & Lee ReadEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close