August 2019 Monthly Update

By Rachel Magruder

August was our first month with this new round of projects, check out their monthly update!

Shadow CLJS

Released shadow-cljs versions 2.8.42 up to 2.8.51. Released shadow-cljs versions 2.8.52

Upgraded :target :react-native support

Changed the way the :react-native build target emits code so that during development source maps work in some limited fashion (ie. only when using Debug JS remotely in Chrome). This is meant to work around the limitation that metro itself currently has regarding source maps directly.

Enhanced the code processing so that js/require calls are automatically detected and don’t require any additional configuration. More info in the related discussion on Clojureverse.

Added the groundwork to allow code-splitting to work with react-native builds so that parts of the code can be loaded lazily when needed (to boost initial startup speed). The JS side of things is done but it also requires work on the react-native side as described here. Hope to create an actual working example of this in the future. I am looking for beta testers willing to dive into this.

Bugfixes/Features

Documentation

Meander

Much of the work I’ve been doing is getting the new version of Meander, epsilon, ready for release. This has involved numerous internal architectural changes, bug fixes, and documentation additions.

One of the most important changes to the library was to qualify (namespace) the core pattern matching and pattern substitution operators such as and, or, scan, etc. Prior to epsilon these operators were available via their unqualified symbols. This led to some friction for folks. From now forward, beginning with epsilon, these operators will be fully qualified and available from the namespace meander.epsilon.

With qualified operators I also further developed a syntax extension mechanism which allows for controlled extension of the pattern matching and/or substitution syntax. This will also be available from the meander.epsilon namespace as defsyntax. This macro allows new symbolic, syntax to be defined.

With the syntax extension and definition mechanism in place, I was able to begin working on real documentation. Because the defsyntax macro compiles to code which emits a defn, which in turn compiles to code which emits a def, we can attach real meta data such as :doc and :arglists to the vars. So now, not only can we define operators via the provided extension mechanism, we can also document them. And that’s exactly what I spent a good deal of time doing. To date, I’ve fully documented all but two operators and I expect those will be documented during the week.

Apart from the operator qualification and documentation efforts, Meanders epsilon branch also received several bug fixes to the improvement of the pattern matching compiler. Meanders Clojure spec definitions have also been given attention and mistakes preventing the use of instrumentation have now been corrected.

Another small but (hopefully) useful addition is the allowance of the search operator to return results in breadth first order. Prior to this option, results were always returned in depth first order. I anticipate the further allowance of configuration to search in the future.

Within the week I plan to release Meander epsilon. During the weeks ahead I intended to aggressively enhance the pattern matching and substitution compilers, put in place infrastructure for guides and tutorials, and begin putting together a rewrite specific compiler if time permits.

Since the last update the epsilon branch of the project has seen a few important improvements and fixes. The two primary improvements have been to pattern matching and to substitution.

For map pattern matching, keys can be logic variables if Meander can determine that the pattern could not have more than one solution. For example, if we know that we have an already solved for a logic variable earlier on in a pattern match, it may be used as a key in the map. This improvement also had transitive effects to our code generation for searching as well. Previously, if a map had logic variables keys we emitted search code regardless. This meant that in some cases we were producing code that was doing more work than necessary.

For substitution, code generation has also been improved as Meander is employing a different approach. We’re now emitting much smarter, faster, and in some cases (dramatically) shorter code. To do this, the substitution compiler collects and returns data as it compiles so that at each point in the compilation there is an accumulation of knowledge which can be used to make better decisions. The generated code is also subsequently optimized by rewriting it to eliminate redundant code by applying functional identities.

Calva

August 1 - 15

Theme: Project Maintainability

This has many aspects, including: Cooperation with other tool smiths, Code factoring, User documentation, and Ease of use.

Orchard task force

Since CIDER and Calva are sharing a lot of the tooling, we have been trying to figure out how to pool our efforts into The Orchard. Bozhidar Batsov has formed a task force with people building libraries and tools for, and/or using, Orchard related things. Kevin and I have joined from the Calva team and we now try to apply an Orchard first mindset when designing how to add certain features.

Documentation

Refactoring Calva

We’re preparing for making some major cleanings up of the Calva code base. And even while we have yet to start any of those efforts we are already cleaning up while we are working with updating Calva. This means the project is more maintainable now than it was two weeks ago, and we intend to continue in this spirit of Kaizen. A more drastic change is that we:

Jack in/Connect

We’ve continued with the strong focus on making it easy to connect Calva to your Clojure project.

Refactoring tooling

We’ve investigated our options for adding refactoring tools.

Various

August 15 - 31

Theme: Project Maintainability - through ease of use

Jack-in and Connect Sequences

We want to try help contribute to the community such that fewer Clojure and ClojureScript projects out there need to specify their editor tooling dependencies and setup. To this end Calva has a Jack-in feature that supports the most common project types and cljs repl types. It also supports customizing the cljs repl configuration so that projects with special cljs types can use Jack in as well. But there are still too many projects out there not supported by Calva Jack in, and this is what we have been working on almost solely.

We are adding something we call Connect Sequences, more on that below. When this is released we will be able to say we enabled the following:

Except for the last one, this all works in development, and we are cleaning up the code and considering to add this additional feature, before release:

The custom Connect Sequence feature is developed documentation first. And you can follow the commits in this PR. (The reason there is awfully little feedback there, is because that happens offline).

Other

Other than jack-in, time has been spent mostly in support and general talking to users. Plus:

CIDER