A scheme inspired s-expression based functional language
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Bryan c13142cd92 Merge low-memory (and file-read-mmap) into main
The whole-file read buffer, the value stack and the symbol table leave the
bss for MAP_NORESERVE mappings made in rt_init, so a program no longer asks
for 330 MiB at execve; asm2 streams its records and lin2 re-reads objects
and builds the image in place; write-file! takes a list of bytes; the
native compiler bounds -j by the machine's memory.

Conflicts with what main gained since 2026-09-27:
- runtime-text: main's hashed, weak symbol table has five symtab
  references, each now loads symtab_base. The heap floor and heap/8 forced
  growth were already on main (f07369b), so the branch's copy is dropped.
  The new mappings get the same MADV_NOHUGEPAGE main gives the bss
  (97a17e1); without it a huge page would come back over the value stack.
- lin2: main's three program headers (code read-and-run, bss on a page of
  its own read-and-write, GNU_STACK) are written into the first
  headers-size bytes of the in-place image the branch builds.
- gen1, gen3: the prelude strings merged cleanly line by line.

scripts/regress.sh passes, 720 fixtures matching the baseline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:55:11 +01:00
bin stage2 and gen1 fail loudly on a file they cannot open; the seeds checked 2026-10-21 19:12:27 +02:00
examples runtime: %memory-add!, a locked add in shared memory 2026-10-25 18:04:16 +01:00
lib Merge low-memory (and file-read-mmap) into main 2026-10-26 17:55:11 +01:00
scripts runtime: solid's rows apart, linked only into programs that use them 2026-10-25 19:21:21 +01:00
src Merge low-memory (and file-read-mmap) into main 2026-10-26 17:55:11 +01:00
.gitignore M23 fix 2026-09-13 20:07:21 +02:00
LICENSE cleaning up output and moving docs out of repo 2026-09-26 10:55:31 +02:00
README Updating compiler 2026-10-25 10:15:40 +01:00
VERSION Version included 2026-09-25 16:01:47 +02:00

# Talc - translate, assemble, link, compile

Talc is a programming language and toolchain that turns .talc programs into
something a computer can run. Those tools are a translator, assembler, linker 
and a front-end compiler that can call all three of these. Talc the name was
a suggestion by a user on the Discord server for "Extractions & Ire".
Otherwise, I would have just called it programming language.

The language takes inspiration from Scheme but it doesn't follow any of the
Scheme standards and is opinionated about where it departs. Expressions are
written in prefix notation as is the custom for lisp/scheme family of
languages. There is no C and no dependency on libc. It runs on a 64-bit
Linux system and can also build UEFI firmware applications like bootloaders.

## Attribution

Despite instructing a clanker to assemble this library over a number of
weeks, it doesn't really feel like mine or anybody in particular.
Additionally, this wouldn't have been possible by a single individual
because the people who blazed this trail with nothing other than intuition
didn't have a robot they could just ask to do it. Furthermore, there are
definitely transliterations in this library where the LLM undoubtedly
reached to the already existing C implementations on how to build and test
this. 

For portions that I could find I think it's appropriate to mention it and
should anybody see other strong correlations between certain codes and
other libraries I'd appreciate reporting it to also have some way to trace
parts this language and anything built using it back to where the real idea
came from.

## Bootstrapping

- Stage0 - Takes hex ASCII and converts to bytes
- Stage1 - Above with labels for jump distance calculation
- Stage2 - Assembler that can read mnemonics, mov, jmp
- Stage3 - Tiny core language, only compiles gen1
- gen1   - Tiny core with garbage collection
- gen2   - Primitive language extensions, built via gen2
- gen3   - Runtime and garbage collection
- gen4   - Current toolchain with libraries 

## Installing

Any x86-64 Linux system will do. Even though the compiler is self-hosting
you will still need a shell and filesystem available to actually install
and run it. 

First build the toolchain

> scripts/bootstrap.sh

Then install the binaries to a PREFIX directory

> scripts/install.sh $HOME/.local/talc

## Usage

> compiler <program-file.talc> <program-name> [<library-dir> ...]

The output file is a Linux ELF binary and can be run like any executable