> My idea is to strip the system down as much as possible and leave only what is required for production. > Development would be done using the full Bun runtime, while production would use its lightweight fork, Cruller. I do not have the resources of the Oven team to develop and maintain a massive general-purpose runtime, so I want to focus on specific production requirements. I don't know about others, but I don't t…
Cruller: Bun's Zig Runtime, Continued on Zig 0.16
111–120 of 127 posts
Re: Cruller: Bun's Zig Runtime, Continued on Zig 0.16
#112What makes Bun Bun is all the things that got removed from this project. Node is already powerful enough and well maintained. Why would anyone use this?
The developer is quite clear about not wanting to make Bun. They want to make a reusable JavaScript runtime for Zig. How would you execute a Node runtime in Zig?
Isn’t the main point of using zig to avoid having a runtime and garbage collection to begin with?
Re: Cruller: Bun's Zig Runtime, Continued on Zig 0.16
#113i dont see the point of this to be honest, if rust is actually better for bun why are you people just hating on it for no reason? a software doesnt have to be written in your favourite language for it to work. bun was a sloppy project is zig and still sloppy in rust
The repo calls out the purpose and it's pretty good.
I might be missing something, but where does it mention why specifically they're interested in having this be Zig and not Rust?
Re: Cruller: Bun's Zig Runtime, Continued on Zig 0.16
#114I don't understand why the git history has been pruned in this fork. According to the first commit in this fork: > Squashed as a single orphan commit — the original oven-sh/bun history isn't relevant to this stripped fork and its shallow clone doesn't push cleanly to a fresh remote. IMHO it's always a bad decision to do that. Here, all commit authors are lost. The original history is always relevant.
Re: Cruller: Bun's Zig Runtime, Continued on Zig 0.16
#115Re: Cruller: Bun's Zig Runtime, Continued on Zig 0.16
#116Earlier quoted context omitted.
The developer is quite clear about not wanting to make Bun. They want to make a reusable JavaScript runtime for Zig. How would you execute a Node runtime in Zig?
Spawning a process and piping the input? This does require having a node available at runtime though. Isn’t the main point of using zig to avoid having a runtime and garbage collection to begin with?
Take a look at the JavaScriptCore documentation to get a sense of what’s possible, it goes far beyond “piping the input”:
Re: Cruller: Bun's Zig Runtime, Continued on Zig 0.16
#117Earlier quoted context omitted.
The repo calls out the purpose and it's pretty good.
> Bun stopped shipping a Zig-based runtime after 1.3.14 — the project moved on to a Rust rewrite. Cruller forks that last Zig-era Bun and ports it forward to Zig 0.16 instead of following Bun into its rewrite. I might be missing something, but where does it mention why specifically they're interested in having this be Zig and not Rust?
Sorry, not repo, the link.
Re: Cruller: Bun's Zig Runtime, Continued on Zig 0.16
#118Earlier quoted context omitted.
Spawning a process and piping the input? This does require having a node available at runtime though. Isn’t the main point of using zig to avoid having a runtime and garbage collection to begin with?
That’s about the most basic imaginable implementation. Typically you use JavaScript runtimes like this to provide a plugin-like system for your static build that allows sandboxed customisation at runtime. Take a look at the JavaScriptCore documentation to get a sense of what’s possible, it goes far beyond “piping the input”: https://developer.apple.com/documentation/javascriptcore
Bun provides the node standard library, I suppose, but you likely don't want it in a plugin system. Because the bulk of it is to deal with web requests, or to allow system-wide file/network/process access. So you're going to re-implement your own safe library anyway.
Re: Cruller: Bun's Zig Runtime, Continued on Zig 0.16
#119Earlier quoted context omitted.
That’s about the most basic imaginable implementation. Typically you use JavaScript runtimes like this to provide a plugin-like system for your static build that allows sandboxed customisation at runtime. Take a look at the JavaScriptCore documentation to get a sense of what’s possible, it goes far beyond “piping the input”: https://developer.apple.com/documentation/javascriptcore
But what does bun bring to the table in that scenario? Why not interface with javascriptcore directly and skip the (unmaintained) middle man? Bun provides the node standard library, I suppose, but you likely don't want it in a plugin system. Because the bulk of it is to deal with web requests, or to allow system-wide file/network/process access. So you're going to re-implement your own safe library anyway.
There's a middle ground between "raw C API" and "full Node-compatible runtime". It sounds like this project is attempting to use that middle ground: the Zig wrapper around JavaScriptCore, rather than the whole abandonware project.
As per another comment here:
> This is not continuing the development on the original Bun (Zig) codebase. It is extracting a subset of that codebase for deployment purposes.