Skip to content

Commit fc47fe5

Browse files
committed
Document dependencies for the "spicy" targets
1 parent ad90b6b commit fc47fe5

1 file changed

Lines changed: 44 additions & 8 deletions

File tree

README.md

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313

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

16-
## Dependencies
17-
18-
- [Rust](https://www.rust-lang.org/) - the compiler is written in it;
19-
- [GCC](https://gcc.gnu.org/) or [Clang](https://clang.llvm.org/) (whatever serves as the `cc` on your POSIX platform) - the `x86_64` and `aarch64` targets generate assembly and pass it to `cc` to assemble and link.
20-
21-
<!-- TODO: document specific dependencies for the rest of the targets. Like mingw32-w64 and wine on Linux for gas-x86_64-Windows, etc. -->
22-
2316
## Quick Start
2417

2518
```console
@@ -30,6 +23,49 @@ $ ./build/b -run ./examples/hello_world.b
3023
Also check out more examples at [./examples/](./examples/).
3124
Find the project documentation at [./docs/](./docs/).
3225

26+
## Dependencies
27+
28+
Generally, to write programs for the three major contemporary platforms (Linux, Windows, Darwin) you need only these things:
29+
30+
- [Rust](https://www.rust-lang.org/) - the compiler is written in it;
31+
- [GCC](https://gcc.gnu.org/) or [Clang](https://clang.llvm.org/) or [mingw-w64](https://www.mingw-w64.org/) (whatever serves as the `cc` on your POSIX platform) - the `x86_64` and `aarch64` targets generate assembly and pass it to `cc` to assemble and link.
32+
33+
If you feel like playing with our "spicy" targets, you will need to setup few additional things.
34+
35+
### uxn
36+
37+
[Uxn](https://100r.co/site/uxn.html) is a pretty cool small virtual machine designed to be simple and portable.
38+
39+
This compiler toolchain expects the `uxnemu` and `uxncli` executables to be available in the `$PATH` environment variable. We recommend to build them from the source code available at [https://git.sr.ht/~rabbits/uxn](https://git.sr.ht/~rabbits/uxn). Follow their build instructions and then copy the contents of the `bin/` folder somewhere were the `$PATH` points at.
40+
41+
### 6502-posix
42+
43+
[MOS Technology 6502](https://en.wikipedia.org/wiki/MOS_Technology_6502) is a legendary processor that was used in such systems as the Atari 2600, Atari 8-bit computers, Apple II, Nintendo Entertainment System, Commodore 64, Atari Lynx, BBC Micro and others.
44+
45+
Since "targeting 6502" doesn't really mean anything, given the diverse array of hardware, we created a special target called [posix6502](https://github.com/bext-lang/posix6502). It's a simple 6502 emulator that exposes some POSIX functionality to programs running on the 6502 processor, allowing them to operate in a POSIX environment. We use it as a testing and playground target for 6502 codegen. In the future, we may add more 6502-related targets.
46+
47+
It consist of a single `posix6502` executable which is expected to be available to the compiler toolchain via the `$PATH` environment variable. We recommend to build it from the source code:
48+
49+
```console
50+
$ git clone https://github.com/bext-lang/posix6502 && cd posix6502
51+
$ cc -o nob nob.c
52+
$ ./nob
53+
```
54+
55+
Copy the `build/posix6502` executable somewhere were the `$PATH` points at.
56+
57+
### ilasm-mono
58+
59+
This target tries to produce [.NET](https://dotnet.microsoft.com/en-us/)/[Mono](https://www.mono-project.com/) compatible binaries. It's currently a work-in-progress and does not have anything useful implemented in it.
60+
61+
The compiler toolchain expects `ilasm` and `mono` executables available in the `$PATH` environment variables. Lots of Linux distros make them available via the mono packages in their official repos:
62+
63+
```consols
64+
$ sudo xbps-install mono # Void Linux
65+
$ sudo apt install mono-devel # Ubuntu
66+
...
67+
```
68+
3369
## Contribution
3470

3571
Accepting Pull Requests is currently paused. We are in the middle of [Decentralizing](https://github.com/tsoding/b/issues/62) this repo. The plan is
@@ -38,7 +74,7 @@ Accepting Pull Requests is currently paused. We are in the middle of [Decentrali
3874
2. Keep `*x86_64*` and `*aarch64*` codegens in the main repo.
3975
3. Move codegens [6502](./src/codegen/mos6502.rs) (owner [@Miezekatze64](https://github.com/miezekatze64)), [uxn](./src/codegen/uxn.rs) (owner [@deniska](https://github.com/deniska)), [gas-sh4dsp-prizm](https://github.com/tsoding/b/pull/175) (owner [@seija-amanojaku](https://github.com/seija-amanojaku)) to separate repos within the organization and give the owners full admin access to them.
4076

41-
You can still submit PRs in the meantime. Just don't expect them to be reviewed any time soon since decouping codegens requires extensive refactoring. They will be addressed eventually.
77+
You can still submit PRs in the meantime. Just don't expect them to be reviewed any time soon since decoupling codegens requires extensive refactoring. The PRs will be addressed eventually.
4278

4379
## References
4480

0 commit comments

Comments
 (0)