3 ms·
Hi, creator here. Never imagined this would make its way into HN. :) I created this to study Rust(yes, I'm still new) and to explore what's possible with curre
by segfault87 7y ago
Hi, creator here. Never imagined this would make its way into HN. :)
I created this to study Rust(yes, I'm still new) and to explore what's possible with current Rust and WebAssembly. I think it turned out to be okay to continue with Rust and I'm more than happy.
Currently it comprises of a parser which reads LDraw(https://ldraw.org/ https://ldraw.org/) file format and a basic renderer. For now the page itself is just a single page with rotating 3d model but eventually would transform into a complete website for creating and sharing your own creations.
If you are interested you can track the development at the GitHub repository(https://github.com/segfault87/ldraw.rs https://github.com/segfault87/ldraw.rs) It's slightly outdated and the current code heavily relies on the bleeding edge of Rust (e.g., nightly, async await, futures 0.3, wasm-bindgen, ...) and needs to be cleaned up before pushing.
If you want more complex model you can try this instead: https://segfault87.github.io/ldraw-rs-preview/#models/6973.ldr https://segfault87.github.io/ldraw-rs-preview/#models/6973.l...
- tenaciousDaniel 7y agoI've always been a JS-focused web developer, with only a bit of experience in other languages (ObjC, Java). I'm trying to build a web app that heavily focuses on 2D graphics. I'm considering going with Rust + WASM, but I don't know anything about Rust. After doing this project, how would you say you feel about this stack? Yay? Nay? I know that's a vague question, but curious if you ran into any particular troubles. I'm not sure how ready WASM is for production apps.
- nicoburns 7y agoWASM is basically ready for 2 kinds of app: 1. Heavy computation with no UI. 2. Stuff that renders to Web GL. For the rest your still best off with JavaScript. 2D graphics is pretty borderline I'd say. More work in Rust+WASM, but doable. Rust itself is wonderful, and well worth learning for the backend if you ever do that kind of stuff.
- binthere 7y agohttp://arewegameyet.com http://arewegameyet.com might help
- segfault87 7y agoThe overall experience has been great. Web APIs(web-sys) are direct translations of WebIDL for now, experiences could get better if we have more 'rustic' APIs. (stdweb looks promising) Learning Rust can be tricky sometimes. Sometimes it requires you to rethink the way how you code - especially when dealing with the borrow checker. If you have to do async tasks (fetch, promises, ...) wait until async-await lands on Rust. It's possible on nightly Rust and wasm-bindgen git but it's not stable. Proceed with caution.
- grenoire 7y agoI ran through the source code of the renderer first, and then the implementation for the rest later. And I can honestly say this is one of the prettier Rust code I have seen so far.
- JoshTriplett 7y agoI'm excited about this; I remember using leocad to design complex models, and I'd love to have programmatic tools to work with the same formats in Rust.