trunk
rust-playground
Our great sponsors
trunk | rust-playground | |
---|---|---|
53 | 65 | |
3,110 | 1,149 | |
3.3% | 3.0% | |
9.6 | 9.5 | |
7 days ago | 19 days ago | |
Rust | Rust | |
Apache 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.
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.
-
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.
-
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.
-
Junior Dev here -- How are we setting up Rust, WASM, and webpack?
The alternative to wasm-pack is trunk. I've never used it, so I can't tell you how good it is.
-
Rendering old school tilemaps with WGPU?
My current tooling is based on using trunk which eframe supports quite easily. Notan could too I suppose. The biggest block in tooling was needing to call notan_main on the wasm module. Trunk (as far as I am aware) does not support that behavior.
-
What's the go-to web frontend + backend project layout these days?
I read through the trunk docs and there isn't any explicit reference to using it within a cargo workspace, however trunk includes a few clever features I discovered reading its example config file... So my thinking now is that I will put Trunk.toml in the project root, add index.html to the /client/ directory and point trunk at it, put the trunk output into /dist/
rust-playground
-
How to Lose Control of Your Shell
That's a valid Unix path, but rust's quoting does nothing to stop it: https://play.rust-lang.org/?version=stable&mode=debug&editio...
-
Borrow Checking Without Lifetimes
Self-referential structs work fine in Rust and always have.
https://play.rust-lang.org/?version=stable&mode=debug&editio...
The compiler will correctly prevent you from moving the value.
The other way to have a struct that starts out as non-self-referential and then becomes self-referential can be achieved with `unsafe` and `Pin::new_unchecked`, which is how `async {}` is handled.
-
Improving Interoperability Between Rust and C++
In rust as currently stands: https://play.rust-lang.org/?version=stable&mode=debug&editio...
On the other hand, both this wrapper and yours are counterproductive if the element size is dynamic (e.g. perhaps you're dealing with some nonsense like:)
struct ITableColumn {
-
New Linux glibc flaw lets attackers get root on major distros
Overflow checks turn into two's compliments' wrapping, but that's only considered acceptable because bounds checks are not turned off.
https://play.rust-lang.org/?version=stable&mode=release&edit...
-
Atomics and Concurrency
I have no idea what you're talking about, but it sounds unnecessarily complicated and why I don't use Rust for any serious work.
This demonstrates the ABA problem in safe Rust: https://play.rust-lang.org/?version=stable&mode=debug&editio...
Substitute the sleep with a combination of doing computation/work and the OS thread scheduler, and you can see how the bug surfaces.
-
Rust 🦀 Installation + Hello World
You can also try Rust online using the Rust playground: https://play.rust-lang.org/
-
4B If Statements
(Click ... beside build to get assembly) https://play.rust-lang.org/?version=stable&mode=release&edit...
Unfortunately the go playground doesn't seem to support emitting assembly?
-
Hey Rustaceans! Got a question? Ask here (49/2023)!
Mystified about strings? Borrow checker have you in a headlock? Seek help here! There are no stupid questions, only docs that haven't been written yet. Please note that if you include code examples to e.g. show a compiler error or surprising result, linking a playground with the code will improve your chances of getting help quickly.
-
Hey Rustaceans! Got a question? Ask here (48/2023)!
If you have a StackOverflow account, consider asking it there instead! StackOverflow shows up much higher in search results, so having your question there also helps future Rust users (be sure to give it the "Rust" tag for maximum visibility). Note that this site is very interested in question quality. I've been asked to read a RFC I authored once. If you want your code reviewed or review other's code, there's a codereview stackexchange, too. If you need to test your code, maybe the Rust playground is for you.
-
Making Games in Go for Absolute Beginners
> I am the developer of Astral Divide, which is entirely written in Go: https://store.steampowered.com/app/2597060/Astral_Divide/
Your game looks great, congrats on your progress! I especially enjoyed how the zoom works when you're leaving/arrive planets, and the unique propulsion system (also, the anchor made me giggle!).
> lack of data structure packages
I tend to not need many, so I'd be curious if you can recall any structure in particular which you couldn't find? No biggie if not.
> package structure not suited for games
I'm not a game dev, but I've seen some larger games such as https://github.com/divVerent/aaaaxy/tree/main/internal (if you haven't played it before—do it!) which seem to be able to place everything into separate packages without issue, so perhaps there's something to gleam from their design?
> maps are random when iterated
Hash map iteration shouldn't be sorted in _any_ language (here's Rust, for example https://play.rust-lang.org/?version=stable&mode=debug&editio... (Python makes it _appear_ as if dicts are sorted hash maps, but that's only because it doesn't only use a hash table, but a vector as well (same as you'd have to do in Go))), otherwise it would cause both portability and security (https://github.com/golang/go/issues/2630) issues. You can use a b-tree (which was probably the data structure you wanted there) if you aren't willing to sort it yourself.
> modding options
If you don't care about unloading https://github.com/pkujhd/goloader
Go actually has one of the best WASM runtimes https://github.com/tetratelabs/wazero
It also has a bunch of libraries for embedding scripting languages https://awesome-go.com/embeddable-scripting-languages, with Tengo _probably_ being quickest https://github.com/d5/tengo
I'd _highly_ recommend Ebitengine in the future, as not only have there been multiple brilliant games using it, but it also has Switch/Android/iOS support, and you can find help with any issue whatsoever in their Discord. People have built 3D games with it, and Hajime is an absolute beast of a developer.
What are some alternatives?
wasm-pack - 📦✨ your favorite rust -> wasm workflow tool!
tailwind-yew-builder - Build tailwind css for yew style applications, using docker-compose, so you don't need to have npm installed
wasm-bindgen - Facilitating high-level interactions between Wasm modules and JavaScript
yew - Rust / Wasm framework for creating reliable and efficient web applications
wasmtime - A fast and secure runtime for WebAssembly
awesome-vite - ⚡️ A curated list of awesome things related to Vite.js
wasm-bindgen-rayon - An adapter for enabling Rayon-based concurrency on the Web with WebAssembly.
crates.io - The Rust package registry
SvelteKit - web development, streamlined
tokio - A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
webpack - A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.
tauri - Build smaller, faster, and more secure desktop applications with a web frontend.