Bash? Nah, I Have Bun.

Поделиться
HTML-код
  • Опубликовано: 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 🙏
  • НаукаНаука

Комментарии • 318

  • @leonzill
    @leonzill 4 месяца назад +155

    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 4 месяца назад +11

      ECMAScript

    • @zionlee1004
      @zionlee1004 3 месяца назад

      @@fulconandroadcone9488 LigmaScript

    • @jsonkody
      @jsonkody 2 месяца назад

      @@fulconandroadcone9488 JS ._.

    • @BarisPalabiyik
      @BarisPalabiyik 2 месяца назад

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

    • @OrderOfInput
      @OrderOfInput Месяц назад

      Hrngggggggggggg

  • @minikame2272
    @minikame2272 4 месяца назад +519

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

    • @anoh2689
      @anoh2689 4 месяца назад +37

      It's like emacs of the js eco system

    • @realmimak
      @realmimak 4 месяца назад +11

      what could go wrong

    • @b_delta9725
      @b_delta9725 4 месяца назад +15

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

    • @carloslfu
      @carloslfu 4 месяца назад +7

      I am all-in for Bun-OS 2030!

    • @clairrorism
      @clairrorism 4 месяца назад

      @@b_delta9725 year of the bun desktop

  • @vsolyomi
    @vsolyomi 4 месяца назад +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 4 месяца назад +13

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

    • @snats
      @snats 4 месяца назад

      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 4 месяца назад

      @@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 4 месяца назад +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 Месяц назад

      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 4 месяца назад +150

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

    • @emireri2387
      @emireri2387 4 месяца назад +6

      i getthejoke but you actually should

    • @Kane0123
      @Kane0123 4 месяца назад +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 4 месяца назад +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 4 месяца назад +1

      Make me!

    • @cubondemais
      @cubondemais Месяц назад

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

  • @NiklasZiermann
    @NiklasZiermann 4 месяца назад +46

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

  • @VivekYadav-ds8oz
    @VivekYadav-ds8oz 4 месяца назад +21

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

    • @AC-hh2cb
      @AC-hh2cb 3 месяца назад

      solvable problem, also not different from before

  • @sillvvasensei
    @sillvvasensei 4 месяца назад +16

    "Your brain on JS" lol

  • @wlockuz4467
    @wlockuz4467 4 месяца назад +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.

  • @laalbujhakkar
    @laalbujhakkar 4 месяца назад +67

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

    • @EwanMarshall
      @EwanMarshall 4 месяца назад +13

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

    • @iamwillshepherd
      @iamwillshepherd 4 месяца назад

      😂 🤣

    • @Turalcar
      @Turalcar 4 месяца назад +1

      It's bun, not node

    • @bren.r
      @bren.r 4 месяца назад

      Not to mention the former is battle tested.

    • @dasten123
      @dasten123 4 месяца назад +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!

  • @anasouardini
    @anasouardini 4 месяца назад +8

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

  • @littleluce
    @littleluce 4 месяца назад +1

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

  • @aabluedragon
    @aabluedragon 2 месяца назад

    Thanks! this is brilliant, well done bun team.

  • @MarcelRobitaille
    @MarcelRobitaille 4 месяца назад +115

    There's no way this kills bash.

    • @Bu7MaiD075
      @Bu7MaiD075 4 месяца назад +17

      javascript: watch me.

    • @nyagah243
      @nyagah243 4 месяца назад +9

      Dude likes hyperbole

    • @b_delta9725
      @b_delta9725 4 месяца назад +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 4 месяца назад +3

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

    • @MarcelRobitaille
      @MarcelRobitaille 4 месяца назад +2

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

  • @creaky2436
    @creaky2436 4 месяца назад +5

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

  • @onoff5604
    @onoff5604 4 месяца назад

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

  • @BlackAsLight448
    @BlackAsLight448 4 месяца назад +25

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

    • @elvitin
      @elvitin 4 месяца назад +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 4 месяца назад

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

  • @happieplantnl
    @happieplantnl 4 месяца назад +1

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

  • @gryg666
    @gryg666 4 месяца назад +14

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

  • @B1GTM4N
    @B1GTM4N 4 месяца назад +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 🔥💯

  • @3ventic
    @3ventic 4 месяца назад +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_ 4 месяца назад +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 4 месяца назад

      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 4 месяца назад

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

    • @yamyam263
      @yamyam263 4 месяца назад +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 4 месяца назад

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

  • @arkbom
    @arkbom 4 месяца назад +5

    Bun brought Google ZX to their runtime

  • @faraonch
    @faraonch 4 месяца назад

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

  • @ADAshiller
    @ADAshiller 4 месяца назад

    Brilliant content and amazing usage example!🎉

  • @clementdato6328
    @clementdato6328 4 месяца назад +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

  • @ilaidabush2991
    @ilaidabush2991 3 месяца назад

    Honestly incredible

  • @deepakmittal3692
    @deepakmittal3692 4 месяца назад +3

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

  • @kwyaza
    @kwyaza 4 месяца назад +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 4 месяца назад +6

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

    • @marty0678
      @marty0678 4 месяца назад

      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.

  • @igorskyflyer
    @igorskyflyer 4 месяца назад +11

    Now let's add PHP to Bun 😍🥰

    • @Rudxain
      @Rudxain 4 месяца назад +1

      💀

    • @soniablanche5672
      @soniablanche5672 4 месяца назад

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

  • @MarlonEnglemam
    @MarlonEnglemam 4 месяца назад +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.

  • @DeuxisWasTaken
    @DeuxisWasTaken 4 месяца назад +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 4 месяца назад +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 4 месяца назад

      @@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 4 месяца назад

      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 4 месяца назад

      @@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 4 месяца назад

      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

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

  • @abdul-hameedmaree881
    @abdul-hameedmaree881 28 дней назад

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

  • @Lemmy4555
    @Lemmy4555 4 месяца назад +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.

  • @michaelfisher4737
    @michaelfisher4737 4 месяца назад +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 4 месяца назад +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 4 месяца назад

    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.

  • @okunamayanad
    @okunamayanad 4 месяца назад +1

    this will help me so much

  • @13zebras
    @13zebras 4 месяца назад

    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 4 месяца назад

      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

  • @EmmettHitz
    @EmmettHitz 4 месяца назад

    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.

  • @scottpageusmc
    @scottpageusmc 4 месяца назад

    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.

  • @kolaysgames
    @kolaysgames 4 месяца назад +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.

  • @TigerWalts
    @TigerWalts 4 месяца назад +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 4 месяца назад +4

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

    • @laalbujhakkar
      @laalbujhakkar 4 месяца назад +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 4 месяца назад +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.

  • @rea1m_
    @rea1m_ 4 месяца назад

    Could you tell the name of the theme you use?

  • @buddy.abc123
    @buddy.abc123 4 месяца назад +30

    Interesting, I'm still not using bun

    • @isehsnap
      @isehsnap 4 месяца назад +7

      YOU HAVE NOT SEEN THE VIDEO

    • @Kane0123
      @Kane0123 4 месяца назад +2

      Don’t lie

    • @BboyKeny
      @BboyKeny 4 месяца назад +2

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

    • @luka1790
      @luka1790 4 месяца назад

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

    • @whoknows3679
      @whoknows3679 4 месяца назад

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

  • @nixoncode
    @nixoncode 4 месяца назад

    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 4 месяца назад

      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 4 месяца назад

      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.

  • @sohaibesohaib2914
    @sohaibesohaib2914 4 месяца назад

    Bun is going wild !

  • @andru5054
    @andru5054 4 месяца назад

    we need a LMAO lang video Theo!

  • @_____case
    @_____case 4 месяца назад +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.

  • @maximeaube1619
    @maximeaube1619 4 месяца назад

    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.

  • @SkarTisu
    @SkarTisu 3 месяца назад

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

  • @coder436
    @coder436 4 месяца назад +1

    PowerShell Core is pretty popular and also cross-platform.

  • @subhasishbiswasray4124
    @subhasishbiswasray4124 4 месяца назад

    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

  • @friedpetrol
    @friedpetrol 4 месяца назад +3

    Bruh wtf this is so cool I'm conflicted

    • @arjix8738
      @arjix8738 4 месяца назад

      They just stole what google did with zx

  • @weeb3277
    @weeb3277 4 месяца назад +1

    what can be written in javascript will be implemented in bun

  • @marksmod
    @marksmod 4 месяца назад +1

    agreed, this is dope

  • @andynn6691
    @andynn6691 4 месяца назад +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 4 месяца назад

      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)

  • @user-hk3ej4hk7m
    @user-hk3ej4hk7m 3 месяца назад

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

  • @michealkinney6205
    @michealkinney6205 4 месяца назад

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

  • @tibo1671
    @tibo1671 4 месяца назад +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 4 месяца назад +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 4 месяца назад

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

    • @zed5790
      @zed5790 4 месяца назад

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

  • @chyldstudios
    @chyldstudios 4 месяца назад +1

    Bun + Bash = Bush shell

  • @rafaelbordoni516
    @rafaelbordoni516 4 месяца назад

    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.

  • @mostly-harmless
    @mostly-harmless 4 месяца назад

    "bun did the work"

  • @caludio
    @caludio 4 месяца назад

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

  • @rafagd
    @rafagd 4 месяца назад +1

    Does adding a shebang at the top work?

    • @KangJangkrik
      @KangJangkrik 4 месяца назад

      Technically possible, except Windows

  • @lauraprates8764
    @lauraprates8764 4 месяца назад +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 4 месяца назад +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.

  • @ColorblindMonk
    @ColorblindMonk 4 месяца назад +3

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

  • @blkgames1447
    @blkgames1447 4 месяца назад

    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)

  • @RobertOSheaGameDev
    @RobertOSheaGameDev 4 месяца назад

    That is really damn cool

  • @manemobiili
    @manemobiili 4 месяца назад

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

  • @CBusschaert
    @CBusschaert 4 месяца назад

    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!

  • @yeikiu
    @yeikiu 4 месяца назад

    Approved!

  • @Akhbash
    @Akhbash 4 месяца назад

    With this, Bun can now efectivelly replace Makefile and Justfile

  • @MCLooyverse
    @MCLooyverse 4 месяца назад

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

  • @Spitfire5592
    @Spitfire5592 4 месяца назад +1

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

  • @MichaelScharf
    @MichaelScharf 4 месяца назад +1

    Perl was the tool to replace shells….

  • @mailslurp
    @mailslurp 3 месяца назад

    just learn bash guys, it will a lasting investment

  • @riolly
    @riolly 4 месяца назад

    Crazy

  • @davidboeger6766
    @davidboeger6766 4 месяца назад

    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.

  • @_modiX
    @_modiX 4 месяца назад

    perfect for a web ui that spawns your shell scripts

  • @ThaUnknown
    @ThaUnknown 4 месяца назад +1

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

    • @ThaUnknown
      @ThaUnknown 4 месяца назад

      which I guess copied google's ZX

  • @proosee
    @proosee 4 месяца назад +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 4 месяца назад +1

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

    • @proosee
      @proosee 4 месяца назад +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 4 месяца назад

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

  • @remcore_
    @remcore_ 4 месяца назад

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

  • @aldrickdev
    @aldrickdev 4 месяца назад +3

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

    • @veqv
      @veqv 4 месяца назад +1

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

  • @SteinGauslaaStrindhaug
    @SteinGauslaaStrindhaug 4 месяца назад

    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 4 месяца назад

      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.

  • @FilipFranik
    @FilipFranik 4 месяца назад

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

  • @chang112x
    @chang112x 4 месяца назад

    I like xonsh, it is really awesome

  • @AndrleJan
    @AndrleJan 4 месяца назад

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

  • @killerdroid99
    @killerdroid99 4 месяца назад

    It's nothing more than syntactic sugar

  • @gro967
    @gro967 4 месяца назад +1

    PowerShell already solved that problem 😅

  • @shadowpony9243
    @shadowpony9243 4 месяца назад

    like a bun in the oven

  • @hannad
    @hannad 4 месяца назад +1

    Holy shit. Don’t do this. 😂

  • @ThomasWSmith-wm5xn
    @ThomasWSmith-wm5xn 4 месяца назад +1

    this actually pissed me off

  • @systematicpsychologic7321
    @systematicpsychologic7321 4 месяца назад

    More Bun

  • @user-tb4ig7qh9b
    @user-tb4ig7qh9b 4 месяца назад +2

    Powershell neoshell both cross platform

  • @benmeehan1968
    @benmeehan1968 4 месяца назад +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.

  • @carloslfu
    @carloslfu 4 месяца назад +1

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

    • @whoknows3679
      @whoknows3679 4 месяца назад

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

    • @bobsimple8291
      @bobsimple8291 4 месяца назад +1

      except it's not true

    • @carloslfu
      @carloslfu 4 месяца назад

      @@bobsimple8291Yeah, it is not fair.

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

  • @rGxDale
    @rGxDale 4 месяца назад +1

    Node already has no by Google for cli tools

  • @mzakyr342
    @mzakyr342 4 месяца назад

    now what, this aint stopping me from using bash, bash 4.3ms on my arch linux like i don't have much things in .bashrc.

  • @follantic
    @follantic 4 месяца назад

    I use bun for simple scripting tasks anyways. This is great news!

  • @0x00official
    @0x00official 4 месяца назад

    RCE joined the chat