compiler
sozu
Our great sponsors
compiler | sozu | |
---|---|---|
15 | 8 | |
20 | 2,833 | |
- | 2.5% | |
8.1 | 9.4 | |
4 months ago | 4 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.
[1]: https://github.com/samsquire/compiler
-
The path to implementing a programming language
Thank you for this article.
I'm a beginner to programming language implementation and design but here's what I learned. But what I want to do this with this comment I want to encourage you to start work on your programming language and just "Do Something©", Anything! You might have always dreamed to create a programming language. You can indeed try that! Have faith that you can do something, even if it's simple or incomplete, at least you learned something and got another skill.
I don't want to be trapped by the idea that building your own programming language is impossibly difficult and that it will never be used so what's the point.
It's so worthwhile.
You can still do something! Effort doesn't have to be wasted! Go and try write a simple virtual machine: it's just a for loop over instructions that manipulate memory. I wrote a non-bytecode compiler, which just uses List for instructions and HashMap for instruction arguments.
Andrew Kling built a browser and operating system and Terry Davis built an operating system. They encourage that someone can in fact learn a lot and do a lot.
I don't want to endlessy design things OR only write implementations. I think you can write lots of ideas down AND spend time implementing things and getting your keyboard busy.
I wrote this incomplete JIT compiler in C which has a simple nondesigned frontend that resembles Javascript. ANF is my intermediate representation.
https://github.com/samsquire/compiler
I wrote a multithreaded imaginary assembly language that sends integers between threads through mailboxes but nowhere near LMAX Disruptor performance.
I think you should avoid spending too much time on your parser or lexer, use the Kaledeiscope LLVM tutorial to learn how to write recursive descent parsers and move onto code generation. I did mine with switch statements. The more you actually write parsers the easier it gets, but at first when you have no clue, you CAN just read someone else's implementation of it. Understand it, then write your own to your own design. if you get Analysis paralysis and worry about making a mistake or unoptimal decision and that prevents you from doing something suboptimal but actually do something.
I rushed through my compiler to get to the code generation step because my goal was code generation.
My dream: parallel and concurrent language that combines threads and coroutines with efficient interthread communication similar to LMAX Disruptor and allows writing of efficient pipelines that are serialisable like Temporal.io.
-
Mir: A lightweight JIT compiler project (2020)
Thanks for this.
I started a basic toy JIT compiler for a language that looks similar to JavaScript. It is incomplete.
https://github.com/samsquire/compiler
With these kinds of projects there is a lot of work to be done and I feel it's difficult to get started reading a codebase for a JIT compiler or gcc or LLVM.
-
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
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?
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.
-
Open Source HTTP Reverse Proxy Built in Rust for Immutable Infrastructures
It's AGPL licensed which for a proxy is a strange choice. They have an unanswered question for months on what it might mean: https://github.com/sozu-proxy/sozu/issues/764
Without an answer to that if you use this and you need to make any change to it (even a tiny bug fix), you're basically opening yourself up a pile of legal issues.
-
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)
-
Any thoughts about Clever Cloud? (Has native rust support.)
BTW that traffic will be coming from our sozu load balancers, built in Rust too ;)
-
ARLB: A very experimental load balancer/reverse proxy based on hyper and tokio
How does it compare to sozu?
What are some alternatives?
PicoBlaze_Simulator_in_JS - Simulator (more accurately: an assembler and an emulator) for Xilinx PicoBlaze, runnable in a browser.
ics-proxy - A calendar proxy application that allows keeping the calendar URL stable while changing the target URL.
epoll-server - C code for multithreaded multiplexing client socket connections across multiple threads (so its X connections per thread) uses epoll
another-rust-load-balancer - A load balancer with support for different middlewares and load balancing strategies, based on hyper and tokio
eopl3 - My notes and solutions to exercises for EoPL3.
tuic - Delicately-TUICed 0-RTT proxy protocol
SVM - Simple stack-based bytecode VM implementations used in my class
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.
preemptible-thread - How to preempt threads in user space
hudsucker - Intercepting HTTP/S proxy
rust - Empowering everyone to build reliable and efficient software.
rust-lsp-proxy - A language server proxy that provides file synchronization and code execution