Please sign in to access this page
λ-calculus beta reducer. written in C. As a demo link i've attached a *compiled* static version of this for x86_64 GNU/Linux. If you don't want to compile it from source, wget it and chmod +x it to be able to run test programs from the git repo. Please also make sure that a C.UTF-8 locale is available on your system. It **DOES NOT** work on MS Windows. This is a MVP running only on unix-likes. It runs on my linux machine and my bsd machine. Please make sure you're running it on a unix-like operating system.
No followers yet
Once you ship this you can't edit the description of the project, but you'll be able to add more devlogs and re-ship it as you add new features!
tried adding win32 support and failed miserably. i learned that utf-8 support in windows is an, uhmm shitshow. attached a screenshot of a windows version barfing out total bulcrap because of utf8
Removed bugs in uint8t* -> wchart* buffer conversions. Include ./lib into the final library with linker black magic, so files that are not in eru source tree can include ./lib/* at runtime. I've added a syntax hack that allows an expression to be evaluated at read-time instead of when computing the output. It works like #. in common lisp.
Basically
lst ← #((cons a) b)
output ← lst
will reduce twice, once for lst', and once for
output'.
l've been learning more lambda calculus. found a fatal flaw in my reducer. i'll have to figure out some declarative reduce this first syntax as a hint to it. here are some expressions i have figured out myself:
.include lib/cons.l
.include lib/comb.l
.include lib/math.l
_rev ← λrev.λl.(((null? (cdr l)) ((cons (car l)) nil)) ((append' (rev (cdr l))) (car l)))
rev ← (Y _rev)
_riota ← λriota.λx.(((zero? x) nil) ((cons x) (riota (pred x))))
riota ← (Y _riota)
iota ← λx.(rev (riota x))
_append' ← λappend.λl.λel.(((null? l) ((cons el) nil)) ((cons (car l)) ((append (cdr l)) el)))
append' ← (Y _append') ; l is a list, el is not a list
lst ← ((cons a) ((cons b) ((cons c) nil)))
output ← (rev lst)
I've added symbol interning which has ever so slightly improved performance. Symbol comparasions are now O(1) instead of O(n) where n is the symbols' length.
started not a long time ago. got beta-reduction working. i'm not quite sure how to go about wrongly choosing infinite paths. i don't know if i have to do something about the naivity of my reducer. it can achieve self-reference with the Y combinator (cool!). my pc is too slow to compute 5!. i need to do some optimizations and plumb memory leaks.