garnix-io/garn

discussion: use https://bun.sh/ instead of deno

Closed this issue · 3 comments

it seems more of target to be drop in replacement for node and may have faster startup time which is prio when doing shell scripts.

also used it to handle latest es2022 modules well.

as i read marketing materials of both on main paves, bun seems gravitates toward shells and cli tools more then deno.

not sure so if deno features of isolation of any use for garn?

bun security oven-sh/bun#725

jkarni commented

Hey!

Our reasons for choosing Deno were twofold:

  1. Fine-grained security/purity controls. We want to be able to say that no files can be accessed from garn.ts, or written to (or, more likely, accessed outside the current directory). My understanding is that this is gaining support in node too though.
  2. Not needing config files. With deno, you can just import directly from URL. With node, you need to have a package.json. That's fine for "real" node projects, but garn.ts isn't itself that - it's just a configuration file for the project. In fact, if it's a configuration for an npm project, that we start having to worry about conflicting package.json files, or merging them, etc.

Any ideas on how bun fits in with those two?

  1. bun has not such support now. link about discussion is above. so bun is considers to compile it with features like network access vs not, file vs not. as i get it. so no it does not have. not sure if they will have, but given node does that - they will have to do it either i guess.
  2. just tried some version of bun from nix unstable latest, it cannot run from HTTPS url. i see. okey.

for
1.1. imho using os level isolations features, like nix does, could be more fit for garn kind of i guess. at least it feels that garn would be more nix integrated and aligned than not in this case.