Writing a winning 4K intro in Rust
codeslow.com
codeslow.com
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!
I've had this exact conversation with coworkers before.
After witnessing how "professionals" act behind closed doors, the difference is merely a mirage, in order to not affect the business image.
What I consider unprofessional for example is banning people from your service because a mob demands it. Paypal is an example of a service for financial transactions that banned users fallen out of good faith. Here professional distance would actually make sense.
Imagine IT services giving out personal information of people they don't like, it is completely unimaginable. I think this is a real danger for large social media sites given the behavior of companies.
Being professional is entirely about being a good lier.
Actually i like source-forge, it does not attract the twitter and facebookish folks as github seems to, aka
EDIT: Maybe the best list to find future NO-GO applicants
Why not just accept that i like something but being absolutely ok with something else?
I'm glad these venerable computers live on.
It's a citation I want to give out surprisingly often.
In that case, definitely have a look at this amazing write up (http://www.sizecoding.org/wiki/Memories).
I always feel like I missed out on something transcendental. I think I would have leaned a huge amount. Instead I had to settle with hacking NewDOS/80 binaries.
I have a huge amount of technical respect for the people who do this stuff.
There were only two types of programming that intimidated me so much I wouldn't even try: people writing languages from scratch and the demo scene people. I just sat back and said "nope, I'll never get there."
I also wrote a BBS, so go figure...
A while back the same happened to pouet (https://twitter.com/pouetdotnet/status/1249453524758528000).
Demoscene stuff seems to be good at triggering the filters :)
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.
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.
The Coding Train on youtube has a ton of content [0]. If you really want to start from the beginning then I would also recommend Coding Math on YouTube [1], which is sort of graphics from first principles using JS/canvas. That even starts with teaching trigonometry, vectors, etc. So if your math is rusty it's a good place to start
At some point in history, when you wrote the straightforward, primitive three-nested-loops version of matrix multiplication your code ran much faster than when you tried to implement one of the more sophisticated algorithms.
That was because the Fortran compiler recognised the primitive version and replaced it with a special purpose highly optimized matrix multiplication. The compiler couldn't do that with the more sophisticated approaches.
> At some point in history, when you wrote the straightforward, primitive three-nested-loops version of matrix multiplication your code ran much faster than when you tried to implement one of the more sophisticated algorithms.
It might also have been due to Fortran using column-major matrix layout; if you try to implement a sophisticated multiplication algorithm that is optimised for row-major matrices, then that will be slower (indeed, also the row-major three-nested-loops version is already quite a bit slower). Another thing is that the sophisticated algorithms usually have some constant overhead that makes them shine only on sufficiently large matrices.
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...
assert_eq!(xs.len(), ys.len());
? $ xargo run
For more information about this error, try `rustc --explain E0463`.
error: could not compile `winapi`.
Still, probably good for interest/learning from. :)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.
I'm not sure if the author is reading this thread, but thanks! :-)
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.
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.
The music vibe reminds a bit of Brian Eno's Under Stars track from the Apollo album:
For some languages where this is really hard to achieve, they'll carve out a separate category for a language if they think there will be enough entries. e.g. a Java category where the entry fits with the space limit, but can use any other library in the default Java classpath, even though that's very very big. Likewise for different operating systems (Linux, MacOS competitions).
There's been a fantastic resurgence in retrohardware and a category called "old school/skool" for entries that have to run in MS-DOS -- which can be ultra hard as you have to code up a lot more of the runtime libraries like music, graphics rendering pipelines, etc.