Fireship · @fireship

Bun is disrupting JavaScript land

Uploaded September 8, 2023 · Length 4:30

Bun is disrupting JavaScript land

Summary

Fireship explains how bun, a new JavaScript runtime, is faster than other tools and simplifies development with features like native APIs and a bundler.

  • bun js
  • javascript runtime
  • javascript performance
  • node js alternative
  • typescript support
  • javascript bundler

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:00

    it is September 8th 2023 and you're

  2. 0:02

    watching the code report yesterday was a

  3. 0:04

    huge day for soy devs Mojo became

  4. 0:06

    generally available a super set of

  5. 0:08

    python that's up to 35 000 times faster

  6. 0:10

    but JavaScript also got way faster

  7. 0:12

    thanks to a new Swiss army knife called

  8. 0:14

    bun and that means it's time for some

  9. 0:15

    new stickers on my MacBook Pro

  10. 0:17

    JavaScript developers have grown tired

  11. 0:19

    of Reinventing new Frameworks so now

  12. 0:21

    we're building an entirely new

  13. 0:22

    JavaScript runtimes in the beginning we

  14. 0:24

    had node.js it then rearranged the

  15. 0:26

    letters to make Dino and now we've got

  16. 0:27

    bun fresh out of the oven which just hit

  17. 0:29

    1.0 this morning and you should take

  18. 0:31

    notice because it can run your

  19. 0:32

    JavaScript code faster than any other

  20. 0:34

    tool known to man but not just that it

  21. 0:36

    also acts as a bundler like webpack or

  22. 0:38

    Veet a test Runner like jest or Karma

  23. 0:41

    and a package manager like npm or yarn

  24. 0:43

    in addition it's almost fully compatible

  25. 0:45

    with existing node.js apis but has its

  26. 0:48

    own set of Highly optimized apis that

  27. 0:50

    actually make it fun to build high

  28. 0:51

    performance server-side applications

  29. 0:52

    with JavaScript before we get into it

  30. 0:54

    though I want to show you another

  31. 0:55

    awesome new tool from our sponsor devgpt

  32. 0:58

    by now you've heard of tools like chat

  33. 0:59

    gbt and co-pilot but devgpt takes AI

  34. 1:03

    code generation to the next level by

  35. 1:04

    integrating directly with your git repo

  36. 1:06

    giving the AI the full context of your

  37. 1:08

    Tech stack and project after writing a

  38. 1:10

    prompt to fix a bug or create a feature

  39. 1:12

    It'll ask follow-up questions to write

  40. 1:14

    highly targeted and useful code once the

  41. 1:16

    code is generated you can then sync

  42. 1:18

    those changes to your local project

  43. 1:19

    instantly then you could prompt it to

  44. 1:21

    generate some unit tests to validate

  45. 1:23

    that code it's like having an automated

  46. 1:24

    engineer by your side who can take care

  47. 1:26

    of your GitHub issues and jira tickets

  48. 1:28

    instantly without complaining you can

  49. 1:30

    try it out for free yourself right now

  50. 1:31

    with the link below but now let's get

  51. 1:33

    back to bun first of all how do they

  52. 1:34

    make this thing so fast one major

  53. 1:36

    difference compared to node and Dino

  54. 1:38

    which uses the V8 engine from chrome bun

  55. 1:40

    uses JavaScript core from Safari which

  56. 1:42

    is known to be optimized for faster

  57. 1:44

    startup times in addition bun is

  58. 1:46

    implemented in the zig programming

  59. 1:48

    language they've put a focus on profile

  60. 1:49

    and performance bottlenecks and

  61. 1:51

    Implement apis in native code the end

  62. 1:53

    result is a hello world with typescript

  63. 1:55

    that's five times faster than es build

  64. 1:57

    keep in mind though benchmarks can

  65. 1:58

    always be cherry-picked and rarely

  66. 1:59

    reflect real world performance it's fun