Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Is Lua a good scripting language?

Name: Anonymous 2011-07-25 14:41

Is it?

Name: Anonymous 2011-07-25 14:43

I wouldn't call it good, but the one that sucks less. Given the current choice of scripting languages, it's not a great accomplishment.

Name: Anonymous 2011-07-25 15:36

Lua is well designed for what it is.

The same cannot be said of any other scripting language.

Name: Anonymous 2011-07-25 15:48

>>3
um what about fioc

Name: Anonymous 2011-07-25 15:53

>>4
Lambdas, __underscores__, no proper tail calls.

Name: Anonymous 2011-07-25 15:55

>>5
just like the BDFL intended

Name: Anonymous 2011-07-25 15:59

>>6
Which means that Python is intrinsically flawed.

Name: Anonymous 2011-07-25 18:18

>>4
Forced Indention Of Code? Lua doesn't have that.

Name: Anonymous 2011-07-25 18:26

>>7
Not flawed, pythonic!

Name: Anonymous 2011-07-25 18:34

having to explicity declare variables as local really clutters the syntax of what could be a very simple and easy to language to work with. New Javascript compilers like V8, Spidermonkey, dscript are just as fast and embeddable as Lua, Id rather use that. I prefer the syntax of Ruby to Lua also.

Name: Anonymous 2011-07-25 18:42

define "good"

Name: Anonymous 2011-07-25 18:44

I like the syntax for using a closure as an iterator, and how multiple return values are handled, but I suppose you can find this in a lot of other languages too.

Name: Anonymous 2011-07-25 18:45

also the coroutines are nice.

Name: Anonymous 2011-07-25 18:57

>>11
define "good"
not OP, but if youre stuck on an island with a solar powered laptop and you have the choice of only the following compilers, which do you pick:
Perl
PHP
Python
Ruby
Lua
Javascript

which do you pick? and lets assume their are no libraries that go along with the compiler except simple I/O, no CPAN in Perl, no "batteries included" in Python. No cheating like writing a Lisp interpreter in one of these languages

Name: Anonymous 2011-07-25 19:00

>>10
having to explicity declare variables as local really clutters the syntax of what could be a very simple and easy to language to work with. New Javascript compilers like V8, Spidermonkey, dscript are just as fast and embeddable as Lua
var var var var
let let let let

Name: Anonymous 2011-07-25 19:03

>>15
var is optional in Javascript, I dont use it, I dont use ; delimiters in Javascript either.

let in functional languages is a good feature, its wasted on a simple scripting language like Lua

Name: Anonymous 2011-07-25 19:15

>>16
If you never use them, then you probably don't understand when you should use them, which means you're probably a shitty programmer.

Name: Anonymous 2011-07-25 19:19

>>16
optional var is lame. I always use it.

Name: Anonymous 2011-07-25 19:24

What about scripting languages for embdedded, resource-constrained systems? Most of the suggested languages are way too heavy, and Lua at least has the reputation for causing excessive heap fragmentation (though I believe this has been improved somewhat).

Name: Anonymous 2011-07-25 19:44

>>19
Forth.

Name: Anonymous 2011-07-25 19:59

>>19
Lua at least has the reputation for causing excessive heap fragmentation

what. maybe as compared to assembly/C.

Name: Anonymous 2011-07-25 20:35

>>17
If you never use them, then you probably don't understand when you should use them, which means you're probably a shitty programmer.
ok, when should I use them? I dont think it affects scope in any way

Name: Anonymous 2011-07-25 21:52

>>22
to answer my own question, I just found out variables declared inside functions are not local to that function unless declared with var

Name: Anonymous 2011-07-25 22:22

>>22
var does affect scope. Observe (from the Chromium JS console):


var a = 42; (function() {var a = 66;})(); a;
  42
var a = 42; (function() {a = 66;})(); a;
  66
(function() {var b = 99;})(); b;
  ReferenceError: b is not defined
(function() {b = 99;})(); b;
  99


So essentially, every variable in your program is global. It's wasteful and can lead to bugs, especially if those variables contain DOM elements.

Name: Anonymous 2011-07-25 22:23

>>24
and Lua has the exact same behavior except that "local" is 2 more letters to type.

Name: Anonymous 2011-07-25 22:30

>>25
and it doesn't do braindead hoisting

Name: Anonymous 2011-07-25 23:50

>>24
>So essentially, every variable in your program is global. It's wasteful and can lead to bugs, especially if those variables contain DOM elements.
which is why I use the coffeescript syntax translater, because it fixes that problem

Name: Anonymous 2011-07-26 0:01

>>27
coffeescript
Oh god. Macbook with Textmate as your editor, correct?

Moving right along...

Name: Anonymous 2011-07-26 0:06

Oh god. Macbook with Textmate as your editor, correct?
no I dont use all the "make js look like haskell" features of coffeescript like:
 square = (x) -> x * x
I just use it because I think variables inside of functions should be local to that function by default, anything else is absurd

Name: Anonymous 2011-07-26 3:04

>>29
does it do it the Ruby way or the Python way?

that is to ask: does it disallow shadowed variable names or does it have a pig-disgusting "nonlocal" keyword?

Name: Anonymous 2011-07-26 3:20


      /    /   /  /_/
     /__  / __/  /

        /  .  \
       /   '   \
      /    |    \
     /           \
    /      |      \

Name: Anonymous 2011-07-26 3:21


                __ __
      /    /   /  /_/
     /__  / __/  /

        /  .  \
       /   '   \
      /    |    \
     /           \
    /      |      \

Name: Anonymous 2011-07-26 3:22

>>21
Honeycomb Artie swiss camaraderie Campbell. Reproach penalty arcsine contemporary damnation ibid schoolmaster.

Name: Anonymous 2011-07-26 3:28

>>22
Vivo classificatory...

Name: Anonymous 2011-07-26 3:29

Everything delude buckthorn acute Pulaski embank showboat. Felonious downgrade. Footage butterball sag influential protrude.

Name: Anonymous 2011-07-26 3:32


   _ _    _
  //- -  //
 //     //
 \_-_- //_-_-

Name: Anonymous 2011-07-26 3:33

Lament exact councilwomen excitation Briton hump optima posh confound. Fruehauf aborning burgeon fantastic lifeboat flu?

Name: Anonymous 2011-07-26 3:34


   _ _    _
  //- -  //
 //     //
 \_-_- //_-_-

Name: Anonymous 2011-07-26 3:41

Cankerworm counterexample ppm prod prop furious Daley Midwest.

Name: Anonymous 2011-07-26 4:50

>>29
You don't use the only features that make Coffeescript nicer than JS?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List