Hi ports --
Attached is a new port, lang/cowgol. Cowgol is a self-hosted
Ada-inspired language for small systems.
---
pkg/DESCR:
Cowgol is an experimental, Ada-inspired language for very small systems
(6502, Z80, etc). It's different because it's intended to be self-hosted
on these devices: the end goal is to be able to rebuild the entire
compiler on an 8-bit micro, although we're not there yet.
Features:
* Properly type safe, modern language inspired by Ada
* The compiler is written in itself and is fully bootstrapped
* Table-driven, easy to port backend (the 80386 backend is 1.2kloc
with no other compiler changes needed)
* Global analysis: dead code removal and static variable allocation,
leading to small and efficient binaries
The following targets are supported:
* Z80 and 8080, on CP/M
* 6502 and 65c02, on the BBC Micro with Tube second processor
* 6502 interpreted bytecode, on the BBC Micro with Tube second
processor
* 80386, on Linux
* Generic and terrible C
Simple emulators for CP/M and the BBC Micro are included.
---
You will need the devel/gpp and devel/zmac ports previously posted.
Compiling with Cowgol is not as straightforward as it is with a C
compiler. Perhaps because of its target environment, it takes 4 steps
to produce an executable, all of which must be done manually (there is
no compiler driver).
First is cowfe, the frontend, whose syntax is cowfe [-Iinclude-path/]
input.cow output.cob. You can have more than one -I but each must end
in a /. Next is cowbe, whose syntax is cowbe input.cob output.coo.
Next is cowlink, whose syntax is cowlink /path/to/standard/lib.coo
input.coo [input2.coo ... ] -o output. Finally, you can take that
output and run it through your final assembler which will be one of
the C compiler, 64tass, or zmac, depending on which CPU you are
targeting.
If you just want to produce native binaries for your OpenBSD machine,
I have provided some wrapper scripts that take care of adding the
correct -I flags for cowfe and /path/to/standard/lib.coo paths for
cowlink. But you probably don't want to do that. You probably want to
either cross compile for your target machine or drop the compiler
binaries and runtime files onto your target machine from OpenBSD
(included in this package) and run it all natively there. See the
Makefile for an explanation of all the different binaries and what
they mean.
Only tested on amd64 (it's little endian only for now).
OK?
~Brian
No comments:
Post a Comment