compiler
sozu
Our great sponsors
compiler | sozu | |
---|---|---|
15 | 8 | |
20 | 2,797 | |
- | 3.1% | |
8.1 | 9.4 | |
3 months ago | 8 days ago | |
C | Rust | |
- | GNU Affero General Public License v3.0 |
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.
compiler
-
A copy-and-patch JIT compiler for CPython
Wow! Thank you for your hard work. I use python for all experimental work so this would speed up my scripting work, such as processing data from API calls or filesystem.
I wrote a simple toy JIT for a Javascript-like language. It might be useful for others to learn from because it's so simply written and not complicated. I do lazy patching of callsites, I haven't got anywhere near as advanced as tracing or copy-and-patching. Much of the code I wrote for this JIT was written in Python and ported to C. The Java Virtual Machine has a template interpreter which is interesting to research.
I haven't got around to encoding amd64 x86_64 instructions as bitmasks yet, so I've hardcoded it.
-
Building a Programming Language in Twenty-Four Hours
https://github.com/samsquire/compiler
It's a toy and incomplete but I've worked on compiling MOV and ADD instructions.
-
Let's make a Teeny Tiny compiler
I used this page to work out the Mod/RM format for opcodes.
https://www.cs.uaf.edu/2016/fall/cs301/lecture/09_28_machine...
I have a barebones toy compiler here that compiles a simple mathematical expression to assembly:
https://replit.com/@Chronological/Compiler3
I have the beginnings of a toy JIT compiler here which generates some machine code for MOVs and function calls but I haven't implemented much else...
http://github.com/samsquire/compiler
For code how I generate an "add" instruction:
https://github.com/samsquire/compiler/blob/main/jitcompiler....
I use a case statement to match on the registers and literally insert opcode bytes into a malloced array.
On thing you can do it implement a JIT compiler.
Here's Martin Jacob's code to execute arbitrary memory:
https://gist.github.com/martinjacobd/3ee56f3c7b7ce621034ec3e...
Since your C program is already in memory, you have access to the C standard library and don't have to worry about linking or object formats :-) but you'll have to worry about parameter passing and FFI.
My JIT compiler based on this idea is here https://github.com/samsquire/compiler but it is incomplete.
- How to get started?
- Notes on my incomplete JIT compiler
-
Erlang: More Optimizations in the Compiler and JIT
This is interesting, thank you.
I really should learn from BEAM and the OTP and learn Erlang. I get the feeling it's super robust and reliable and low maintenance. I wrote a userspace multithreaded scheduler which distributes N lightweight threads to M kernel threads.
https://github.com/samsquire/preemptible-thread
I recently wrote a JIT compiler and got lazy compilation of machine code working and I'm nowhere near beginning optimisation
https://github.com/samsquire/compiler
How do you write robust software, that doesn't crash when something unexpected goes on?
I looked at sozo https://github.com/sozu-proxy/sozu
and I'm thinking how to create something that just stays up and running regardless.
- Is it possible to optimize this bytecode interpreter more?
- How do you create a correct AST with interaction between method call and function call?
- How do you parse function calls?
sozu
-
Erlang: More Optimizations in the Compiler and JIT
This is interesting, thank you.
I really should learn from BEAM and the OTP and learn Erlang. I get the feeling it's super robust and reliable and low maintenance. I wrote a userspace multithreaded scheduler which distributes N lightweight threads to M kernel threads.
https://github.com/samsquire/preemptible-thread
I recently wrote a JIT compiler and got lazy compilation of machine code working and I'm nowhere near beginning optimisation
https://github.com/samsquire/compiler
How do you write robust software, that doesn't crash when something unexpected goes on?
I looked at sozo https://github.com/sozu-proxy/sozu
and I'm thinking how to create something that just stays up and running regardless.
-
Rust-based reverse proxy?
Sozu: Well documented, runtime configurable proxy
-
Do most people just restart their Rust web servers once every three months?
https://github.com/sozu-proxy/sozu https://github.com/sozu-proxy/sozu/blob/main/doc/design_motivation.md
-
Force all rust application traffic to pass from proxy.
Could sozu or rathole or leaf or exodus somehow help?
-
Scalable server design in Rust with Tokio
it is not sufficient: a listen socket has its own queue of new TCP connections (that were already handshaked by the kernel), so dropping the listen socket drops the queue. The right way is to start the new server, transfer the listen socket from the old server to the new one with SCM_RIGHTS, then start accepting again from the new instance. That's how it is done in the sozu HTTP proxy (which also uses SO_REUSEPORT to launch multiple work processes each with their own listeners, to improve performance and isolate failure)
-
ARLB: A very experimental load balancer/reverse proxy based on hyper and tokio
How does it compare to sozu?
What are some alternatives?
ics-proxy - A calendar proxy application that allows keeping the calendar URL stable while changing the target URL.
another-rust-load-balancer - A load balancer with support for different middlewares and load balancing strategies, based on hyper and tokio
tuic - Delicately-TUICed 0-RTT proxy protocol
quilkin - Quilkin is a non-transparent UDP proxy specifically designed for use with large scale multiplayer dedicated game server deployments, to ensure security, access control, telemetry data, metrics and more.
rust-lsp-proxy - A language server proxy that provides file synchronization and code execution
hudsucker - Intercepting HTTP/S proxy
ws-tool - High perform & easy to use websocket client/server
privaxy - Privaxy is the next generation tracker and advertisement blocker. It blocks ads and trackers by MITMing HTTP(s) traffic.
speed-tests - Code for comparing CDN speeds!
tokio-reuseport
lets-encrypt-warp - Helper crate to make TLS with warp easy using lets-encrypt
http - Rust HTTP types