Skip to content

Commit

Permalink
add ffi_util package for FFI related util & add `@ffi_util.RawFunct…
Browse files Browse the repository at this point in the history
…ion` type for capture-free function
  • Loading branch information
Guest0x0 committed Jan 24, 2025
1 parent ee138fa commit 7fd624c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ffi_util/ffi_util.mbti
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package moonbitlang/core/ffi_util

// Values

// Types and methods
pub type RawFunction

// Type aliases

// Traits

1 change: 1 addition & 0 deletions ffi_util/moon.pkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
4 changes: 4 additions & 0 deletions ffi_util/raw_function.mbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/// A compiler builtin type for raw functions, i.e. functions without any capture.
/// This is useful when passing callbacks to FFI.
/// Here `T` must be a function type in `RawFunction[T]`
pub type RawFunction[T]

0 comments on commit 7fd624c

Please sign in to comment.