DEV Community

Discussion on: 100 Languages Speedrun: Episode 89: MoonScript

Collapse
 
romeerez profile image
Roman K • Edited

Thank you!

MoonScript was created and mostly used by a single person Leafo. And that's no wonder. Also Leafo is a creator of a web framework Lapis, if we compare it with express.js - no doubt even though Lapis was created and used only by a single guy, it's times more superior! Leafo created MoonScript to make it easier writing web framework, and he created web framework to create a web portal for amateur games itch.io/. Leafo had to create a lot of libraries on this hard way, and he also created moonrocks - luarocks alternative for MoonScript.

That's what Lua ecosystem looks like - small group of people are busy with creating game mods, one legendary person Mike Paul created best in class JIT compiler, and second legend keeps pushing packages for whole decade.

I don't really recommend Lua or MoonScript for anything new, but as a game modder you're stuck with whatever game developers decided to use

What would you suggest instead for embedding? Given that we need fast, lightweight language for simple scripting, with easy to use C or C++ bridge? JS is fast enough for most tasks, but not that lightweight. Lua fits perfectly when need to add a bit of logic into something complex and performant, such as web server, game engine, database, or something with limited resources as IoT. Also Lua is a language of AwesomeWM - lightweight tiling window manager for linux.

JS, JS and JS for everything, I know, Lua has endangered community, tiny ecosystem.

Probably Go, it also aims to be simplistic, surpasses Lua by memory and speed, ecosystem

Collapse
 
taw profile image
Tomasz Wegrzanowski

I don't really know how easy it is to embed different languages, but I can definitely see why JavaScript is winning over Lua on its home turf.

Does it even matter that it's more lightweight? Games are routinely over 100GB these days, what's a few MBs even?

Collapse
 
romeerez profile image
Roman K • Edited

To be honest - for games it doesn't matter, even on cheaper mobile devices few MB won't change the weather. By lightweight I mean for RAM.

I remember talking to a mobile app developer who was very proud of packing quite complex app with nice graphics into 10 MB, around 5 years ago. And now it's absolutely normal if app is written on React Native and eats 300-400 or more MB or RAM, You know, I like Lua probably because of nostalgia, probably it's no longer a competitor, probably for some years already, but it was so nice to play with back in time, before the ES6 reborn.