Yes, I was shocked at how small it is. I had no experience working with such limited resources going into this project. Our router had 32MB of storage. At one point I was looked into adding a python interpreter, and it was like 11MB. The Lua interpreter is like 250KB. Tiny!
Also, the ternary operator has the best syntax of any language I have ever used.
x = [condition] and [true value] or [false value]
No question marks or colons or anything weird. It’s a logical extension of && and || after commands in bash using keywords since it is a verbose language. I wish every language had this syntax.
For contrast, python is:
x = [true value] if [condition] else [false value]
It just seems weird to me to have the condition in the middle.
Yes, I was shocked at how small it is. I had no experience working with such limited resources going into this project. Our router had 32MB of storage. At one point I was looked into adding a python interpreter, and it was like 11MB. The Lua interpreter is like 250KB. Tiny!
Also, the ternary operator has the best syntax of any language I have ever used.
x = [condition] and [true value] or [false value]
No question marks or colons or anything weird. It’s a logical extension of
&&
and||
after commands in bash using keywords since it is a verbose language. I wish every language had this syntax.For contrast, python is:
x = [true value] if [condition] else [false value]
It just seems weird to me to have the condition in the middle.