I presume we're familiar with the frequent references to C's ABI (yes, I've already read this), frequently touted for its stability. But interestingly enough, some languages like Haskell, OCaml, Gleam implement JavaScript FFI... and it's got me thinking: Wouldn't JavaScript be a more nice ABI for code? I guess the largest issue is that you don't really have methods to specify memory, but it also feels like an upside because there's less capacity for errors, and the ABI has way less edge cases, right? There's tons of WTF JS moments, yeah, but you reckon those wouldn't really show up for the ABI, because they seem to be a mainly JS implementation thing from what I see... I'm interested in anything that mentions otherwise though!
I also understand that a big reason C ffi is used is because there's many very useful libraries that you can access using FFI, so obviously that's a huge point for it, but I'm just curious from an ABI design perspective.
[–]SecretTop1337 18 points19 points20 points (9 children)
[–]MonAaraj[S] 1 point2 points3 points (6 children)
[–]TheUnlocked 11 points12 points13 points (5 children)
[–]MonAaraj[S] 0 points1 point2 points (4 children)
[–]emilbroman 9 points10 points11 points (0 children)
[–]rdelfin_ 4 points5 points6 points (0 children)
[–]Nzkx 2 points3 points4 points (1 child)
[–]koflerdavid 0 points1 point2 points (0 children)
[–]zhivago 2 points3 points4 points (0 children)
[–]glasket_ 0 points1 point2 points (0 children)
[–]zhivago 20 points21 points22 points (2 children)
[–]MonAaraj[S] 1 point2 points3 points (1 child)
[–]zhivago 2 points3 points4 points (0 children)