c4
AoikC4x86Study
c4 | AoikC4x86Study | |
---|---|---|
2 | 1 | |
919 | 8 | |
- | - | |
10.0 | 10.0 | |
almost 9 years ago | over 4 years ago | |
C | C | |
GNU General Public License v3.0 only | GNU General Public License v3.0 only |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
c4
- AoikC4x86Study: Line-by-line comments to c4.c and c4x86.c files
-
A CPU Is a Compiler
This part is not terribly difficult, though,—Forth implementations have long explored[1] the road from emiting a list of VM instructions (“token threading”) to emitting a list VM instruction implementation entry points (both “indirect” and “direct threading”, arguably) to emitting a stream of call instructions targeting said entry points (“subroutine threading”) to copying the implementation bodies there (“inline threading”).
With sufficient dedication, you can even obtain the machine code to inline by cutting it out of code compiled from a high-level implementation language, in the name of portability. Gforth does this[2] in the land of Forth, but the more well-known implementation is perhaps the dyngen code generator[3] used in Qemu before the switch to TCG in version 0.10.
Generating machine code isn’t difficult, and neither is modifying a (low-level) bytecode generator to do it[4]. Generaring good machine code is difficult.
[1] http://www.bradrodriguez.com/papers/moving1.htm
[2] https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Dyn...
[3] https://gitlab.com/qemu-project/qemu/-/blob/v0.9.1/qemu-tech..., rendered as https://web.archive.org/web/20081120011949if_/http://bellard...
[4] https://github.com/EarlGray/c4/blob/master/JIT.md
AoikC4x86Study
What are some alternatives?
qemu
c4 - C in four functions