Using Joyride for Advent of Code

An alternative environment for using Clojure to solve Advent of Code problems is Joyride, an extension to Visual Studio Code that lets you script the editor like Emacs users script their editor.

Here’s a template/example project that contains some utilities, instructions, and a skeleton for solving Day 1:

https://github.com/PEZ/joyride-aoc-2022

The prerequisites are listed in the README, but in summary it is:

  • VS Code

Yes, no Java or any clojure tooling required. Once you have installed Joyride and Calva in VS Code (takes a few seconds) you are set.

It should be a pretty good resource for practicing Clojure. Only very, very basic Clojure knowledge is required. And since you will be using Calva, you can always use the Command Fire up the Getting Started REPL and get a guide into the language.

For people familiar to Clojure, it could be a pretty fun way to tackle Advent of Code.

Here’s a recording of me demoing the template project, complete with Live Coding Disaster and all:

3 Likes

We just updated Joyride so that you can reload JavaScript code to get new function definitions and such. Without restarting the REPL/The VS Code window. For when you use JavaScript to hack VS Code in user space. It creates something as unexpected as Interactive JavaScript Programming…

The reasons to do this could be several.

  1. You want to script VS Code in user space, but Clojure looks a bit daunting.
  2. You want performance that SCI can’t currently give you, for some specific part of your scripting.
  3. You want tVS Code JavaScript IDE help with the VS Code APIs, and node APIs, and node module APIs (this is a bit lacking when using Clojure in Joyride)
  4. You want to use ChatGPT to quickly find solutions to Advent of Code problems. ChatGPT speaks JavaScript better than it speaks Clojure.

The template project is now updated with an example of how to script VS Code in user space using JavaScript instead of Clojure. No ChatGPT integration yet, but maybe you can add that and PR it to the template? I can recommend asking ChatGPT about how to do it, it will give you the code.

Please use Clojure if you do ChatGPT updates to the above repo. :smile:

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.