Live data from Hacker News

Writing a winning 4K intro in Rust

codeslow.com

51–60 of 94 posts

Re: Writing a winning 4K intro in Rust

#52

I'm a little confused about what's happening here... Rust can run in an OpenGL shader ?!

This is old and may not even compile anymore, but it's short enough to give you an idea of what's going on.

https://github.com/ohazi/opengl-demo-rust

GLSL shaders are usually either loaded from files or stored as strings in your programming language of choice. The OpenGL library or bindings will usually have some facility to compile those programs and then send them to the GPU, along with textures, geometry, etc.

Re: Writing a winning 4K intro in Rust

#53
post #35
post #33

I love the demo scene, but the culture is kind of strange. Like I've been fooling around with the C64, and all the tools (emulators, debuggers, and etc) are hosted on source forge, or sometimes this random ftp. The author of the debugger I'm using proudly proclaims that he only works on it when he's fucked up on drugs after parties. The documentation of some tools has lewd ascii art, and etc etc. I appreciate the ant…

"On the one hand, I found a program that does exactly what we need. On the other hand, not-quite-dressed anime characters..." I've had this exact conversation with coworkers before.

Which program?

Re: Writing a winning 4K intro in Rust

#54
post #48

Earlier quoted context omitted.

This is not true. Unsafe only disables a few safety features. There are still a bunch left on so unsafe rust is still more safety checked than C.

Care to elaborate? What are such safety features?

The only unsafe functionality the author describes is the unchecked array access. Based on that (which may be incomplete, of course), the borrow checker is a safety feature that is active.

Re: Writing a winning 4K intro in Rust

#56
post #33

I love the demo scene, but the culture is kind of strange. Like I've been fooling around with the C64, and all the tools (emulators, debuggers, and etc) are hosted on source forge, or sometimes this random ftp. The author of the debugger I'm using proudly proclaims that he only works on it when he's fucked up on drugs after parties. The documentation of some tools has lewd ascii art, and etc etc. I appreciate the ant…

It's easy to spot the influence of dissociatives and psychedelics in many demos.

Re: Writing a winning 4K intro in Rust

#57
post #33

I love the demo scene, but the culture is kind of strange. Like I've been fooling around with the C64, and all the tools (emulators, debuggers, and etc) are hosted on source forge, or sometimes this random ftp. The author of the debugger I'm using proudly proclaims that he only works on it when he's fucked up on drugs after parties. The documentation of some tools has lewd ascii art, and etc etc. I appreciate the ant…

> a little more professional

After witnessing how "professionals" act behind closed doors, the difference is merely a mirage, in order to not affect the business image.

Re: Writing a winning 4K intro in Rust

#58
post #33

I love the demo scene, but the culture is kind of strange. Like I've been fooling around with the C64, and all the tools (emulators, debuggers, and etc) are hosted on source forge, or sometimes this random ftp. The author of the debugger I'm using proudly proclaims that he only works on it when he's fucked up on drugs after parties. The documentation of some tools has lewd ascii art, and etc etc. I appreciate the ant…

https://github.com/smabie Is it your github with a creepy kid picture? Very unprofessional!

Re: Writing a winning 4K intro in Rust

#59
post #48

Earlier quoted context omitted.

This is not true. Unsafe only disables a few safety features. There are still a bunch left on so unsafe rust is still more safety checked than C.

Care to elaborate? What are such safety features?

The grandparent is wrong. Unsafe doesn't disable safety functions. From the big book of Rust Unsafety:

The only things that are different in Unsafe Rust are that you can:

- Dereference raw pointers

- Call unsafe functions (including C functions, compiler intrinsics, and the raw allocator)

- Implement unsafe traits

- Mutate statics

- Access fields of unions

https://doc.rust-lang.org/stable/nomicon/what-unsafe-does.ht...

The point is, unsafely calling `get_unchecked` is what's bypassing the range check feature. Not Unsafe itself.

Re: Writing a winning 4K intro in Rust

#60

Does someone know what the problem is with the intrinsics? Or is there a problem? The author states that this breaks his debug build for some reason.

I think the author called _mm_load_ps() on a pointer that isn’t 16-bit aligned. Either change that to _mm_loadu_ps() (which also works on unaligned pointers but incurs a performance penalty), or make sure your object is aligned when doing the heap allocation (there’s a STL function called aligned_alloc() in C++, probably there’s something similar in Rust)
Post reply on HN