Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Language is Lua and the word is "embedded"

Tags:

embedded

lua

I was reading about the language "Lua" and I was confused with the three following lines :

  1. Lua is designed primarily for embedded systems and clients .

  2. The only competitor to Lua back then was TCL which was meant to be embedded into applications .

  3. Lua is intended to be embedded into other applications,

So , what is the difference between the meaning of word "embedded" in the first line and the word "embedded" in the second and third line . What does it mean for a language to be embedded into other applications ?

like image 302
Eddie Dorphy Avatar asked Dec 22 '17 18:12

Eddie Dorphy


2 Answers

According to Wikipedia

An embedded system is a computer system with a dedicated function within a larger mechanical or electrical system, often with real-time computing constraints.

Typical examples include cars or coffee makers, where computers are embedded into the system to fulfill certain tasks.

The typical constraint is that embedded systems are often less powerful than a typical desktop computer due to cost and energy constraints. Therefore, languages to be used on embedded systems should allow for a lightweight execution. This is how "embedded" is used in the first line.

The second and third line refer to the usual application of Lua: It is meant to be used to extend the functionality of existing programs. For example think about a coffee maker where you can specify your own coffee recipes. Then the actual control program of the coffee machine is written for example in C, while you can specify the coffee recipe in Lua. In this way, your coffee recipes that you write in Lua are embedded in the C application.

Application of Lua in embedded systems

Due to a comment that questions the use of Lua in embedded systems, here some examples taken from Wikipedia's list of Lua applications:

  • The Canon Hack Development Kit (CHDK), an open source firmware for Canon cameras, uses Lua as one of two scripting languages.
  • Cisco Systems uses Lua to implement Dynamic Access Policies within the Adaptive Security Appliance (ASA), and also SIP normalization in Cisco Unified Communications Manager (CUCM).
  • Custom applications for the Creative Technology Zen X-Fi2 portable media player can be created in Lua.
  • Lego Mindstorms NXT and NXT 2.0 can be scripted with Lua using third-party software.
  • LuCI, the default web interface for OpenWrt, is written primarily in Lua.
  • NodeMCU uses Lua in hardware. NodeMCU is an open source hardware platform, which can run Lua directly on the ESP8266 Wi-Fi SoC.
  • Sierra Wireless AirLink ALEOS GSM / CDMA / LTE gateways allow user applications to be written in Lua.
  • The Perimeta session border controller from Metaswitch Networks uses Lua as a scripting language to manipulate SDP data on the fly.
  • Rockbox, the open-source digital audio player firmware, supports plugins written in Lua.
  • The Squeezebox music players from Logitech support plugins written in Lua on recent models (Controller, Radio and Touch).
  • TI-Nspire calculators contain applications written in Lua, since TI added Lua scripting support with a calculator-specific API in OS 3+.
like image 61
koalo Avatar answered Nov 15 '22 09:11

koalo


The use of the term "embedded" here is not the the same meaning as the [embedded] tag, in SO, or even the term "embedded systems" as it is conventionally used.

The link in the Wikipedia page is erroneous and misleading - the link is to "embedded systems", but the citation refers to it being an embeddable language - which is not the same thing.

Don't confuse these things - I have been developing embedded systems for many years and don't see Lua featuring anywhere. It could of course be used an an embedded language in an embedded system (for end user customisation for example), but it is not an embedded systems language as such.

like image 40
Clifford Avatar answered Nov 15 '22 09:11

Clifford