This commit is contained in:
parent
a1634554bf
commit
96b9c1bf8d
1 changed files with 55 additions and 8 deletions
|
@ -1,8 +1,6 @@
|
||||||
# q
|
# q
|
||||||
|
|
||||||
A programming language that quickly compiles to machine code.
|
A programming language including compiler, assembler and linker with the following goals:
|
||||||
|
|
||||||
## Goals
|
|
||||||
|
|
||||||
- Fast compilation
|
- Fast compilation
|
||||||
- High performance
|
- High performance
|
||||||
|
@ -10,45 +8,94 @@ A programming language that quickly compiles to machine code.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
Build:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git clone https://git.urbach.dev/cli/q
|
git clone https://git.urbach.dev/cli/q
|
||||||
cd q
|
cd q
|
||||||
go build
|
go build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Symlink:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
ln -s $PWD/q ~/.local/bin/q
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
Build:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
q build examples/hello
|
q build examples/hello
|
||||||
|
```
|
||||||
|
|
||||||
|
Run:
|
||||||
|
|
||||||
|
```shell
|
||||||
./examples/hello/hello
|
./examples/hello/hello
|
||||||
```
|
```
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
|
To run all tests:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
go run gotest.tools/gotestsum@latest
|
go run gotest.tools/gotestsum@latest
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Every package must pass its unit tests.
|
||||||
|
|
||||||
|
The code coverage should ideally be around 80-100% for each package.
|
||||||
|
|
||||||
|
Integration tests that test the output of the produced executables are located in the dedicated `tests` directory.
|
||||||
|
|
||||||
## Platforms
|
## Platforms
|
||||||
|
|
||||||
You can cross-compile executables for Linux, Mac and Windows using arm64 or x86-64.
|
### Matrix
|
||||||
|
|
||||||
|
| | arm64 | x86-64 |
|
||||||
|
| ------- | ------ | ------ |
|
||||||
|
| Linux | ✔️ | ✔️ |
|
||||||
|
| Mac | ✔️* | ✔️ |
|
||||||
|
| Windows | ✔️* | ✔️ |
|
||||||
|
|
||||||
|
Those marked with a star are supported in theory but there are no developer machines to test them.
|
||||||
|
|
||||||
|
### Cross compilation
|
||||||
|
|
||||||
|
Compilation for a different target is supported out of the box:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
q build examples/hello --os linux
|
q build examples/hello --os linux
|
||||||
q build examples/hello --os mac
|
q build examples/hello --os mac
|
||||||
q build examples/hello --os windows
|
q build examples/hello --os windows
|
||||||
|
```
|
||||||
|
|
||||||
|
```shell
|
||||||
q build examples/hello --arch x86
|
q build examples/hello --arch x86
|
||||||
q build examples/hello --arch arm
|
q build examples/hello --arch arm
|
||||||
```
|
```
|
||||||
|
|
||||||
| CPU | Linux | Mac | Windows |
|
## Security
|
||||||
| ------ | ----- | --- | ------- |
|
|
||||||
| arm64 | ✔️ | ❔ | ❔ |
|
### PIE
|
||||||
| x86-64 | ✔️ | ✔️ | ✔️ |
|
|
||||||
|
All executables are built as Position Independent Executables (PIE) supporting a dynamic base address.
|
||||||
|
|
||||||
|
### Memory pages
|
||||||
|
|
||||||
|
Code and data are separated into different memory pages and loaded with different access permissions.
|
||||||
|
|
||||||
|
| | Read | Execute | Write |
|
||||||
|
| ------ | ---- | ------- | ----- |
|
||||||
|
| Code | ✔️ | ✔️ | ❌ |
|
||||||
|
| Data | ✔️ | ❌ | ❌ |
|
||||||
|
|
||||||
## Status
|
## Status
|
||||||
|
|
||||||
`q` is under heavy development and not ready for production yet.
|
`q` is under heavy development and not ready for production yet.
|
||||||
|
|
||||||
Feel free to [get in touch](https://urbach.dev/contact) if you are interested in helping out.
|
Feel free to [get in touch](https://urbach.dev/contact) if you are interested in helping out.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue