REPOSITORY OVERVIEWLive repository statistics
★ 34Stars
⑂ 1Forks
◯ 10Open issues
◉ 34Watchers
66/100
OPENREPOHUB HEALTH SIGNALHealthy signals
A transparent discovery signal based on current public GitHub metadata.
Recent activity35% weight
100 Community adoption25% weight
23 Maintenance state20% weight
40 License clarity10% weight
100 Project information10% weight
75 This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
README preview
#+TITLE:Lamber, a Simple Language
Lamber is a minimalist functional programming language with a focus on graspability, readability...
and compilation to pure untyped Lambda Calculus, of course!
It's inspired by Lua, Haskell, and Wisp.
And it smells of creamy cheese!
#+begin_src lua
def factorial function (n)
if (= n 0)
then 1
else
- n : factorial : dec n .
#+end_src
Step by step:
- You can bind things to names/variables (like
factorial) with let, def, local, and var. All of these do the same thing, so pick the one you like the most.
- Functions are all there is to Lamber. It compiles to raw lambdas, after all. It's only consequential that things you bind to vars are
fn-s, lambda-s,a nd function-s.
- There's
if/when to do conditional checks. With else branches and else if chaining. Boring stuff, right?
- There's no need for explicit
return statement, because the last form in the function/branch is the return value.
- So factorial returns either
1 or... wait, I need to explain some more.
- Functions are prefix in Lamber, so
= n 0 means "n is equal to zero" and dec n means decreasing n.
- There's no looping in Lamber, only recursion.
- Luckily, first-class functions and abundance of list processing utilities in the standard library make explicit looping unnecessary in most cases.
- There are several special syntax pieces, mostly stolen from [[https://srfi.schemers.org/srfi-119/][Wisp]]:
: colon to chain function calls. Lamber emphasizes composable functions that are easy to chain, as in * n : factorial : dec n:
- Decrease n.
- Call
factorial on it.
- And multiply the result by
n.
. period is a shortcut for end (like in Lua and the kind.) You can do explicit end too, but it's not as pretty:
#+begin_src lua
else
,* n : factorial : dec n
end
#+end_src
- Values
There's a number of guiding principles Lamber is built around:
- Minimalism :: If something is not absolutely necessary, it's not going to be there.
- Cognitive :: All there is in the language should fit into one moderately overwhelmed programmer's head.
- Footprint :: Implementation should be small enough.
- Build :: All the libraries and apps are provided as files on CLI or in
LAMBER_PATH and sorted lexicographically. Want to load your lib earlier? Just rename the file!
- Syntactical :: There shouldn't be more than ten pieces of syntax in the language.
- As of the moment of writing, there are eight:
let / def etc. variable definition.
if branching.
function-s.
type-s.
- Literal values, like booleans, numbers, and strings.
- Function calls.
- Colons.
- Periods.
- Readability :: Lambda Calculus is scary. Lua is not. Lamber tries to be somewhere in between the two, with the bias towards Lua.
- Functional design :: Functional programming won, and you have to live with it. Make your functions composable and higher-order. And no side-effects (well, there's [[./lib/8000-io.lmb]], but hush!)
- Installation & Getting Started
- Clone the repo:
#+begin_src sh
git clone --recursive https://github.com/aartaka/lamber
#+end_src
- Install a Lisp implementation like [[https://sbcl.org/][SBCL]].
- Compile the
lamber executable with make all
- Use the generated
lamber as in
#+begin_src sh
./lamber example/hello.lmb
Hello, world!
./lamber example/factorial.lmb int
120
#+end_src