Hacker Newsnew | past | comments | ask | show | jobs | submit | GenericCanadian's commentslogin

Good learning resources for those curious:

- https://taintedcoders.com/ (I'm the author)

- https://bevy.org/learn/book/intro/

- https://www.youtube.com/@chrisbiscardi

- https://www.youtube.com/@PhaestusFox

Lots of good stuff on the official Bevy discord too


All guides on https://taintedcoders.com/ have been updated to 0.17. Congrats to everyone on the release


Phlex is an amazing project. Makes frontend fun again. I've built my own UI library using DaisyUI and Tailwindcss that we use in all our Rails projects: https://github.com/inhouse-work/protos

It cannot be overstated how nice it is to move away from erb and into pure ruby. Private methods as partials is a game changer for refactoring your UI.


I increasingly wonder if I'm the only one left who genuinely likes erb :-D

Not a fan of the rails erb helper methods though, so maybe it doesn't count. I almost exclusively use it outside of rails now


I don't know if I'm a fan but I've almost never had erb be the problem in a Rails app. The LLMs can work with it easily. Don't need to bring in extensions to work with major text editors. Sticking with ERB for now.


I found using partials between projects to be a headache. I wanted a way to standardize my UI for accessibility across all projects and not have to re-implement the same standards over and over. It's nice to be able to package the UI up into a gem and keep it maintained everywhere.

It's got a nice path for incremental adoption, so there is no need to go all-in unless you want to. Personally my Rails projects are all 95%+ ruby now.

Another nice knock off effect is that the LSP and integration with my IDE (neovim) is much nicer with Phlex components than it is with ERB.

I also think personally I don't like "magic" spaces like ERB where its hard for me to follow the code path. How does ERB manage multiline blocks with html in them? Hard to understand, harder to explain. To me it feels like there is less to worry about in Phlex where I'm thinking more in Ruby, less in the specifics of the view context.


Have you had much luck with slots? I have a project using View Components that leverages slots. I've tried migrating to Phlex, but the lack of explicit slot support has been a bit frustrating.


Slots are pretty easy in Phlex. Have a look at the README in the repo I linked for an idea. I just create `with_column` or `with_header` methods that take a block and store it.

To create them declaratively (not needing to call them in a set order) you just create a module that defines `before_template` and calls `vanish`: https://www.phlex.fun/miscellaneous/v2-upgrade.html#removed-...


As someone who's worked with Ruby for 12 years here are some insights:

Ruby makes message passing first class. That just changes how you think about programs. In exchange you give up passing functions so our anonymous functions are our blocks (actually just another object that can receive messages). So you don't `list(something)` you `something.list` and that lets you change what `.list` does depending on who `something` is very easily.

Ruby's defining feature is that the line between language author and program author is razer thin. You can completely change the language yourself by extending core classes. This is why we have `1.day` in Rails even though its not supported in the main language. DHH (author of Rails) could add that without consulting Matz (author of Ruby). So lots of stuff gets prioritized to make developers happy because its easy to add.

In Ruby the messages you receive are passed up the chain of ancestors. Your ancestors are a linked list of classes going back to a root class like `Object`. You can modify this linked list at will with mixins and inheritance with complete control (should I go before or after this other receiver).

Ruby's REPL and debugging experience is amazing. I often keep one tab with an `irb` or `rails console` open to sketch things while developing the code for it elsewhere. I'm also always inside a debugger to figure things out. When I'm in Rust or Python I'm met with a very different environment.


I get the debugging experience, as I've already found it pleasant and painless compared to the difficulty of setting debugging environments in other languages. But for the messages first approach and thinness, what's the real world benefit in practice?


You can intercept and modify messages on the fly. This helps a lot if you want to update legacy code, but don't want to break other classes that use the same call. It also allows for modularization more easily. I have a project that receives data from a bunch of sources, so I have a class for each source (this is simplified). To make it much easier to add a new one, which happens pretty regularly, the code that calls the processor checks all the classes in a specific folder for a certain function (`.respond_to?`) and then gets the right one for the data type. This means that to add a new source I have to change 0 lines of legacy code, just drop the new class file in the right place and it works.


