Live data from Hacker News

Writing a winning 4K intro in Rust

codeslow.com

11–20 of 94 posts

Re: Writing a winning 4K intro in Rust

#11
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." […

Oh yeah, the Cracktro.

Re: Writing a winning 4K intro in Rust

#12
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." […

I never get tired of watching these things. Such a cool art form.

Re: Writing a winning 4K intro in Rust

#13
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() {
        s += xs[i] * ys[i];
    }
https://users.rust-lang.org/t/how-to-zip-two-slices-efficien...

https://github.com/rustsim/nalgebra/blob/b1b18d17ee64d3fd28b...

Re: Writing a winning 4K intro in Rust

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

Rust will do that too. We're talking about micro-optimization-level details, not allocation of iterator objects and so forth.

Re: Writing a winning 4K intro in Rust

#15
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." […

I'm surprised someone on HN since 2012 would learn about the demoscene today! Then again, it's true that the demoscene "keeps to itself", it's always been quite the bubble. I'm not sure how that community could do some outreach, but I believe a lot more people would find it interesting.

Re: Writing a winning 4K intro in Rust

#16
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." […

Recently, Virtuaverse used Demoscene as part of a cyberpunk story.

https://www.gog.com/game/virtuaverse

Re: Writing a winning 4K intro in Rust

#20
post #12
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." […

I never get tired of watching these things. Such a cool art form.

Sometimes they can be a lot of filler though. Yes you managed to create a 40 minute video but its 90% the same thing moving very slowly.
Post reply on HN