Bash? Nah, I Have Bun.

Поділитися
Вставка
  • Опубліковано 26 січ 2024
  • The new Bun shell ($) enables some INCREDIBLY cursed stuff. I loved every second of it
    BLOG POST bun.sh/blog/the-bun-shell
    Check out my Twitch, Twitter, Discord more at t3.gg
    S/O Ph4se0n3 for the awesome edit 🙏
  • Наука та технологія

КОМЕНТАРІ • 317

  • @leonzill
    @leonzill 5 місяців тому +156

    I open my front end code, it is JavaScript. I open my server code, it is JavaScript. My database? JavaScript. My shell commands? JavaScript. I leave my desk to get a snack. I open the fridge, it’s full of JavaScript. I try to scream, but only JavaScript comes out.

    • @fulconandroadcone9488
      @fulconandroadcone9488 5 місяців тому +11

      ECMAScript

    • @zionlee1004
      @zionlee1004 4 місяці тому

      @@fulconandroadcone9488 LigmaScript

    • @jsonkody
      @jsonkody 3 місяці тому

      @@fulconandroadcone9488 JS ._.

    • @BarisPalabiyik
      @BarisPalabiyik 2 місяці тому

      And you write all on the VSCode an electron app, written in JavaScript.

    • @OrderOfInput
      @OrderOfInput 2 місяці тому

      Hrngggggggggggg

  • @minikame2272
    @minikame2272 5 місяців тому +520

    If this scope creep keeps up, Bun will end up being an entire OS. You read it here first.

    • @anoh2689
      @anoh2689 5 місяців тому +37

      It's like emacs of the js eco system

    • @realmimak
      @realmimak 5 місяців тому +11

      what could go wrong

    • @b_delta9725
      @b_delta9725 5 місяців тому +15

      bun os becoming more mainstream than any linux distro would be crazy

    • @carloslfu
      @carloslfu 5 місяців тому +7

      I am all-in for Bun-OS 2030!

    • @clairrorism
      @clairrorism 5 місяців тому

      @@b_delta9725 year of the bun desktop

  • @vsolyomi
    @vsolyomi 5 місяців тому +118

    The cycle historically is 1.5-2 years for JS: we do the thing our own way and its the best thing ever, in 2 years: we did this thing our way and it was the worst thing ever and now I live in perpetual hell to support it in my project.

    • @codywikman1881
      @codywikman1881 5 місяців тому +13

      That cut deep. (while pondering the move to HTMX)

    • @snats
      @snats 5 місяців тому

      i feel that bun is really permeating a lot of principal developer apps. if it goes kaput, it's going to be a mess

    • @vsolyomi
      @vsolyomi 5 місяців тому

      @@codywikman1881 I have a feeling that htmx might actually survive the vicious cycle but I wouldn't bet my life on it either...

    • @okie9025
      @okie9025 5 місяців тому +2

      I predict that in 2-3 years, we will all go back to using React SPAs for everything and realize server-first apps and web-centric API design were a mistake

    • @philippefutureboy7348
      @philippefutureboy7348 2 місяці тому

      That’s really a JS/web thing. You look at Python, C++, Java, etc, and they all have some solid implementations and stick to them.
      Web is an ADHD kid with decision anxiety and delusions of grandeur

  • @wvovaw3052
    @wvovaw3052 5 місяців тому +150

    Don't ever set Bun as your system command shell....

    • @emireri2387
      @emireri2387 5 місяців тому +6

      i getthejoke but you actually should

    • @Kane0123
      @Kane0123 5 місяців тому +7

      Am I crazy to think that the differences between OS shells are less important as a we shift more and more toward containers even locally?

    • @channel-uz9fz
      @channel-uz9fz 5 місяців тому +1

      it would be funny if they developed some sort of way to actually make that work, like how zsh has `emulate sh && . /etc/profile` and it just works

    • @zildeos9858
      @zildeos9858 5 місяців тому +1

      Make me!

    • @cubondemais
      @cubondemais 2 місяці тому

      @@Kane0123 a little bit crazy, mostly due to windows. For windows, containers need WSL which doesn't have full access to do what a Linux or MacOS could do. That means either workarounds that can be difficult to do or simply having to do stuff directly with windows, which means no containers. Sometimes you simply have no choice but to use Windows. That's when you cry because all your shell skills become mostly irrelevant. Bun shell would shine in those scenarios. Also containers can consume a lot of resources and you might need those resources free for you to use.

  • @VivekYadav-ds8oz
    @VivekYadav-ds8oz 5 місяців тому +21

    now you have no idea what are the dependencies of this package because it's written in a string.

    • @AC-hh2cb
      @AC-hh2cb 4 місяці тому

      solvable problem, also not different from before

  • @wlockuz4467
    @wlockuz4467 5 місяців тому +10

    It certainly feels like an unusual direction to move in, but I have stopped trying to make sense of what goes on in the JS land.

  • @NiklasZiermann
    @NiklasZiermann 5 місяців тому +46

    These 'lets just see how much crap I can do with this' videos lately are really enjoyable to watch

  • @abdul-hameedmaree881
    @abdul-hameedmaree881 Місяць тому +1

    "7ms to start a shell, very annoying" I believe if you're not an alien, you will not notice that slowness level

  • @sillvvasensei
    @sillvvasensei 5 місяців тому +16

    "Your brain on JS" lol

  • @MarcelRobitaille
    @MarcelRobitaille 5 місяців тому +115

    There's no way this kills bash.

    • @Bu7MaiD075
      @Bu7MaiD075 5 місяців тому +17

      javascript: watch me.

    • @nyagah243
      @nyagah243 5 місяців тому +9

      Dude likes hyperbole

    • @b_delta9725
      @b_delta9725 5 місяців тому +9

      for webdev it's already meeting the quota. i used to manage my templates with a bash script, but now bun init ./template is easier and better

    • @b_delta9725
      @b_delta9725 5 місяців тому +3

      @@ElmerGLue what's a better tool for templates?

    • @MarcelRobitaille
      @MarcelRobitaille 5 місяців тому +2

      @@b_delta9725 Sounds like you're already a JS dev though.

  • @anasouardini
    @anasouardini 5 місяців тому +8

    PHP is staring at bun right now: "really!...."

  • @creaky2436
    @creaky2436 5 місяців тому +5

    Classic definition of “If it can be written in js, it will”

  • @BlackAsLight448
    @BlackAsLight448 5 місяців тому +25

    This feature seems just like the dax module available in Deno.

    • @elvitin
      @elvitin 5 місяців тому +8

      haha, and here I was thinking it was a super innovation from the bun engine, when Deno already had it, just didn't get the same spotlight. Bun is making everything seem like it's something new. Definitely, the Bun team does better in marketing

    • @peterjasko7059
      @peterjasko7059 5 місяців тому

      Damn it’s literally the same thing. Thanks for pointing it out!

  • @laalbujhakkar
    @laalbujhakkar 5 місяців тому +67

    yup! replace a 10mb binary with 3700 node packages so you can write “shell” commands in js - the madness continues!

    • @EwanMarshall
      @EwanMarshall 5 місяців тому +13

      and basically just created yet a new incompatible shell in doing it.

    • @hey.im_him
      @hey.im_him 5 місяців тому

      😂 🤣

    • @Turalcar
      @Turalcar 5 місяців тому +1

      It's bun, not node

    • @bren.r
      @bren.r 5 місяців тому

      Not to mention the former is battle tested.

    • @dasten123
      @dasten123 5 місяців тому +2

      javascript is _much_ more nicer to read and write than a shell script. Nothing is replaced here... it's combining the powers of two worlds, that's the point!

  • @onoff5604
    @onoff5604 5 місяців тому

    Great! Would love to learn more about this. Sounds like progress and a bit of the hope.

  • @littleluce
    @littleluce 5 місяців тому +1

    The end of this video made need laugh so hard. Amazing job!

  • @aabluedragon
    @aabluedragon 3 місяці тому

    Thanks! this is brilliant, well done bun team.

  • @arkbom
    @arkbom 5 місяців тому +5

    Bun brought Google ZX to their runtime

  • @gryg666
    @gryg666 5 місяців тому +14

    So, we can run php-cli inside js code. Perfect! :)

  • @happieplantnl
    @happieplantnl 5 місяців тому +1

    Nice! Would also love to see a video on Nushell. A shell made with Rust focused on data

  • @kwyaza
    @kwyaza 5 місяців тому +18

    Still using shell commands, I was hoping for better abstraction. E.g. instead of "grep" - you would import a JS function that does the same, then you just write JS instead of bash.
    Python has far better libraries for this. This is only useful - if you have an existing node project and want to keep some sysadmin stuff in the same project instead of .sh files.

    • @rafaelbordoni516
      @rafaelbordoni516 5 місяців тому +6

      Better yet, we go full javascript and npm install bun-grep with 2000 dependencies

    • @marty0678
      @marty0678 5 місяців тому

      Yeah, that's what I was just thinking too. Unless there is some hard reason you need a npm specific package or just require you work in JS, this doesn’t solve anything new that Python hasn’t been doing for years.

  • @ilaidabush2991
    @ilaidabush2991 4 місяці тому

    Honestly incredible

  • @3ventic
    @3ventic 5 місяців тому +53

    I have mixed feelings about this. I love shell scripts, but highly dislike code in strings, because you lose out on things like syntax highlighting and intellisense. How do you know which options this implementation of ls has? How do you know which commands are supported at all without trial and error? It feels like simplified APIs would have been more clear and integrated better with existing tooling, but I suppose I'll have to try for myself to see if it really matters.

    • @barjo_
      @barjo_ 5 місяців тому +4

      Wouldn't it be possible to create tooling around this? Like how Tailwind CSS is a syntax confined to strings, but it has tooling for formatting, auto complete, and documentation on hover. There are also plugins to syntax highlight inline code such as SQL inside string literals. I don't see why a similar thing wouldn't be attainable with this

    • @rapzid3536
      @rapzid3536 5 місяців тому

      Anything more than a couple one liners and I'd rather have it in an actual bash script so I can use the VSCode shell check extension.

    • @wlockuz4467
      @wlockuz4467 5 місяців тому

      ​@@barjo_At that point it seems like inventing a problem then creating a solution for it

    • @yamyam263
      @yamyam263 5 місяців тому +1

      @@wlockuz4467 why? The problem of writing JS shell scripts is annoying enough to warrant a solution, and here we have a really elegant one at that that literally (pun intended) makes it so much easier for beginners to write code. Plus, intellisense really isn’t a big deal at all in string literals, I use it everyday with emotion css function. I’m getting tired of the “if it ain’t broke don’t fix it” anti-innovation crowd, it seems like you just like complaining because it’s easier than learning new things.

    • @ElliotGuy-tp4si
      @ElliotGuy-tp4si 5 місяців тому

      @yamyam263 It's called bloatware. You shouldn't be doing shell in a web server, that's just a throwback to CGI and FastCGI then that still wasn't fast enough so people agreed that shell doesn't scale to the web. Now here we are again but with Bun. Also, they tested Bash in their performance test which even its own manpage acknowledges has too many features. If they tested a lightweight shell like Dash I guarantee you it would perform better than any Bun shell written in JS. I saw the writer tested sh but they obviously don't know that many systems symlink sh to bash these days. The whole "what about Windows" argument is irrelevant on the server side ever since containers and WSL.
      Honestly, people with the complexity engineering mindset are scary. When I was in uni a couple years ago I saw people learning React before basic HTML/CSS. If I tried talking to them about anything fundamental then all of a sudden they knew nothing.

  • @ADAshiller
    @ADAshiller 5 місяців тому

    Brilliant content and amazing usage example!🎉

  • @faraonch
    @faraonch 5 місяців тому

    Impressive and funny at the same time how you present these sane technologies combined!

  • @B1GTM4N
    @B1GTM4N 5 місяців тому +2

    This is just absolutely insane. Incredibly hype and happy to be alive in this day and age, where we can implement things like this.
    Crazy 🔥💯

  • @clementdato6328
    @clementdato6328 5 місяців тому +6

    Interesting. More native to the language makes it present a nicer API to the user(Bun user) but it is hard to maintain? It is more like an “illusion” that they allow scripting. More like a very special function that interprets strings very specifically, ideally imitating what shells do

  • @DeuxisWasTaken
    @DeuxisWasTaken 5 місяців тому +20

    Zsh has a bash compatibility mode, enabled by default when its $0 is "bash" or "-bash". Also macOS moved to it long after it became a popular shell on linux and macs.

    • @EwanMarshall
      @EwanMarshall 5 місяців тому +3

      indeed, also no mention of csh, where are the BSD guys :D Serioualy, a lot of people don't seem to realise that dash is ubuntu system default and fish is quite popular. Maybe we need to stop creating new incompatible shells to solve the shell compatibility problem.

    • @MCLooyverse
      @MCLooyverse 5 місяців тому

      @@EwanMarshall xkcd/927. I say that devs should be aware of what they're writing for, and readers should look at the shebang. If you want to write something cross-platform, target POSIX sh, and if you want to use something cross platform, don't run it in fish.

    • @conceptrat
      @conceptrat 5 місяців тому

      Yep. All these different shells exist because of choice. And some provide compatibility but usually not mirroring of functionality, between each other. Implementing shell functions into something that is used as a language is just asking for trouble. Should PHP, which can be used to write command line programs, also implement bash or pwsh?

    • @DeuxisWasTaken
      @DeuxisWasTaken 5 місяців тому

      @@EwanMarshall bash, zsh and dash are at least all Bourne Shell (sh) compatible, dash being a descendant of ash. fish and csh are a whole another can of worms :D
      By the way, dash being made the default shell for I think Debian some years ago, as an effort to speed up the system so that system scripts don't have to spin up a whole bash instance, uncovered a lot of scripts that were declared as /bin/sh but actually had bash-specific syntax and broke on the switch.
      Currently, if you want to have cross-system compatibility (not including Windows which as always decides to be the outcast), you've gotta only use sh syntax, as poor as it is.

    • @michaeltomkins6436
      @michaeltomkins6436 5 місяців тому

      The mac bash was FreeBSD Bash and does not have all the same flag options as Linux Bash, it was also modified to do MacOS type things. This is hidden a bit by the move to zsh in mac.
      For example cp -aux works fine on Linux (copy, recursively, save links, only 1 filesystem) but is most similar to cp -pRX source dest on MacOS (it really doesn't have a direct equivalent). Go checkout the relevant man pages

  • @deepakmittal3692
    @deepakmittal3692 5 місяців тому +3

    Backtick operator in PHP does a very similar thing. Been using PHP to create shell scripts since forever and it's great!

  • @okunamayanad
    @okunamayanad 4 місяці тому +1

    this will help me so much

  • @MarlonEnglemam
    @MarlonEnglemam 5 місяців тому +3

    well, no one can deny that the Bun team is working hard on features! I love it. BTW I can't wait for the windows stable version.

  • @TigerWalts
    @TigerWalts 5 місяців тому +15

    Imagine if they did this with Nushell's approach to CLI instead of Bash and you got structured data back from your commands instead.

    • @ZotyLisu
      @ZotyLisu 5 місяців тому +4

      "Write programs to handle text streams, because that is a universal interface"
      ~ Unix philosophy

    • @laalbujhakkar
      @laalbujhakkar 5 місяців тому +3

      getting text back via stdin and spitting text out on stdout, and operating on this in a pipeline is a feature, not a bug tbh.

    • @zeratax
      @zeratax 5 місяців тому +2

      @@laalbujhakkar it's intentional sure, but it sucks ass. writing scripts in nushell is so so much easier and they are way more stable too.

  • @EmmettHitz
    @EmmettHitz 5 місяців тому

    iPython has been trying to do this for years. I've seen a couple really odd folks run it somewhat successfully, but you do a pretty stellar job of isolating yourself from the ecosystem in ways that are really non-productive.

  • @igorskyflyer
    @igorskyflyer 5 місяців тому +11

    Now let's add PHP to Bun 😍🥰

    • @Rudxain
      @Rudxain 5 місяців тому +1

      💀

    • @soniablanche5672
      @soniablanche5672 5 місяців тому

      PHP is a scripting language so you could just do $`php -r "echo 'hello world'"`

  • @SkarTisu
    @SkarTisu 4 місяці тому

    “This is just your brain on JavaScript, my guy” 😂

  • @kolaysgames
    @kolaysgames 5 місяців тому +3

    My first thought after hearing this: so zoomers have invented child_process.execSync. My second thought (after watching the video): so zoomers don't know that shell (if, for, |) and coreutils (ls, rm, cat) are two separate parts of the operating system. And yes there is a win32 port of rm with -rf support, more than one actually.

  • @Lemmy4555
    @Lemmy4555 5 місяців тому +1

    we need an extensible lsp for template tags, it would open a lot of possibilities for all this kind of stuff, the closest thing to macros in js.

  • @sohaibesohaib2914
    @sohaibesohaib2914 5 місяців тому

    Bun is going wild !

  • @chyldstudios
    @chyldstudios 5 місяців тому +1

    Bun + Bash = Bush shell

  • @michaelfisher4737
    @michaelfisher4737 5 місяців тому +1

    as some one that uses fish the main issue with it is not being bash compatible, which im fine with as I can just swap to bash if i need to, but I still run all my scripts like deployment scripts in bash, then I dont have to worry about it being on the system as all unix systems come with bash, unless they put js and bun into the kernel I just see this as another fish which its self get a lot of stick for not being bash compatible

    • @EwanMarshall
      @EwanMarshall 5 місяців тому +1

      Yep, solve shell compatibility by yet a new shell. It hasn't worked the last dozen times. It is that old joke about new standards.

  • @thegrumpydeveloper
    @thegrumpydeveloper 5 місяців тому

    That’s crazy they wrote their own. Zx did a nice job of making the $ syntax for shells in js work but cool if things like rm just work.

  • @marksmod
    @marksmod 5 місяців тому +1

    agreed, this is dope

  • @lauraprates8764
    @lauraprates8764 5 місяців тому +4

    The solution to the bash vs world problem is just to write posix compliant scripts and don't care for ppl who for some reason link sh to non posix compliant shells or windows users

    • @lhpl
      @lhpl 5 місяців тому +2

      Right! If you put #!/bin/sh as the first line of a shell script, you should not use anything not in POSIX.
      There has been a variety of shells in Unix since "forever". Bourne shell, Korn shell, Csh. And later mksh, tcsh, Bash, Zsh, ...
      Bun sounds like another stupid JS thing.

  • @ThaUnknown
    @ThaUnknown 5 місяців тому +1

    bun shell is like what execa did over a year ago, just slightly more extended?

    • @ThaUnknown
      @ThaUnknown 5 місяців тому

      which I guess copied google's ZX

  • @friedpetrol
    @friedpetrol 5 місяців тому +3

    Bruh wtf this is so cool I'm conflicted

    • @arjix8738
      @arjix8738 5 місяців тому

      They just stole what google did with zx

  • @jgkdmdevienjjgg8866
    @jgkdmdevienjjgg8866 4 місяці тому

    I think when redirecting output to a buffer they just create temp file when interpolating buffer variable into $ string. And when it's done awaiting they just read file - put it into buffer and delete file. This thing is really cool, it could replace python / bash for ci/cd stuff in gitlab/docker for example

  • @RobertOSheaGameDev
    @RobertOSheaGameDev 5 місяців тому

    That is really damn cool

  • @mailslurp
    @mailslurp 4 місяці тому

    just learn bash guys, it will a lasting investment

  • @_____case
    @_____case 5 місяців тому +1

    Many language runtimes allow you to issue shell commands to the host and listen to the results.
    It's cool that Bun is adding a nice syntax for it, but it's not like it replaces the shell itself.

  • @mostly-harmless
    @mostly-harmless 5 місяців тому

    "bun did the work"

  • @yeikiu
    @yeikiu 5 місяців тому

    Approved!

  • @weeb3277
    @weeb3277 5 місяців тому +1

    what can be written in javascript will be implemented in bun

  • @13zebras
    @13zebras 5 місяців тому

    Theo: the bash vs zsh issues you mention are mostly BSD vs Linux/gnu issues. zsh and bash are very compatible, but the different flags, for instance, are the differences between BSD and Linux implementations of commands. I get tripped up by these all the time.

    • @fulconandroadcone9488
      @fulconandroadcone9488 5 місяців тому

      aren't those commandes just binarys on your system and open source for the most part? never really went into it it but would it not be posible to make both behave exacly the same

  • @andru5054
    @andru5054 5 місяців тому

    we need a LMAO lang video Theo!

  • @riolly
    @riolly 5 місяців тому

    Crazy

  • @coder436
    @coder436 5 місяців тому +1

    PowerShell Core is pretty popular and also cross-platform.

  • @MichaelScharf
    @MichaelScharf 5 місяців тому +2

    Perl was the tool to replace shells….

  • @aldrickdev
    @aldrickdev 5 місяців тому +3

    If you make a POSIX compliant script it should work on bash and zsh without needing to download something new

    • @veqv
      @veqv 5 місяців тому +1

      shh don't scare them, they're skiddish.

  • @buddy.abc123
    @buddy.abc123 5 місяців тому +30

    Interesting, I'm still not using bun

    • @isehsnap
      @isehsnap 5 місяців тому +7

      YOU HAVE NOT SEEN THE VIDEO

    • @Kane0123
      @Kane0123 5 місяців тому +2

      Don’t lie

    • @BboyKeny
      @BboyKeny 5 місяців тому +2

      I installed it because of this shell feature. They got me..

    • @luka1790
      @luka1790 5 місяців тому

      I use it for scripts, because its so easy to setup. No typescript setup bs

    • @whoknows3679
      @whoknows3679 5 місяців тому

      This feature had existed for years in both node and deno
      Look for zx by google for node (originals )
      Dax for deno

  • @maximeaube1619
    @maximeaube1619 5 місяців тому

    Funny how I was writing an npm run script with stdin/stdout just this morning and it didn't feel quite right. But this is making a lot of sense.

  • @gro967
    @gro967 5 місяців тому +1

    PowerShell already solved that problem 😅

  • @rea1m_
    @rea1m_ 5 місяців тому

    Could you tell the name of the theme you use?

  • @ColorblindMonk
    @ColorblindMonk 5 місяців тому +3

    Giving JavaScript access to your shell. That's the most reasonable thing I've ever heard

  • @rafaelbordoni516
    @rafaelbordoni516 5 місяців тому

    I don't know if I'm happy new people have one less thing they need to learn to get started (bash) or if I'm worried new people won't learn bash and get to the market anyway.

  • @_modiX
    @_modiX 5 місяців тому

    perfect for a web ui that spawns your shell scripts

  • @tibo1671
    @tibo1671 5 місяців тому +3

    At 2:25, I don't get the point : you can install zsh or bash or fish or anything on Linux, and I guess you can do the same thing on MacOs... It's not a problem to run a bash script if your current interpreter is zsh since the shebang tells the kernel which interpreter to run ??

    • @lauraprates8764
      @lauraprates8764 5 місяців тому +2

      I think the problems comes with ppl using bash extensions while the shebang is sh, on linux the sh is probably a symlink to bash, so it works, but that's not the right way to do it, when the shebang is sh you would expect that it's a posix compliant shell, the same thing happens with makefiles, many ppl use GNU extensions, but the name Makefile or makefile implies that it's a posix compliant makefile, on linux this is not a common issue, since make is usually a symlink to GNU Make, but for other unix-like system this might be an issue

    • @tibo1671
      @tibo1671 5 місяців тому

      @@lauraprates8764 Okay, see what you mean
      But then it's just a matter of using *#!/bin/bash* instead of *#!/bin/sh* ^^'

    • @zed5790
      @zed5790 5 місяців тому

      ​@@lauraprates8764 and how will this deno shell solve that problem? Are they gonna rewrite the existing bash script in deno? If yes, why not rewrite it in python or Ruby? That will eliminate cross platform issue. If cross platform shell is really a need then use Nushell. If speed is a requirement then use faster programming languages (even tho speed is never a requirement in shell).

  • @Spitfire5592
    @Spitfire5592 5 місяців тому +1

    If you just wrote to the POSIX spec you’d all be fine.

  • @Akhbash
    @Akhbash 5 місяців тому

    With this, Bun can now efectivelly replace Makefile and Justfile

  • @caludio
    @caludio 5 місяців тому

    recursive "cp" with direcrtories has a different semantic in macOS and Linux. Creepy stuff.

  • @blkgames1447
    @blkgames1447 5 місяців тому

    Bun team's roadmap:
    - Bunker (for Docker users)
    - Buxt (faster than nuxt)
    - Bunizzle (faster than Drizzle)
    - BunDB (why aren't we creating databases with Bun and storing everything in .bundb files?)
    - BunDoc (if you wanna stick with JsDoc)

  • @subhasishbiswasray4124
    @subhasishbiswasray4124 5 місяців тому

    I tried bun 2 months ago,
    Where I found bugs while running on my Ubuntu,it was running fine on windows but having some issues with Linux

  • @remcore_
    @remcore_ 5 місяців тому

    If this compiles to a standalone treeshaken binary, I'm in

  • @benmeehan1968
    @benmeehan1968 5 місяців тому +2

    Sure there's plenty of dev's with experience of bash commands, the typical options you need to remember, all from muscle memory. But we are also now well used to autocomplete and built in docs. It seems the Bun have reimplemented bash commands in JS, and then a layer to process CLI strings into those JS API's. So please, expose those JS API's so I can use them natively, then I can start to forget about the arcane bash commands and options, and have something that is readable, self documenting and that devs that follow don't have to go through the pain of the previous generation.

  • @ThomasWSmith-wm5xn
    @ThomasWSmith-wm5xn 5 місяців тому +1

    this actually pissed me off

  • @killerdroid99
    @killerdroid99 5 місяців тому

    It's nothing more than syntactic sugar

  • @rafagd
    @rafagd 5 місяців тому +1

    Does adding a shebang at the top work?

    • @KangJangkrik
      @KangJangkrik 5 місяців тому

      Technically possible, except Windows

  • @MCLooyverse
    @MCLooyverse 5 місяців тому

    I love how, in the *one* other language that natively handles JSON elegantly, you chose to instead export that work out to `jq`.

  • @shadowpony9243
    @shadowpony9243 5 місяців тому

    like a bun in the oven

  • @FilipFranik
    @FilipFranik 5 місяців тому

    "Writing cross platform scripting is actually really difficult!" PowerShell

  • @kisaragi-hiu
    @kisaragi-hiu 4 місяці тому

    The Emacs equivalent of this, Eshell, is extensively documented. Bun shell needs the same. Other than that, I don't actually think this would ever hurt, even in the long rub.

  • @michealkinney6205
    @michealkinney6205 5 місяців тому

    Others have said something similar, but this needs to be the default shell in a Web OS (not the dead one by the same name, but the concept). It would also be awesome to have native Linux, Android, MacOS, and Windows support in that OS (possibly with enabling dev mode or something, not the out of the box experience).. but with a cross-platform CLI that bridges the gap and ties right into the browser with support for JS, etc. So awesome! I look forward to see where this goes and what people do with it. And I think the native OS should simply support Progressive Web Apps with only lightweight OS features (like consistent login, settings, file management, graphics, a modern layered theme manager, touch support with context menus, etc).

  • @hannad
    @hannad 5 місяців тому +1

    Holy shit. Don’t do this. 😂

  • @user-hk3ej4hk7m
    @user-hk3ej4hk7m 4 місяці тому

    There's a similar thing for python called xonsh, except it's a superset of posix sh.

  • @systematicpsychologic7321
    @systematicpsychologic7321 5 місяців тому

    More Bun

  • @proosee
    @proosee 5 місяців тому +3

    Meanwhile, Bun is still using WSL on Windows, so the real question is: how much cross-platform is it actually... but cool idea, I can definitely see at least few areas where this would be super useful, like build scripts, simple tools.

    • @yojou3695
      @yojou3695 5 місяців тому +1

      i mean, wsl is the only sane option, why would they ever do something different

    • @proosee
      @proosee 5 місяців тому +3

      @@yojou3695 my point is: it's not Bun that is making it corss-platform - it's WSL. And also, it kind of defeats the purpose: the main promise of Bun is that it is faster than vanilla nodejs tools, but if performance is your main goal then why are you going through another layer of WSL? I know, the effort of virtually implementing every low level thing again specially for Windows is too much and I get that this is beyond reach for now, but let's stop pretending we are making something cross-platform if we are running it inside the tool that is literally designed to run any Linux executable on Windows...

    • @whoknows3679
      @whoknows3679 5 місяців тому

      This exist on both node and deno and with deno you can compile to binary on windows
      Zx for node
      Dx for deno

  • @AndrleJan
    @AndrleJan 5 місяців тому

    Self promo, there is a package nodejsscript for cross-platform scripting (uses shelljs library internally).

  • @manemobiili
    @manemobiili 5 місяців тому

    Shoutouts to korn shell and rc!
    But in all seriousness every os should have at least busybox (or toybox) installed in base.

  • @user-tb4ig7qh9b
    @user-tb4ig7qh9b 5 місяців тому +2

    Powershell neoshell both cross platform

  • @rGxDale
    @rGxDale 5 місяців тому +1

    Node already has no by Google for cli tools

  • @CBusschaert
    @CBusschaert 5 місяців тому

    Hi Phase/Theo. I don't know who's doing the youtube part of this, but it'd help a lot if when Theo mentions "check out that other video i made", we could get a card or at least a link in the description. I don't really have compliments to sandwich this with yet because i haven't watched the rest of the video, sorry. Nice hair, though!

  • @chang112x
    @chang112x 5 місяців тому

    I like xonsh, it is really awesome

  • @arjix8738
    @arjix8738 5 місяців тому +7

    So like google's zx?

    • @mikopiko
      @mikopiko 5 місяців тому +2

      Yeah, this reminded me of it!

    • @whoknows3679
      @whoknows3679 5 місяців тому

      Exactly, not sire why people think this is new it literally been out for years for both node and deno

    • @dasten123
      @dasten123 5 місяців тому

      @@whoknows3679 isn't zx basically just a fancy way of running shell commands from node? So if for example "rm blah" doesn't work on Windows, using zx won't help. With Bun it does work. And you can't say it isn't important when you see the download numbers of rimraf

    • @whoknows3679
      @whoknows3679 5 місяців тому

      @@dasten123 what you mean lol bun doesn’t even work properly on windows

    • @dasten123
      @dasten123 5 місяців тому

      @@whoknows3679 not yet but they are working on it right now

  • @not_hehe__
    @not_hehe__ 5 місяців тому

    anything that can be written in javascript, will be eventually written in javascript

  • @0x00official
    @0x00official 5 місяців тому

    RCE joined the chat

  • @x_techno_pro
    @x_techno_pro 5 місяців тому

    Nix OSes ❌
    POSIX complaint✅

  • @nixoncode
    @nixoncode 5 місяців тому

    do people actually run so many os based commands locally?
    I have used windows until for the i was like 17, then linux for like 4 more years, and now mac because i was given an mbp, but i still miss the time have had with linux, and I am saving for a windows desktop, & with wls, do I really need anything else?

    • @rafaelbordoni516
      @rafaelbordoni516 5 місяців тому

      Depends on the project/company I guess? Maybe devops people need to run the whole pipeline they're creating locally to test them? I'm not devops specialist but the few times I had to change devops stuff in my company I had to build stuff locally, but then again where I work we only use linux so the compatibility stuff was never a problem for us.

    • @CFEF44AB1399978B0011
      @CFEF44AB1399978B0011 5 місяців тому

      You'll find very quickly that with Windows subsystem for Linux, things that shouldn't break do break because it's not a real Linux, it's a containerized Linux and a lot of things are replaced or hobbled. For example if you ever tried to use the networking stack to use things like trace route or ICMP related things or security related things, the network stack will just get in your way. Also the stack will get in your way when you're trying to do specific file operations.

  • @carloslfu
    @carloslfu 5 місяців тому +1

    Bun has done a better job at Deno than Deno! omg, roasted 😬

    • @whoknows3679
      @whoknows3679 5 місяців тому

      Deno has had this for years, but is not like they created
      Google created this, look for zx for node

    • @bobsimple8291
      @bobsimple8291 5 місяців тому +1

      except it's not true

    • @carloslfu
      @carloslfu 5 місяців тому

      @@bobsimple8291Yeah, it is not fair.

  • @SteinGauslaaStrindhaug
    @SteinGauslaaStrindhaug 5 місяців тому

    Wait, I know windows cmd is weird; but I'm pretty sure if you write sh code without bashisms or use the correct shebang for the isms you're using; and avoid file system structure assumptions or assumptions about non-posix tools being available (which won't even work universally on all Linux flavours anyway) it will work well on both Mac and Linux as long as they have the shell matching the shebang installed.

    • @SteinGauslaaStrindhaug
      @SteinGauslaaStrindhaug 5 місяців тому

      Heck I've even had some success running bashism free shell scripts on windows as long as it's executed using the more linux like shell (which I don't remember what is called) and not the old cmd. Of course Windows is _really_ limited in what it has preinstalled of common tools outside of the basic posix ones.

  • @guglielmobartelloni
    @guglielmobartelloni 5 місяців тому

    Lol js in the Shell

  • @Son0fBeelzebub
    @Son0fBeelzebub 5 місяців тому

    meanwhile clojure ecosystem with babashka, squint, clojure itself, clojureascript and etc: lol