Follow

I've been building a program for work in Rust, and I'll say right now that the safety features of the language are fantastic, but the real productivity win compared to C++ is the build system

This is a program that:
- Downloads images from a web service
- Uses ISPC to process those images, and runs as many processing threads as your computer has cores
- Uses SDL to show a UI where users can inspect the images
- Has an embedded web server because reasons

I built this in a week. This'd be unthinkable in C++

@jon_valdes I had no idea we had an ISPC crate! This is awesome! Can you share some details about that? Also, are you using the imgui crate and like glium for the UI part?

@photex Yeah, the ispc crate works super well, and was really easy to do the initial integration.
I just put the ispc compiler (it's just one file, amazingly) in a "tools" directory right next to the source code, and added a build.rs build script to the project, like this:

@photex Then in the rust code I added:
ispc_module!(color_comparisons);
And then you can use whatever functions (and types) you declared in ISPC as functions inside that rust module you declare with that macro. Works really nicely!

@jon_valdes this is so awesome. I've been preparing for a bake-off between ispc and sycl. Sycl basically meant no hope for Rust and a bunch of our systems at work are rust. This pretty much settles the debate for me personally.

@photex One small detail I haven't figured out yet is how to specify which targets you want ISPC to build for. I believe the ispc crate does have support for that, but I just haven't bothered looking it up yet

@jon_valdes I see an example on the readme. github.com/Twinklebear/ispc-rs

Looks really straight-forward too. This is an impressive crate. I love the effort regularly made by this community.

@photex Also, "a bunch of our systems at work are rust" sounds intriguing :blobcat: May I ask what company it is?

@jon_valdes Kopernikus Automotive GmbH. We're building remote autonomous driving systems, with some telemetry and OTA update stuff for folks doing more focused or direct autonomous driving development.
Small startup mostly remote.

@photex as for the UI, I did a completely custom, software-rendered UI system 😅 I just allocate a buffer, treat it as a texture, put all the colors in it, and then blit that texture to the screen. Not the most performant, but it's simple, cross-platform, doesn't run into OpenGL not working through VPN on windows...
And hell, it looks good enough 🙃

Sign in to participate in the conversation
Mastodon for Tech Folks

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!