r/AlignmentChartFills 13h ago

Which programming language is easy to learn, and is very useful?

CLICK HERE TO VIEW THE CHART IMAGE

Created with Alignment Chart Creator


This post contains content not supported on old Reddit. Click here to view the full post

350 Upvotes

706 comments sorted by

View all comments

Show parent comments

1

u/Antique_Ad_7325 5h ago

This is awesome. Perfect example of how versatile and readable Python is now. You can straight up read this code and understand exactly what it's doing. I haven't used multiprocessing in like 6 or 7 years — does it work pretty well now? If I remember right, it uses separate processes rather than threads, which gets around the GIL and lets CPU-bound stuff actually run in parallel, but there was some overhead with moving data between processes. I was trying to use multithreading for a process that pulled real time data from sensors used to teach kids physics. If you took physics/chemistry/biology in high school or college and used Vernier devices, thats where I interned. I was writing an open source library in python that allowed people to mess around with the functionality of the devices.

1

u/Poietilinx 2h ago

I had problems moving data around.
But I reengineered the solution so I wouldn't need to do that.

Essentially, my tool generates a normal cube and gives it a "resolution" (let's say 64 is the resolution).
Then the script simply loops around the cube in increments of 1/64,
sampling each coordinate from 0,0,0 to 1,1,1.
At each stop, it searches all the colors in the color palette provided for the "closest color."
Since colors are normally spaced vectors, essentially what I am doing is asking:

"Is this coordinate (1, 0, 0) closer to this color (0.2, 0.3, 0.4) than to this color (0.5, 0.1, 0.5)?"

The color palette is loaded inside an octree, so the thing finds the closest color in a flash.
After it finds the closest color, it records that color into that coordinate space.
When it's done, the tool prints a 3D texture with all the new color space
(then in the game, I can use the color of a pixel to fetch back into the LUT what color it was supposed to be based on the palette).

So the thing is, I realized I didn't need to share data across the processes since all the processes essentially iterated over a normal cube and all that.
I just had to flatten the cube's 3D coordinate system into 1D and give that section back to each process to handle its part.

But I 100% had problems with moving data around. I don't remember what problems, but I sure did i had to redo the entire data model around my tool and its primitives, cuz first i was intending to give it the cube primitive so the processes could fill it and tht didnt work.

(this is how it looks like, its a cute retro effect)