Live data from Hacker News

Writing a winning 4K intro in Rust

codeslow.com

31–40 of 94 posts

Re: Writing a winning 4K intro in Rust

#31
post #29

Looks nifty. Seems to only compile on Win though: $ xargo run For more information about this error, try `rustc --explain E0463`. error: could not compile `winapi`. Still, probably good for interest/learning from. :)

Hm so it's leveraging the Windows API. I thought demos were supposed to be bare-metal.

Most 4K demos on Pouet the last years has been Windows only. Demoscene parties usually specifies exactly what computer they will run the demos on in advance so groups can optimize for that setup. The code sometimes only run on that particular setup.

Re: Writing a winning 4K intro in Rust

#32
post #7

TIL: about the Demoscene[1], "an international computer art subculture focused on producing demos: self-contained, sometimes extremely small, computer programs that produce audio-visual presentations. The purpose of a demo is to show off programming, visual art, and musical skills. Demos and other demoscene productions are shared at festivals known as demoparties, voted on by those who attend, and released online." […

> TIL: about the Demoscene

In that case, definitely have a look at this amazing write up (http://www.sizecoding.org/wiki/Memories).

Re: Writing a winning 4K intro in Rust

#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 anti-corporate vibe and at the same time wish they were a little more professional. Whatever you think, they're true 80s style cyberpunk hackers!

Re: Writing a winning 4K intro in Rust

#34

That intro was very cool! Does anyone have pointers for a fullstack web dev who is interested in the demoscene (or computer generated art in general)? I've actually played around a bit with rust [1] (I understand it probably isn't ideal for demoscence), but I haven't really done any graphics programming before. I get the feeling it is a pretty deep rabbit hole. [1] https://github.com/dwaltrip/advent-of-code-2019-rust

> but I haven't really done any graphics programming before

I've never written any demos but do enjoy playing with GPUs. Regarding anything and everything graphics related, try not to get overwhelmed by modern APIs; it's very easy to lose the forest for the trees. Shadertoy is a really good starting point.

My impression of the demoscene can be loosely summarized as extreme code golf for graphics and sound.

Re: Writing a winning 4K intro in Rust

#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.

Re: Writing a winning 4K intro in Rust

#38
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 side were you on?

Re: Writing a winning 4K intro in Rust

#39
post #5

Kinda surprised about iterators not getting optimized so well. Even in higher-level languages, this is a commonly utilized optimization opportunity - e.g. the C# compiler will replace a foreach-loop over an array with an identical (but faster) for-loop.

There are tricks/an art to Rust's iterator semantics. One example I know of is that when trying to calculate a dot product, you can improve the generated code and elide the bounds check only by a very particular syntax: // Must slice to equal lengths, and then bounds checks are eliminated! let len = cmp::min(xs.len(), ys.len()); let mut xs = &xs[..len]; let mut ys = &ys[..len]; let mut s = 0.; for i in 0..xs.len() {…

Does it still elide the bounds check if you replace the first three lines with

    assert_eq!(xs.len(), ys.len());

?

Re: Writing a winning 4K intro in Rust

#40
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…

As far as I am aware, the only known bypass of a particular iOS security mitigation has a note in it from the author notifying readers that they’ll only understand it after they “hit a blunt”. Said author also enjoys referencing Kim Jong Un in their work. It’s not just the demoscene that’s like this.
Post reply on HN