HNHacker News
TopNewBestAskShowJobs

jkelleyrtp

2,460 karma · joined September 24, 2018

https://jonathan-kelley.com
submissionscomments
jkelleyrtp··on Swift Static Linux SDK
Supposedly faster in Swift 6 but I don't have any big swift projects to throw at it. It uses LLVM so it's not going to be as fast as Go's.

In Swift 6 they:

- Improved parallelism via compilation pipelining (ie top-level object files are referencing not-yet-compiled symbols but can still proceed while those compile in the background)

- Parallelized and pipelined debug symbol generation (lazy debug symbols)

jkelleyrtp··on Swift Static Linux SDK
Swift 6 is amazing - I say this as a big Rust person. It seems like Swift is now its own entity outside the Apple bubble and has a few very interesting features:

- An "embedded" mode that turns off reflection for kilobyte-sized binaries

- An upcoming WASM target

- An LSP for VSCode

- Native C++ interop

- Typed "throws"

- Static linking on linux and the linux sdk

- Porting a number of "core foundation" / foundation primitives to nix platforms

- Distributed actors for concurrency that run on distant machines

- Data-race free by default

- non-copy RAII generic types

Watch the video on Swift 6: https://developer.apple.com/videos/play/wwdc2024/10136/.

IMO Swift 6 is a better Go and than Go, and a better Rust for app-dev type stuff, which seems to be what people want to use Rust for.

Swift has shipped stuff that Rust has been sitting on its hands over for years:

- Anonymous enums/structs in parameters/match statements

- Named function arguments

- A type of `Send` bound that allows Rcs to be sent between threads (not Arcs)

- Swift preview hotreloading

- autoclones (without GC)

Swift also took a bunch of goodies from Rust *[1]

- No garbage collector

- Traits via "protocol"

- ADT for Option/Result

- macros

- non-copy types enforcing RAII

I really really wish Rust had been keeping up with Swift's ergonomics because it's looking like Swift is going to catch up to Rust's cross-platform story much faster. Swift really could end up as the "do it all" language for frontend/backend/app dev.

[1] By "took" I mean if you like these things in Rust you'll see them in Swift

