blog

This is the TAO blog. See also djedr.github.io/writing and github.com/jevko/writing for more writing.

Meanwhile, here is the latest post.

Binary Lambda Calculus implemented as a shell on top of λDNA

Darius J Chuck

2024-01-18

This is just a short note about something cool I made with the previously announced λDNA programming language.

I meant to write a proper blog post about this some time ago, but in case that doesn’t materialize, I am reposting a lightly edited Discord message.


Here is something pretty cool:

A Hello World generated by a Brainfuck program running on a Brainfuck interpreter running on the BLC8 universal machine running on BLC8 (all this wizarded up by John Tromp) implemented as a shell on top of λDNA, all written in pure JS and (hopefully :D) running in your browser:

https://xtao.org/ldna/blc8.html#urls[[uni.Blc][bf.Blc][hw.bf]]

And here it is running John’s Hilbert curve drawing program:

https://xtao.org/ldna/blc8.html#urls[[hilbert.Blc]]texts[[aaaa][]]

All this is to say that I played around with the thing further and managed to throw together implementations of BLC and BLC8 as “shells” on top of λDNA to demonstrate the idea.

Online versions of the shells for BLC and BLC8 are here:

I mirrored some of the BLC programs from Justine Tunney’s SectorLambda post here:

They can be loaded into the shells either by clicking the buttons marked ‘load program’ at the top or by drag&dropping a program link onto the page.

I also added a crude mechanism for sharing which should help with collaborative debugging, etc. All input you enter is serialized into a URL at the top of the page which you can copy-paste to share your session. The URL is automatically wrapped in <>, so it will display correctly on Discord.

Seems like all programs work – although beware primes.blc which generates an infinite sequence of primes. This will eventually hang/crash the browser tab as memory fills up.

Implementing all this I found that my original input idea was a bit too simplistic, so I had to adjust it slightly to restore referential transparency. Now that the whole thing can run the BF interpreter and the universal machines, I am more confident that it works in the general case and it is possible to implement different I/O protocols/shells on top of λDNA.

It’s all very rough and the code is a mess at the moment, but it’ll have to do for now. It is published here: https://codeberg.org/xtao-org/ldna/

Anyway, I hope you folks find this as fun and interesting as I did. Let me know if you find any bugs, run into any problems or have any questions.

PS Here is a song to listen to when playing around with this:

Become a supporter

I prefer to share my creations for free. However living and creating without money is not possible for me. So I ask companies and people, who want and can, for support. Every symbolic cup of coffee counts!

Buy Me a Coffee at ko-fi.com   Postaw mi kawę na buycoffee.to

Thank you!

Darius J Chuck

Archive

Binary Lambda Calculus implemented as a shell on top of λDNA 2024-01-18

JsonHilo.js Githelp trial 2023-12-08

λDNA programming language 2023-12-04

Meditating on the Wizard Book and language design 2023-12-01

Introducing nuklĕus, a minimal IDE for LAST 2023-11-28

Revelation: Lambda Calculus Reduced To Four Primitive Operations 2023-07-23

Multistrings: a simple syntax for heredoc-style strings 2023-05-25

Encodings for numbers in lambda calculus 2022-09-29

Introduction to the LAST programming language 2022-09-01

Introducing Jevko: a minimal general-purpose syntax 2022-02-22

Writing about Jevko on GitHub 2022-01-21

Semantics of JSON 2021-12-18

Alternative description of Data Jevko 2021-12-10 12:45

Alternative grammar for Jevko 2021-12-10 12:00

Formal grammar for Data Jevko 2021-12-10

Jevko: a zero waste syntax 2021-12-09

Minimal syntax for phylogenetic trees 2021-12-06

Minimal syntax for rose trees 2021-11-27

JsonHilo.js – ultra-fast lossless JSON parse event streaming 2021-07-29

One year of TAO 2021-07-21

One-escape TAO 2021-07-16

TAO in one line 2021-07-09

The best format for multiple-word identifiers 2021-07-07

Square brackets 2021-07-05

Fixing S-expressions: overnesting on the left 2021-06-29

xtao.org 2021-06-10

Operator, please dial the number 2021-06-04

Fixing CSV 2021-06-04

Streaming spreadsheets 2021-06-03

Nested query params 2021-06-02

No escaping 2021-06-01

TAO blog and public newsletter 2021-04-08