filipw,
@filipw@mathstodon.xyz avatar

if I asked you today to write an algorithm X that you need to compile as native library that can run in the browser, desktop Windows app and Android/iOS app, which language would you choose for that and why?

C is not allowed because it's year 2023 already and we can do better 😅

xgranade,
@xgranade@wandering.shop avatar

@filipw Honestly? Rust, full stop. WASM gets you into the browser quite well, and for platforms that allow native code, you can make a *.so or *.dll that's pretty much indistinguishable from one made in C.

I even once had an experiment where I used the same file to define WASM and native C APIs, expanding with macros as appropriate for each target.

filipw,
@filipw@mathstodon.xyz avatar

@xgranade yeah I agree 100%. and with something like https://github.com/mozilla/uniffi-rs you don't even need to do FFI by hand, it can all be elegantly generated...

I was wondering how people solve this though, it's not like (I think) it's a super unusual use case - but I reckon most would still go for C/C++

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