Let's take a first look at Bun 1.0 - the worlds fastest JavaScript runtime. Find out how Bun compares to Node.js and Deno. 

#webdevelopment #javascript #thecodereport 

🔥 Level up AI code generation with DevGPT

Try it for free: https://devgpt.com/?utm_source=fireship

💬 Chat with Me on Discord

https://discord.gg/fireship

🔗 Resources

Bun 1.0 details https://bun.sh/blog/bun-v1.0
Bun.js Launch Video https://youtu.be/BsnCpESUEqM
Deno NPM modules https://youtu.be/cv7ci6GT5Hg

🎨 My Editor Settings

- Atom One Dark 
- vscode-icons
- Fira Code Font

🔖 Topics Covered

- Bun.js vs Node.js
- Bun vs Deno
- How is Bun so fast?
- Are JavaScript apps fast?
- Best JS frameworks
- How to optimize JavaScript performance
2024-02-04T05:00:37.433Z
nova-2
2-general-nova
2024-01-09.29447
30089e05-99d1-4376-b32e-c263170674af
fd31cea1-6dac-4a2a-9de2-bc91f238b4d5
6efd4b3b214ac3f11d36cc5793c764efceb2eb8898964f3845f848bba4a9c44c
67875a7f-c9c4-48a0-aa55-5bdb8a91c34a
deprecated
It is September 8, 2023, and you're watching the code report.
Yesterday was a huge day for soy devs.
Mojo became generally available, a superset of Python that's up to 35,000 times faster.
But JavaScript also got way faster, thanks to a new Swiss army knife called bun.
And that means time for some new stickers on my MacBook Pro.
JavaScript developers have grown tired of reinventing new frameworks, so now we're building entirely new JavaScript runtimes.
In the beginning we had Node.
Js, then rearranged the letters to make Dino, and now we've got bun fresh out of the oven, which just hit 1 point o this morning.
And you should take notice because as it can run your JavaScript code faster than any other tool known to man.
But not just that, it also acts as a bundler like Webpack or Vite, a test runner like Jest or Karma and a package manager like NPM or Yarn.
In addition, it's almost fully compatible with existing Node.
Js APIs, but has its own set of highly optimized APIs that that actually make it fun to build high performance server side applications with JavaScript.
Before we get into it though, I wanna show you another awesome new tool from our sponsor, DevGPT.
By now, you've heard of tools like Chat GPT and Copilot, but Dev GPT takes AI code generation to the next level by integrating directly with your git repo, giving the AI the full context of your tech stack and project.
Checked.
After writing a prompt to fix a bug or create a feature, it'll ask follow-up questions to write highly targeted and useful code.
Once the code is generated, you can then sync those changes to your project instantly, then you could prompt it to generate some unit tests to validate that code.
It's like having an automated engineer by your side who can take care of your GitHub issues and Jira tickets instantly without complaining.
You can try it out for free yourself right now with the link below.
But now let's get back to BUN.
First of all, how do they make this thing so fast?
One major difference compared to Node and Deno, which uses the v eight engine from Chrome.
BUN uses JavaScript core from Safari, which is known to optimized for faster start up times.
In addition, BUN is implemented in the Zig programming language.
They've put a focus on profile and performance bottlenecks and implement APIs in native code.
The and result is a hello world with TypeScript that's 5 times faster than ES build.
Keep in mind though benchmarks can always be cherry picked and rarely reflect real world performance.
It's fun to go fast, but because I only have 12 monthly active users on my website.
It doesn't make a huge difference for me.
What I care about is the developer experience.
Can BUN make my life easier?
Well, first up, it's got awesome TypeScript support out of the box.
You can immediately start writing TypeScript code without any configuration or headaches.
And it also supports JSX and hot reloading, which means you don't need any weird dependencies like nodemon and concurrently to recompile your code when things change.
That's cool, but one of the absolute worst things about Node has been the transition from common JS to ES modules.
What's cool about BUN is that you can just use import and require in the same file and everything just magically works.
And it's compatible with existing Node.
Js packages, which means you don't have to reinvent the wheel for every little thing you want to implement.
Deno also added NPM support as well recently, but what I really like about BUN is its native APIs.
For example, to read and write to the file system, we can access the global bun runtime and make a reference to a file, then lazily read it or parse its That may not seem like a big deal, but in Node.
Js, there are 3 different ways to do the same thing.
Read file with callbacks, read file with promises, or read file async.
You can actually use all of those in BUN, but not only are the native APIs faster, they're easier to use.
In addition, it's extremely easy to set up an HTTP server in BUN by simply calling the serve method.
You then use familiar browser primitives like fetch and response to build your API.
That'll take you pretty far, but there's also frameworks that work with BUN, like Alicia, that claims to be 18 times faster than Express JS and Node.
BUN also works with Hano, which has been my go to framework for building APIs recently.
BUN has tons of other simplifications as well, like it as WebSockets nice and simple out of the box without any extra dependencies, and you can use environment variables without things like dotenv.
Pretty cool.
But as The name implies, bun is also a bundler.
The bun build command will take all your source files and then combine them into a single output that can be used in a browser.
And based on this benchmark, it's pretty amazing how much faster things have gotten just since webpack 5 a couple years ago.
Oh, and another really cool thing is that BUN has a SQLite base built directly into the runtime.
It's incredibly convenient to have a relational database without the need to install and configure a bunch of drivers.
Another thing we need to about though is the BUNT package manager.
That's up to 25 times faster than npm.
And it's actually a standalone tool that could be used in any Node.
Js project today.
If you wanna make things go faster right now, replace npx with a command like bunks cowsay hello world, which allows you to save a few precious milliseconds when a hi to your mom, which is important because you never know how much time you have left to do that.
This has been the code report.
Thanks for watching, and I will see you in the next one.

