Python FFI Support
#10775
Replies: 4 comments 2 replies
-
Wtf, and how did you think we could do that? |
Beta Was this translation helpful? Give feedback.
1 reply
-
I believe that they should not |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think this is a great idea. Everytime I want to interop with Python for AI / data engineering, its always a pain. Bun has a history of this with things like the sqlite integration and it fits with the philosophy of focusing on practical real-world dev experience above all. |
Beta Was this translation helpful? Give feedback.
0 replies
This comment was marked as off-topic.
This comment was marked as off-topic.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Bun (and the typescript ecosystem are amazing); together, developer are able to quickly build out amazing full-stack web application. Yet, when creating non-trivial applications which require more than just some basic CRUD logic, the typescript full-stack ecosystem doesn't quite live up to hype. Increasingly, in order to build out AI driven applications (and more) developers have to turn to another language (like python) and create an API which wraps some bit of functionality.
Creating a REST API works, but as most know, it doesn't work well (even when using OpenAPI codegen tools). To get these applications working, developers have to attempt to sync state, duplicate database models, and undertake many other boilerplate tasks across their "frontend" and "backend" codebases. While this was a necessity for 2010s when developers moved from SSR rendering to SPA apps, we are seeing a renaissance of SSR (this time with hydration). Therefore, if we are back to rendering on the server, why do we need still setup a bunch of bloatware in order to create a real application. Why don't we just start calling the "backend" directly?
While there are a bunch of interesting ways to accomplish this, arguably the best way is through Foreign Function Interfaces (FFIs). While bun does have a FFI, most most backends in use today (namely python) do not easily compile down to the de-facto FFI format (i.e. C). And while there is a way to call python from bun (i.e. https://github.com/codehz/bun_python) or using wasm (i.e. pyodide), these methods do not have first class support within bun.
Given this, I was wondering if the bun team has any plans in the near or short term to support calling python code within bun?
Beta Was this translation helpful? Give feedback.
All reactions