flameeyes, (edited )
@flameeyes@mastodon.social avatar

Okay more refactoring concerns. The functions are all over the place both in terms of maintaining state and accessing global parameters. Plus structure sizes are fixed with arrays, because of course this is basic C.

flameeyes,
@flameeyes@mastodon.social avatar

Before someone suggests rewriting it in Rust (which is a meme by now), please give me an answer to https://flameeyes.blog/2019/05/18/im-told-rust-is-great-where-are-the-graphics-libraries/?mtm_campaign=social&mtm_kwd=mastodon first.

DavidNielsen,
@DavidNielsen@mastodon.social avatar

@flameeyes seems like a question for @soller, he seems on top of the Rust world.

soller,
@soller@fosstodon.org avatar

@DavidNielsen @flameeyes I'm too busy rewriting things in Rust to deal with such blog posts

soller,
@soller@fosstodon.org avatar

@DavidNielsen @flameeyes I guess I was blocked for this, I can't see the thread any more 🤣. Rust GUI libraries are growing quickly, and I am writing many complex GUI apps for COSMIC exclusively in Rust.

hayalci,

@flameeyes rewrite it in Zig? /ducks

jmc,
@jmc@mastodon.social avatar

@hayalci @flameeyes This wouldn't actually be such a bad idea if the original project is in C, but for graphics libraries the situation is still a bit wonky 😶

flameeyes,
@flameeyes@mastodon.social avatar

@jmc @hayalci I mean, if it can still call into ffmpeg it might work. But I'd like something a little more... mainstream.

federicomena,
@federicomena@mstdn.mx avatar

@flameeyes Over in the GNOME world we've been moving some things to use the Rust image codecs; they are working well. Do you want some details? (TL;DR - the actual codecs under the "image" crate are much better than they were when you wrote your blog entry.)

I did some research around porting libjpeg-turbo to Rust and arrived at some conclusions - also happy to talk about this.

(For unpaper - looked at the sources briefly - yes! Put things in neat structs instead of global vars!)

federicomena,
@federicomena@mstdn.mx avatar

@flameeyes Oh man. The unpaper sources are verrrrrry similar to something I've refactored before.

Do you want some refactoring advice? I think this can be turned into reusable code reasonably easily, with bog-standard refactoring. I read your "re-designing an interface" blog post and it's totally doable.

flameeyes,
@flameeyes@mastodon.social avatar

@federicomena any advice is always appreciated 😀 but in general it's not my first refactor, it's more a balancing act between finding the time and keeping it working, given I don't actually use the tool myself directly anymore 😞

I'm already glad I managed to split it into separate files, when I forked it it was a single unpaper.c with everything inside 😬

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • mdbf
  • ethstaker
  • magazineikmin
  • GTA5RPClips
  • rosin
  • thenastyranch
  • Youngstown
  • osvaldo12
  • slotface
  • khanakhh
  • kavyap
  • InstantRegret
  • Durango
  • provamag3
  • everett
  • cisconetworking
  • Leos
  • normalnudes
  • cubers
  • modclub
  • ngwrru68w68
  • tacticalgear
  • megavids
  • anitta
  • tester
  • JUstTest
  • lostlight
  • All magazines