so it looks like Lua just got ported
into the front end look at this thing
Roblox has officially just ported react
Lua Roa navigation Pico match Lua chalk
graphql Lua Apollo client Lua
everything's Lua Lua all the way down
just Roblox 880,000 lines of JS
translated into Lua it appears most uh
most of this is driven by their JS T Lua
compiler which is not too surprising
right um is this a bad idea is this a
good idea I think the thing is that a
lot of people sleep on how good Lua is
as a language Lua is an amazing language
there's there's only one really I'd say
one big kind of Pitfall of Lua that I
can really think of and I'm not even
sure one based indexing honestly does
not bother me it mostly doesn't bother
you either right most of the things you
do are going to be like 4X in some sort
of iterator right so it's like it
doesn't really exist for you to be upset
about it as this one in one one based
indexing that's just it just doesn't
exist I get it one based kind of
annoying whatever but I'd say the real
the only real downfall to the language
is how they handle array lengths and
that's it uh here I'll show you this Lua
this I think is a
tragedy uh let's see uh a equals um
there we go so I have a oh yeah I forgot
also their interpreter suck so if I go
uh print a I'll get a table if I go
table insert um a Fu I get uh print a I
still get table if I go print length of
a I get a one now watch this if I go
a 2 equals nil and I print length it's
still one if I go A3 equals Fu and I
print length it's still one
so until I set two to something two
equals bar now when I print it length is
three it determines the length by the
first nil that it encounters null
terminated arrays yes nil terminated
arrays I would say that is the biggest
downfall to Lua the reason why it makes
perfect sense um but there are no there
are no uh what's it called there the
this is not a fat pointer a table is not
a fat pointer does not contain the
length and so I really don't like that
at all uh also a table is an array which
also is an object so it's kind of the
same thing and so I think that's part of
the reasoning for it and B it just
doesn't have the length property so it's
not there because how do you determine
length if I were to go like this if I
were to go b equals an array and then
say B uh five equals a bar is that an
array or is that a map you don't know
and that's also what makes um Lua just
so easy to embed is it's a very simple
language it's a very very very simple
language and so besides for that one
foible I think Lua is one of the best
simple languages ever it's extremely
easy to teach to kids it's extremely
easy to use uh if you have a good
require system and you're a little bit
judicious about how you write it it's
also really easy to write the LSP snco
LSP uh you can take that and you can use
something that's kind of like JS do and
you'll even get types throughout your
code and it'll even catch a lot of the
ways you call functions and so you get
like close to typing as if it were
typescript it's pretty straightforward
it's pretty nice um I really enjoy I
I've actually genuinely really enjoyed
it does it have a standard Li yeah it
has like OS there's some basic stuff
that it has uh but no it doesn't have
typed arrays it does not have typed
arrays it has table um I really
generally like Lua and so I'm surprised
actually that Lua isn't more used I've
used a lot of Lua and all the projects
that I built in with Lua have originally
started with me going I do not like I do
not like this this is bad this is bad
then I use it a lot and I go actually
this really isn't that bad this actually
is pretty good I'm pretty shocked about
that and then it just it just gets
better and better and better and then my
usage of Lua has been honestly one of
the most positive things ever so do I
think this is surprising for Roblox
you're telling me the company in which
is known for having its Lua that it's
championing Ford that uses it for all of
its game engine that's using it for
everything wouldn't start using it for
front end you know that they have Lua
Lua jsx have you seen that look at this
thing it's like already there it's a
thing so it's like they already have
most of it done and so is it a big
surprise no I don't think this is a big
surprise in fact I'm actually shocked it
took this long for them to say you know
what eff it we're going to go full Lua
support we're just going to do Lua all
the way down obviously they wouldn't do
react 18 server components and all that
that's just like so much effort and I
don't you know it's a very unproven
approach uh people seem to really like
it but uh I don't know what the ending
path is going to be for Server
components and doesn't make sense for
for Roblox to go down that route and
Implement something that's significantly
more complicated probably not another
like argument you should have in mind
when it comes to Lua is let's say you're
writing a uh game or some sort of
embedded piece of software and you want
part of it to be updatable via the
Internet or to be able to download stuff
to be able to kind of live update it
with very little effort you can embed
micro python which I'm not even sure if
it's still a thing anymore you can embed
your own DSL you can embed V8 and
JavaScript or you can embed Lua now
making your own DSL would probably be
horrible I would just strongly never
suggest doing that there's almost never
a reason to do that uh micropython I
don't even know if it exists anymore but
it is it was it may still be a thing uh
doing Javas doing JavaScript is so
difficult it will be a team of one to
three people for like a year it's
genuinely hard to do that's if you use
V8 now is quickjs easier I don't know if
quickjs is any easier it's a single C
file with 50,000 lines of code if you
need to do modifications of any sort it
might be pretty difficult and I don't
know it's testing surface and how
correct it actually is um and then
finally if you do Lua you will you will
be able to do Lua in probably an
afternoon if you're talented with
embedded stuff if you're not talented
maybe 2 days how's l air handling L's
air handling is actually really great uh
that's another thing I really like about
it if you want some air handling um can
I I don't know if I can do this uh in
here but let's just try I'll do a
function Fu and I can go like this error
this errors right and there we go we
have a function
Foo um uh oh there we go uh Fu can I
call it perfect this airs if I don't
want it to throw or crash the system I
PE call and then I can pass in the
arguments that I want right here so if I
go PE call
Print you'll notice that it was
unsuccessful and here's the air that's
pretty good like I like that that's at
least better so it's not the worst it's
pretty much errors are asserts unless if
you wrap the asserts so generally I
actually think that Lua is pretty good
pretty good for one of these languages
yeah you're right it's not it doesn't
Mark the function as error throwing but
it also doesn't have types it does have
co- routines I've never really done much
for co- routines it can go multi-thread
and all that so I don't know what will I
get if I learn Lua you get the ability
to work in any embedded system that
needs uh that needs Dynamic stuff and
it's super simple to learn Lua is easier
to learn than JavaScript Lua is easier
to express your ideas in I think than
JavaScript because you tend to have less
availability to express them so that
means you just tend to have a more
constrained way and typically really
constrained way of doing things makes it
really simple to implement stuff Lou is
amazing uh let's see to be used in
embedded uh scripting Paradigm there are
various bindings already for example
postgress embedded systems cars Etc yeah
Lu is really good in the embedded world
and I think that's what uh unfortunately
the web chose JavaScript as its main
character and some people really hate
JavaScript some people really like
JavaScript the same thing can be said
with Lua any D highly Dynamic language
has a a huge amount of problems just by
the very nature of it being Dynamic you
know it isn't the web uh the embedded
world it is but it's a different type of
embedded world I don't know I would
strongly recommend taking some time to
learn Lua and you know what the best
part about learning Lua is you know what
the best part is is once you learn Lua
and you get done uh with Lua
you can go in here and you can configure
your neovim experience with Lua you know
why because Lua is extremely embeddable
and it's even embedded in neovim right
it's just the right way to go I don't
know I'm really excited about this I
think it's super cool that uh they're
doing this will this make Lua more
popular probably not will people should
I should you adopt Lua instead of
JavaScript if you're building a website
probably not real talk you should
probably not do that uh I would
personally say you shouldn't do that but
Roblox is doing it because they feel
that it's better so that's super cool
and it probably does work better for
Roblox considering their expertise right
they write the compilers they have the
teams they have everybody all aligned
they own the entire stack it just makes
sense for them it's too late I already
have 50 million in funding for my Lua
back startup let's go let's go I
actually do strongly recommend learning
about um Lua I think it's a very I think
it's a very good language and you get to
configure neoven and if you ever have an
embedded project you will you actually
have something in which you can embed
with easily like it's it's it's it it is
a great little thing to at least have on
your radar and I'm glad that you at
least minimally listen to this because
now at some point in your life if you
ever have an embedded project and you're
like I need a DSL you'll go hold on I'm
not going to create a DSL I heard I can
embed Lua in like a day you'll go and
you'll embed Lua in a day you'll go oh
this is fantastic and not only that but
when I say Lua I'm secretly saying
Brazil because Brazil gave us Lua Brazil
mention absolutely a Jad