it is july 22nd 2022 and you're watching
the code report the programming
languages that people love to hate are
disappearing quickly microsoft killed
javascript with typescript apple killed
objective c with swift jetbrains killed
java with kotlin and now google is
stepping up to the plate for the biggest
challenge of all c plus plus it just
announced a new experimental language
called carbon which is designed to match
the performance of c plus with llvm
while being able to interrupt with
existing c plus plus code bases that's a
big deal because c plus plus is by far
the most prolific language when it comes
to building high performance low level
systems c plus has been around since
1983 and it's accumulated a lot of
technical debt in the process the
creator of c plus plus once said quote
within c plus plus there is a much
smaller and cleaner language struggling
to get out the problem with making c
plus better today is that it's such an
important language for so many code
bases that it needs to focus more on
standardization as opposed to evolving
the design to what modern developers
want it's really hard to change and
establish technology this sucks change
it
like when python 2 went to python 3 the
changes weren't that extreme but it's
still very painful for anybody wanting
to migrate a code base and also all the
content on the web and stack overflow
becomes stale one could argue it's
actually a good thing that c plus
doesn't try to change too aggressively
carbon is designed to be a successor
language for c plus plus which is no
small undertaking but google is no
stranger to creating programming
languages it gave us go and dart which
are both very well liked in the industry
at this point carbon doesn't have a good
logo or mascot but i'm sure it will get
one eventually you might also be
wondering why not just use a modern
memory safe language like rust first of
all not all c plus developers actually
like rust but more importantly carbon is
designed for easy adoption by existing c
plus code bases and developers it has
bi-directional interoperability with c
plus which means you can use existing c
plus plus libraries and carbon
seamlessly or vice versa now i've only
been coding for about 12 years which
isn't nearly enough time to learn c plus
plus but let's take a look at some code
anyway to run carbon at this point
you'll need to install google's build
tool bazel as well as llvm to build it
to say hello world we have a main
function that uses print with a string
literal it looks pretty simple but if
you've never seen a c plus plus hello
world that uses this character out
then it looks like a
revolutionary improvement but a bigger
feature is the fact that it supports a
modern generic system generics allow you
to pass types as parameters to classes
and functions a common pattern in
statically typed languages but c plus
takes a different approach that's often
misused and abused called templates
carbon still supports templates but
generics will provide a bunch of
advantages in most situations but more
importantly carbon looks to improve upon
memory safety patterns in c plus plus
you can have uninitialized variables
which can sometimes be important for
performance but more often than not they
just result in bugs and memory access
bugs can be very dangerous when hackers
learn to exploit them carbon has an
entire dock on its safety strategy and
basically it tries to be as safe as
possible without hurting performance or
interoperability with c plus and it can
be run in different modes like debug
performance and hardened depending on
how much you want to prioritize memory
safety notably it doesn't use mechanisms
like borrow checking reference counting
or garbage collection like you might
find in other languages sounds pretty
cool so when can i start using it well
at this point it's experimental and it's
an extremely ambitious project it'll
likely be multiple years before this
language is production ready now even
though google just implemented a hiring
freeze employers are already looking to
hire carbon developers you just need to
have 10 years of carbon experience to
apply this has been the code report
thanks for watching and i will see you
in the next one