Lua appreciation thread

Lua appreciation thread

>know lua
>don't use lua to create roblox games, get virtual currency and convert that into real money
why?

Other urls found in this thread:

leafo.net/lapis/changelog.html
my.mixtape.moe/wxfmxs.pdf
my.mixtape.moe/nbzcqp.pdf
my.mixtape.moe/zwnaqz.pdf
freegamedev.net/wiki/Scripting#Scripting_languages
github.com/dbohdan/embedded-scripting-languages
github.com/lemon-lang/lemon
twitter.com/NSFWRedditImage

Is there lua framework (like node.js) to create a website?

Iua is the only programming thing i have ever done. I used to mess around with defunct world of warcraft addons. Always wanted to pic up programming but idk if lua is really useful at all or a good starting point.

luvit?

yes

used lua to mod gmod without knowing what i'm doing. those were good times.

>He doesn't make simple gmod addons and sell them to french teenagers on gmodstore

node.js isn't a fucking web framework you retard

this was me. sorry for calling you a retard. thinking node.js is a web framework is a common misconception, so I don't blame you.

anyway, check out leafo.net/lapis/changelog.html

seems good better than learn c and write.. what c programmers write?

Im actually writing a universal Lua script host with hotloading right now. Its called LuaDemon on github.
>pls no haet i kno i succ

Ill use it on my Windows Server and a Raspberry.

I've been using bourne shell for ages and I'm thinking of using lua to replace some of my more bigger scripts with.
Is there anything to facilitate interaction with command-line tools (much like the `sh` module in python)? Am I using Lua incorrectly? Should I look into something like Perl instead?
My use case is one where I need to call a bunch of arbitrary external tools, for which there are no bindings for other languages.

Lua can run C code/functions using FFI.
You can also just execute shell commands from Lua. A little slow but it works.

Love2D is actually beautiful for making gaymes, I love it

Lua has its problems as a language but overall it's what I wish JavaScript was

try openresty. coroutines can make asynchronous operations really simple

Yeah, the problems I'm facing is that what I want to do (calling regular shell scripts, amongst others), isn't entirely possibly with the FFI. Executing shell commands via os.execute voids one of the biggest reasons I'm running away from shell: Expansion and escaping shenanigans.

Honestly I'd love to use love2d and lua but my brain is too small to grasp metatables etc.

they removed the roblox forums a few weeks ago
F

If you're looking for node.js but in lua, luvit is literally that.

There are more profitable ways an indie programmer can make money.

books bump:
>Programming in Lua - 4th Edition.pdf
my.mixtape.moe/wxfmxs.pdf
>Lua Programming Gems.pdf
my.mixtape.moe/nbzcqp.pdf
>love-for-lua-game-programming.pdf
my.mixtape.moe/zwnaqz.pdf

You don't really need to know advanced lua concepts like the metaprogramming stuff; treat it like a simple imperative language, just using functions and flow control if you want, it'll still be comfy

you do need to know the intricacies of the import system though, but that isn't too hard

Name just one
>u cant

aside from game addons can it be actually used for anything? serious question
what are some cool stuff that is made with it?

thanks user

PsP shit

I'm thinking of writing a JavaScript game for the browser where I want users to be able to write custom scripts for their levels. Seeing as JS sucks ass and is generally unsuited for those sort of things, are there any good tools or libraries out there that let me sandbox user-generated Lua scripts inside a JS program?

>1-based indexing
we were THIS CLOSE to finally having a decent scripting language, and they fuck it up.

Im not really sure what youre trying to do

>metatables
It is literally just defining operators based on specially named functions in tables.

Get over it grandpa. 1 > 0.
THATS JUST MATH

This. Stop using Lua. Let's just let it die like php.

It's the only thing which genuinely fucks me off about Lua and I'm one of those who actually likes Lua.

I tried Squirrel once, but when I tried embedding it, closures with upvalues decided to arbitrarily not work.

What would you recommend then?
> there is no way in hell you would ever be able to get Python working in a good sandbox it's actually impossible

Javascript, Kotlin, clojure, python

Clojure seemed alright though I've yet to put the time into it (still messing with SBCL), already know Python, should probably check Kotlin out some time, Javascript can jump off a fucking cliff

I suspect out of all of those the only ones you can really sandbox are Javascript and maybe Clojure if you decide to make some horrible spaghetti macros

Javascript has gotten much better since es6. It's also the fastest scripting language now thanks to the overwhelming amount of support. Npm and node are comfy af, what are you afraid of?

It's probably an inverse Stockholm syndrome to be honest, I think we can both agree that the usual application of JS as a web frontend, mostly because of various not-actually-JS factors (main one being having to support multiple browsers of various outdatedness), is fucking garbage, and I tend to mentally lump JS into that mess.

Though having said that I do believe that npm is a big raging fire, would be nice to see that revised so that left pad doesn't happen again and neither does the "i can't put more files into this folder" issue.

This is a problem that's been solved by babel. Write your code in ES6 or ES8 or even typescript and babel will convert your code to browser compatible js. I agree that web development was awful before a year or two ago though.

The problem is that even though ES6+ is good standalone webshits are more interested in converting shitty code written for shitty codebases INTO good clean(er) ES6 than writing good code.

There is actuall a patch that lets you index from zero, iirc. The problem with 1 base indexing is that when you need arrays(sequences) you're almost certainly going to need to % and 1based breaks modulus math.

>roblox

bunp

WORLD

OF

WARCRAFT

Best language for small projects.

small but well thought out ecosystem.
Also luaJIT is a work of art

World of Broken addoncraft

Just fix them then

this thread still live, nice

>there is no way in hell you would ever be able to get Python working in a good sandbox it's actually impossible
This. Python devs made it pretty clear that they don't care about anything that doesn't have directly to do with amassing libraries.

As for alternatives, there is a bunch of stuff like shown here:
freegamedev.net/wiki/Scripting#Scripting_languages
github.com/dbohdan/embedded-scripting-languages
github.com/lemon-lang/lemon

Mind you, some are one dev projects.

>Also luaJIT is a work of art
it is, but if you actually need a JIT compiler for a scripting language you are doing it wrong.

Well you don't *need* it, but its useufl in that it's fast and has a great FFI. You can totally get away with the C interpreter for speed, it's faster than CPython in general; and the C API, which is also supported by the JIT, but obviously can't JIT it. BUt as with most language extensions, there is no reason to use it if you aren't going to take full advantage of it.

literally learned programming doing Lua shit for WoW 13 years ago.
>Present day
have released a few Addons, an alternative dmg meter in the pipeline

>has a great FFI
That also functions as exploits.

WHY IS THE WORLD CRUEL

ffi = nil
require = nil

[picture of integra hellsing]
Well, that was step 1, what about step 2 - 10?

Literally who? Some anime tiddie monster or something? Fag.

Kindly consider suicide