Skip to content

Commit 2878dfd

Browse files
author
nullnominal
committed
Merge
2 parents cbe80b0 + cb5882e commit 2878dfd

32 files changed

Lines changed: 1515 additions & 1236 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Install Dependencies
1717
run: |
1818
sudo apt-get update
19-
sudo apt-get install -qq -y clang make fasm mingw-w64 wine64 gcc-aarch64-linux-gnu qemu-user
19+
sudo apt-get install -qq -y clang make mingw-w64 wine64 gcc-aarch64-linux-gnu qemu-user
2020
git clone https://git.sr.ht/~rabbits/uxn11
2121
cd uxn11
2222
make cli

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,13 @@ RSS=\
2323
$(SRC)/targets.rs \
2424
$(SRC)/jim.rs \
2525
$(SRC)/jimp.rs \
26-
$(SRC)/codegen/fasm_x86_64.rs \
2726
$(SRC)/codegen/gas_aarch64.rs \
2827
$(SRC)/codegen/gas_x86_64.rs \
2928
$(SRC)/codegen/mos6502.rs \
3029
$(SRC)/codegen/uxn.rs \
3130
$(SRC)/codegen/ir.rs \
3231
$(SRC)/codegen/bytecode.rs \
3332
$(SRC)/codegen/mod.rs \
34-
$(SRC)/runner/fasm_x86_64_linux.rs \
35-
$(SRC)/runner/fasm_x86_64_windows.rs \
3633
$(SRC)/runner/gas_x86_64_linux.rs \
3734
$(SRC)/runner/gas_x86_64_windows.rs \
3835
$(SRC)/runner/gas_x86_64_darwin.rs \

README.md

Lines changed: 7 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# B Programming Language
22

33
> [!WARNING]
4-
> Compiler is not fully implemented yet.
4+
> The Compiler is not fully implemented yet. Plus on its own it's probably not useful for any serious Software Development. It is fun for Recreational Programming though.
55
66
<p align=center>
77
<img src="./logo/logo_strawberry.png" width=400>
@@ -11,14 +11,14 @@
1111
<sub>Logo by Strawberry 🍓</sub>
1212
</p>
1313

14-
Compiler for the B Programming Language implemented in [Crust](https://github.com/tsoding/crust)
14+
Compiler for the [B Programming Language](https://en.wikipedia.org/wiki/B_(programming_language)) implemented in [Crust](https://github.com/tsoding/crust).
1515

1616
## Dependencies
1717

1818
- [Rust](https://www.rust-lang.org/) - the compiler is written in it;
19-
- [fasm](https://flatassembler.net/) - used as the compiler backend;
19+
- [GCC](https://gcc.gnu.org/) or [Clang](https://clang.llvm.org/) (whatever surves as the `cc` on your POSIX platform) - the `x86_64` and `aarch64` targets generate assembly and pass it to `cc` to assemble and link.
2020

21-
<!-- TODO: document specific dependencies for the rest of the targets. Like mingw32-w64 and wine on Linux for Fasm_x86_64_Windows, etc. -->
21+
<!-- TODO: document specific dependencies for the rest of the targets. Like mingw32-w64 and wine on Linux for gas-x86_64-Windows, etc. -->
2222

2323
## Quick Start
2424

@@ -28,74 +28,11 @@ $ ./build/b -run ./examples/hello_world.b
2828
```
2929

3030
Also check out more examples at [./examples/](./examples/).
31-
32-
## Testing
33-
34-
The project comes with [btest](./src/btest.rs) utility which tests the B compiler. It is built automatically along with the B compiler when you do `make`.
35-
36-
When you run it, it just builds and runs all the tests from the [./tests/](./tests/) folder on all the supported targets and generates a matrix report. Give it a try to see it for yourself:
37-
38-
```
39-
$ make
40-
$ ./build/btest
41-
```
42-
43-
It doesn't crash when it encounters errors, it just collects the statuses of the tests on all the platforms to give an overview of the current state of the compiler.
44-
45-
### Slicing the Test Matrix
46-
47-
If you want to test only on a specific platform you can supply the flag `-t`.
48-
49-
```console
50-
$ ./build/btest -t fasm-x86_64-linux
51-
```
52-
53-
You can supply several platforms.
54-
55-
```console
56-
$ ./build/btest -t fasm-x86_64-linux -t uxn
57-
```
58-
59-
If you want to run a specific test case you can supply flag `-c`.
60-
61-
```console
62-
$ ./build/btest -c upper
63-
```
64-
65-
You can do several tests.
66-
67-
```console
68-
$ ./build/btest -c upper -c vector
69-
```
70-
71-
And of course you can combine both `-c` and `-t` flags to slice the Test Matrix however you want.
72-
73-
```console
74-
$ ./build/btest -c upper -c vector -t fasm-x86_64-linux -t uxn
75-
```
76-
77-
Both flags accept [glob](https://en.wikipedia.org/wiki/Glob_(programming)) patterns.
78-
79-
```console
80-
$ ./build/btest -t *linux -c *linux
81-
```
82-
83-
If you want to exclude a specific platform you can supply the flag `-xt`.
84-
85-
```console
86-
$ ./build/btest -xt fasm-x86_64-linux
87-
```
88-
89-
`-xt` also accepts [glob](https://en.wikipedia.org/wiki/Glob_(programming)) patterns.
90-
91-
```console
92-
$ ./build/btest -xt *-linux
93-
```
31+
Find the project documentation at [./docs/](./docs/).
9432

9533
## References
9634

9735
- https://en.wikipedia.org/wiki/B_(programming_language)
9836
- https://www.nokia.com/bell-labs/about/dennis-m-ritchie/kbman.html
99-
- https://github.com/tsoding/good_training_language
100-
- https://www.felixcloutier.com/x86/
101-
- https://www.scs.stanford.edu/~zyedidia/arm64/
37+
- https://www.nokia.com/bell-labs/about/dennis-m-ritchie/bref.html
38+
- https://www.nokia.com/bell-labs/about/dennis-m-ritchie/btut.html

docs/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Documentaiton
2+
3+
This folder contains various documents regarding the project
4+
5+
- [btest.md](./btest.md) - documents the testing tool.
6+
- [bext.md](./bext.md) - documents the B extensions and deviations from the original [kbman](https://www.nokia.com/bell-labs/about/dennis-m-ritchie/kbman.html) document.

docs/btest.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# btest
2+
3+
The project comes with [btest](../src/btest.rs) utility which tests the B compiler. It is built automatically along with the B compiler when you do `make`.
4+
5+
When you run it, it just builds and runs all the tests from the [../tests/](./tests/) folder on all the supported targets and generates a matrix report. Give it a try to see it for yourself:
6+
7+
```
8+
$ make
9+
$ ./build/btest
10+
```
11+
12+
It doesn't crash when it encounters errors, it just collects the statuses of the tests on all the platforms to give an overview of the current state of the compiler.
13+
14+
## Slicing the Test Matrix
15+
16+
If you want to test only on a specific platform you can supply the flag `-t`.
17+
18+
```console
19+
$ ./build/btest -t gas-x86_64-linux
20+
```
21+
22+
You can supply several platforms.
23+
24+
```console
25+
$ ./build/btest -t gas-x86_64-linux -t uxn
26+
```
27+
28+
If you want to run a specific test case you can supply flag `-c`.
29+
30+
```console
31+
$ ./build/btest -c upper
32+
```
33+
34+
You can do several tests.
35+
36+
```console
37+
$ ./build/btest -c upper -c vector
38+
```
39+
40+
And of course you can combine both `-c` and `-t` flags to slice the Test Matrix however you want.
41+
42+
```console
43+
$ ./build/btest -c upper -c vector -t gas-x86_64-linux -t uxn
44+
```
45+
46+
Both flags accept [glob](https://en.wikipedia.org/wiki/Glob_(programming)) patterns.
47+
48+
```console
49+
$ ./build/btest -t *linux -c *linux
50+
```
51+
52+
If you want to exclude a specific platform you can supply the flag `-xt`.
53+
54+
```console
55+
$ ./build/btest -xt gas-x86_64-linux
56+
```
57+
58+
`-xt` also accepts [glob](https://en.wikipedia.org/wiki/Glob_(programming)) patterns.
59+
60+
```console
61+
$ ./build/btest -xt *linux
62+
```
63+
64+
`-xc` is just like `-xt` but for test cases.
65+
66+
```console
67+
$ ./build/btest -xt *linux -xc asm*
68+
```
69+
70+
<!-- TODO: document -a <action> and tests.json -->

0 commit comments

Comments
 (0)