Befunge
Rustler
Befunge | Rustler | |
---|---|---|
5 | 36 | |
19 | 4,330 | |
- | 1.2% | |
3.5 | 8.8 | |
12 months ago | 13 days ago | |
JavaScript | Rust | |
- | Apache License 2.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.
Befunge
-
The Rust Performance Book
1. C compilers don't do a good job, & thus even CPython, which has historically stuck to rather vanilla C, uses computed goto, as described in https://eli.thegreenplace.net/2012/07/12/computed-goto-for-e...
I resorted to similar techniques in optimizing Befunge: https://github.com/serprex/Befunge (See bejit.c & marsh.c/marsh.h)
2. Rust enums are not variable sized, think of them as tagged C unions, where the Rust compiler can sometimes apply tricks to make Option> the same size as Vec
3. match can specialize for straight forward cases, when in doubt use https://godbolt.org
- Ask HN: Recommendation for general purpose JIT compiler
-
Why asynchronous Rust doesn't work
I've found async to be straight forward anytime I've used it. Promise#then is equivalent to callbacks
async/await often requires very little changes compared to synchronous code, whereas reworking a program into callbacks is much more impactful. & the async/await compilation process tends to produce better performance in addition to this. My first async/await work was a few years ago to increase a data importer's performance by an order of magnitude compared to the blocking code
Here's an example where looping made for a callback that recursively called, using async/await I get to use a plain loop:
before: https://github.com/serprex/Befunge/blob/946ea0024c4d87a1b75d...
after: https://github.com/serprex/Befunge/blob/9677ddddb7a26b7a17dd...
I don't see why people find it so complicated to separate begin-compute & wait-on-compute
I've since rewritten a nodejs game server into rust, https://github.com/serprex/openEtG/tree/master/src/rs/server... handleget/handlews are quite straight forward
- Python interpreter written in rust reaches 10000 commits
-
Compilers Are Hard
You'll also find them used in CPython's ceval.c
I use them in both my C befunge implementations:
https://github.com/serprex/Befunge/blob/c97c8e63a4eb262f3a60...
https://github.com/serprex/Befunge/blob/c97c8e63a4eb262f3a60...
Rustler
-
Ask HN: What is the best way to learn Erlang?
Yep, I think you'd be hard-pressed to find the actual Elixir code be the bottleneck in a real-life application. But if you do encounter that, you can use something like Rustler[0] for the CPU-intensive bottleneck, as Discord did[1] while working on a data structure they needed. Slow DB queries are something else to look out for.
[0] https://github.com/rusterlium/rustler
[1] https://github.com/discord/sorted_set_nif
-
AI Toolkit: Give a brain to your game's NPCs, a header-only C++ library
For performance intensive tasks, you could rely on Rust NIFs, there is this great project: https://github.com/rusterlium/rustler
My last project with Elixir was using Elixir merely as an orchestrator of static binaries (developed in golang) which were talking in JSON via stdin/stdout.
-
Building Apps with Tauri and Elixir
From the moment we discovered Tauri, we really felt like this was the perfect fit. The API is really solid, the configuration files are minimal and easy to understand, and the usage of Rust makes it way easier to add new functionalities and think about interesting ways of interoperating with Elixir via the Rustler library.
-
Async Rust Is A Bad Language
Elixir/Rust is the new Python/C++, and Rustler makes the communicating between the 2 languages super easy: https://github.com/rusterlium/rustler
-
Why elixir over Golang
Rustler is so awesome for this. Write Elixir NIFs in Rust? Yes, please!
- Is RUST a good choice for building web browsers?
-
Why do you enjoy systems programming languages?
But really, I would suggest thinking about what you want to build before "how" or "with which tool" - one of the signs of a person becoming a good engineer is having an array of tools at their disposal and being able to choose a correct tool for the correct task. Rust also excels in integrating with other languages - with JS via WebAssembly (a bit of self-promotion, for example), with Elixir via Rustler, with Python via PyO3 and PyOxidizer, etc. So you absolutely can start writing a frontend app with JS, or a distributed system with Elixir, or a data processing/ML app with Python and use Rust to speed up critical parts of those. Or, in reverse, you can start with Rust & add new capabilities to whatever you're building, that being a frontend, a resilient chat interface, or an ML model.
-
PasswordRs 0.1.0 released (Rust NIF for password hashing)
I created a elixir (wrapper) library to generate password hashes. Other Elixir libraries use a C NIF to generate password hashes. This libary uses a Rust NIF (using Rustler) and the Rust libraries the generate the different hashes. Additionally this library uses RustlerPrecompiled so you don't need to have a Rust compiler installed to use this library. It supports argon2, scrypt, brypt and pbkdf2.
- Elixir and Rust is a good mix
-
It's legos all the way down
unfortunately as of the time of this writing, rustler does not support generic type intefaces so I guess this is impossible?
What are some alternatives?
qbe-rs - QBE IR in natural Rust data structures
gleam - ⭐️ A friendly language for building type-safe, scalable systems!
openEtG
hsnif - Tool that allows to write Erlang NIF libraries in Haskell
ubpf - Userspace eBPF VM
nifty - helpful tools for when I need to create an Elixir NIF .
bug - Scala 2 bug reports only. Please, no questions — proper bug reports only.
carbon-lang - Carbon Language's main repository: documents, design, implementation, and related tools. (NOTE: Carbon Language is experimental; see README)
rune - An embeddable dynamic programming language for Rust.
Akka - Build highly concurrent, distributed, and resilient message-driven applications on the JVM
minivm - A VM That is Dynamic and Fast
elixir-nodejs - An Elixir API for calling Node.js functions