lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 24/05/2010 04:16, Patrick wrote:
I can't transfer several useful concepts from Lua back to C.
Simple code like this seems problematic to me in C:
SomeTable= {Lua = "fun", a = 1, b = 2, c = 1 + 2}

Is there another complied language that is similar to Lua?

Probably not, but you can find compiled languages having useful shortcuts (ie. syntax for associative arrays) like this one.
Perhaps D (but I never really learned it).
Nimrod <http://force7.de/nimrod> aims to have a syntax close of Python (among other influences) and you can do:

  const romanComposites = [
    ("M", 1000), ("CM", 900), ("D", 500), ("CD", 400), ("C", 100),
    ("XC", 90), ("L", 50), ("XL", 40), ("X", 10),
    ("IX", 9), ("V", 5), ("IV", 4), ("I", 1)
  ]

for example.

There are other compiled languages (usually generating C or C++ code to be compiled with your favorite compiler - often GCC - for your platform) around, like ooc (seems low level, close of C, haven't seen such syntax sugar), haXe (this C++ back end seems recent, no?), perhaps the (in)famous Google Go (or is it "Go!"?), Factor, etc.

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --