>What can you tell me about it?
It's my primary scripting language of choice because it's fast, portable and simple. The only language faster than Lua(JIT) is a compiled language.
>Which learning resources do you recommend?
Read the PiL book (https://www.lua.org/pil/contents.html). However, that's for the old version 5.0, because they want to jew you out of shekels, so after you've done that, install Lua 5.3 and read the reference manual (https://www.lua.org/manual/5.3/).
Don't bother with using shitty old versions of Lua, it's a pain in the ass. Always update your code for the newest version when it comes out.
>Is it relatively popular?
It's quite popular as an extension language for games - this is because its speed is high compared to other interpreted languages.
>>1200 oh that, the 4th edition is for the latest version of lua. But it requires (((purchase))) and I don't think it's worth it, the main difference between 5.0 and 5.3 is basically just bit operators and a few small improvements which you can get from the reference manual/changelog/whatever.
Found the 4th edition on libgen. There's also a 1mb and 7mb version of this pdf, not sure why the size disparity, but this one seems to be complete after looking through it.
I've been wanting to pick up another scripting lang that isn't Python. The 'closeness' with C is cool too.
Why is OP and a bunch of faggots in this thread calling it "LUA"? The name is "Lua". You guys look like the retards who say "TOR", which is also incorrect btw.
There's a lot of cool stuff you can do with LUA in vidya. I remember playing with scripts for Counter-Strike 2D and a more recent game would be From the Depths.
>>1219 >What about a text editor?
Learn Emacs and you'll never have to ask that question again. As a bonus, you also wont have to look at niggers begging for gibs, either.
>>1271 exactly. I didn't even notice the niggers message because usually I use `touch` to create the file before using the editor, if I need a new file. This is because I like to confirm that I have sufficient permissions to make a file; I don't like not being able to save a file and having to copy it out of some temporary location with doas.
Guess you faggots never went to the vim website either? Why support nigger lovers? I don't understand.
> We must secure the existence of our people, and a future for white children...
< unless the nigger lovers and kikes make something I like.
>>1285 Why would I visit the vim website, when vim came with my system? And how does using vim help Bram at all? And in what way does helping niggers in far off countries endanger whites? And how is any of this on-topic in a lua thread?
What do you people think of semantic whitespace? I always thought it was a good idea, but I see people shit on it, and no one uses it for new languages. You are going to properly indent your code anyways, and your indentation describes how you expect your code to interpretted. Consider the c code:
#define X if(y) z()
if(a)
X;
else
b();
Clearly this code does something different than intended. Why not make the expected behaviour the actual behaviour? I'd take it a step farther: operator precedence should be determined by whitespace as well. Consider the expression: "a*b + c*d". Compare it with "a * b+c * d". Shouldn't they behave differently?
This is only marginally more on-topic than endless kvetching from /pol/ users, but lua takes the traditional approach of ignoring whitespace, plus it terminates blocks with end rather than a curly brace (same as ruby, and similar to bash or viml, but not something I've seen in a real programming language). I'm wondering why people prefer such a bulky system over the relatively plain regime of semantic indentation?
>>1288 >And how does using vim help Bram
Who the fuck is Bram?
>in what way does helping niggers endanger whites?
It increases the nigger population and then they flood over here because muh refoogeezz!!!
>And how is any of this on-topic
Because Lua is a programming language, and programs are made with editors.
>You are going to properly indent your code anyways
No compiler knows what the proper way of indenting is. (muh tabs vs spaces). No compiler is going to be smart enough to parse the multitude of completely sane whitespace formats. Symantic whitespace is a recipe for highly ambiguous bullshit like the pajeetscript return {} vs return\n{}.
>Clearly this code does something different than intended.
That's because not putting braces around your blocks is retarded. Furthermore, not wrapping your macros in do {...} while (0) blocks is also retarded. Your problem only comes into existence when two (2) retarded coding practices are used simultaneously. I.e. fix your fucking code.
>Consider the expression "a*b + c*d" and "a * b+c * d"
>Shouldn't they behave differently?
No. Absolutely not, you fucking idiot. Order of operations must take precedence. If you want to override those rules then you use brackets. Do you want your shitty programs in your shitty programming language to break because someone pressed the space bar in an innocent-looking block of code?
>Lua takes the traditional approach of ignoring whitespace
Yes, and that's a good thing (tm). Sometimes short statements can fit on one line e.g.
if ((a > b) or (c < d)) then break; end;
I don't want those statements to be forced into whatever brain-damaged standard the writers of the programming language came up with. For example, the "standard" spacing for Lua code is 2 spaces. That looks like shit and the different blocks blur into each other. C code is optimally formatted with 8-space (tab) indentation, because C code with high levels of indentation should be refactored. Lua code is optimally formatted with 4-space indentation because the acceptable levels of nesting are higher. 4 spaces is the minimum readable indentation level for Lua. For HTML, 2 spaces is the optimal level of indentation because HTML often needs to be very deeply nested.
>>1292 >No compiler knows what the proper way of indenting is.
It detects it automatically based on the indentation of the first line.
>Symantic whitespace is a recipe for highly ambiguous bullshit like the pajeetscript return {} vs return\n{}.
Note that this wouldn't be a problem if lua had semantic whitespace, because it's grammar can always tell where a statement ends.
>order of operations must take precedence
order of operations is a holdover from before there were more than two operators. It's idiotic to hold onto it so tightly when better systems exists. It's especially stupid in languages that allow user defined operators like haskell or nim, but still silly in a language like lua.
>If you want to override those rules then you use brackets
brackets are hard to parse with your eyes. See lisp.
>pressed the space bar in an innocent-looking block of code?
It already breaks if they press a letter key, or a number, or a symbol. Actually it already breaks on space if they press it in the middle of a token. The only reason you wouldn't expect a badly placed character to break your program is historical precedence.
>Sometimes short statements can fit on one line
Python allows this:
if a>b or c<d: break
or even:
f1(); f2();
>I don't want those statements to be forced into whatever brain-damaged standard the writers of the programming language came up with.
Python lets you choose the number of spaces or to use indents. Python 2 let you interleave them assuming 1 tab == 8 spaces.
>if ((a > b) or (c < d)) then break; end;
or
if ((a > b) or (c < d)) then break end
because lua ignores semicolons
>>1297 One particular example of a syntax ambiguity caused by treating whitespace this way is (in Lua) as follows:
function raf()
return function(f) return function() f("hello world") end end
end
raf()
(print or io.write)("top kek")
The last two lines of the above example could be interpreted in one of two ways:
raf();
(print or io.write)("top kek");
or
raf()(print or io.write)("top kek");
Currently the second scenario is assumed ("hello world" is printed) but you can see how this leads to problems. Explicit usage of non-whitespace characters (such as semicolon) after all statements is how this is solved. That is why I always remember to put semicolons at the end of statements in Lua. It solves a lot of weird bugs, since with the above example, it would seem that raf() would be called (discarding the return value) followed by print("top kek").
>>1322 >Lapis
>Sailor
fuckin BLOAT
Just use haserl so that you don't need to rewrite CGI processing code, and that's good enough for every dynamic website
It really bothers me that "scripting" and "programming" is used interchangeably :(
I always wondered how pajeets, niggers and sjws called themselves "programmers" when I know for a fact none of them are smart enough to make a function from scratch, especially in a low level language.
Just my opinion, but lapis does thing is totally retarded ways. The author of lapis also came up with "moonscript" https://moonscript.org/
I usually praise Lua for having really good ecosystem compared to javascript, but ldoc, and lapis are examples that stick out to me as "I really hope this dosn't get popular".
>>1345 Hasel is literally just a simple C program that puts the GET and POST parameters into Lua arrays, faggot. It's not a shitty meme and it's objectively the best way of doing it.
e.g. with haserl:
if (POST["comment"]) then
save_comment(POST["comment|]);
io.write("Comment submitted");
end
>>1362 You are just pushing a dumb stereotype.Most of us old timers use spacing because we are used to making long forum posts. I am probably 50% older than you so i don't expect to be understood.
Now could you help this old man out a little bit? There are so few resources on LUA web development online and i am not sure where to start.
>>1365 >we're used to making long forum posts
>haven't dropped the habit even though forums died 10 years ago
gee whiz grandpa, has your brain fucking calcified or something?
>>1365 Don't waste your time. Lua web development is like taking up unicycle riding. It looks kind of cool when it's done well, but there is no practical reason to do it.
Go, Django and even JS frameworks like Angular are much more practical and useful to learn. Somebody might tell you PHP, but don't be fooled.
>>1370 >there is no practical reason to do it
Except that Lua is one of the fastest interpreted languages in existence, even faster if you consider the existence of LuaJIT. Lua has less bloated code and backwards-compatibility bullshit than israeli languages like (((PHP))), or bloated crufty pajeet/object-oriented languages like Perl and Python. There is literally no reason to use one of those piece of shit languages when you have the option of using Lua or C.
>Go
Go is meme jewgle shit. It offers nearly no advantages over C, and its compiler is slower than C++. The generated executables are multiple megabytes in size by default. Imagine if everything in /bin/ and /usr/bin/ was over 3MB in size. The binaries alone would consume multiple gigabytes of disk space, and cause cache problems in the CPU, slowing everything down. Go is a piece of shit.
>JS frameworks
Are you a literal fucking pajeet? JS frameworks are the epitome of cancer. JS pajeets make libraries for the max() function alone, for fuck's sake. Un-fucking-believable. Go kill yourself. Or go back to any other imageboard if you want to have pajeetscript stuffed down your throat. Useless pajeets like you are why computers are getting slower and more error-prone every day.
>inb4 MUH JAWBS
Kill yourself. Working in mcdonalds is better than getting a "programming job" due to the amount of utter and absolute cancer involved in modern "programming". Everybody worth their salt does it for free.
>>1374 Try making a website in C, then try making a website in Go. The difference is night and day.
All the static shit is generated automatically via go generate, libraries are super easy to use since they're always documented. Have you tried using crypto in C? Go standard libs are what the stdlib actually should be.
Not gonna lie, compile times are slow (up to a few seconds) on my non-botnet CPU, and I miss manual memory management. But the ease of development far outweighs the rest.
Please name a web application you have developed with your autistic language prefetence that isn't
A) trivial
B) a refactor of an existing application (ie this image board)
Protip: you can't
You can hate on pajeets for using angular, which I'm not calling elegant, but they are writing actual applications. You know. Stuff on the internet? As opposed to bitching about artificial benchmarks to the 3 other people on this board. Which is the more performant solution: a JS Frankenstein cobbled together out of pre-made libraries in a few hours, or your perfect, elegant, supple Lua implementation that doesn't exist?
>>1384 >Waah if you are making improvements on a prototype that means it isn't reeeeeeel programming
>But pajeetscript is reeeeeeaaaal programming amirite!
I think you are trolling now.
Boards are only viewable in catalog format for simplicity. There are far fewer features. I have to type in post IDs. Really the only thing that's an advantage is that it's a hidden service. That also means a couple spammers can render it unusable, so the only security is achieved by being a low value target
>>1393 >Durr simplicity bad!
>Harrrr muh features!
>Muh extra typing!
<not knowing that hakase + few global vols deleted over 5000 spamposts during spammer-kun's tyranny
Newnormalfag.
>>1370 >django is much more practical and useful
AHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA
>>1393 Literally which corporation's cock are you sucking off when you imply an onion service is magically more vulnerable to spam? I can't even imagine what retarded fucking idea you had when you wrote your post.
>have to type in post IDs
The only workaround for that is using JS, which is far worse overall. Web applications are a hack, there will never be real support for even a feature this mundane. Meanwhile, this chan lets you post from Tor without cookies, referer [sic] headers, or JS.
>>1408 >Newnormalfag.
a shame that the Hacker News faggots always find us so quickly. I'm only sorry we didn't optimise their ancestors out of the gene pool on the first compiler pass.
>>1365 Excessive spacing is bloat. Reserve it for paragraph separation only. And by that I mean actual full blown paragraphs and not 2 sentence pseudo-paragraphs. If your ideas are jumping around to the point where you feel it necessary to start a new paragraph after just a few sentences then you're clearly writing like some kind of nigger, which you do seem to be doing.
>>2466 Tcl is good too. It's bad for doing lots of processing, since it's slow, but its built-in async I/O facilities are excellent. If I were writing a web or IRC server or something, I would definitely use it.
I used lua for a while on a medium-sized project.
+ No compilation, it just runs, hot reloading is easy, great for prototyping
+ Convenient type system
+ Minimal
- Debugging
Overall, it's a great language, but making complex projects would quickly become a nightmare. It's way closer to JavaScript than I expected.
>>2468 Speed is probably Lua = Perl5 > TCL > Python.
Making C extension is extremely easy and there's a LLVM based runtime in the work (https://archive.is/Ibhd9), though.
Nothing wrong with Lua but for general desktop use and server-side scripting work, I'd use Tcl. It works exactly like a shell language in its integration with the unix toolchain, and then offers Tk (which is incredibly fast and lean, by today's standards) and pretty much everything else missing from shell languages. Incredibly versatile. Python really offers no compelling advantages over Tcl, and I'm unsure why it even got popular.
LUA. What can you tell me about it and which learning resources do you recommend? Is it relatively popular?