jkelleyrtp··on Ask HN: Who is hiring? (June 2024)
Dioxus Labs (http://dioxuslabs.com) | Founding Rust Engineer | San Francisco | in-person | Full-time | 125-150k | 0.5-3% equity

I'm Jonathan, the creator of Dioxus (YC S23). Dioxus is a popular crossplatform GUI library for Rust that, imo, is the easiest way to ship apps that are beautiful, fast, and robust.

Dioxus is quite popular, almost 20k stars on GitHub, and we recently raised a sizable seed round from "top vcs." We have a lot of exciting projects on the horizon:

- in-place binary patching for rust hotreloading (http://github.com/jkelleyrtp/ipbp)

- a WGPU powered HTML/CSS renderer (http://github.com/dioxusLabs/blitz)

- experiments with LLM-based component generation (http://github.com/dioxusLabs/dioxus-ai)

- upcoming mobile tooling

- TUI-based devtools for a ruby-on-rail like experience

- a deploy platform for web/desktop/mobile/backend and all the fun that entails...

I'm looking for a founding systems engineer passionate about Rust, WASM, apps, the web, compilers, linkers, and devex - basically someone who's not afraid of anything. Dioxus is a very lean organization and we've been able to move so quickly since we keep our team small and high trust. No annoying standups or corporate bureaucracy. If you want to contribute to OSS, move the needle, and work in a startup that's closer to deeptech with hard problems, this role is for you.

I'm specifically looking for people who are excited by this space and doing this type of work. If you're just looking for a job then this probably isn't the right role for you.

Apply on our yc page or are reach me directly at jon at dioxuslabs dot com

https://www.ycombinator.com/companies/dioxus-labs/jobs/dRPOo...

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
We have a guide about optimizing that it looks like we just haven't propagated into the template.

You can get hello world to sub 50kb. Our todomvc in the docs gets to 234kb.

Also note that wasm starts really really quickly, so it's not 1:1 JS<->WASM.

https://dioxuslabs.com/learn/0.5/cookbook/optimizing

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
Tauri and Dioxus both share a webview and all of Tauri's extensions/plugins work with dioxus, so the only real difference is where your code lives. Since Dioxus and Tauri share a good deal of architecture similarities, it's not really an "either/or" case and I'm sure whatever the Tauri folks try to monetize will work with Dioxus apps automatically.

IMO if you're building an app in Rust, you probably want to avoid the wasm build step and shim out to the little bit of JS here-and-there for interactions you can't quite get in Dioxus.

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
Tauri and Dioxus both share a webview and all of Tauri's extensions/plugins work with dioxus, so the only real difference is where your code lives. Since Dioxus and Tauri share a good deal of architecture similarities, it's not really an "either/or" case and I'm sure whatever the Tauri folks try to monetize will work with Dioxus apps automatically.
jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
Dioxus still re-renders components but throws a lot of optimizations at the rsx that components generate, getting it close to solid's performance. It's more like preact than it is solid.

Optimizations include: - splitting out dynamic pieces of the UI into their own "diff bin" - memoizations by default - signals implicitly marking attributes as dirty / managed

So, still react-like

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
No, but we've been helping authors of popular crates prep for the update. Crate authors can submit their projects to https://github.com/dioxus-community/ and we'll help maintain and update them.
jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
Stable/1.0 is always tough to call, and you can't predict the future of course, but it does seem obvious that enterprise value 1.0 software. It's more likely that we 1.0 different pieces of the stack (core, rsx!, html) so the ecosystem can build on top of stable primitives. We probably couldn't 1.0 the renderers themselves for a while.

It's probably another year of iteration until I feel like we're 100% stable, but my penchant for another rewrite is at an all time low.

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
We'll probably explore that in the future but right now our team is literally just 2.5 fulltime engineers.

Tauri is seeking monetization via CrabNebula, but I can see how the governance structure would secure more confidence in the OSS side.

http://crabnebula.dev

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
If you want to use a Rust frontend framework with Tauri you need to compile to wasm. You typically use svelte/vue/react etc as the frontend, or I guess you could attempt some sort of MPA approach with SSR.

Here's a guide for using Yew with Tauri. Notice how you need to install wasm-bindgen and wasm-pack. https://dev.to/stevepryde/create-a-desktop-app-in-rust-using...

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
That's awesome!! I must've ran into kweb when designing the DSL at first - they're so similar. I'm secretly a huge kotlin fan and love the kotlin DSLs and concurrency models.
jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
Yes, a big feature bevy is lacking is a decent editor. There's been an ongoing push to get dioxus into bevy to accelerate the editor development. Bevy's ECS model is good for games but hasn't been cleanly mapped into the traditional GUI space yet. Dioxus is composable so you can integrate it at multiple levels. The bevy folks are using our virtualdom plus state management with their own renderer.
jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
I'd add React-Native / expo to your list.

Flutter is written in Dart but renders to a canvas on the web making it a very, very poor choice for web apps. Especially backend/fullstack apps. Plus you can't use tailwind or whatever flavor of css library there is today. Flutter just nailed the "get up and running" part which we've got as well: `cargo binstall dioxus-cli`, `dx new`, `dx bundle` is literally less than 30 seconds. Hopefully `dx deploy` coming soon.

Electron is... it's electron. A whole chromium instance, an IPC bridge between your frontend and the system, NodeJS, etc. If you compile for size, our desktop apps are 3mb. You can easily deploy them on an embedded/low end device. We're hoping to eat some market share in the embedded-ish land (not true embedded, but like industrial or POS).

Dioxus also has mobile and desktop compatible server functions which basically no other projects have. Expo has been kinda exploring this space. One of our examples is deploying your own LLM on your own infrastructure with a dioxus mobile app UI and it fits in a single file and builds in under a minute.

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
Yeah Nico is awesome. Between Evan and Nico, I'm sure I'm the worst programmer on the team!
jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
We have grants and corporate sponsors to keep the project alive even if the VC money runs out. This was all a side project for me at first, so I went down the "donation" route in the beginning.

Donations are great but they're not how the system works, unfortunately. Dioxus could never compete with the two most valuable companies on earth if it wasn't a self-sustaining business. VC just lets me scale the team from 2 people to 10(?) and have some cash to iterate. We were "profitable" even before taking venture money.

Now we're able to take on more moonshot-type projects like the blitz renderer, a deploy platform, UI fuzz tooling, and more. We're using our seed round exclusively to make dioxus as awesome as possible, so even if it doesn't work out at a venture level, there's still a really cool, polished, end-to-end app framework that you can build and ship with in Rust.

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
Yes, we're looking at something like a Vercel/Expo model, probably built on Fly, Cloudflare, or AWS, but designed to be self hosted.

We've got a decent amount of enterprise adoption and I think there's money to be made by selling something like a self-hosted Vercel. TBD on licensing - I'd want it to be open source but we wouldn't want people reselling our deploy platform.

We raised a seed to prove that people want to build with dioxus. If that hypotheses is validated, then we invest in the deploy model. If not, we have OSS grants and corporate sponsors that will keep the project alive for years even if the VC money runs out.

I'm not super interested in making money at the hobbyist tier - those developers are our evangelists. Enterprise self hosting is likely harder but I think we can provide a lot of value to teams building apps in large companies.

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
Venture doesn't necessarily mean bad. Long term the goal the goal is to dissolve the gates to Apple and Google's walled gardens, which I personally believe is a net good.

As much is the idealist in me wants to do that with no venture backing, the realist in me knows we need Dioxus to be self sustaining and providing legitimate value for people to switch. Google spends 76 million dollars a year on catering alone - there's no way you can compete with Android and Flutter without huge resources.

Apple and Google capture the value for their platforms via fees and lock-in. Our goal is to capture value by providing really good utilities for building and deploying apps. You can't move heaven and earth without a really big lever, and venture gives us more leverage.

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
Wrote about that here: https://github.com/DioxusLabs/dioxus?tab=readme-ov-file#diox...

You're probably not going to be building an email client or the next instagram in egui, but it is good for stuff where you're fine with re-rendering every entire frame (data viz, graphics stuff).

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
Someone else figured it out :-)

I think we had a prototype of it a long time ago but couldn't figure out how to implement drop. Leptos came out but just leaked the runtime in its initial rev. We figured we could safely recycle the runtimes and voila, problem solved.

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
It's mostly just needed to interact with FFI and declare some types as Send/Sync.

We use it in 3 places:

- fixing some FFI on iOS

- enabling function-call syntax for signals (took this implementation from dtolnay)

- implementing Send/Sync for an ID that uses a pointer as a hash (which honestly could be removed in lieu of a usize, now that I'm looking at it)

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
Creator here, so I'm biased...

Yew has had about 10 commits in the past 6 months and the original creator has since moved on.

Leptos is a good solution for web-app type stuff, but IMO there's a big usability gap. I'll let the community be the judge there, but I wrote up some differences here: https://github.com/dioxusLabs/dioxus/?tab=readme-ov-file#dio... Leptos was fortunate enough to receive a lot of attention from youtubers on its launch.

The most important thing here: we raised venture money for Dioxus. We have many years of runway, are pretty lean, and exclusively focused on pouring resources into making the best GUI library for Rust (and potentially branching out to Python/JS). Getting into YC isn't easy, raising money isn't easy, and there's currently no other Rust projects with similar goals, talent, and financial backing. Biased of course.

Oh, and we're committed to the bevy integration. bevy_dioxus is already updated for 0.5 and we share corporate sponsors with the bevy folks.

Final point, legally, no we're not inspired by any pokemon with a similar sounding name. Even though that pokemon is awesome.

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
It is poor man's GC, but the memory semantics are exactly the same as the previous version. Since `use_hook` owns a value for the lifetime of the component, that value is dropped when the component drops. All signals still `use_hook` so their lifetimes are the same. No performance impact whatsoever since we generally discourage calling `GenerationalBox::new()` outside of use_hook.

Now if you spammed `GenerationalBox::new()` in a loop or something, yeah, your garbage will exist until the component drops. But most of the time folks will just push/pop from a Map or a Vec and regular memory semantics apply.

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
One of this release's features is getting byte streams into the webview using custom protocols. It's not as ideal as say, sharing a GPU texture with the webview, but powerful enough to do video streaming and data viz.
jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
You can choose between using the system's webview as your renderer or an experimental WGPU-based engine that pulls in stylo (the piece of servo shared with Firefox).

We're hoping to move folks to the WGPU renderer in the long term, but it's still pretty raw and many companies using Dioxus are pragmatic enough to know that a webview is a good enough solution for like 90% of apps.

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
Agreed, but we've been doing a lot of R&D discovering new ways of doing things. Dioxus was the first Rust framework to do template-based hotreloading and we couldn't have predicted that was even possible 2 years ago.

The Copy-state stuff also seemed impossible a year ago, so no way to plan ahead. Now, I think things have matured enough that there's hopefully not a major major rewrite for a long time.

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
It was 3 months of work and you probably saw our alphas kicking around for a while.

We had been thinking about this rewrite for like 6 months, but put it off for a while. Glad we dove into it since the finished product is so much better.

jkelleyrtp··on Dioxus 0.5: Web, Desktop, Mobile Apps in Rust
Wrote about that here in our readme:

https://github.com/dioxusLabs/dioxus/?tab=readme-ov-file#dio...

Tauri puts your frontend in the webview and you need to communicate with native Rust functions through an IPC boundary (like electron).

In Dioxus your Rust code lives on the native side, so you don't need IPC to do things like read from the file system, websockets, etc. Tauri also forces your frontend to compile to WASM, and a lot of interesting rust crates don't compile to wasm.

It's a little hard to express how much simpler it is to build when you don't have an IPC boundary. Dioxus' tooling is also dedicated to just Rust, so you can go from zero to bundled `.app` in less than a minute (12 seconds fresh build, 20 seconds fresh bundle).

That being said we're huge fans of Tauri and the flexibility it gives you (frontend in whatever web-compatible UI you want) and you can even use Dioxus in your Tauri apps!

jkelleyrtp··on Java is becoming more like Rust, and I am here for it
I'm a big Rust person but the language I think that's slept on is Kotlin.

It has all the goodies I like in Rust (multiplatform, decorators, FP, pattern matching) but with a GC/JVM to back it.

I personally like Rust since I can drop down to low-level embedded projects and stick with one language, but depending on what interest you, Kotlin can be an excellent fit.

jkelleyrtp··on PG&E claims no connection between rate increases and $2.2B jump in earnings
The delivery fee is different for every building in the city. I’ve been receiving $200+ bills and been asking around to friends and their delivery fee per kWh is less than mine, for whatever reason. Sounds like you got lucky.
← PreviousPage 3 of 9Next →