💾 Archived View for idiomdrottning.org › brev captured on 2021-11-30 at 19:37:34. Gemini links have been rewritten to link to archived content

View Raw

More Information

➡️ Next capture (2022-06-11)

-=-=-=-=-=-=-

brev

Scheme is a beautiful minimalist language, the barest of building blocks that can make anything.

So let’s make anything.

I just want to sand down every edge. I’m sick of boilerplate and of re-typing things that the compiler should do.

In other words, I love anaphora, clojurian, miscmacros and similar. I sometimes wish I could use a language where all that stuff was just built-in right away.

Hence brev.

It depends on and reexports the following extensions as is:

From sxml-transports it reexports pre-post-order* and pre-post-order-splice*, from sxpath it rexeports the eponymous sxpath procedure, and from bi-combinators it reexports the exceptionally useful bi-each combinator.

From uri-common it reexports everything but from some (not all!) of the procedures it removes “uri-“ or ”-uri” from the name, as follows:

(rename uri-common
        (uri-reference reference)
        (absolute-uri absolute)
        (uri-path path)
        (uri-query query)
        (uri-fragment fragment)
        (uri-host host)
        (uri-reference? reference?)
        (absolute-uri? absolute?)
        (uri-path-absolute? path-absolute?)
        (uri-path-relative? path-relative?)
        (uri-relative-to relative-to)
        (uri-relative-from relative-from))

Compiling brev code

.brev files are scheme files that have an implicit (import brev mdg) at the start of them.

On zsh and bash you can use

csc -prologue <(echo "(import brev mdg)") your-file-name.brev

to compile them.

On POSIX, you can use this shell script:

#!/bin/sh
echo "(import brev mdg)" > /tmp/brev-prol.scm
csc -prologue /tmp/brev-prol.scm "$@"

This is provided in the egg repo with the name brev. It also passes through any other flags you add, like -O3 or whatever.

brev -O3 your-file-name.brev

This is great for quick little apps and pocs and explorations.

If you are making modules (especially if you are making eggs), instead please just make them as normal .scm files that import only the modules they actually need, including brev-separate if needed. There is a brev2scm program included that helps you do that.

.brev files in Emacs

Just add

(add-to-list 'auto-mode-alist '("\\.brev$" . scheme-mode))

in your init file to load .brev files with scheme-mode. (Or change to taste if you like other modes for your scheming.)

Source code

git clone https://idiomdrottning.org/brev

License

Brev is just a meta package so it’s up to the license of stuff it links in. The meta-package itself is just public domain. The new stuff in brev-separate is BSD 1-clause.

Mailing list

Subscribe: brev-dev+subscribe@zebra.idiomdrottning.org

Post: brev-dev@zebra.idiomdrottning.org