1. Euphoria vs Python vs Go vs Rust

Any Euphoria/Phix programmers want to do this algorithm and compare? Fun!

http://www.nicolas-hahn.com/python/go/rust/programming/2019/07/01/program-in-python-go-rust/

new topic     » topic index » view message » categorize

2. Re: Euphoria vs Python vs Go vs Rust

I've already started digging into it. Haven't written any code yet. Just trying to take stock of what we need to accomplish this.

I could use an external library to read/write PNG files, but that feels like cheating since I'm just passing off most of the work to C code.

Although, his Python code is using PIL (Python Imaging Library) which is written in C as a Python module. So maybe it's not cheating then?

Thoughts?

-Greg

new topic     » goto parent     » topic index » view message » categorize

3. Re: Euphoria vs Python vs Go vs Rust

This only works on ppm files:
https://rosettacode.org/wiki/Percentage_difference_between_images#Phix

This will load a png and extract the pixels (but do something else with them):
https://rosettacode.org/wiki/Color_quantization#Phix
Note that (my) im_pixel() routine only works on IM_RGB so it uses imImageRemoveAlpha() as a work-around.

Between the two of them, and a fixed im_pixel(), should be everything you need.
Actually, writing a brand new im_get_all_pixels() would probably be better and much faster, as well as sidestep the im_pixel() bug.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Euphoria vs Python vs Go vs Rust

ghaberek said...

I could use an external library to read/write PNG files, but that feels like cheating since I'm just passing off most of the work to C code.

I agree with you that it's cheating. Besides, even using a C-lib, the Python performance is awful.

So, go the other route.

However, if there's a C-lib that is demonstrably better, sure... Why not? It's still Euphoria as main().

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu