πΎ Archived View for l-3.space βΊ log-240211-1.gmi captured on 2024-05-12 at 15:03:51. Gemini links have been rewritten to link to archived content
β¬ οΈ Previous capture (2024-03-21)
-=-=-=-=-=-=-
Time-stamp: <2024-02-11 12h13 UTC>
Let's postpone the why and what of BQN, and address the how
Suppose that you're interested in using
but you're troubled by not having any. Well, if you're an Arch linux and using emacs, the following should see you through
I found the AUR package for CBQN lacking, in that it didn't compile the shared libraries which i wanted for the LSP integration below. To that end, here's what i'm using
$ cat PKGBUILD # Maintainer: Firegem <mrfiregem [at] protonail [dot] ch> pkgname=cbqn-git pkgver=r2743.8c18fddd pkgrel=1 pkgdesc="A BQN implementation in C." arch=('x86_64' 'i686' 'aarch64' 'arm') url="https://github.com/dzaima/CBQN" license=('Apache' 'Boost' 'GPL3' 'MIT') depends=('glibc' 'libffi') optdepends=('ttf-bqn386: BQN and APL compatible font') makedepends=('git' 'clang') provides=("${pkgname%-git}") conflicts=("${pkgname%-git}") source=("${pkgname%-git}::git+${url}.git") md5sums=('SKIP') pkgver() { cd "${srcdir}/${pkgname%-git}" printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } build() { cd "${srcdir}/${pkgname%-git}" make PIE='-pie' o3n make PIE='-pie' shared-o3 } package() { cd "${srcdir}/${pkgname%-git}" make PREFIX="${pkgdir}/usr/" install }
the changes to build() and package() are minor, but appear to be necessary.
With that it should be possible to install a functioning BQN compiler and REPL.
https://git.sr.ht/~detegr/bqnlsp
Cloning and building this should work now that the above PKGBUILD puts /usr/lib/libcbqn.so onto the file system. Not too much to say here, other than copy the resulting bqnlsp into your path somewhere
Fortunately for us, all of the hard work has already been done
(use-package bqn-mode :ensure t :defer :bind (:map bqn-mode-map ("M-TAB" . expand-abbrev) ("C-c r r" . bqn-comint-eval-dwim) ("C-c r b" . bqn-comint-eval-buffer)) :hook (bqn-mode . (lambda () (eglot-ensure) (bqn-comint-buffer))) :config (require 'bqn-keymap-mode) (require 'bqn-glyph-mode))
Note that the first time this is run eglot may ask for the path of bqnlsp, simply provide it.
At first when using BQN i found that while i could remember the names of the various glyphs in which i was interested, i could not recall where they were on the "BQN Keyboard"---a task not aided by the fact that i don't use QWERTYβ°. To that end i wrote some abbrev aliases so that i could type the names and press either space or whatever the favourite abbrev trigger was to replace the word with the glyph
(define-abbrev-table 'bqn-mode-abbrev-table '( ;; funtions ("abs" "β") ("assert" "!") ("ceiling" "β") ("classify" "β") ("conj" "β§") ("couple" "β") ("deduplicate" "β·") ("depth" "β‘") ("deshape" "β₯") ("dgrade" "β") ("disj" "β¨") ("divide" "Γ·") ("drop" "β") ("dsort" "β§") ("enlist" "β") ("find" "β·") ("floor" "β") ("group" "β") ("gt" ">") ("gte" "β₯") ("indices" "/") ("join" "βΎ") ("left" "β£") ("length" "β ") ("lshift" "Β«") ("lt" "<") ("lte" "β€") ("match" "β‘") ("maximum" "β") ("member" "β") ("minimum" "β") ("minus" "Β―") ("modulus" "β") ("multiply" "Γ") ("neg" "Β¬") ("neq" "β ") ("nmatch" "β’") ("occurrence" "β") ("pair" "β") ("pick" "β") ("power" "β") ("prefix" "β") ("range" "β") ("recip" "Γ·") ("replicate" "/") ("reshape" "β₯") ("reverse" "β½") ("right" "β’") ("root" "β") ("rshift" "Β»") ("select" "β") ("shape" "β’") ("sign" "Γ") ("solo" "β") ("span" "Β¬") ("sqrt" "β") ("suffix" "β") ("take" "β") ("transpose" "β") ("ugrade" "β") ("usort" "β¨") ;; combinators ("atop" "β") ("catch" "β") ("choose" "βΆ") ("constant" "Λ") ("lhook" "βΈ") ("over" "β") ("rhook" "β") ("self" "Λ") ("swap" "Λ") ("under" "βΎ") ("valence" "β") ;; 1-modifiers ("cell" "Λ") ("each" "Β¨") ("fold" "Β΄") ("insert" "Λ") ("scan" "`") ("table" "β") ("undo" "βΌ") ;; 2-modifiers ("depth" "β") ("rank" "β") ("repeat" "β") ;; syntax ("define" "β") ("export" "β") ("change" "β©") ("nothing" "Β·") ("sep" "β") ;; constants ("pi" "Ο") ("infty" "β")))
to make this not irritating i found myself also setting
(setq save-abbrevs 'silently)
and adding (abbrev-mode) to the bqn-mode hook.
Happy BQN'ing!
---
β° For the curious