Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ihnorton/mojo-ffi
https://github.com/ihnorton/mojo-ffi
mojo mojo-lang
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ihnorton/mojo-ffi
- Owner: ihnorton
- Created: 2023-10-20T03:47:23.000Z (about 1 year ago)
- Default Branch: ffi-demo
- Last Pushed: 2023-10-20T16:58:15.000Z (about 1 year ago)
- Last Synced: 2024-02-11T18:47:28.284Z (10 months ago)
- Topics: mojo, mojo-lang
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 26
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-mojo - mojo-ffi - Notes and recipes about how to call C functions from Mojo and other tricks. (🗂️ Libraries / FFI / Interop)
- awesome-max-mojo - ihnorton/mojo-ffi - ffi?style=social"/> : Mojo FFI Notes. (FFI Bindings)
- awesome-max-mojo - ihnorton/mojo-ffi - ffi?style=social"/> : Mojo FFI Notes. (FFI Bindings)
README
# Mojo FFI Notes
1. [Calling C libraries from Mojo](mojo-call-c/)
2. [Statically linking a Mojo executable against a C library](mojo-exe-link-c-static/) (demo)
3. [Creating a shared library from Mojo, and calling it from C](c-link-mojo-shared/) (demo)In order to run 2 and 3, add `scripts/` to your `PATH` before using the demo `Makefile`s (or invoke `/this/path/scripts/mojoc` directly). The scripts require `python` to be available in `PATH`.
(note: the scripts have not yet been updated to support macOS, but the approach should work with minor modifications)
or you can use
```bash
source setup.sh
```
this will make the Makefiles on 3 work properly