December 2020 Monthly Update
By Alyssa Parado
Happy (belated) New Year everyone! Here are the updates from our new projects.
- Babashka news page
- Released babashka/process to clojars: https://clojars.org/babashka/process
- Released babashka/babashka.curl to clojars https://clojars.org/babashka/babashka.curl
- Held talk on babashka and sci internals
- Made 3 week survey and made data available
- Moved most of README docs to book.babashka.org
babashka.deps#677. See docs.
babashka.deps#678. See docs.
--clojureoption to invoke a JVM clojure process similar to the official Clojure CLI.
- Upgrade to GraalVM 20.3.0 #653
- Documentation: a list of all available linters #936
- Lint protocol and interface implementations in
- Upgrade to GraalVM 20.3.0 #1085
- Fix analysis for cljs.core simple-benchmark #1079
- Support babashka.process $ macro syntax #1089
- Fix recur arity in doysync #1081
- Alias linter doesn’t recognize (quote alias) form #1074
- Fix retries for refer :all when linting in parallel #1068
- Improve analyzing syntax of
- Namespaced map in deps.edn causes false positive #1093
- Support ignore hints in
- Fix unsorted namespaces linter for nested libspecs #1097
- Fix recur arity in doysync #1081
- Released v2020.12.12
- deps.clj 0.0.11 released: catching up with clojure 184.108.40.2063
- Buddy pod https://github.com/babashka/pod-babashka-buddy
- Etaoin pod 0.0.1 release https://github.com/babashka/pod-babashka-etaoin
- Pod registry https://github.com/babashka/pod-registry
- Fswatcher pod https://github.com/babashka/pod-babashka-fswatcher
- Fix issue with unzipping nested directory babashka/pod-registry#4
- Sqlite3 pod https://github.com/babashka/pod-babashka-sqlite3
- Detect macro var as val at analysis time #467
- Restructure namespace for #417-related refactoring #468
- Optimization for
- Optimization for
- Excluded clojure var in macro still gets resolved to in syntax quote #466
- Optimization for ctx #473
- Optimization for fns #475
- Release 0.2.0: https://github.com/borkdude/sci/blob/master/CHANGELOG.md#v020
- Optimization for vars that are inlined in clojure #483
- Only add location metadata to seqs and symbols #488
- Inline edamame opts / get rid of end-line and end-column #490
- Fix NPE in VSCode plugin #12
- Edamame (parser lib for sci): handle whitespace after read-cond splice #71
- Edamame: add
- Edamame: fix for auto-resolved map and current namespace #74
- Report number of arguments used in
assocover a large body of source code https://gist.github.com/borkdude/e6f0b12f9352f3375e5f3277d2aba6c9 as investigation for https://clojure.atlassian.net/browse/CLJ-1656.
- Edamame: make end locations optional #75
- Depstar: fix for Windows #57
I released version 0.5.0 of O’Doyle Rules with two new features that make it rule even more:
- An easy way to request all facts in a session via
(query-all session), mainly intended for serialization. You can parse them later and re-insert them into your session.
- A new block type called
:then-finally, which lets you react to insertions and retractions that affect a rule’s matches. This is vital for creating “derived facts” that accumulate other facts – which is my equivalent to Clara’s accumulators.
You can read more in the release notes.
I also added several benchmarks to the repo. One of them is code extracted from my dungeon crawler test game. Some of the benchmarks are also implemented with Clara and DataScript to compare performance. I will soon be putting a lot of focus on performance so these will help. GOTTA GO FAST, as Ricky Bobby once said.
I released version 0.6.0 with a new feature that makes it possible for rules to build recursive data structures similar to what you’d get from “pull” queries in DataScript or Datomic. See the release notes for more. Using O’Doyle in this way is somewhat advanced and hard to explain briefly, so to go along with the release I wrote a more in-depth explanation: Using O’Doyle Rules as a poor man’s DataScript.
Next month will be focused on performance. There’s a lot of low-hanging fruit from the RETE literature that I still need to steal, such as “node sharing”. When they make a movie about this, there’ll be a scene where my character is deep in the stacks of an old library, dusting off CS papers and scrolling through microfilm to find the lost gems of early rules engine research.
It won’t be true, but it’ll be a cool scene.
This first couple of weeks involved information gathering on the Language Server Protocol in general and clojure-lsp, specifically, and how to integrate it with VS Code and Calva. Fortunately, the initial integration had been started on a branch by Kevin Ahlbrecht and Peter Strömberg.
Below is a list of work that has been done in the last couple of weeks. Some features in clojure-lsp have been disabled in favor of Calva’s functionality, at least for now, because Calva’s similar functionality is either more mature at this time, or there is work required to make the two feature sets work well together. The initial goal is to publish a release with clojure-lsp early, disabling anything that might cause issues for now, while providing features Calva was lacking. The disabled features may receive work later in order to integrate them.
- Figured out how to trace LSP messages and added a Calva setting for enabling this.
- Submitted a PR to Microsoft’s language-server-protocol-inspector to fix an issue with running this project locally. The inspector helps more easily sort through LSP messages.
- Made a change to clojure-lsp to make references code lens work
- Added a command to Calva to make references code lens work. When references code lenses are clicked, a peek definitions window opens.
- Added a Calva setting to enable references code lens
- Disabled Calva’s Clojure definition provider in favor of clojure-lsp’s
- Disabled clojure-lsp’s diagnostics in favor of clj-kondo’s, which we bundle with Calva
- Disabled clojure-lsp’s hover provider in favor of Calva’s
- Disabled clojure-lsp’s completion provider in favor of Calva’s
- Fixed an issue in clojure-lsp to prevent negative numbers in ranges
A development version (vsix) was sent to the #calva channel of the Clojurians slack for testing of the above changes, and I plan to release the changes soon and then continue work on some things that have been disabled, and/or on extra capabilities clojure-lsp can provide.
Version 2.0.134 Was Released
This includes a couple of small fixes for things I noticed while developing.
Calva’s clojure-lsp integration has been released as of version 2.0.137. See the ClojureVerse post for details.
Contributing to clojure-lsp is important to improving Calva, and I expect to be doing more of this in the future. Below are changes I made or helped with.
- Fix jar file URIs to be compatible with both Windows and Unix
- Add initialization options that allow disabling formatting providers
- Fix go id for documentHighlight
- Fix duplicated usages/references for cljc files
Peter Strömberg and myself have been quite active lately, and Eric Dallo has been a tremendous help with clojure-lsp fixes, PR reviews, ideas, etc. Peter added refactoring commands that utilize clojure-lsp’s refactorings as well as updated the docs to explain clojure-lsp in Calva and the refactoring commands. Below is a list of recent Calva changes.
- Binding keys to REPL functions, passing the namespace and cursor line (Notespace integration)
- Make REPL prompt submit if the cursor is after the top level form
- Only print stacktrace on demand
- Bring in refactorings we get access to via clojure-lsp
- Add ”clojure-lsp starting” progress indicator
- Fix step into local dep with debugger
- Use Pseudo Terminal instead of Task for Jack-in
- Prefer cider-nrepl symbol definitions over clojure-lsp
- Enable clojure-lsp completion items when no nrepl connection