oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.38k stars 2.78k forks source link

Allow embedding bun as a C-compatible library #14252

Open dunglas opened 1 month ago

dunglas commented 1 month ago

What is the problem this feature would solve?

Node as well as some other popular scripting languages runtime (PHP, Python...) provide an API to embed the engine in other programming languages (C, C++, Go) as a dynamic or shared library.

What is the feature you are proposing to solve the problem?

Exposing Bun as a library usable in programs able to call libraries using the C conventions (almost all existing programming languages).

Calling Zig from C looks possible, but experimental: https://github.com/ssteinbach/c_call_zig

What alternatives have you considered?

No response

DeadWisdom commented 1 month ago

If I could embed bun, then I could be running typescript in my python servers or in Unreal, which would be super cool.