I would suggest taking a look at Phlex (https://www.phlex.fun/). This kind of ruby maximalism is very pleasing to the dev process. For the interaction I'm using hotwire and stimulus. Been using pure Phlex views in production for 2 years now. I wrote Protos (https://github.com/inhouse-work/protos) which is built on top of Phlex and adds a bunch of quality of life features I wanted.


I wrote https://taintedcoders.com/ for anyone looking for an introduction to Rust game development with Bevy.

Bevy is still early, but the sweet spot right now is simulations. It's particularly weak in its UI, but that's the coming focus for getting the editor built.

If anyone needs ideas, making [boids](https://slsdo.github.io/steering-behaviors/) in Bevy is a great weekend project.


While Bevy might be the hottest thing in the Rust gamedev scene, Tiny Glade didn't use it for rendering purposes - AFAIK only the ECS was used from Bevy.


Can I also use Rust to build UI / window / data heavy apps? I am webdeveloper mostly so looking into other avenues right now.


Sure, there's "native" UI with stuff like slint(QT-like) or iced(system76 is actually building the COSMIC linux desktop environment with this).

And you can also get an electron-like stack going, that is actually much less bloated than "normal" electron, by using tauri-webview, which uses the OS-provided webview and combining it with one of the many cool rust WASM-based reactive web-ui frameworks, like leptos or dioxus. This gets you compiled sizes of ~10s of MB compared to electrons 100s of MBs.

There's also bindings to a lot of traditional ui libs, like GTK, QT & Tk.

I'm currently going for the 2nd option (with leptos for the web part) as I'm used to the web-stack and am very productive with this approach, but native UI also seems very tempting to dig into further.

Some related links:

- https://www.arewewebyet.org/topics/frameworks/

- https://areweguiyet.com/#ecosystem


I can personally vouch for Slint. The DSL is very pleasant to work with, it's still evolving (and the devs are very active and responsive), tooling is also getting better and better each release and it supports translations and accessibility already (through AccessKit). I've been (veeeery) slowly working on a Matrix client with it and I've quite enjoyed it so far.


I'm also developing a chat client (tho for LLMs) using QML. Here's a little video showcasing it: https://custom-downloads.s3.us-west-2.amazonaws.com/chat_cli...

Still, very much in its infancy.

The backend is currently C++ but I'm considering using other languages since there are so many bindings (Mojo is on my radar).


Looking really good so far, keep it up! Is the source available somewhere I could take a peek? o.o


Thanks! Unfortunately not, it's been too hard for me to monetize FOSS projects, so it's going to be closed source.


Very understandable, it is indeed quite hard :(

Best of luck! I'll keep an eye on it ;)


Thank you! I'll keep en eye on Eigen too! I'm curious how it will work out with Slint.


Hey that is really cool thank you. I have Sublime as my IDE, and it looks like I can use that as well, and using a webview might leverage my understanding of webtech.


Tauri 2 is quite good. It even builds for Android now


> but the sweet spot right now is simulations

What kind of games are you referring to?


Not so much games proper, but more like scientific computing visualisations, CAD, stuff like that.

This interview talks about it in a bit of length: https://youtu.be/PND2Wpy6U-E


Sounds a lot like what Wolfram is working on with categorizing cellular automota. Strikes me that a lot of his work is very biological in its search for axioms from experimentation


I wrote this in Crystal lang to learn more about it and the language: https://github.com/nolantait/disruptor.cr

There is a Ruby version that is also very readable: https://github.com/ileitch/disruptor


And here's a version in Rust: https://crates.io/crates/disruptor

(Disclaimer: I wrote it.)


Author of https://taintedcoders.com/ here. Thanks for the mention. I hope to one day be a "consistently up to date" resource :p.

Bevy is the first game engine that made me feel the way Rails did about web development but for game dev. Most game development is focused on the art and the editor which makes sense. But Bevy is really centered around the coder which I found refreshing.

Love to see writeups like these, especially the gore. Great read.


I also wrote an LMAX Disruptor in Crystal: https://github.com/nolantait/disruptor.cr

Here is one in Ruby: https://github.com/ileitch/disruptor

Both languages are quite readable and I've used these to teach the concepts to beginners.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: