Clojure CLI - which execution option to use
Execution options (-A -M -T -X) define how aliases are used with the Clojure CLI. Aliases are included via one of these execution options and each option can affect how the alias is used.
Since the first documented released which exclusively used the -A
execution option to include aliases, the design has evolved to provide specific execution options to run code via clojure.main (-M
) and clojure.exec (-X
). In July 2021, the ability to run tools (-T
) independent from the Clojure project classpath was also introduced.
The exec-opts command line flags have evolved to enable these features, so lets explore those flags and show how each flag is typically used.
Continue reading →Clojure CLI - understanding aliases
Clojure CLI provide a very flexible way to run Clojure and uses aliases in a deps.edn
configuration file to optionally include execution options, code paths and library dependencies (Maven & Git). Aliases can be used with any of the Clojure CLI execution options that run with either clojure.main or clojure.exec.
Aliases provide a simple way to optionally include community libraries and tools for working with Clojure projects (e.g test runner, built tools, etc.). Community tools can be added to each Clojure project deps.edn
configuration, or preferably to a user level deps.edn
file for use with any Clojure project (easier to maintain as there is a central alias)
Understanding what an alias is and how to define them ensures an effective use of Clojure CLI and a smooth workflow.
Continue reading →Automate Cryogen Clojure blog with GitHub Actions
Practicalli uses Cryogen static site generator for its blog website. Cryogen is fast and simple to use thanks to the Clojure EDN file used for configuration.
Cryogen documentation shows how to publish a Cryogen blog to GitHub pages using Git command. The deployment can be automated using GitHub actions, so that a new version of the site is deployed when Pull Requests are merged to the specified branch (or on direct commits to that branch).
Continue reading →Microsoft Language Server Protocol, LSP, is exactly what the name says it is. Its a (JSON RPC) protocol. Its no more and no less than that. LSP is however a big strategy peace for Mircrosoft to encourage developers to adopt VS Code, which naturally provides support for the LSP protocol. The implementation of tooling that uses LSP is left to companies and communities that develop editor and related tools.
Standards can be an opportunity to focus development work and provide a rich set of tools that are far easier to integrate. There are many examples of where a protocol has provided a huge amount of diversity, such as TCP/IP, DNS, HTTP and HTML protocols that drove the creation of the web we know today. Standard protocols in themselves did not make the web, but allowed developers to build on top of them and create the rich and diverse experience on the web that we see today.
LSP is no different. By itself LSP provides no benefit. However, when adopted as a standard by tooling developers it has the potential to help grow an even richer experience for the whole developer community.
Continue reading →Brave Clojure redux - part 1 - the REPL
Brave Clojure redux is series that revisits the code examples and tooling covered in the book: "Clojure for the Brave and the True". The good news is you do not need to be brave or true to read the book or learn Clojure either. It does help if you have some time and motivation though.
Brave Clojure redux uses Clojure CLI tools rather than Leiningen as used in Brave Clojure. Code examples will be used from the book, complemented with additional examples where relevant.
Part 1 covers the Clojure REPL process, a vital part of Clojure development. The basics of building and running a project are also included.
Continue reading →