💾 Archived View for thingvellir.net › bass.gmi captured on 2024-07-08 at 23:54:38. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-04-19)

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

bass, The B.+ Awful Scripting System

A horrifically mutilated Scheme-like mess of lexical tokens reminiscent of Brainfuck. (All of the built-in identifiers are soley punctuation; I guess this language is kinda meat-language independent?)

The title is a regular expression; B.+ is any word of your choice starting with B to describe your anguish at or hatred of this language.

Types

There are 5 data types.

Syntax

Comments begin with a semicolon and end with an ASCII line-feed character.

Expressions begin with '(' and end with ')'.

Lists begin with '[' and end with ']'.

Strings begin and end with a double-quote. Double-quotes can be written inside strings by placing two directly next to eachother.

Built-in Functions

Formal-ish Kinda-EBNF Grammar

comment = ';' [^\n]* ;
none    = '(' ')' ;
(* [0-9] is just an example, the base is implementation-defined :) *)
integer = '-'? [0-9]+ ;
string  = '"' ('""'|[^"]) '"' ;
symbol  = [^0-9;$ ]+ [^; ]* ;
atom    = none | integer | string | symbol ;
list    = '[' (atom | list)+ ']' ;
expr    = '(' (atom | list | expr)+ ')';

Examples

;;; hello world
(! "hello, world")

;;; condition
(<- example (~ ()))
(? example
  [[()     (! "example is false")]
   [(~ ()) (! "example is true")]])

;;; list concatenation
(! (>< [1 2 3] [4 5 10]))

;;; arithmetic
(! (+ 2 2))

;;; function
(<- square (. [n]
  (* n n)))

;;; a kind of associative array
(<- my-array
  [["name"        "Ada"]
   ["gender"      ":)"]
   ["prefers-tau" (~ ())]])
(! (? "name" my-array))

;;; making bass more like a regular scheme
(<- define <-)
(<- car ^<)
(<- cdr ^>)
(<- cond ?)
(<- display !)
(<- lambda .)