Improved documentation
This commit is contained in:
parent
a7afd680da
commit
8974b8b0aa
12
README.md
12
README.md
@ -56,9 +56,15 @@ q build examples/hello --dry
|
||||
The `Build` type defines all the information needed to start building an executable file.
|
||||
The name of the executable will be equal to the name of the build directory.
|
||||
|
||||
`Run` starts the build which will scan all files in the build directory.
|
||||
The functions found in the scan will be translated to generic assembler instructions.
|
||||
All the functions that are required to run the program will be added to final assembler.
|
||||
`Run` starts the build which will scan all `.q` source files in the build directory.
|
||||
Every source file is scanned in its own goroutine for performance reasons.
|
||||
Parallelization here is possible because the order of code in a directory is not significant.
|
||||
|
||||
The main function is meanwhile waiting for new function objects to arrive from the scanners.
|
||||
Once a function has arrived, it will create another goroutine for the function compilation.
|
||||
The function will then be translated to generic assembler instructions.
|
||||
|
||||
All the functions that are required to run the program will be added to the final assembler.
|
||||
The final assembler resolves label addresses, optimizes the performance and generates the specific x86-64 machine code from the generic instruction set.
|
||||
|
||||
The `Run` method is currently not fully implemented.
|
||||
|
2
go.mod
2
go.mod
@ -1,5 +1,5 @@
|
||||
module git.akyoto.dev/cli/q
|
||||
|
||||
go 1.21
|
||||
go 1.22
|
||||
|
||||
require git.akyoto.dev/go/assert v0.1.3
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
|
||||
// Scan scans the directory.
|
||||
func Scan(path string) (<-chan *Function, <-chan error) {
|
||||
functions := make(chan *Function, 16)
|
||||
functions := make(chan *Function)
|
||||
errors := make(chan error)
|
||||
|
||||
go func() {
|
||||
|
@ -7,6 +7,7 @@ type InvalidDirectory struct {
|
||||
Path string
|
||||
}
|
||||
|
||||
// Error implements the text representation.
|
||||
func (err *InvalidDirectory) Error() string {
|
||||
if err.Path == "" {
|
||||
return "Invalid directory"
|
||||
|
Loading…
Reference in New Issue
Block a user