Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions apps/bnk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# BunNativeKit

> Early work in progress. Don't expect anything to work (how you want it to at least).

BunNativeKit (bnk) is a little research project i started to do a bunch of funny "nonsense" and "neat" things to- uh i mean WITH* bun :D

### Essentially a TLDR of BNK would be my funny attempt at working with native code in Bun, but wrapping it up in a nice DX box :D
> it is not currently classifiable as JIT - but, im working on things under the hood to get closer to that goal. But the API signature will stay roughly the same.

Write inline Zig, C, C++, or Rust right in your TypeScript and have it Just Work™. The JIT compiler handles all the compilation, caching (both memory and disk!), and FFI symbol parsing automagically. Need production builds? AOT mode has you covered with cross-platform compilation and TypeScript declaration generation. Oh and it'll even install Zig for you if you don't have it <3

```ts
import { jit } from "@bunnativekit/jit";
// <lang>.jit() expects a main function. currently it will run main, though this will be configurable in the future.
const result = await jit.zig(`
export fn main(a: i32, b: i32) i32 {
return a + b;
}
`, 6, 7); // => 13
```

Give [bunnativekit.xwx.gg](https://bunnativekit.xwx.gg) a look for more nonsense + deeper dive into what bnk is, why/what/huh???- and a api ref ([bnk.xwx.gg](https://bnk.xwx.gg) also works dw <3)


MIT License <3