Aboa ("the good" in Portuguese) is a programming language that melds the best aspects of other programming languages together with a few new ideas into an alloy of surpassing quality.
- Interactive ... Lisp, Smalltalk
- Beautiful ... APL, Uiua
- Ubiquitous ... C, Python
- Uncompromising ... Haskell, Rust
- Minimal ... Erlang, Scheme
- Sublime ... BQN, Idris, LFE, Racket
- Monetization
- Accomodation
- Mass adoption
- Ease of learning
- Code generation
- Packaging
Aboa syntax is a work-in-progress, previously based on Scheme R7RS, but now deviating quite far away from Lisps, with the following differences:
-
Like Scheme, there are only expressions, no statements whatsoever. The topmost level is a single expression that contains 0 or more nested expressions within.
-
Unlike Scheme, not all expressions must be bounded by lists (...).
-
Also unlike Scheme, every expression is essentially a function that takes one argument which is always a list of 0 (empty), 1, or more values, and produces a single list of 0, 1, or more values.
-
Even more unlike Scheme--and most other languages--expressions and their values within are evaluated from left to right, top to bottom, one after the other in a pipe-like sequence, the result of each previous expression becoming the argument to the next expression to its right, or below on the left side of the next line. Thus nested expressions, are neither evaluated nor executed until they are encountered. This supports a single pass during interpretation.
aboa Scheme semantics
# ; comment
'symbol 'symbol symbol literal
"..." "..." string literal
_ argname expression input argument reference, single list in aboa, one or more in Scheme
_n argname nth list element of input argument reference
/_ argname expression input of previous scope, one level per /
: '() empty value
(^ ...) declare anon function (pure)
(> ...) (lambda ...) declare anon procedure (effectful)
^(...) (...) apply right function expression (pure), left to right
>(...) (...) apply right procedure expression (effectful), left to right
(...) (...) bounds of expression scope, applied when under active apply
name = (define bind name to immutable right value: literal, func, proc
name =< (define bind name to mutable right value: literal, func, proc
^name apply bound function, its one argument comes from its left
>name (p ...) apply bound procedure, in aboa its one argument comes from its left
<) (p ...) tail recursion to beginning of expression
/<) tail recursion outward one level per /
=> name (set! name mutate variable
== = equal so it's 2 characters long like !=
!= != not equal
<= <= less than or equal
<< < less than so it's 2 characters long like <=
>= >= greater than or equal
>> > greater than so it's 2 characters long like >=
=| = member of list, returns bitmask with 1 for each match
:8 ...->char monadic convert to byte (include ASCII char)
:f ...->float monadic convert to float 64
:i ...->integer monadic convert to integer 64 (bool is 0 and 1)
:u ??? monadic convert to UTF-8 code point
? if conditional, may become generalized with Scheme "cond"
?/_ if if instead passes input of previous scope through on false
! ... on fail provide result
.. range of left value to right value
, dyadic append values together into a list
~ dyadic catenate values L to R
& fold
@ (eval interpret value as aboa syntax, return result
$ standard library name prefix
OLD SCHEME EQUIVALENT SYNTAX:
& fold block scope may be eliminated if global scope is eliminated
: : **type *only found in Chicken Scheme and Racket
% **prim type e.g. % int, .% float, "" string, etc.
#!/usr/bin/env aboa
#:aboa-v-00-01
# Bye Bye Hello World
==: ? ("countdown: " >$io.si) _
:i ! ("Invalid countdown "~_1~", try again...\n" >$io.sof : </)
("World, Hello..." >$io.sof)
_..0 & (> _2~"..." >$io.sof 1 >$cc.sleep)
"Bye Bye.\n" >$io.sof-
Functional programming paradigm only; no object-orientation.
-
All special forms/reserved keywords are symbols, never words. Words are used exclusively by user/library definitions and can always be redefined whereas symbols cannot.
-
Parentheses ( ) like in Lisp to achieve data-as-code, clearly establish syntax boundaries (i.e not relying upon indentation or line-breaks), and make code appear obviously as code when read.
-
No curly braces because they can be difficult to type on international keyboards and mark a programming language as a descendent from C, which Aboa is not.
-
Comments start with # (hash/pound) because it is the most readable and common (Elixir, F#, Julia, Perl, Python, R, Ruby, Shell, Tcl).
-
Top of all source files (after #! if present) declare a language+version for its syntax, akin to #lang in Racket.
-
No package management or pre-built distribution. Reuse is assumed to be achieved by inclusion of other sources, however they are acquired (e.g. git, tarball) and arranged (e.g. copied, symlinked, submodule).
-
Enforcement between functions that have no side-effects (declared by name(^ ...) or (^ ...) for lambda) and procedures that have side-effects (declared by name(> ...)) and called by >name(name ...).
-
No English words predefined by the syntax, although the standard library is.
-
WIP: aboa-s7 embeddable C
- derived from s7
-
WIP: POSIX shell
-
TODO: on the Erlang BEAM
- plan to derive from LFE
-
TODO: within its own VM
- plan to derive from Chez Scheme
-
TODO: possibly? web via Wasm ...
- aboa-vim ViM configuration for the aboa syntax and color scheme