aboutsummaryrefslogtreecommitdiff
path: root/readme.md
blob: 451ef6782c25fcc0cd5f7e367e3f7c25bbb8c1a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# BLoC

This project proposes a file format for programs encoded in binary
lambda calculus. Its main goal is minimal redundancy and therefore
allowing maximal optimzation.

It’s kind of inspired by ELF.

## Format

It’s assumed that all bit-encoded strings are padded with zeroes at the
end.

### Header

| from | to   | content            |
|:-----|:-----|:-------------------|
| 0x00 | 0x04 | identifier: “BLoC” |
| 0x04 | 0x?? | entries            |
| 0x?? | 0x?? | structure          |

### Entry

| from | to   | content                           |
|:-----|:-----|:----------------------------------|
| 0x00 | 0x02 | length of BLC expression in bytes |
| 0x02 | 0x?? | bit-encoded BLC expression        |

The final entry is represented by an entry size of 0.

### Structure

This reflects the basic structure of the program and can’t use
variables. Instead, the structure entry uses the following derivation of
normal bit-encoded BLC:

| prefix   | content                      |
|:---------|:-----------------------------|
| 00M      | abstraction                  |
| 01MN     | application                  |
| 1<entry> | 2 byte reference to an entry |