Alternatives to Lua as an embedded language?

后端 未结 7 501
盖世英雄少女心
盖世英雄少女心 2021-01-30 05:23

I am working on an embedded system running Linux on a DSP. Now we want to make some parts of it scriptable and we are looking for a nice embeddable scripting language. These scr

7条回答
  •  滥情空心
    2021-01-30 05:35

    There's always Lisp. :) But that underscores the fact that Lua is in fact less "quirky" than most languages. It was designed for non-programmers and reads like pseudocode. It has clean, uniform semantics (first class nested functions with lexical scoping; multiple assignment; multiple return values; a single, flexible data structuring mechanism with clean constructor syntax; etc.) which make it very easy to learn, read, write, etc. It also happens to be unexpectedly powerful and expressive (proper tail calls, continuations, metaprogramming, etc.)

    The only really "quirky" aspect of Lua is that arrays index from 1, and that fact that it doesn't borrow C's conventions like everybody else (~= rather than !=, -- rather than //, etc.), but these are mostly quirky through the eyes of programmers habituated to C-like languages.

    An alternative might be Squirrel, which is inspired by Lua, has similar goals, but C-like syntax. I've not used it though, so I don't know well it meets it's goals.

提交回复
热议问题