-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Bun #9
Comments
Bun seems like a really bad idea to me. Do you actually use it? I am hesitant to support a runtime that is doomed. |
Regardless, this will not be possible until Bun supports network imports. Pending oven-sh/bun#38. Even if Replete will not support Bun out of the box, I intend to extend the interface of Replete's run.js to accept a custom list of REPLs. That way a Bun REPL could be written in userland. |
Yes, we're using bun. It has its shortcomings but we like the runtime performance and speed of their dev team. Feels a bit weird to install deno just for Replete. |
I'd just like to clarify what you are requesting. It's important to understand that Replete does not run as a single process. Rather, there is a "master" process controlling several "padawan" processes, one for each REPL environment:
The code for the master process was originally written to run on Node.js. Later, I discovered that the same code ran on Deno, thanks to Deno's excellent Node.js compatibility layer. Deno, unlike Node.js, is capable of loading code directly over the network, removing the most complicated step of Replete's installation, so it became the preferred runtime. As you rightly point out, this convenience came at a cost: a dependency on Deno. The only way the master can run in a Bun process is if Bun implements the required Node.js APIs. Now, the padawans. Obviously Deno code must be evaluated in a Deno process, and Node.js code in a Node.js process. But because the interface between master and padawan is loose, any combination of master and padawan is allowed. For example, the following configurations all work:
It is also possible to disable REPLs that are not required, simply by omitting the I am optimistic that I can write a Bun padawan. But unless Bun's Node.js compatibility layer is sufficiently comprehensive, the dependency on Deno or Node.js for the master process will remain. Does your team have Node.js installed? If so, it should be possible for you to avoid installing Deno whilst still using Replete to evaluate Bun code. |
It turns out Bun's Node.js compatibility is good enough to run Bun, Node.js, and Deno REPLs, but not good enough to run the browser REPL. (This call to You should now be able to use Replete without Deno or Node.js installed. You can try it out by cloning the Replete repository, installing the latest VSCode extension, and placing the following replete.json in your project root:
Providing a debugging port is optional, but I find it comes in handy. |
Would be great if https://bun.sh would be supported as alternative to Node/Deno.
The text was updated successfully, but these errors were encountered: