# Interop with Other Languages A major goal of Puck is _universal, minimal-overhead language interoperability while maintaining type safety_. There are three issues that complicate language interop: 1. Conflicting memory management systems, i.e. Boehm GC vs. reference counting 2. Conflicting type systems, i.e. Python vs. Rust 3. The C ABI. For the first, Puck uses what amounts to a combination of ownership and reference counting: and thus it is exchangeable in this regard with Nim (same system), Rust (ownership), Swift (reference counting), and many others. (It should be noted that ownership systems are broadly compatible with reference counting systems). For the second, Puck has a type system of similar capability to that of Rust, Nim, and Swift: and thus interop with those languages should be straightforward for the user. Its type system is strictly more powerful than that of Python or C, and so interop requires additional help. Its type system is equally as powerful as but somewhat orthogonal to Java's, and so interop is a little more difficult. For the third, Puck is being written at the same time as the crABI ABI spec is in development. crABI promises a C-ABI-compatible, cross-language ABI spec, which would *dramatically* simplify the task of linking to object files produced by other languages. It is being led by the Rust language team, and both Nim and Swift have expressed interest in it. Which bodes quite well for future... Languages often focus on interop from purely technical details. This *is* very important: but typically no thought is given to usability (and often none can be, for necessity of compiler support), and so using foreign function interfaces very much feel like using *foreign* interfaces. Puck attempts to change that. ...todo... Existing systems to learn from: - https://doc.rust-lang.org/reference/abi.html - https://www.hobofan.com/rust-interop/ - https://github.com/eqrion/cbindgen - https://github.com/chinedufn/swift-bridge - https://kotlinlang.org/docs/native-c-interop.html - https://github.com/crackcomm/rust-lang-interop - https://doc.rust-lang.org/reference/abi.html - https://doc.rust-lang.org/reference/items/functions.html#extern-function-qualifier - https://github.com/yglukhov/nimpy - https://github.com/yglukhov/jnim - https://github.com/PMunch/futhark - https://lib.haxe.org/p/callfunc/