Live data from Hacker News

Writing a winning 4K intro in Rust

codeslow.com

41–50 of 94 posts

Re: Writing a winning 4K intro in Rust

#41

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

Javascript demos is one option https://www.dwitter.net/

Re: Writing a winning 4K intro in Rust

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

Probably developers sick of all programming being so sterile and corporate. You can't even publish a foss project without people jumping at you if its not suitable for a corporate environment.

Re: Writing a winning 4K intro in Rust

#43
post #37

As author mentions, it is non-idiomatic Rust with lots of unsafe's, basically writing C code with Rust compiler.

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.

Re: Writing a winning 4K intro in Rust

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

[deleted]

Re: Writing a winning 4K intro in Rust

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

Using the OS is allowed. As far as I know, one of the reasons why there are more Windows demos than for example Linux, is that Windows provides more graphics/sound APIs out-of-the-box while on Linux the OS itself does less you'd have to utilize libraries (which is kind of cheating when doing a 4k demo).

I think it could be summarized as "write a demo for the target platform as efficiently as possible". Doesn't necessarily need to be bare metal, there are JS demos that run in the browser as well. In that case the browser (with all its APIs) is the target platform.

Re: Writing a winning 4K intro in Rust

#46

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

In this intro and in almost every modern 4kB intro, the graphics are made in a shader. To play with shaders, I'd recommend you to look at https://www.shadertoy.com/. Check also Inigo Quilez's website (https://www.iquilezles.org/), it has a lot of fascinating content.

Re: Writing a winning 4K intro in Rust

#47

Earlier quoted context omitted.

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.

Something something lucky 10,000

For those not in the know, this is an xkcd reference: https://xkcd.com/1053/

It's a citation I want to give out surprisingly often.

Re: Writing a winning 4K intro in Rust

#48
post #37

As author mentions, it is non-idiomatic Rust with lots of unsafe's, basically writing C code with Rust compiler.

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?

Re: Writing a winning 4K intro in Rust

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

I wish HN had a top nav link and a mechanism like it has for “Show HN” posts, but for demoscene stuff. The prefix one would use could be “Demoscene HN” or something, and the rule would be the same as for the “Show HN” prefix – that using it is “allowed” only when the submitted of the link was involved in making the thing :D
Post reply on HN