Speaker 0: It is September 8, 2023, and you're watching the code report. Yesterday was a huge day for soy devs. Mojo became generally available, a superset of Python that's up to 35,000 times faster. But JavaScript also got way faster, thanks to a new Swiss army knife called bun. And that means time for some new stickers on my MacBook Pro.

JavaScript developers have grown tired of reinventing new frameworks, so now we're building entirely new JavaScript runtimes. In the beginning we had Node. Js, then rearranged the letters to make Dino, and now we've got bun fresh out of the oven, which just hit 1 point o this morning. And you should take notice because as it can run your JavaScript code faster than any other tool known to man. But not just that, it also acts as a bundler like Webpack or Vite, a test runner like Jest or Karma and a package manager like NPM or Yarn.

In addition, it's almost fully compatible with existing Node. Js APIs, but has its own set of highly optimized APIs that that actually make it fun to build high performance server side applications with JavaScript. Before we get into it though, I wanna show you another awesome new tool from our sponsor, DevGPT. By now, you've heard of tools like Chat GPT and Copilot, but Dev GPT takes AI code generation to the next level by integrating directly with your git repo, giving the AI the full context of your tech stack and project. Checked.

After writing a prompt to fix a bug or create a feature, it'll ask follow-up questions to write highly targeted and useful code. Once the code is generated, you can then sync those changes to your project instantly, then you could prompt it to generate some unit tests to validate that code. It's like having an automated engineer by your side who can take care of your GitHub issues and Jira tickets instantly without complaining. You can try it out for free yourself right now with the link below. But now let's get back to BUN.

First of all, how do they make this thing so fast? One major difference compared to Node and Deno, which uses the v eight engine from Chrome. BUN uses JavaScript core from Safari, which is known to optimized for faster start up times. In addition, BUN is implemented in the Zig programming language. They've put a focus on profile and performance bottlenecks and implement APIs in native code.

The and result is a hello world with TypeScript that's 5 times faster than ES build. Keep in mind though benchmarks can always be cherry picked and rarely reflect real world performance. It's fun to go fast, but because I only have 12 monthly active users on my website. It doesn't make a huge difference for me. What I care about is the developer experience.

Can BUN make my life easier? Well, first up, it's got awesome TypeScript support out of the box. You can immediately start writing TypeScript code without any configuration or headaches. And it also supports JSX and hot reloading, which means you don't need any weird dependencies like nodemon and concurrently to recompile your code when things change. That's cool, but one of the absolute worst things about Node has been the transition from common JS to ES modules.

What's cool about BUN is that you can just use import and require in the same file and everything just magically works. And it's compatible with existing Node. Js packages, which means you don't have to reinvent the wheel for every little thing you want to implement. Deno also added NPM support as well recently, but what I really like about BUN is its native APIs. For example, to read and write to the file system, we can access the global bun runtime and make a reference to a file, then lazily read it or parse its That may not seem like a big deal, but in Node.

Js, there are 3 different ways to do the same thing. Read file with callbacks, read file with promises, or read file async. You can actually use all of those in BUN, but not only are the native APIs faster, they're easier to use. In addition, it's extremely easy to set up an HTTP server in BUN by simply calling the serve method. You then use familiar browser primitives like fetch and response to build your API.

That'll take you pretty far, but there's also frameworks that work with BUN, like Alicia, that claims to be 18 times faster than Express JS and Node. BUN also works with Hano, which has been my go to framework for building APIs recently. BUN has tons of other simplifications as well, like it as WebSockets nice and simple out of the box without any extra dependencies, and you can use environment variables without things like dotenv. Pretty cool. But as The name implies, bun is also a bundler.

