123 points by johnsmith13 6 months ago flag hide 16 comments
johnkerry 6 months ago next
Great article! I've been looking for a good introduction to generative art with Rust and this hit the spot. Thank you for sharing!
srmason 6 months ago prev next
Just curious, what's the advantage of using Rust for generative art over other languages?
johnkerry 6 months ago next
Rust has excellent support for multithreading and the borrow checker makes it less error-prone than C++ or other widely used languages. It's also gaining more popularity in the game development community, which is a growing area for generative art.
sacha 6 months ago prev next
I really appreciate the code samples! I've never worked with Rust before and this helped me get started with understanding its syntax and capabilities. Thanks for the write-up!
johnkerry 6 months ago next
Glad you liked it! I found the best way to learn a new programming language is to read through and write working code samples that illustrate its concepts. Hopefully, it helps other developers learning Rust too!
singularity 6 months ago prev next
Very cool indeed! I'm going to try this approach out on my machine learning projects. I imagine it would make great visualizations for clusters and other related data structures.
alpineliam 6 months ago prev next
I've been using Hashes for Years! Is this approach new? Have you seen it working in other projects?
johnkerry 6 months ago next
@alpineliam There's nothing really new here; this is quite an established technique within the generative art community. I've been using this particular strategy for over a decade, but I continue to discover new uses and variations every year. I'm glad someone else has found success with it too!
aeoncurious 6 months ago prev next
I'm also a beginner learning Rust, I see there's an affinity between the language and this generative art. Any special libraries or resources you'd recommend?
johnkerry 6 months ago next
I'm glad you noticed an affinity too! Some libraries to get you started with Rust and generative art includes 'picture-rs' which provides a number of features to create and display graphics. You can use the 'lerp' library for smoothly tween and interpolate between colors! Good luck, and let me know how it works out for you!
trevarth 6 months ago prev next
Well there is also Haskell! What's your opinion about the Haskell generative art ecosystem?
johnkerry 6 months ago next
@trevarth That's a good question! I don't have a lot of experience with Haskell, but from what I understand, Haskell has great support for code elegance and can produce impressive results in generative art. However, the environment is smaller than Rust or anything related to C++, which can sometimes affect documentation and the community size. I'll have to look into it more!
lithanum 6 months ago prev next
I'm curious if anyone else has built programs to generate generative art from music? I've heard that's a popular use case in the generative art community.
uranus 6 months ago prev next
I've used Amper Music myself. I like their AI songwriting tool, which you can use to generate and customize a track and render it as a visual piece. It takes some getting used to, but the results are worth it!
mtmckinley 6 months ago next
@uranus Is there any way to use open-source solutions for this? Amper Music isn't open source.
uranus 6 months ago next
@mtmckinley Yes, I've also used Sonic Pi, an open-source platform that combines code with music. It's based on the Ruby programming language and allows you to create sounds, loops, melodies, and visualizations. Check it out! https://www.sonic-pi.net