joker

Small Clojure interpreter, linter and formatter.

EPL-1.0 License

Stars
1.6K

Bot releases are visible (Hide)

joker -

Published by candid82 almost 6 years ago

General improvements

  • added joker.repl namespace
  • added :ns and :name to vars' meta
  • added joker.os/chdir (thanks @jcburley!)
  • added Joker versions of clojure.template and clojure.walk namespaces (thanks @jcburley!)
  • added min and max arity reporting in some error messages (thanks @jcburley!)
  • added multimethods support (thanks @jcburley!)
  • defmacro now returns the var
  • fixed arity error message when calling macros
  • implemented refer-clojure

Linter improvements

  • added re-find with arity 1
  • fixed this inside proxy (thanks @conormcd!)
  • Joker now evaluates in-ns when linting. This results in more accurate error messages (pointing to the current namespace rather than user namespace). IMPORTANT: if you have .jokerd/linter.* files, you might have to add (in-ns 'joker.core) at the top to make sure your definitions reside in joker.core namespace and are therefore referred in the namespace being linted.

Fixes

  • only public joker.core vars are now referred in user namespace (previously, private vars were referred as well)
joker -

Published by candid82 almost 6 years ago

General improvements

  • changed -- to mean only end of Joker options, never stdin. Use - for stdin. (Thanks @jcburley)
  • added new core function: requiring-resolve (from Clojure 1.10)
  • added socket REPL (for example, joker --repl localhost:8080). Thanks @jcburley!

Linter improvements

  • made Joker aware of more Clojure core's vars, including new vars introduced in Clojure 1.10
  • Joker now warns on odd number of clauses in cond-> and cond->>

Fixes

  • fixed read-line to read entire lines (thanks @jcburley)
joker -

Published by candid82 almost 6 years ago

General improvements

  • joker.os/sh and joker.os/sh-from now return integer exit code in :exit key. (Thanks @jcburley!)
  • added new command line flag --no-readline. It disables readline functionality in the repl. Useful if joker is called with rlwrap.
  • added new functions from Clojure 1.10: joker.core/ex-cause, joker.core/ex-message
  • Joker now prints result of evaluating -e <expr> if not nil
  • for consistency with Clojure, (str <ns>) now returns namespace's name, while (pr <ns>) prints #object[Namespace "<name>"].
  • command line option --expr is renamed to --eval (for consistency with Clojure). (Thanks @jcburley)

Linter improvements

  • made Joker aware of new Clojure 1.10 functions: add-tap, remove-tap, tap>, read+string, PrintWriter-on
  • warn on shadowed unused binding (see https://github.com/candid82/joker/issues/96)
  • warn on fn form with empty body. The warning is behind :fn-with-empty-body flag (defaults to true).
  • warn on unused fn parameters. The warning is behind :unused-fn-parameters flag (defaults to false). See https://github.com/candid82/joker/issues/97
  • suppress unused binding or unused parameter warnings if the name starts with underscore.
  • made Joker aware of *data-readers*

Fixes

  • fixed indentation when pretty-printing seqs.
joker -

Published by candid82 about 6 years ago

General improvements

  • Improved command line parsing. Thanks @jcburley!
  • command-line-args now correctly returns a seq of arguments passed to the script rather than a vector of arguments passed to joker itself. Thanks @jcburley!
  • Added support for CPU and memory profiling. Thanks @jcburley!
  • Significantly improved Joker's startup time by pre-parsing joker.core code and storing the AST in a binary format.
joker -

Published by candid82 about 6 years ago

General improvements

  • support '-' (single hyphen) as alias for stdin, deprecate '--' (double hyphen) for stdin. Thanks @jcburley!

Linter improvements

  • skip type inference for dynamic vars to avoid false positives
joker -

Published by candid82 about 6 years ago

General improvements

  • added joker.url namespace to standard library for encoding / decoding urls.

Linter improvements

  • improved support for user declarations (.jokerd/linter.clj)
  • fixed arities for spit and slurp
  • fixed :include-macros linting in ClojureScript (thanks @benalbrecht !)
  • Joker now exits with code 1 if there are any linter warnings or errors
joker -

Published by candid82 about 6 years ago

Linter improvements

  • added Math to known namespaces (ClojureScript)
  • added support for shadow-cljs's :default option in require
  • added cljs.test macros to known-macros
joker -

Published by candid82 over 6 years ago

Fixes

joker -

Published by candid82 over 6 years ago

General improvements

  • added joker.os/sh-from function

Linter improvements

joker -

Published by candid82 over 6 years ago

General improvements

  • qualified names are now handled correctly in let bindings (they are forbidden)

Linter improvements

  • nicer arity warnings
joker -

Published by candid82 over 6 years ago

General improvements

  • added new functions to standard library: joker.os/stat, joker.html/escape, joker.html/unescape, joker.html/start-file-server

Linter improvements

  • Joker will now execute the following files (if they exist) before linting the file: .jokerd/linter.cljc (for both Clojure and ClojureScript), .jokerd/linter.clj (Clojure only), .jokerd/linter.cljs (ClojureScript only). The rules for locating .jokerd directory are the same as for locating .joker file. See #50 for details.
  • Joker will now warn on duplicate var definition
joker -

Published by candid82 over 6 years ago

General improvements

  • added joker.http/start-server function
  • added many new functions to joker.time namespace (see docs)

Linter improvements

  • strings are now allowed for lib names in require (ClojureScript only) (#48)

Fixes

  • case macro now works properly (#47)
joker -

Published by candid82 over 6 years ago

General improvements

  • added swap-vals! and reset-vals! functions (from Clojure 1.9)
  • added new functions to standard library: joker.http/send, joker.os/mkdir, joker.os/cwd, joker.os/ls, joker.base64/encode-string, joker.math/sin, joker.math/cos, joker.math/hypot, joker.math/pi (a var).
  • made ExInfo (return by ex-info) a map with :message, :cause, and :data keys.
joker -

Published by candid82 almost 7 years ago

General improvements

  • added joker.core/pprint function (very basic pretty printing)
  • added new command line parameter: -e <expression> will execute provided expression and exit
  • added new command line parameter: --hashmap-threshold <number>. Tells Joker the maximum number of slots in array map. A slot is used for either key or value. If there is more keys and values than provided number (defaults to 16), persistent hashmap will be used instead. Negative value means "no limit", so Joker will always use array maps. This parameter is useful when Joker is used to pretty print EDN data structures: setting it to negative value allows prevents Joker from using persistent hashmaps (which don't preserve keys order) and forces it to use array maps instead (which do preserve keys order). For example, the following command can be used to pretty print EDN data structure (read from stdin):
joker --hashmap-threshold -1 -e "(pprint (read))"

Linter improvements

Fixes

joker -

Published by candid82 almost 7 years ago

General improvements

Linter improvements

joker -

Published by candid82 almost 7 years ago

General improvements

Linter improvements

  • fixed false positives when destructuring maps with namespaced keywords in ClojureScript
  • added warning on unused private macro
  • added warning on calling =, ==, < and similar functions with only one argument

Fixes

joker -

Published by candid82 about 7 years ago

Linter improvements

{:known-namespaces [clojure.spec.gen.test]}
{:known-tags [db/fn]}
  • implement better support for defrecord, deftype, defmethod, defprotocol, extend-type, reify, extend-protocol

  • fix false positives on BigDecimal

  • fix false positives on symbols with $

joker -

Published by candid82 about 7 years ago

General improvements

  • implemented splicing reader conditionals

Linter improvements

  • Joker now understands alias and create-ns and won't complain about symbols or keywords in aliased or created namespaces. See https://github.com/candid82/joker/issues/21 for more details.
  • Joker now allows to specify symbols that are introduced by a macro in .joker file:
{:known-macros [[riemann.streams/where [service event]]]}

So each element in :known-macros vector can now be either a symbol (as before) or a vector with two elements: macro's name and a list of symbols introduced by this macro. See https://github.com/candid82/joker/issues/20 for the discussion that led to this feature.

  • fixed false positive on new call

Fixes

  • division by zero doesn't crash Joker anymore
  • fixed loading .joker file on windows
joker -

Published by candid82 about 7 years ago

General improvements

  • updated to the latest version of readline. This, in particular, allows to build Joker for Solaris.
  • new joker.core/joker-version function
  • new joker.core/*joker-version* var
  • new joker.json/write-string function
  • new joker.time standard namespace, currently with only one function joker.time/sleep

Linter improvements

Fixes

  • fixed str for string, regex and chars
joker -

Published by candid82 over 7 years ago

Linter improvements

  • Joker can now infer types in trivial cases and warn on argument type mismatch for a subset of core functions. For example, this code (map [1 2] inc) will result in a warning:
Parse warning: arg[1] of #'joker.core/map must have type Seqable, got Fn

Fixes

  • fixed reading unicode characters
  • fixed the crash when reading blank keyword '(:)'
  • joker.os/sh result now includes correct :success value (was always true before, now will be false if the process exits with non-zero code)
Package Rankings
Top 6.97% on Proxy.golang.org
Badges
Extracted from project README
CircleCI