The bun build command will take all your source files and then combine them into a single output that can be used in a browser. And based on this benchmark, it's pretty amazing how much faster things have gotten just since webpack 5 a couple years ago. Oh, and another really cool thing is that BUN has a SQLite base built directly into the runtime. It's incredibly convenient to have a relational database without the need to install and configure a bunch of drivers. Another thing we need to about though is the BUNT package manager.

That's up to 25 times faster than npm. And it's actually a standalone tool that could be used in any Node. Js project today. If you wanna make things go faster right now, replace npx with a command like bunks cowsay hello world, which allows you to save a few precious milliseconds when a hi to your mom, which is important because you never know how much time you have left to do that. This has been the code report.

Thanks for watching, and I will see you in the next one.
It is September 8, 2023, and you're watching the code report. Yesterday was a huge day for soy devs. Mojo became generally available, a superset of Python that's up to 35,000 times faster. But JavaScript also got way faster, thanks to a new Swiss army knife called bun. And that means time for some new stickers on my MacBook Pro. JavaScript developers have grown tired of reinventing new frameworks, so now we're building entirely new JavaScript runtimes. In the beginning we had Node. Js, then rearranged the letters to make Dino, and now we've got bun fresh out of the oven, which just hit 1 point o this morning. And you should take notice because as it can run your JavaScript code faster than any other tool known to man. But not just that, it also acts as a bundler like Webpack or Vite, a test runner like Jest or Karma and a package manager like NPM or Yarn. In addition, it's almost fully compatible with existing Node. Js APIs, but has its own set of highly optimized APIs that that actually make it fun to build high performance server side applications with JavaScript.
Before we get into it though, I wanna show you another awesome new tool from our sponsor, DevGPT. By now, you've heard of tools like Chat GPT and Copilot, but Dev GPT takes AI code generation to the next level by integrating directly with your git repo, giving the AI the full context of your tech stack and project.
software development
software
Checked. After writing a prompt to fix a bug or create a feature, it'll ask follow-up questions to write highly targeted and useful code. Once the code is generated, you can then sync those changes to your project instantly, then you could prompt it to generate some unit tests to validate that code. It's like having an automated engineer by your side who can take care of your GitHub issues and Jira tickets instantly without complaining. You can try it out for free yourself right now with the link below. But now let's get back to BUN. First of all, how do they make this thing so fast? One major difference compared to Node and Deno, which uses the v eight engine from Chrome. BUN uses JavaScript core from Safari, which is known to optimized for faster start up times. In addition, BUN is implemented in the Zig programming language. They've put a focus on profile and performance bottlenecks and implement APIs in native code. The and result is a hello world with TypeScript that's 5 times faster than ES build. Keep in mind though benchmarks can always be cherry picked and rarely reflect real world performance. It's fun to go fast, but because I only have 12 monthly active users on my website.
It doesn't make a huge difference for me. What I care about is the developer experience. Can BUN make my life easier? Well, first up, it's got awesome TypeScript support out of the box. You can immediately start writing TypeScript code without any configuration or headaches. And it also supports JSX and hot reloading, which means you don't need any weird dependencies like nodemon and concurrently to recompile your code when things change.
software development
That's cool, but one of the absolute worst things about Node has been the transition from common JS to ES modules. What's cool about BUN is that you can just use import and require in the same file and everything just magically works. And it's compatible with existing Node. Js packages, which means you don't have to reinvent the wheel for every little thing you want to implement. Deno also added NPM support as well recently, but what I really like about BUN is its native APIs. For example, to read and write to the file system, we can access the global bun runtime and make a reference to a file, then lazily read it or parse its That may not seem like a big deal, but in Node. Js, there are 3 different ways to do the same thing. Read file with callbacks, read file with promises, or read file async. You can actually use all of those in BUN, but not only are the native APIs faster, they're easier to use. In addition, it's extremely easy to set up an HTTP server in BUN by simply calling the serve method. You then use familiar browser primitives like fetch and response to build your API. That'll take you pretty far, but there's also frameworks that work with BUN, like Alicia, that claims to be 18 times faster than Express JS and Node. BUN also works with Hano, which has been my go to framework for building APIs recently. BUN has tons of other simplifications as well, like it as WebSockets nice and simple out of the box without any extra dependencies, and you can use environment variables without things like dotenv. Pretty cool. But as The name implies, bun is also a bundler. The bun build command will take all your source files and then combine them into a single output that can be used in a browser.
And based on this benchmark, it's pretty amazing how much faster things have gotten just since webpack 5 a couple years ago. Oh, and another really cool thing is that BUN has a SQLite base built directly into the runtime. It's incredibly convenient to have a relational database without the need to install and configure a bunch of drivers. Another thing we need to about though is the BUNT package manager. That's up to 25 times faster than npm. And it's actually a standalone tool that could be used in any Node.
databases
data management
Js project today. If you wanna make things go faster right now, replace npx with a command like bunks cowsay hello world, which allows you to save a few precious milliseconds when a hi to your mom, which is important because you never know how much time you have left to do that. This has been the code report. Thanks for watching, and I will see you in the next one.
It is September 8, 2023, and you're watching the code report. Yesterday was a huge day for soy devs. Mojo became generally available, a superset of Python that's up to 35,000 times faster. But JavaScript also got way faster, thanks to a new Swiss army knife called bun. And that means time for some new stickers on my MacBook Pro. JavaScript developers have grown tired of reinventing new frameworks, so now we're building entirely new JavaScript runtimes. In the beginning we had Node. Js, then rearranged the letters to make Dino, and now we've got bun fresh out of the oven, which just hit 1 point o this morning. And you should take notice because as it can run your JavaScript code faster than any other tool known to man. But not just that, it also acts as a bundler like Webpack or Vite, a test runner like Jest or Karma and a package manager like NPM or Yarn. In addition, it's almost fully compatible with existing Node. Js APIs, but has its own set of highly optimized APIs that that actually make it fun to build high performance server side applications with JavaScript. Before we get into it though, I wanna show you another awesome new tool from our sponsor, DevGPT. By now, you've heard of tools like Chat GPT and Copilot, but Dev GPT takes AI code generation to the next level by integrating directly with your git repo, giving the AI the full context of your tech stack and project. Checked. After writing a prompt to fix a bug or create a feature, it'll ask follow-up questions to write highly targeted and useful code. Once the code is generated, you can then sync those changes to your project instantly, then you could prompt it to generate some unit tests to validate that code. It's like having an automated engineer by your side who can take care of your GitHub issues and Jira tickets instantly without complaining. You can try it out for free yourself right now with the link below. But now let's get back to BUN. First of all, how do they make this thing so fast? One major difference compared to Node and Deno, which uses the v eight engine from Chrome. BUN uses JavaScript core from Safari, which is known to optimized for faster start up times. In addition, BUN is implemented in the Zig programming language. They've put a focus on profile and performance bottlenecks and implement APIs in native code. The and result is a hello world with TypeScript that's 5 times faster than ES build. Keep in mind though benchmarks can always be cherry picked and rarely reflect real world performance. It's fun to go fast, but because I only have 12 monthly active users on my website. It doesn't make a huge difference for me. What I care about is the developer experience. Can BUN make my life easier? Well, first up, it's got awesome TypeScript support out of the box. You can immediately start writing TypeScript code without any configuration or headaches. And it also supports JSX and hot reloading, which means you don't need any weird dependencies like nodemon and concurrently to recompile your code when things change. That's cool, but one of the absolute worst things about Node has been the transition from common JS to ES modules. What's cool about BUN is that you can just use import and require in the same file and everything just magically works. And it's compatible with existing Node. Js packages, which means you don't have to reinvent the wheel for every little thing you want to implement. Deno also added NPM support as well recently, but what I really like about BUN is its native APIs. For example, to read and write to the file system, we can access the global bun runtime and make a reference to a file, then lazily read it or parse its That may not seem like a big deal, but in Node. Js, there are 3 different ways to do the same thing. Read file with callbacks, read file with promises, or read file async. You can actually use all of those in BUN, but not only are the native APIs faster, they're easier to use. In addition, it's extremely easy to set up an HTTP server in BUN by simply calling the serve method. You then use familiar browser primitives like fetch and response to build your API. That'll take you pretty far, but there's also frameworks that work with BUN, like Alicia, that claims to be 18 times faster than Express JS and Node. BUN also works with Hano, which has been my go to framework for building APIs recently. BUN has tons of other simplifications as well, like it as WebSockets nice and simple out of the box without any extra dependencies, and you can use environment variables without things like dotenv. Pretty cool. But as The name implies, bun is also a bundler. The bun build command will take all your source files and then combine them into a single output that can be used in a browser. And based on this benchmark, it's pretty amazing how much faster things have gotten just since webpack 5 a couple years ago. Oh, and another really cool thing is that BUN has a SQLite base built directly into the runtime. It's incredibly convenient to have a relational database without the need to install and configure a bunch of drivers. Another thing we need to about though is the BUNT package manager. That's up to 25 times faster than npm. And it's actually a standalone tool that could be used in any Node. Js project today. If you wanna make things go faster right now, replace npx with a command like bunks cowsay hello world, which allows you to save a few precious milliseconds when a hi to your mom, which is important because you never know how much time you have left to do that. This has been the code report. Thanks for watching, and I will see you in the next one.
It
it
is
is
September
september
8,
8
2023,
2023
and
and
you're
you're
watching
watching
the
the
code
code
report.
report
Yesterday
yesterday
was
was
a
a
huge
huge
day
day
for
for
soy
soy
devs.
devs
Mojo
mojo
became
became
generally
generally
available,
available
a
a
superset
superset
of
of
Python
python
that's
that's
up
up
to
to
35,000
35,000
times
times
faster.
faster
But
but
JavaScript
javascript
also
also
got
got
way
way
faster,
faster
thanks
thanks
to
to
a
a
new
new
Swiss
swiss
army
army
knife
knife
called
called
bun.
bun
And
and
that
that
means
means
time
time
for
for
some
some
new
new
stickers
stickers
on
on
my
my
MacBook
macbook
Pro.
pro
JavaScript
javascript
developers
developers
have
have
grown
grown
tired
tired
of
of
reinventing
reinventing
new
new
frameworks,
frameworks
so
so
now
now
we're
we're
building
building
entirely
entirely
new
new
JavaScript
javascript
runtimes.
runtimes
In
in
the
the
beginning
beginning
we
we
had
had
Node.
node
Js,
js
then
then
rearranged
rearranged
the
the
letters
letters
to
to
make
make
Dino,
dino
and
and
now
now
we've
we've
got
got
bun
bun
fresh
fresh
out
out
of
of
the
the
oven,
oven
which
which
just
just
hit
hit
1
1
point
point
o
o
this
this
morning.
morning
And
and
you
you
should
should
take
take
notice
notice
because
because
as
as
it
it
can
can
run
run
your
your
JavaScript
javascript
code
code
faster
faster
than
than
any
any
other
other
tool
tool
known
known
to
to
man.
man
But
but
not
not
just
just
that,
that
it
it
also
also
acts
acts
as
as
a
a
bundler
bundler
like
like
Webpack
webpack
or
or
Vite,
vite
a
a
test
test
runner
runner
like
like
Jest
jest
or
or
Karma
karma
and
and
a
a
package
package
manager
manager
like
like
NPM
npm
or
or
Yarn.
yarn
In
in
addition,
addition
it's
it's
almost
almost
fully
fully
compatible
compatible
with
with
existing
existing
Node.
node
Js
js
APIs,
apis
but
but
has
has
its
its
own
own
set
set
of
of
highly
highly
optimized
optimized
APIs
apis
that
that
that
that
actually
actually
make
make
it
it
fun
fun
to
to
build
build
high
high
performance
performance
server
server
side
side
applications
applications
with
with
JavaScript.
javascript
Before
before
we
we
get
get
into
into
it
it
though,
though
I
i
wanna
wanna
show
show
you
you
another
another
awesome
awesome
new
new
tool
tool
from
from
our
our
sponsor,
sponsor
DevGPT.
devgpt
By
by
now,
now
you've
you've
heard
heard
of
of
tools
tools
like
like
Chat
chat
GPT
gpt
and
and
Copilot,
copilot
but
but
Dev
dev
GPT
gpt
takes
takes
AI
ai
code
code
generation
generation
to
to
the
the
next
next
level
level
by
by
integrating
integrating
directly
directly
with
with
your
your
git
git
repo,
repo
giving
giving
the
the
AI
ai
the
the
full
full
context
context
of
of
your
your
tech
tech
stack
stack
and
and
project.
project
Checked.
checked
After
after
writing
writing
a
a
prompt
prompt
to
to
fix
fix
a
a
bug
bug
or
or
create
create
a
a
feature,
feature
it'll
it'll
ask
ask
follow-up
follow-up
questions
questions
to
to
write
write
highly
highly
targeted
targeted
and
and
useful
useful
code.
code
Once
once
the
the
code
code
is
is
generated,
generated
you
you
can
can
then
then
sync
sync
those
those
changes
changes
to
to
your
your
project
project
instantly,
instantly
then
then
you
you
could
could
prompt
prompt
it
it
to
to
generate
generate
some
some
unit
unit
tests
tests
to
to
validate
validate
that
that
code.
code
It's
it's
like
like
having
having
an
an
automated
automated
engineer
engineer
by
by
your
your
side
side
who
who
can
can
take
take
care
care
of
of
your
your
GitHub
github
issues
issues
and
and
Jira
jira
tickets
tickets
instantly
instantly
without
without
complaining.
complaining
You
you
can
can
try
try
it
it
out
out
for
for
free
free
yourself
yourself
right
right
now
now
with
with
the
the
link
link
below.
below
But
but
now
now
let's
let's
get
get
back
back
to
to
BUN.
bun
First
first
of
of
all,
all
how
how
do
do
they
they
make
make
this
this
thing
thing
so
so
fast?
fast
One
one
major
major
difference
difference
compared
compared
to
to
Node
node
and
and
Deno,
deno
which
which
uses
uses
the
the
v
v
eight
eight
engine
engine
from
from
Chrome.
chrome
BUN
bun
uses
uses
JavaScript
javascript
core
core
from
from
Safari,
safari
which
which
is
is
known
known
to
to
optimized
optimized
for
for
faster
faster
start
start
up
up
times.
times
In
in
addition,
addition
BUN
bun
is
is
implemented
implemented
in
in
the
the
Zig
zig
programming
programming
language.
language
They've
they've
put
put
a
a
focus
focus
on
on
profile
profile
and
and
performance
performance
bottlenecks
bottlenecks
and
and
implement
implement
APIs
apis
in
in
native
native
code.
code
The
the
and
and
result
result
is
is
a
a
hello
hello
world
world
with
with
TypeScript
typescript
that's
that's
5
5
times
times
faster
faster
than
than
ES
es
build.
build
Keep
keep
in
in
mind
mind
though
though
benchmarks
benchmarks
can
can
always
always
be
be
cherry
cherry
picked
picked
and
and
rarely
rarely
reflect
reflect
real
real
world
world
performance.
performance
It's
it's
fun
fun
to
to
go
go
fast,
fast
but
but
because
because
I
i
only
only
have
have
12
12
monthly
monthly
active
active
users
users
on
on
my
my
website.
website
It
it
doesn't
doesn't
make
make
a
a
huge
huge
difference
difference
for
for
me.
me
What
what
I
i
care
care
about
about
is
is
the
the
developer
developer
experience.
experience
Can
can
BUN
bun
make
make
my
my
life
life
easier?
easier
Well,
well
first
first
up,
up
it's
it's
got
got
awesome
awesome
TypeScript
typescript
support
support
out
out
of
of
the
the
box.
box
You
you
can
can
immediately
immediately
start
start
writing
writing
TypeScript
typescript
code
code
without
without
any
any
configuration
configuration
or
or
headaches.
headaches
And
and
it
it
also
also
supports
supports
JSX
jsx
and
and
hot
hot
reloading,
reloading
which
which
means
means
you
you
don't
don't
need
need
any
any
weird
weird
dependencies
dependencies
like
like
nodemon
nodemon
and
and
concurrently
concurrently
to
to
recompile
recompile
your
your
code
code
when
when
things
things
change.
change
That's
that's
cool,
cool
but
but
one
one
of
of
the
the
absolute
absolute
worst
worst
things
things
about
about
Node
node
has
has
been
been
the
the
transition
transition
from
from
common
common
JS
js
to
to
ES
es
modules.
modules
What's
what's
cool
cool
about
about
BUN
bun
is
is
that
that
you
you
can
can
just
just
use
use
import
import
and
and
require
require
in
in
the
the
same
same
file
file
and
and
everything
everything
just
just
magically
magically
works.
works
And
and
it's
it's
compatible
compatible
with
with
existing
existing
Node.
node
Js
js
packages,
packages
which
which
means
means
you
you
don't
don't
have
have
to
to
reinvent
reinvent
the
the
wheel
wheel
for
for
every
every
little
little
thing
thing
you
you
want
want
to
to
implement.
implement
Deno
deno
also
also
added
added
NPM
npm
support
support
as
as
well
well
recently,
recently
but
but
what
what
I
i
really
really
like
like
about
about
BUN
bun
is
is
its
its
native
native
APIs.
apis
For
for
example,
example
to
to
read
read
and
and
write
write
to
to
the
the
file
file
system,
system
we
we
can
can
access
access
the
the
global
global
bun
bun
runtime
runtime
and
and
make
make
a
a
reference
reference
to
to
a
a
file,
file
then
then
lazily
lazily
read
read
it
it
or
or
parse
parse
its
its
That
that
may
may
not
not
seem
seem
like
like
a
a
big
big
deal,
deal
but
but
in
in
Node.
node
Js,
js
there
there
are
are
3
3
different
different
ways
ways
to
to
do
do
the
the
same
same
thing.
thing
Read
read
file
file
with
with
callbacks,
callbacks
read
read
file
file
with
with
promises,
promises
or
or
read
read
file
file
async.
async
You
you
can
can
actually
actually
use
use
all
all
of
of
those
those
in
in
BUN,
bun
but
but
not
not
only
only
are
are
the
the
native
native
APIs
apis
faster,
faster
they're
they're
easier
easier
to
to
use.
use
In
in
addition,
addition
it's
it's
extremely
extremely
easy
easy
to
to
set
set
up
up
an
an
HTTP
http
server
server
in
in
BUN
bun
by
by
simply
simply
calling
calling
the
the
serve
serve
method.
method
You
you
then
then
use
use
familiar
familiar
browser
browser
primitives
primitives
like
like
fetch
fetch
and
and
response
response
to
to
build
build
your
your
API.
api
That'll
that'll
take
take
you
you
pretty
pretty
far,
far
but
but
there's
there's
also
also
frameworks
frameworks
that
that
work
work
with
with
BUN,
bun
like
like
Alicia,
alicia
that
that
claims
claims
to
to
be
be
18
18
times
times
faster
faster
than
than
Express
express
JS
js
and
and
Node.
node
BUN
bun
also
also
works
works
with
with
Hano,
hano
which
which
has
has
been
been
my
my
go
go
to
to
framework
framework
for
for
building
building
APIs
apis
recently.
recently
BUN
bun
has
has
tons
tons
of
of
other
other
simplifications
simplifications
as
as
well,
well
like
like
it
it
as
as
WebSockets
websockets
nice
nice
and
and
simple
simple
out
out
of
of
the
the
box
box
without
without
any
any
extra
extra
dependencies,
dependencies
and
and
you
you
can
can
use
use
environment
environment
variables
variables
without
without
things
things
like
like
dotenv.
dotenv
Pretty
pretty
cool.
cool
But
but
as
as
The
the
name
name
implies,
implies
bun
bun
is
is
also
also
a
a
bundler.
bundler
The
the
bun
bun
build
build
command
command
will
will
take
take
all
all
your
your
source
source
files
files
and
and
then
then
combine
combine
them
them
into
into
a
a
single
single
output
output
that
that
can
can
be
be
used
used
in
in
a
a
browser.
browser
And
and
based
based
on
on
this
this
benchmark,
benchmark
it's
it's
pretty
pretty
amazing
amazing
how
how
much
much
faster
faster
things
things
have
have
gotten
gotten
just
just
since
since
webpack
webpack
5
5
a
a
couple
couple
years
years
ago.
ago
Oh,
oh
and
and
another
another
really
really
cool
cool
thing
thing
is
is
that
that
BUN
bun
has
has
a
a
SQLite
sqlite
base
base
built
built
directly
directly
into
into
the
the
runtime.
runtime
It's
it's
incredibly
incredibly
convenient
convenient
to
to
have
have
a
a
relational
relational
database
database
without
without
the
the
need
need
to
to
install
install
and
and
configure
configure
a
a
bunch
bunch
of
of
drivers.
drivers
Another
another
thing
thing
we
we
need
need
to
to
about
about
though
though
is
is
the
the
BUNT
bunt
package
package
manager.
manager
That's
that's
up
up
to
to
25
25
times
times
faster
faster
than
than
npm.
npm
And
and
it's
it's
actually
actually
a
a
standalone
standalone
tool
tool
that
that
could
could
be
be
used
used
in
in
any
any
Node.
node
Js
js
project
project
today.
today
If
if
you
you
wanna
wanna
make
make
things
things
go
go
faster
faster
right
right
now,
now
replace
replace
npx
npx
with
with
a
a
command
command
like
like
bunks
bunks
cowsay
cowsay
hello
hello
world,
world
which
which
allows
allows
you
you
to
to
save
save
a
a
few
few
precious
precious
milliseconds
milliseconds
when
when
a
a
hi
hi
to
to
your
your
mom,
mom
which
which
is
is
important
important
because
because
you
you
never
never
know
know
how
how
much
much
time
time
you
you
have
have
left
left
to
to
do
do
that.
that
This
this
has
has
been
been
the
the
code
code
report.
report
Thanks
thanks
for
for
watching,
watching
and
and
I
i
will
will
see
see
you
you
in
in
the
the
next
next
one.
one
success
The speaker discusses new tools for building high-performance server side applications with JavaScript, including the developers and their sponsor. They also show a new tool called DevGPT, which uses AI code generation and integrates directly with git repo, giving the developers a full context of their tech stack and project. The speaker also discusses the benefits of using the BUN framework, including its native APIs, read and write to file, and its ability to set up an HTTP server. They conclude by discussing the benefits of using the BLive package manager and its use in creating a standalone tool for building APIs.
Bun is disrupting JavaScript land
It is September 8, 2023, and you're watching the code report. Yesterday was a huge day for soy devs. Mojo became generally available, a superset of Python that's up to 35,000 times faster. But JavaScript also got way faster, thanks to a new Swiss army knife called bun. And that means time for some new stickers on my MacBook Pro. JavaScript developers have grown tired of reinventing new frameworks, so now we're building entirely new JavaScript runtimes. In the beginning we had Node. Js, then rearranged the letters to make Dino, and now we've got bun fresh out of the oven, which just hit 1 point o this morning. And you should take notice because as it can run your JavaScript code faster than any other tool known to man. But not just that, it also acts as a bundler like Webpack or Vite, a test runner like Jest or Karma and a package manager like NPM or Yarn. In addition, it's almost fully compatible with existing Node. Js APIs, but has its own set of highly optimized APIs that that actually make it fun to build high performance server side applications with JavaScript. Before we get into it though, I wanna show you another awesome new tool from our sponsor, DevGPT. By now, you've heard of tools like Chat GPT and Copilot, but Dev GPT takes AI code generation to the next level by integrating directly with your git repo, giving the AI the full context of your tech stack and project. Checked. After writing a prompt to fix a bug or create a feature, it'll ask follow-up questions to write highly targeted and useful code. Once the code is generated, you can then sync those changes to your project instantly, then you could prompt it to generate some unit tests to validate that code. It's like having an automated engineer by your side who can take care of your GitHub issues and Jira tickets instantly without complaining. You can try it out for free yourself right now with the link below. But now let's get back to BUN. First of all, how do they make this thing so fast? One major difference compared to Node and Deno, which uses the v eight engine from Chrome. BUN uses JavaScript core from Safari, which is known to optimized for faster start up times. In addition, BUN is implemented in the Zig programming language. They've put a focus on profile and performance bottlenecks and implement APIs in native code. The and result is a hello world with TypeScript that's 5 times faster than ES build. Keep in mind though benchmarks can always be cherry picked and rarely reflect real world performance. It's fun to go fast, but because I only have 12 monthly active users on my website. It doesn't make a huge difference for me. What I care about is the developer experience. Can BUN make my life easier? Well, first up, it's got awesome TypeScript support out of the box. You can immediately start writing TypeScript code without any configuration or headaches. And it also supports JSX and hot reloading, which means you don't need any weird dependencies like nodemon and concurrently to recompile your code when things change. That's cool, but one of the absolute worst things about Node has been the transition from common JS to ES modules. What's cool about BUN is that you can just use import and require in the same file and everything just magically works. And it's compatible with existing Node. Js packages, which means you don't have to reinvent the wheel for every little thing you want to implement. Deno also added NPM support as well recently, but what I really like about BUN is its native APIs. For example, to read and write to the file system, we can access the global bun runtime and make a reference to a file, then lazily read it or parse its That may not seem like a big deal, but in Node. Js, there are 3 different ways to do the same thing. Read file with callbacks, read file with promises, or read file async. You can actually use all of those in BUN, but not only are the native APIs faster, they're easier to use. In addition, it's extremely easy to set up an HTTP server in BUN by simply calling the serve method. You then use familiar browser primitives like fetch and response to build your API. That'll take you pretty far, but there's also frameworks that work with BUN, like Alicia, that claims to be 18 times faster than Express JS and Node. BUN also works with Hano, which has been my go to framework for building APIs recently. BUN has tons of other simplifications as well, like it as WebSockets nice and simple out of the box without any extra dependencies, and you can use environment variables without things like dotenv. Pretty cool. But as The name implies, bun is also a bundler. The bun build command will take all your source files and then combine them into a single output that can be used in a browser. And based on this benchmark, it's pretty amazing how much faster things have gotten just since webpack 5 a couple years ago. Oh, and another really cool thing is that BUN has a SQLite base built directly into the runtime. It's incredibly convenient to have a relational database without the need to install and configure a bunch of drivers. Another thing we need to about though is the BUNT package manager. That's up to 25 times faster than npm. And it's actually a standalone tool that could be used in any Node. Js project today. If you wanna make things go faster right now, replace npx with a command like bunks cowsay hello world, which allows you to save a few precious milliseconds when a hi to your mom, which is important because you never know how much time you have left to do that. This has been the code report. Thanks for watching, and I will see you in the next one.
The speaker discusses new tools for building high-performance server side applications with JavaScript, including the developers and their sponsor. They also show a new tool called DevGPT, which uses AI code generation and integrates directly with git repo, giving the developers a full context of their tech stack and project. The speaker also discusses the benefits of using the BUN framework, including its native APIs, read and write to file, and its ability to set up an HTTP server. They conclude by discussing the benefits of using the BLive package manager and its use in creating a standalone tool for building APIs.