Bash? Nah, I Have Bun.

Sdílet
Vložit
  • čas přidán 26. 01. 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 🙏
  • Věda a technologie

Komentáře • 318

  • @leonzill
    @leonzill Před 4 měsíci +154

    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.

  • @minikame2272
    @minikame2272 Před 4 měsíci +519

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

    • @anoh2689
      @anoh2689 Před 4 měsíci +37

      It's like emacs of the js eco system

    • @realmimak
      @realmimak Před 4 měsíci +11

      what could go wrong

    • @b_delta9725
      @b_delta9725 Před 4 měsíci +15

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

    • @carloslfu
      @carloslfu Před 4 měsíci +7

      I am all-in for Bun-OS 2030!

    • @clairrorism
      @clairrorism Před 4 měsíci

      @@b_delta9725 year of the bun desktop

  • @vsolyomi
    @vsolyomi Před 4 měsíci +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 Před 4 měsíci +13

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

    • @snats
      @snats Před 4 měsíci

      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 Před 4 měsíci

      @@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 Před 4 měsíci +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 Před měsícem

      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 Před 4 měsíci +149

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

    • @emireri2387
      @emireri2387 Před 4 měsíci +6

      i getthejoke but you actually should

    • @Kane0123
      @Kane0123 Před 4 měsíci +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 Před 4 měsíci +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 Před 4 měsíci +1

      Make me!

    • @cubondemais
      @cubondemais Před měsícem

      @@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 Před 4 měsíci +21

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

    • @AC-hh2cb
      @AC-hh2cb Před 3 měsíci

      solvable problem, also not different from before

  • @wlockuz4467
    @wlockuz4467 Před 4 měsíci +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 Před 4 měsíci +46

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

  • @sillvvasensei
    @sillvvasensei Před 4 měsíci +16

    "Your brain on JS" lol

  • @anasouardini
    @anasouardini Před 4 měsíci +8

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

  • @MarcelRobitaille
    @MarcelRobitaille Před 4 měsíci +115

    There's no way this kills bash.

    • @Bu7MaiD075
      @Bu7MaiD075 Před 4 měsíci +17

      javascript: watch me.

    • @nyagah243
      @nyagah243 Před 4 měsíci +9

      Dude likes hyperbole

    • @b_delta9725
      @b_delta9725 Před 4 měsíci +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 Před 4 měsíci +3

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

    • @MarcelRobitaille
      @MarcelRobitaille Před 4 měsíci +2

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

  • @laalbujhakkar
    @laalbujhakkar Před 4 měsíci +67

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

    • @EwanMarshall
      @EwanMarshall Před 4 měsíci +13

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

    • @iamwillshepherd
      @iamwillshepherd Před 4 měsíci

      😂 🤣

    • @Turalcar
      @Turalcar Před 4 měsíci +1

      It's bun, not node

    • @bren.r
      @bren.r Před 4 měsíci

      Not to mention the former is battle tested.

    • @dasten123
      @dasten123 Před 4 měsíci +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!

  • @creaky2436
    @creaky2436 Před 4 měsíci +5

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

  • @3ventic
    @3ventic Před 4 měsíci +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_ Před 4 měsíci +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 Před 4 měsíci

      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 Před 4 měsíci

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

    • @yamyam263
      @yamyam263 Před 4 měsíci +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 Před 4 měsíci

      @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.

  • @BlackAsLight448
    @BlackAsLight448 Před 4 měsíci +25

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

    • @elvitin
      @elvitin Před 4 měsíci +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 Před 4 měsíci

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

  • @gryg666
    @gryg666 Před 4 měsíci +14

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

  • @onoff5604
    @onoff5604 Před 4 měsíci

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

  • @arkbom
    @arkbom Před 4 měsíci +5

    Bun brought Google ZX to their runtime

  • @happieplantnl
    @happieplantnl Před 4 měsíci +1

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

  • @abdul-hameedmaree881
    @abdul-hameedmaree881 Před 22 dny

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

  • @MarlonEnglemam
    @MarlonEnglemam Před 4 měsíci +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.

  • @littleluce
    @littleluce Před 4 měsíci +1

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

  • @clementdato6328
    @clementdato6328 Před 4 měsíci +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

  • @kwyaza
    @kwyaza Před 4 měsíci +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 Před 4 měsíci +6

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

    • @marty0678
      @marty0678 Před 4 měsíci

      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.

  • @B1GTM4N
    @B1GTM4N Před 4 měsíci +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 🔥💯

  • @deepakmittal3692
    @deepakmittal3692 Před 4 měsíci +3

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

  • @ADAshiller
    @ADAshiller Před 4 měsíci

    Brilliant content and amazing usage example!🎉

  • @DeuxisWasTaken
    @DeuxisWasTaken Před 4 měsíci +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 Před 4 měsíci +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 Před 4 měsíci

      @@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 Před 4 měsíci

      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 Před 4 měsíci

      @@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 Před 4 měsíci

      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

  • @igorskyflyer
    @igorskyflyer Před 4 měsíci +11

    Now let's add PHP to Bun 😍🥰

    • @Rudxain
      @Rudxain Před 4 měsíci +1

      💀

    • @soniablanche5672
      @soniablanche5672 Před 4 měsíci

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

  • @aabluedragon
    @aabluedragon Před 2 měsíci

    Thanks! this is brilliant, well done bun team.

  • @faraonch
    @faraonch Před 4 měsíci

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

  • @TigerWalts
    @TigerWalts Před 4 měsíci +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 Před 4 měsíci +4

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

    • @laalbujhakkar
      @laalbujhakkar Před 4 měsíci +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 Před 4 měsíci +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.

  • @ilaidabush2991
    @ilaidabush2991 Před 3 měsíci

    Honestly incredible

  • @EmmettHitz
    @EmmettHitz Před 4 měsíci

    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.

  • @kolaysgames
    @kolaysgames Před 4 měsíci +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.

  • @buddy.abc123
    @buddy.abc123 Před 4 měsíci +30

    Interesting, I'm still not using bun

    • @isehsnap
      @isehsnap Před 4 měsíci +7

      YOU HAVE NOT SEEN THE VIDEO

    • @Kane0123
      @Kane0123 Před 4 měsíci +2

      Don’t lie

    • @BboyKeny
      @BboyKeny Před 4 měsíci +2

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

    • @luka1790
      @luka1790 Před 4 měsíci

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

    • @whoknows3679
      @whoknows3679 Před 4 měsíci

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

  • @okunamayanad
    @okunamayanad Před 3 měsíci +1

    this will help me so much

  • @thegrumpydeveloper
    @thegrumpydeveloper Před 4 měsíci

    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.

  • @_____case
    @_____case Před 4 měsíci +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.

  • @SkarTisu
    @SkarTisu Před 3 měsíci

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

  • @Lemmy4555
    @Lemmy4555 Před 4 měsíci +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.

  • @jgkdmdevienjjgg8866
    @jgkdmdevienjjgg8866 Před 3 měsíci

    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

  • @13zebras
    @13zebras Před 4 měsíci

    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 Před 4 měsíci

      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

  • @michaelfisher4737
    @michaelfisher4737 Před 4 měsíci +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 Před 4 měsíci +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.

  • @chyldstudios
    @chyldstudios Před 4 měsíci +1

    Bun + Bash = Bush shell

  • @ColorblindMonk
    @ColorblindMonk Před 4 měsíci +3

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

  • @scottpageusmc
    @scottpageusmc Před 4 měsíci

    I've been using Deno to run shell scripts for several years. Host the dependencies anywhere, local network or cloud. Bun does look interesting though.

  • @maximeaube1619
    @maximeaube1619 Před 4 měsíci

    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.

  • @ThaUnknown
    @ThaUnknown Před 4 měsíci +1

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

    • @ThaUnknown
      @ThaUnknown Před 4 měsíci

      which I guess copied google's ZX

  • @michealkinney6205
    @michealkinney6205 Před 4 měsíci

    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).

  • @blkgames1447
    @blkgames1447 Před 4 měsíci

    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)

  • @tibo1671
    @tibo1671 Před 4 měsíci +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 Před 4 měsíci +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 Před 4 měsíci

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

    • @zed5790
      @zed5790 Před 4 měsíci

      ​@@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).

  • @FilipFranik
    @FilipFranik Před 4 měsíci

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

  • @lauraprates8764
    @lauraprates8764 Před 4 měsíci +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 Před 4 měsíci +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.

  • @friedpetrol
    @friedpetrol Před 4 měsíci +3

    Bruh wtf this is so cool I'm conflicted

    • @arjix8738
      @arjix8738 Před 4 měsíci

      They just stole what google did with zx

  • @MCLooyverse
    @MCLooyverse Před 4 měsíci

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

  • @SteinGauslaaStrindhaug
    @SteinGauslaaStrindhaug Před 4 měsíci

    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 Před 4 měsíci

      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.

  • @coder436
    @coder436 Před 4 měsíci +1

    PowerShell Core is pretty popular and also cross-platform.

  • @weeb3277
    @weeb3277 Před 4 měsíci +1

    what can be written in javascript will be implemented in bun

  • @CBusschaert
    @CBusschaert Před 4 měsíci

    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!

  • @sohaibesohaib2914
    @sohaibesohaib2914 Před 4 měsíci

    Bun is going wild !

  • @gro967
    @gro967 Před 4 měsíci +1

    PowerShell already solved that problem 😅

  • @nixoncode
    @nixoncode Před 4 měsíci

    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 Před 4 měsíci

      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 Před 4 měsíci

      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.

  • @rafaelbordoni516
    @rafaelbordoni516 Před 4 měsíci

    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.

  • @kisaragi-hiu
    @kisaragi-hiu Před 3 měsíci

    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.

  • @marksmod
    @marksmod Před 4 měsíci +1

    agreed, this is dope

  • @proosee
    @proosee Před 4 měsíci +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 Před 4 měsíci +1

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

    • @proosee
      @proosee Před 4 měsíci +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 Před 4 měsíci

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

  • @benmeehan1968
    @benmeehan1968 Před 4 měsíci +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 Před 4 měsíci +1

    this actually pissed me off

  • @andru5054
    @andru5054 Před 4 měsíci

    we need a LMAO lang video Theo!

  • @rea1m_
    @rea1m_ Před 4 měsíci

    Could you tell the name of the theme you use?

  • @hannad
    @hannad Před 4 měsíci +1

    Holy shit. Don’t do this. 😂

  • @caludio
    @caludio Před 4 měsíci

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

  • @AndrleJan
    @AndrleJan Před 4 měsíci

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

  • @MichaelScharf
    @MichaelScharf Před 4 měsíci +1

    Perl was the tool to replace shells….

  • @Spitfire5592
    @Spitfire5592 Před 4 měsíci +1

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

  • @Akhbash
    @Akhbash Před 4 měsíci

    With this, Bun can now efectivelly replace Makefile and Justfile

  • @carloslfu
    @carloslfu Před 4 měsíci +1

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

    • @whoknows3679
      @whoknows3679 Před 4 měsíci

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

    • @bobsimple8291
      @bobsimple8291 Před 4 měsíci +1

      except it's not true

    • @carloslfu
      @carloslfu Před 4 měsíci

      @@bobsimple8291Yeah, it is not fair.

  • @oldave6
    @oldave6 Před 4 měsíci

    Hi,
    Great content as always. But some feedback for you. The editing style is sometimes a little uncomfortable. You finish a sentence, and immediately the video cuts to your next sentence. Add a few 100ms please!

  • @mostly-harmless
    @mostly-harmless Před 4 měsíci

    "bun did the work"

  • @RobertOSheaGameDev
    @RobertOSheaGameDev Před 4 měsíci

    That is really damn cool

  • @subhasishbiswasray4124
    @subhasishbiswasray4124 Před 4 měsíci

    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

  • @user-hk3ej4hk7m
    @user-hk3ej4hk7m Před 3 měsíci

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

  • @rafagd
    @rafagd Před 4 měsíci +1

    Does adding a shebang at the top work?

    • @KangJangkrik
      @KangJangkrik Před 4 měsíci

      Technically possible, except Windows

  • @mailslurp
    @mailslurp Před 3 měsíci

    just learn bash guys, it will a lasting investment

  • @killerdroid99
    @killerdroid99 Před 4 měsíci

    It's nothing more than syntactic sugar

  • @aldrickdev
    @aldrickdev Před 4 měsíci +3

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

    • @veqv
      @veqv Před 4 měsíci +1

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

  • @manemobiili
    @manemobiili Před 4 měsíci

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

  • @riolly
    @riolly Před 4 měsíci

    Crazy

  • @arjix8738
    @arjix8738 Před 4 měsíci +7

    So like google's zx?

    • @mikopiko
      @mikopiko Před 4 měsíci +2

      Yeah, this reminded me of it!

    • @whoknows3679
      @whoknows3679 Před 4 měsíci

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

    • @dasten123
      @dasten123 Před 4 měsíci

      @@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 Před 4 měsíci

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

    • @dasten123
      @dasten123 Před 4 měsíci

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

  • @_modiX
    @_modiX Před 4 měsíci

    perfect for a web ui that spawns your shell scripts

  • @davidboeger6766
    @davidboeger6766 Před 4 měsíci

    How is this different (and more importantly better) than using packages like rimraf and which? Presumably it's still platform-specific implementations under the hood, and any performance improvements are down to the implementation avoiding spawning shells rather than the programmer-facing syntax. So what we're really getting is strings as code, which as others have mentioned tends to trip up existing tooling.
    If shell startup times are really a critical performance issue for your application, then the solution is to do what bun shell is likely doing internally, just write an implementation which avoids shells altogether by using lower-level APIs. It seems a shame for Bun Shell to go through the trouble of solving an actual real problem with a number of common commands (as evidenced by the demand for those packages) only to wrap it up in a hacky centralized shell package that many people won't want to use.

  • @Son0fBeelzebub
    @Son0fBeelzebub Před 4 měsíci

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

  • @systematicpsychologic7321
    @systematicpsychologic7321 Před 4 měsíci

    More Bun

  • @not_hehe__
    @not_hehe__ Před 4 měsíci

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

  • @andynn6691
    @andynn6691 Před 4 měsíci +4

    4:05 Testing for a file in a list of directories doesn't spawn a new process at all in bash. The [/test command is a builtin. Even if it did execute in a new process, that wouldn't be starting a new bash shell interpreter.

    • @nUrnxvmhTEuU
      @nUrnxvmhTEuU Před 4 měsíci

      That's not what Theo was trying to say. Running a command like that *from JS* would need to spawn a shell. Both JavaScript and Bash are scripting languages (very different ones, but with some non-zero overlap), and until now Bash was waaay more comfortable for efficiently launching commands. Now with Bun Shell, you can do something very similar from JS with similar performance (but a more feature-rich programming language to back it up)

  • @chang112x
    @chang112x Před 4 měsíci

    I like xonsh, it is really awesome

  • @remcore_
    @remcore_ Před 4 měsíci

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

  • @TurtleKwitty
    @TurtleKwitty Před 4 měsíci

    so.... your jq example is that a bun implementation of jq or is that your system happens othave jq? Does bun handle dependencies of command line stuff if its not a bun built in thing?
    Thats why I kinda dislike this, its great that theyre making the interface for shell calls better with wrapping and stuff but I kinda hate that they're pushing towards making shell calls more defualt? Make a library for ls that takes in a regex if that's what you want, but going through a fake shell like that is a horrendous idea in practice even though it DOES sound really awesome in theory

  • @x_techno_pro
    @x_techno_pro Před 4 měsíci

    Nix OSes ❌
    POSIX complaint✅

  • @shadowpony9243
    @shadowpony9243 Před 4 měsíci

    like a bun in the oven