[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: 1778087015786.png (1.29 MB, 1283x816)
1.29 MB PNG
why doesn't this language get enough appreciation?
>>
because it doesn't use curly brackets
>>
cuz its brazilian
>>
because it filters the jeet
>>
>>108767012
lowest effort edit I've ever seen
>>
File: Luapeek.png (103 KB, 1056x544)
103 KB PNG
It was a scripting language that adopted C philosophy in a world that wanted more Java.
>>
>>108767012
1-based array
>>
It's kind of bad but it ended up fairly popular anyhow because it's easy to embed into a larger program. In game dev it's gradually dying because making anything complex in it is endless self-inflicted pain.
>>
>>108767012
Because Python is better for 99% of tasks.
Lua is really good as an embedded VM-based programming language, but that's all it does well, language has many issues and is not stable between versions, standard library is too small for anything useful, ecosystem is subpar, tables have ugly quirks that leak implementation details (array + hashmap), error handling is awful (weak typing, automatic casting, silently passes nil to functions).
>>108767081
Not really? It's more similar to JavaScript that C cause of the prototype-based object system and dynamic+weak typing.
>>
>>108767012
My wife Yuki
>>
because there's no built-in way to split strings. it's on par with sepples in retardation.
>>
>>108767650
When I said it's designed like C, I mean in the way that it's minimal (in its library as well as syntax), portable, and doesn't enforce a specific paradigm.
>>
>>108767611
Languages should be 1 based or set to whatever you like. 0 based indexing was a compile-time optimization from BCPL that Ctards unthinkingly copied.
>>
lua has some redeeming qualities. it in many ways is the spiritual successor to lisp where it has a strong opinion on what data should be. all data structures are built using tables and this is appealing. the looping constructs are far superior to other scripting languages. i dislike how it lacks a proper integer type and everything is floating point. i also dislike the local keyword, as everything should be local. one based indexing is fine when you consider that lua does not use arrays or lists, although strange at first.
>>
>>108767012
1. no batteries (jobbers want solutions)
2. it is incredibly simple (jobbers crave complexity)
>>
>>108768079
>set to whatever you like
Look, even perl disabled that feature by now. It's not a good idea.
>>
>>108768079
It makes sense for C too because arrays are just pointer arithmetics, index is just an offset from the array point, so it makes perfect sense that pointer + index * size == pointer when index is 0, but anyway it's a convention at this point.
>>
>>108767650
>it's more similar to JavaScript
Except JavaScript actually has:
1. real arrays, which Lua doesn't
2. classes, which Lua doesn't
3. an actual prototype chain, which Lua doesn't (no- it doesn't metatables aren't quite the same. They can express something like a prototype chain, but you have to DIY it and it will likely be subtly incompatible with any other DIY'd implementation from any other library, utterly destroying 'class inheritance' and code re-use across the board)
4. a functioning multi-tier JIT giving it far better performance. (since approx. 2022 the V8 JS VM outperforms the unofficial LuaJIT implementation by approx 2.3x - and LuaJIT is already ~5x faster than the official Lua runtime, which is a pure interpreter. Why videogames use Lua over JS as an embedded language, I will never understand. Cargo cult, pur sang - I guess.)
>>
>>108768241
>all data structures are built using tables and this is appealing.
The fact that everything is a nail and you only have a hammer is not very appealing. At all.
>>
>>108768333
lua is slow and stupid but i'd sooner kill myself than be forced to use JS for anything other than front end dev
>>
>>108768333
Javascript is webshit-coded, it's made to be used in a browser not for being embedded.
>>
>>108768333
>utterly destroying 'class inheritance' and code re-use across the board
Absolutely OOPbrained
>>
>>108768333
videogames use lua since its easy to pick up and emebed. it's pretty free-form and allows for fast iteration times. almost nobody uses it because it can compute fib the fastest in a benchmark.
>>
File: 1545816314103.jpg (53 KB, 1280x720)
53 KB JPG
Both Lua and JS sucks, a Scheme should have been the language for embedding.
>>
>>108768079
>>108767081

round 1 (or 0), fight.

>>108768312
the first positive number is 0, so it is the first number everywhere. if 1 was the first positive number, then, zero would be a special number with special behaviour everywhere, what would be a[i] when i=0? - a complication that serves nothing but itself.

Lua is a +1-1 mistake language, hehehe
>>
>>108768417
>if 1 was the first positive number, then, zero would be a special number with special behaviour everywhere
You are not ready for the mathematically rigorous discussion about this.
>>
File: 1714287643463834.jpg (128 KB, 1280x1272)
128 KB JPG
>arrays start from fucking 1
>>
>>108768417
>the first positive number is 0
That's not true, retardbro.
1-arrays still suck though. Nobody likes special snowflake language design.
>>
>>108768632
its not an array its a hash table
>>
>>108768575
>>108768651
The set of natural numbers can both include or not include zero, even mathematicians have no clear answer to this.
>>
File: 1768742245829311.png (27 KB, 128x128)
27 KB PNG
>>108768654
>1-indexing is OK because we don't actually have real arrays
>>
File: 1775500776844901.png (210 KB, 558x527)
210 KB PNG
>>108768654
Wrong, tables in Lua are both arrays and hash tables at the same time.
The consecutive numerically-indexed (no gaps allowed and excluding zero) part of a table is an array, the rest is a hash table.
So you have retardation where if you have a table and you assign keys from 1 to 3 those will be allocated as part of the array part of the table but then if you assing keys 5 to 9 those will be allocated as part of the hashmap part of the table, because there is a gap at key 4, oh and of course if you try to access the unallocated key 4 it will return nil not give you an explicit error cause fuck you and of course if you try to iterate the table the array part will be ordered and the hashmap part will be unordered and don't get me started on sorting and counting using tables...
Tables are fucking dumb man.
>>
>>108767012
Is there any notable Lua software?
>>
>>108768397
normies hate parentheses
>>
>>108767012
>made by brownoids
>"""tables"""
>1-based array
>shit syntax all in the name of "writing less"
no thanks
in a more serious note, at least for me, it has so much widespread usage that it's so boring to see, i don't see the appeal of using something that a lot of people already used
>>
>>108767012
Why should it be?
For example lisp's syntax can be learned in 2 minutes and it has tail recursion optimization...
Ruby is as high level as a language can get.
Go has clever parallelism that even retards like me can use.
So what's special about lua? I'm generally curious
>>
File: shima lua.jpg (169 KB, 1920x1080)
169 KB JPG
>>108768733
You make it all sound like a bigger deal than it really is.
>>108768747
Neovim, LOVE2D, scripting language of countless software and games
>>108768828
If you need a scripting language for your project, you won't find anything easier to embed. Its simplicity and size make it appealing for developers without needing to compromise on capability or speed.
>>
File: screenshot.png (10 KB, 640x480)
10 KB PNG
>>108767012
idk but you can run it in temple os now
>>
>>108767012
>why doesn't this language get enough appreciation?
Because the average developer is too dumb to understand Lua, thus, they stay with Python.

And for the people smart enough to understand the power of Lua, they eventually realize Lisp, Erlang, Haskell, etc. are better.
>>
>>108768241
>it in many ways is the spiritual successor to lisp
>it lacks a proper integer type and everything is floating point.

last time I checked, numerical support for lisp is second to no other programming language, with fixed precision integers, arbitrary precision integers, floats, complex numbers, fractions... all of them are first-class data types, so kek... how can it be a "spiritual successor"?

the spiritual successor of Lisp is ML and thus the whole family -- Ocaml, Haskell, and even F# and Scala, even if the latter sucks for some things.

They don't have the iconocity and thus the macros (bummer) but you gain an excellent type system.
>>
>>108768333
>Except JavaScript actually has
what a long post to write "i am a webshit"
>>
>>108768978
>numerical support for lisp is second to no other programming language
Number tower is areally cool concept, more languages should do it.
>the spiritual successor of Lisp is ML
No ML is not spiritual successor of Lisp, it's more like it's rival, they bitterly oppose each other as they use two different definitions of lambda calculus, and two different philosophy for types and binding.

Speaking of Lua and Lisp, do you like Fennel?
It takes the good part of Lua (it's VM) but with sane Lisp syntax and semantics.
https://fennel-lang.org/
>>
>>108768978
i meant in the sense of design around a specific data structure. lisp chooses the cons cell as its main data structure and in lua it is the table. lisp can be written in a functional style, but in no way forces it upon you. ml languages are also statically typed, which is very much not lisp like.
>>
>>108768978
>the spiritual successor of Lisp is ML
you know nothing about either language
>>
File: 1775698416462225.png (93 KB, 469x284)
93 KB PNG
I don't understand the 1 based array/collection hate? literally I want the 100th element in the collection then in 1 based it is arr[100] in 0 based it is arr[99]
>>
File: Ips thigss .png (2.34 MB, 1128x2048)
2.34 MB PNG
>>108768333
The amount of butthurt anons just shows how right you are.
>>
>>108770876
It makes sense if you only ever use 1D arrays where each element has no structural relation to the others.
The moment you want to index by any multiplied value (which happens all the fucking time in real programs), it becomes a constant nuisance.
>>
>>108767012
>1-based indexing (need to add +1 all the fucking time)
>lack of +=, -=, *=, etc. (typing variable = variable + 1 gets old fast)
>standard library lacks a lot of really basic functionality (hell, recommendations for a sleep function back when I used it were literally just a busy loop or calling out to the fucking command line to run a sleep command)
These were my biggest gripes.
It's good for precisely one thing, lightweight scripting embedded in a larger C/C++ program.
Hell, I feel like micropython could give it a run for its money at this point, depending how hard it is to integrate. Similarly small footprint, but much more fully featured.
>>
>>108771367
>micropython
How similar is it to Python and how embeddable is it?
>>
>>108772076
Most scripts work with no changes, it is very compatible with normal python. Libraries that aren't normally bundled with python are more of a mixed bag, but quite a few of them have micropython versions.
Most of the micropython-specific stuff is done in a way that does not mess with normal compatibility (it allows inline assembly/compilation and arbitrary address space access, but only where you instruct it to). Hardware abstractions are contained in bundled libraries.
I have no idea how difficult it is to embed in a larger program, but I wouldn't be surprised if it isn't too hard. It's very modular and designed to allow easy C extensions.
>>
Overshadowed by Python, Java, and Javascript that all came out close to the same time. Java was enterprise pushed by a big company, Javascript covered the biggest booming new technology, browsers and nothing else works in it without plugins at the time which were typically just Java. and Python made it's name as a baby language for scripting.

There was nothing Lua offered that these other new scripts didn't, except it was just some language made by a Brazilian and not corporate backed.
>>
File: 1774815543017934.png (293 KB, 515x596)
293 KB PNG
>>108767012
what are you talking about? lua is probably the most talked about and used embedded language
>but what about general purpose
the qualities which make it good for its intended domain (living inside another program) make it not-so-good for general purpose programming. string operations are slow, file operations suck, patterns are non-standard regex, very basic systems things are lacking from the standard lib requiring an external library or doing it yourself by making C bindings.
i would never choose janet over clojure or scheme, and the gap there is much smaller than lua and its nearest "general purpose" siblings.

oh also the C API is kind of crap. luajit fixes this since you can (and should) bypass it with ffi, but that's not standard lua.

the module system is cute though. i would say package loaders are better than lisp reader macros in most ways, but not being able to set debug or trace information in a portable way makes the whole exercise futile.
>>
>>108769244
No, anon is right. You don't know the history of the languages, ML absolutely lives downstream of Lisp as a kind of "List processing with (mostly) pure expressions is right, but s-expressions and dynamic types suck" affair.
ML was derived from ISWIM, which itself was a rebirth of M-expressions.
As Lisp looked to the lambda calculus and added a load of pragmatisms, ISWIM took the dead M-expressions as a syntax sugar over Lisp's pragmatic pseudo-lambda calculus. ML reified it with static types and a module system. Destructuring, ref, etc. are all just thin macros over Lisp behavior.
>>
>>108767012
BEAN People. We call them BEAN People. Anyone native to Mexico and South America. ALL BEAN PEOPLE.
>>
>>108767012
It's fine embedded, but it kinda sucks as a general purpose language.
>>
>>108767012
>LUA
>AIDS girl from SAO
Checks out.
>>
>>108768672
the answer is provided by practice - the compukter hardware. 0 is a positive number in there. if 1'tards create their own schematic and compukter.. its only possible for a runtime to do arbitrary stuff with offsets, you can create arrays that start with 2, 3 or 1001, but it will be based on 0-based. Lua is not run by the Lua

>>108768911
>you won't find anything easier to embed

PHP is easier to embed into web server, in fact, it specifically started as an "applet" project, an extension to various web servers. it doesnt make it notable though, it doesnt make it the same league as JS/Python because it is secondary to the "thing", while the later act independently the first hand.

so on the road to general purpose, Lua has this 0-1 wall, while PHP doesnt. it actually can jailbreak, while Lua cannot. this "strong side" is probably the answer for both runtimes. if you think Lua can jailbreak, put arguments, but Lua folks dont put them
>>
Mb i'm stoopid but what does 1-indexing mean? You can write table[1] = smth but nothing stops you from writing table[0] = smth.
>>
>>108775706
I mean what's there in the language that makes 1 first class and 0 second class?
>>
>>108775726
ipairs and table literals start out at 1
That's about it
>>
>>108775577
The ESL-speak and PHP fellatio in this post are genuinely fascinating
>>
File: 1744666291859336.jpg (207 KB, 582x505)
207 KB JPG
>>108776022
>>
>>108767012
Shit language. I work on a production network stack that uses Lua extensively for embedded control plane code, and it constantly has latency issues. We are migrating it piece by piece to rust because it has shown huge improvements in performance and reliability.
>>
>>108772654
the languages having shared history doesn't mean they're "spiritually" the same though. actually developing anything in lisp (or fake java lisp) is an entirely different beast from the ML family which tends to be centered around type tetris, saying one succeeds the other is apples and oranges
>>
>>108776090
>I work on a production network stack that uses Lua extensively for embedded control plane code, and it constantly has latency issues.
I don't even like Lua but this sounds more like using the wrong tool for the job.
>>
>>108776159
Yes, it absolutely was the wrong tool for the wrong job. In defense of the engineers that developed this systems a decade ago, before I joined, our company has a widely used internal development toolkit and runtime environment for doing scripting on embedded systems in Lua. So using it was definitely the easy path for shitting out a product that management liked.
>>
>>108769244
>you know nothing about either language
i'm gonna report you to your teacher mr. Nagoor Babu for bad conduct

go learn programming language history
>>
File: durga 1757089747605295.jpg (139 KB, 1280x720)
139 KB JPG
>>108776150
>actually developing anything in lisp (or fake java lisp) is an entirely different beast from the ML family which tends to be centered around type tetris
with the "type tetris" comment you confirm yourself to be a Durga graduate that has never ever written actual code in both lisp and an ML family language.
>>
>>108768333
V8 is massive, it can't be embedded without a lot of pain. There's MicroQuickJS but not sure how's going nowadays
>>
>>108768333
You forgot something else Javascript has
>A massive runtime / RAM footprint
>>
>>108768787
Normies ruin everything.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.