The Hacker's Language in Action: #1 First Contact

in #software7 years ago (edited)

It is discreet, powerful, simple, extensible, portable. Widely used in areas such embedded systems, mobile devices, The Internet of Things, games and more. Its name, Lua, born in 1993 and its father is Roberto Ierusalimschy. But hackers worldwide found its beauty.

LUA.png

Why do Hackers like it?

Information on Russian hackers and malware can be found on this steemit post with other information sources.

Get Lua

The official web site is lua.org and the binaries for windows on Lua Builds. For Linux or Mac OS installation is easier on Lua Downloads.

First program on file "hello.lua"

  1. Put:
    hello.lua
  2. Execute
    ExecuteLua

    Chunks: Each piece of code that Lua executes (a file or single line in interactive mode).

  3. Other hello:
    hello2.lua
    exec2

    Others: with dofile("myfile.lua") in interactive mode we are using your owner functions and variables. Or lua -i myfile.lua to execute your file and then stay in interactive mode or lua -l myfile.lua for load file only.

  4. Comments:
    coments

    Line 11 is a common trick

Eight basic Types

types8

nil: A type with a single value, nil, and whose main property is to be different from any other value.

Booleans

Lua supports conventionals set of logicals operators: and, or, not.

A GOLDEN RULE: The result of the and operator is its first operand if that operand is false; otherwise the result is its second operand. The result of the or operator is its first operand if that operand is not false; otherwise the result is its second operand.
boolean1

To be continued...

References:

  • Roberto Ierusalimschy, Programming in Lua, Fourth Edition.
  • lua.org

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 66552.75
ETH 3490.33
USDT 1.00
SBD 2.64