wee_alloc
trunk
wee_alloc | trunk | |
---|---|---|
7 | 54 | |
632 | 3,185 | |
0.0% | 2.2% | |
0.0 | 9.7 | |
about 1 year ago | 3 days ago | |
Rust | Rust | |
Mozilla Public License 2.0 | 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.
wee_alloc
-
Rust + WASM + Typescript [+ React]
As a note, you might find some references to use wee_alloc, but it has been unmaintained for some time and shouldn't be used. I'm using the default allocator with the wasm32-wasi target and it works fine, but I don't know if that works with wasm32-unknown-unknown too; if not there's lol_alloc.
-
Junior Dev here -- How are we setting up Rust, WASM, and webpack?
Note that the wasm-pack tutorial recommends using the wee_alloc crate. This crate is unmaintained and leaks memory, so it should be avoided. Remove this crate, the default allocator works just fine in WebAssembly.
-
Don't use wee_alloc in production code targeting WebAssembly.
It leaks memory: https://github.com/rustwasm/wee_alloc/issues/106
-
Need advice on a project involving Webassembly+ web_sys + webgl
Last thing that comes to mind is switching the allocator to wee_alloc. I use it most of the time for wasm projects and it doesn't make too much of a difference in binary size but that always depends on the project and usually saves at least a few kB.
-
Developing a cross-platform game for browser, Ios, and Android using rust?
For example, check out wee_alloc.
-
Rust on the front-end
wee_alloc, an allocator optimized for small code size.
-
#![no_std] with WASI is more complicated than I thought it would be
Ok. Now I need to add in a global allocator. I use wee_alloc since I know it works pretty well with WASM: Cargo.toml
trunk
-
Surprisingly Powerful – Serverless WASM with Rust Article 1
Trunk is a WASM web application bundler for Rust. Trunk uses a simple, optional-config pattern for building & bundling WASM, JS snippets & other assets (images, css, scss) via a source HTML file. - Trunk
-
Migrating a JavaScript frontend to Leptos, a Rust framework
Note that Leptos uses Trunk to serve the client side application. Trunk is a zero-config Wasm web application bundler for Rust.
-
Why Is the Front End Stack So Complicated?
I've been using Rust and WASM for my latest front-end project, and I think this setup is a viable alternative to commonly used JS frameworks for those willing to put in some effort to ramp up on new technology. Addressing the concerns from the article:
"No universal import system" - Rust has it's own module system and Cargo is used for managing dependencies, no need to worry about different module systems.
"Layers of minification, uglification, and transpilation." Just compile Rust to WASM file for the browser, same as using any other compile target.
"Wildly different environments." Something that you'll still need to deal with. Some runtime dependencies are system-specific (code running on the browser usually needs access to Web APIs, and JavaScript, code running on the server can't access WebAPIs but can access the system clock and filesystem. Sometimes separate libraries or separate runtime configs are needed (e.g. configurable time source)
"Overemphasis on file structure." Not a problem for imports, but you may still have file structure dependencies things like CSS, image resources etc.
"Configuration hell." Pretty much non-existent once you have your Rust compiler setup locally.
"Development parity." Just use trunk: https://trunkrs.dev/, to watch, build and serve, config is minimal.
-
PSA: Rust web frontend with Tailwind is easy!
Trunk, the Rust-equivalent of Webpack & Vite, comes with tailwind built-in. You heard that right! You don't even need to install the tailwind CLI via npm or something like that. No more package.json! <3
-
Awesome presentation of Dioxus - cross-platform GUI framework at RustNL
Can you not use dioxus with "trunk" (https://trunkrs.dev/) ?
-
A Chess Engine is written in Rust that runs natively and on the web!
Thanks a lot! As I said in an earlier comment, building this allowed me to explore a lot of features of rust like Traits, Dynamic Dispatch, Pattern Matching, Const evaluation, Static variables, etc. and that on top of that trying to figure out how to conveniently port it to WASM was also a nice learning experience. I am currently using trunk as a bundler which ties in neatly with a GitHub action but before that, I tried cargo-run-wasm, which felt a little hacky. So overall a whole lot of learning.
-
Speak English to me, The secret World of Programmers
Here here. I don't think programmers - as a group - get to complain about people not learning programming tools while simultaneously making them so unapproachable (especially Linux things).
It's not just the overuse of acronyms. There's also:
* Religious devotion to the CLI despite it having terrible discoverability.
* Really bad naming. Git is probably the worst offender at this, but the whole of Unix is a naming mess. WTF is `usr`? Is that where user files go?
* Generally over-complicated tooling. A good example of this is Node/NPM. So complicated to set up! Contrast it with https://trunkrs.dev/
* Deification of distro packages. No I do not want to spend half of my development time packaging my app for 10 different distros. I guess I'll go with curl | bash then.
* Distain for binary app distribution. I'm looking at you glibc.
-
Helper/cheat tool for the board game Cryptid - my first website built with Rust/Wasm
I used Notan for drawing the game board in combination with the excellent egui for adding UI elements. It was surprisingly easy to bring it to web with Trunk.
-
MailCrab
Hi, the author of MailCrab here :-) Yew is nice, especially if you enjoy writing Rust. However, it definitely takes more time and dedication than writing a frontend in React, Vue etc. Yew and the surrounding ecosystem keeps improving, and it is way more usable than when I first tried it. The tooling I used (Trunk https://trunkrs.dev/) is very minimal with respect to the number of features compared to many of the popular web-bundlers (Webpack etc.) but it works well for most simple use-cases.
-
Is rust + yew a good starting point for learning web dev?
Yew is way way nicer in that regard because it uses Trunk which is very excellent and you don't have to deal with any of that really. Just trunk serve and away you go. Plus you get the advantage of not having to deal with Javascript. Typescript is nice, but it's no Rust.
What are some alternatives?
wasm-bindgen - Facilitating high-level interactions between Wasm modules and JavaScript
wasm-pack - 📦✨ your favorite rust -> wasm workflow tool!
wasi-libc - WASI libc implementation for WebAssembly
tailwind-yew-builder - Build tailwind css for yew style applications, using docker-compose, so you don't need to have npm installed
cargo-wasi - A lightweight Cargo subcommand to build Rust code for the `wasm32-wasi` target
create-wasm-app - npm init template for consuming rustwasm pkgs
yew - Rust / Wasm framework for creating reliable and efficient web applications
compiler-builtins - Porting `compiler-rt` intrinsics to Rust
wasmtime - A fast and secure runtime for WebAssembly
awesome-vite - ⚡️ A curated list of awesome things related to Vite.js