This is just a very quick experiment with Michiel Borkent's Reagami package.
I found it an astonishingly easy way to build a web GUI. To play with this:
- Create a reagami app as documented here, but do not start it:
npm create reagami-app my-app| #!/bin/bash | |
| ############################################################################### | |
| # | |
| # weigh.sh | |
| # | |
| # Usage: `weigh.sh <URL>`: prints the download weight of a web resource. | |
| # Dependencies: bash; awk; find; wget. | |
| # | |
| # No copyright claimed; no warranty; use as you see fit. |
| #!/bin/bash | |
| ############################################################################### | |
| # | |
| # weigh.sh | |
| # | |
| # Usage: `weigh.sh <URL>`: prints the download weight of a web resource. | |
| # | |
| # No copyright claimed; no warranty; use as you see fit. | |
| # Author: Simon Brooke |
The Jolt language is an experimental Clojure source to native executable compiler built on Chez Scheme. This Gist describes how I got it running on Debian Trixie.
Firstly, in the jolt repository, the file bin/joltc is a (clever) shell script wrapper. It assumes that the chez scheme executable on your system will be invoked as chez. If you install chez scheme using the Debian package manager, it will be installed as chezscheme, and consequently the script won't find it. I intend to submit a pull request to make the shell script try a number of possible variant names for the chez scheme executable, but I haven't yet done so and, even if I do, it may not be accepted.
I tried creating a symbolic link /home/simon/bin/chez → /usr/bin/chezscheme but this did not work, apparently because the executable constructs the path to its boot file as a relative path from its ex
| (ns are-you-lazy | |
| "Sometimes it's useful to check whether an object is lazy without | |
| exploring the whole of it!" | |
| (:import [clojure.lang IPending LazilyPersistentVector LazySeq])) | |
| (defn lazy? | |
| "Return `true` if this `coll` lazy, else `false`. | |
| **NOTE THAT** Probably all lazy sequences are instances of | |
| `clojure.lang.LazySeq`, but `LazySeq` implements an interface `IPending` |
| (defn map-interval | |
| "Like `map` -- apply function `f` to each element in `col` in turn and | |
| return the values returned in sequence, but in a single thread and pausing | |
| between each invocation of `f`. | |
| Useful for example in circumstances where you're querying a rate-limited | |
| service." | |
| [f col interval] | |
| (let [a (atom ())] | |
| (doseq [x col] |
| #!/bin/bash | |
| # Script to set all origin URLs of all my projects in my workspace to the new | |
| # (forgejo) URL, replacing previous GitHub URLs. | |
| # Background: I keep all my active projects as subdirectories of the | |
| # directory `workspace`. You need to clone all the projects from GitHub to | |
| # Forgejo **first**, before running this script; but this is simply done | |
| # through the Forgejo user interface. See | |
| # https://www.journeyman.cc/blog/posts-output/2025-03-08-installing-forgejo/ |
WARNING: These are very crude tests. Note in particular that I should really average times over about fifty runs, because they do vary; and I have not done this.
Recursive performance in Common Lisp is very good — better on this test than iterative performance, which surprises me. Note that the iterative algorithm takes about one third more processor cycles, and slightly more store.
| (ns fibs.fibonacci | |
| "Compute Fibonacci sequences. | |
| The motivation for writing this was reading a presentation by Stuart | |
| Sierra on Fibonacci sequences in which he showed both recursive and tail | |
| recursive solutions in Clojure, both of which he correctly noted blew up | |
| for large values of `n`, but did not show a `reduce` based solution which | |
| would seem efficient, idiomatic and (relatively) robust. | |
| Stuart's presentation is here: |
| (ns latest-version | |
| "Find the most current stable version identifier of a Clojure (and Java) package." | |
| ;; This builds on Yannick Scherer's [ancient-clj](https://github.com/xsc/ancient-clj), | |
| ;; which in turn builds on Chas Emerick's | |
| ;; [pomegranate](https://github.com/clj-commons/pomegranate/). It goes without saying | |
| ;; that I could not have done this without them. | |
| ;; Usage: (latest-stable-version 'org.jmonkeyengine/jme3-core) | |