Skip to content

Instantly share code, notes, and snippets.

@jkelleyrtp
jkelleyrtp / gist:1769a8be6d2aaf733736b50cbca4548f
Last active June 21, 2024 17:38
Dioxus Labs + "High Level Rust"

Dioxus Labs + “High-level Rust”

Recently an article very critical of Rust swept r/rust, r/programming, and HackerNews. This isn’t the first time someone has been critical of Rust, but in my experience, it’s one of the few times I didn’t see the typical host of responses piling on the author about “doing Rust wrong.” The post was so thorough and so poignant that it shut up even the loudest of zealots.

With that article, I felt a vibe shift. Someone finally called out Rust on its bullshit, so to speak. It’s true - “Rust gamedev ecosystem lives on hype” - and it’s about time we addressed it. There’s a lot of Rust folks whose answer would be “just get gud.” But the article rightly points out that for startups, small teams, and basically anyone who just wants to ship, Rust is not the answer.

Why does my opinion matter at all?


@jkelleyrtp
jkelleyrtp / selection.rs
Created May 12, 2023 13:07
Revamped selection API
struct GlobalState {
name: String,
age: i32,
user: User,
}
struct User {
name: String,
age: i32,
config: Config,
@jkelleyrtp
jkelleyrtp / insane_polymorphism.rs
Last active July 12, 2022 19:23
Rust endpoint polymorphism
/*
This code shows how you would make a Rust API polymorphic over various functions.
It uses a technique to differentiate impls of a trait using a ZST marker.
This particular example might be too complex for the intended crate, hence its extraction into a gist.
*/
use std::marker::PhantomData;
use tokamak::{Request, Response};
fn main() {
use tokio::{runtime::Builder, sync::{mpsc}};
use winit::{event::{Event, WindowEvent}, event_loop::{ControlFlow, EventLoop}, window::{Window, WindowBuilder}};
pub struct Gpu {
pub surface: wgpu::Surface,
pub device: wgpu::Device,
pub queue: wgpu::Queue,
pub sc_desc: wgpu::SwapChainDescriptor,
pub swap_chain: wgpu::SwapChain,

Keybase proof

I hereby claim:

  • I am jkelleyrtp on github.
  • I am jkelleyrtp (https://keybase.io/jkelleyrtp) on keybase.
  • I have a public key ASC9lYFL_BAdEDf5sFtO1K9nRBh1ZVixwypItG7p7f8oIgo

To claim this, I am signing this object: