|
people trot that quote out to dismiss legit problems in their pet language. it's completely reasonable to discuss those issues because a programming language is a user interface for programming
|
# ? Apr 7, 2013 19:52 |
|
|
# ? Jun 12, 2024 12:40 |
|
Toady posted:lua "arrays" suck because you can insert nil into them and create a gap which fucks up a bunch of things including the value returned by the length operator. combine that with silently returning nil for undefined element and variable accesses and it's fun times are you saying [1,2,3,nil,5] has a length of 4? because that sounds nuts
|
# ? Apr 7, 2013 19:55 |
http://divshot.github.io/geo-bootstrap/
|
|
# ? Apr 7, 2013 19:58 |
|
so loud it hurt my earballs
|
# ? Apr 7, 2013 20:02 |
|
ultramiraculous posted:are you saying [1,2,3,nil,5] has a length of 4? because that sounds nuts iirc it has a length of 3. sparse arrays have their uses, but combined with typos silently returning nil, you can end up with bugs that propagate far from their origin. because of this and other issues, lua isn't designed well for writing large codebases google's street view team had to write their own stack analyzer because: Google lua-checker page posted:* Referencing a variable that has not been declared will return nil. This is no different from referencing a 'declared' variable that has the value nil. Thus spelling mistakes in Lua variable names can go undetected and lead to program misbehavior.
|
# ? Apr 7, 2013 20:10 |
|
ultramiraculous posted:are you saying [1,2,3,nil,5] has a length of 4? because that sounds nuts he is saying that the table with keys 1,2,3 and 5 has four keys, and you can unset a key by assigning the value nil. you can argue that lua should have "normal" arrays as well, but it does not, it instead uses a usage patter convention for situations where one would normally use arrays
|
# ? Apr 7, 2013 20:10 |
|
Cybernetic Vermin posted:he is saying that the table with keys 1,2,3 and 5 has four keys, and you can unset a key by assigning the value nil. you can argue that lua should have "normal" arrays as well, but it does not, it instead uses a usage patter convention for situations where one would normally use arrays i'm saying lua's length operator (#) stops counting at the element before nil (other functionality get messed up as well), so if a nil gets in by accident, you'll have hard-to-debug misbehavior. all of this occurs silently with no warnings from lua
|
# ? Apr 7, 2013 20:24 |
|
according to the language spec the length of #{1,2,3,nil,5} can either be 3 or 5:quote:If the array has "holes" (that is, nil values between other non-nil values), then #t can be any of the indices that directly precedes a nil value (that is, it may consider any such nil value as the end of the array). amazing lua 5.2 prints 5 for #{1,2,3,nil,5} but like i said that's not reliable Opinion Haver fucked around with this message at 20:32 on Apr 7, 2013 |
# ? Apr 7, 2013 20:29 |
|
ah, right, got that wrong. don't know lua terribly well. overall i sort of agree on this end, arrays are too fundamental to fully leave out, a foolish consistency is the hobgoblin and all that. otoh a good array and table implementation is all a language really needs as far as datatypes go, and lua seems to get the table more right than most among the p's.
|
# ? Apr 7, 2013 20:33 |
|
yaoi prophet posted:amazing
|
# ? Apr 7, 2013 20:33 |
|
quote:In practice, Lua programs over (say) 1000 lines tend to accumulate these kinds of problems, making debugging difficult. stop plagiarizing my feelings about python, google
|
# ? Apr 7, 2013 20:35 |
|
quote:i'm shocked, shocked that they're sick and tired of smuglords telling them things they already about their language lua only got popular because it was fast for videogames. a group of fans emerged along the way that thinks it's beautiful and perfect because you have to build everything by hand with tables, and anything more is "overdesigning" the language. the only person in that community who is critical of anything is mike pall of luajit, who called 5.2 the "vista of lua releases"
|
# ? Apr 7, 2013 20:47 |
|
apparently i was reading an old spec the new spec says that the length of {1,2,3,nil,5} is undefined: quote:Unless a __len metamethod is given, the length of a table t is only defined if the table is a sequence, that is, the set of its positive numeric keys is equal to {1..n} for some integer n. In that case, n is its length. Note that a table like good job
|
# ? Apr 7, 2013 20:57 |
|
several pages of luachat
|
# ? Apr 7, 2013 20:59 |
is LUA the right language for me????
|
|
# ? Apr 7, 2013 21:03 |
|
gucci void main posted:is LUA the right language for me???? probably not
|
# ? Apr 7, 2013 21:13 |
|
Vanadium posted:I don't mind lua but this is absolutely true.
|
# ? Apr 7, 2013 21:40 |
|
it's nice that people are finally posting actual problems with lua instead of their braindead inability to cope with 1-based indexing. thank you.
|
# ? Apr 7, 2013 21:41 |
|
unix shell scripts require "then" and i never forget it great language btw, like APL except readable (and slow)
|
# ? Apr 7, 2013 21:53 |
|
yaoi prophet posted:apparently i was reading an old spec
|
# ? Apr 7, 2013 22:02 |
|
Gazpacho posted:unix shell scripts require "then" and i never forget it fi
|
# ? Apr 7, 2013 22:41 |
|
ultramiraculous posted:are you saying [1,2,3,nil,5] has a length of 4? because that sounds nuts nope, that has length 5 and will return 5 if you use the length operator. To be more clear the literal {1,2,3,nil,5} will have length 5. however you can screw it up by doing x = {1,2,3,4,5} x[4] = nil. That will come back with length 3. It is an annoying aspect of tables. Zaxxon fucked around with this message at 23:30 on Apr 7, 2013 |
# ? Apr 7, 2013 23:19 |
|
Zaxxon posted:nope, that has length 5 and will return 5 if you use the length operator. not in 5.1
|
# ? Apr 7, 2013 23:25 |
|
remember when lua people managed to convince c/c++ guys that it would be a good idea to embed lua in their applications and let less talented developers write the business rules while ignoring the infrastructure is that myth still alive
|
# ? Apr 7, 2013 23:28 |
|
Internaut! posted:remember when lua people managed to convince c/c++ guys that it would be a good idea to embed lua in their applications and let less talented developers write the business rules while ignoring the infrastructure what in the name of gently caress are you talking about
|
# ? Apr 7, 2013 23:30 |
|
nah unix shell awesomeness is unconditional, it's the only language that gives me the rush that basic on the ol c64 did
|
# ? Apr 7, 2013 23:34 |
|
vapid cutlery posted:what in the name of gently caress are you talking about 4m results why pretend you havent heard of this thing that is basically the only reason for lua's "relevance" here in tyool 2013
|
# ? Apr 8, 2013 00:16 |
|
Internaut! posted:4m results I'm talking specifically about your weird argument re: "less talented" developers and "business logic"
|
# ? Apr 8, 2013 00:34 |
|
i thought it was mainly wow hackers bringing their hobbies into the office with them, and any engineering justification was merely a political cover
|
# ? Apr 8, 2013 00:50 |
|
Gazpacho posted:i thought it was mainly wow hackers bringing their hobbies into the office with them, and any engineering justification was merely a political cover It was being used in games years before wow
|
# ? Apr 8, 2013 01:42 |
|
|
# ? Apr 8, 2013 01:43 |
|
Hmm wonder why that's in there. Rip lucasarts
|
# ? Apr 8, 2013 01:46 |
|
used to be the SCUMM (Script Creation Utility for Maniac Mansion) bar but they switched to lua for grim fandango unless ur being sarcastic in which case yep beats me
|
# ? Apr 8, 2013 02:21 |
|
Internaut! posted:remember when lua people managed to convince c/c++ guys that it would be a good idea to embed lua in their applications and let less talented developers write the business rules while ignoring the infrastructure sure why not. it's better than letting the poo poo devs use a compiler
|
# ? Apr 8, 2013 02:25 |
|
Nomnom Cookie posted:sure why not. it's better than letting the poo poo devs use a compiler fwiw: carmack came out and said scripting languages were a mistake for games. nothing is improved by having more lovely code by lovely devs. i.e if you're 'dumbing down' so that people who aren't programmers can write game logic, devs spend more time fixing it. c.f business rules
|
# ? Apr 8, 2013 04:30 |
|
Internaut! posted:let less talented developers write the business rules while ignoring the infrastructure truly there is nothing new under the sun
|
# ? Apr 8, 2013 04:57 |
|
so wait are lua arrays cstrings
|
# ? Apr 8, 2013 06:59 |
|
the anti-scripting language for normals to write code is like the "REAL ENGINEERS" argument against software devs, except even less valid but sperg elitism is nothing new, so the notion will always persist
|
# ? Apr 8, 2013 07:56 |
|
oh yeah I forgot about how lua killed the greatest adventure series of all time gently caress lua
|
# ? Apr 8, 2013 08:10 |
|
|
# ? Jun 12, 2024 12:40 |
|
as we all know the quality of games is all about the programming, programmers are the rulers and backbone of the game development process, with a court of loyal, but unfortunately stupid, artists, designers and writers
|
# ? Apr 8, 2013 08:20 |