r/Compilers •

[deleted by user]

[deleted] — view deleted post

0 Upvotes

26 comments sorted by

View all comments

Show parent comment

3

u/stingraycharles Feb 22 '26

Hey, as someone who does a lot of FFI with GC based languages (Java, Go, C# and Python), I can tell you that GC doesn’t automatically make FFI harder, it’s just that GC is entirely paused during any FFI invocation.

That’s typically acceptable.

Most languages (eg Go and Java) provide various levels of “safety” around function invocations, and allow you to do “unsafe” invocations which assume eg that you don’t modify memory, don’t do any callbacks, etc.

Using reference counting can be interesting, but I can’t escape the feeling that there’s a reason that nearly all languages settled on GC (circular references being a major one).

1

u/funcieq Feb 22 '26

Yes, you're right, because I use C# myself. I realize that from the developer's side it's relatively simple. But it's not just about ffi. It's also about giving zap a wider range of possibilities.