208 private links
Integrate a rust game compiled in wasm into sveltkit
In Rust, we can use:
- enums
- builder pattern
- enums + builder pattern
- another way: Instead of insisting on several builder methods, let’s create a single method that can add any option to the search options. The search option is then an
enum
.
Pagefind seems to be a great search tool for static (or SSRed) websites.
Pagefind is written in Rust and runs after my static site generator binary. pagefind indexes all generated HTML and provides an API to query that, including a search UI which you can see at the bottom of every page here. Perfect for my static site setup and it aims to not use much storage or bandwidth.
Available at https://pagefind.app/
The Big Idea of cargo-dist is that we want to streamline all the steps of providing prebuilt binaries for a rust project.
He basically says that his startup prioritizes developer productivity over performance.
Even if performance is not a reason to use Rust, the author provides some more:
- If you know the tech already :)
- Your service interoperates with services that are perf-critical or can be supported in the future
- The Serde library is awesome. Check the doc and use cases.
- It is not amazing with databases but it's very good. Diesel deserves a plus-one: it generates all your SQL queries for you, from a typed SQL schema that it generates from your SQL migrations. It is then similar to the feature of Prisma. It is not perfect though, because of error messages: it makes no sense, or are 60 lines long or difficult to factor out common code.
- It has better modeling of the business domain: enums and unclonable types.
- Reliability: we already know it.
It can be useful to generate an HTML view of entries :)
Create a command line interface from a REST API.
It seems powerful!
Joat uses a YAML file to define subcommands of two types: requests and scripts. Requests subcommands ease the interaction with a REST API and scripts combine multiple commands into a more convenient one.
Use one package manager built on top of corepack to support npm, yarn and pnpm.
#idea #project support more package managers such as cargo, deno, ... :)
Oh wait, there is already something https://github.com/egoist/dum
Execute powerful common commands
33 specific ways to improve your Rust code
Definitely a cool project!
A command runner triggered on custom files. It is then useful to trigger a build or dev command when a file is changed.
Some people may think that the strict nature of Rust will slow down development, which is true only insofar as it won’t let you cut any corners. However, experience has conclusively shown that this is a net win. In fact, Rust lets us ride the wall, which makes us faster, not slower.
-
cargo build --release
-
set
strip = true
to profile.release in cargo.toml -
set
opt-level = "s"
to optimize for size instead of runtime speed -
set
lto = true
to enable link-time optimization -
set
codegen-units = 1
to maximize size reduction but it results in slow builds -
use cargo bloat to understand which dependencies are taking up space
Implement a default builder pattern. It looks efficient.
A french guide on the rust language. It is not complete as the official documentation but provides a good start with lot's of the rust's features.