Extrait du cours lua: Bright –A C‐like Lua Derivative
Lua Derivative
Who we are
• System engineering company, specialists in USB technology
• Ninety people
• Headquartered in Ithaca, NY; sites in Austin, Tokyo, Tai pei , Seoul and Europe
• Focused on cell phone industry
Over 500 million cell phones that use MCCI technology
Two of the top four cell phone OEMs
Two of the top four cell phone Platform Vendors
• Additional markets in set‐top boxes, car navi systems
Focus of Presentation
• What did we learn about Lua based on the changes we made?
• How are we using our re‐skinned Lua
MCCI’s Problem Space
• Our customers are huge engineering teams
– many products, shipped in high volume
– years of prep work for one month’s production!
– very risk averse
•Our software has to be integrated into their development environments
– each environment is different
– each environment evolves unpredictably and asynchronously
•We have to maintain economy of scale and deliver bug fixes across all the different consumers
• We use automation intensively
What Automation to Use?
• Java, Perl, Python, etc., are “well accepted”
– For brevity, let’s say “LDJ” for “language de jour”
•If they’re not using LDJ, all these LDJs are very heavyweight; this generates resistance to using our automation
• Most LDJs have enormous libraries which add to the complexity
Why not Lua?
• Lua is a research language, targeting embedded scripting
– needs to evolve
–backward compatibility is less important than exploring new ways of saying thing
– Lua as a stand‐alone language is secondary to Lua as an embedded language
•MCCI needed a language that would emphasize backwards compatibility and stand‐alone tool applications
– backward compatibility is critical
– Bright used as a stand‐alone language is a primary use‐case
–Lua 3.2 to 4.0 made us realize that in order to use Lua technology, we needed a degree of independence
What did we change and why?
•We liked Lua a lot –we hoped for its general adoption –and we wanted to stay out of the way…
• We changed syntax – something “almost like” Lua seemed worse than something quite different
– we switched to C‐like syntax for somewhat cynical reasons
•We changed semantics to meet the need of a production environment
– Zero‐origin indexing
– “Undefined” values
– No locale sensitivity
– Empahsis on script portability over functionality
Three kinds of changes
• Trivial – nothing interesting about them
•Small –somewhat interesting, but not a major change to the flavor of the language
• Large –major changes to the flavor of the language
•Curiously, the effort involved was inverse to the scale of the change
Trivial Changes
• C‐like syntax
–This was trivial, in the sense that it was a simple exercise in the lexer and parser
– More details as to what we did later –if there’s time
• Created man pages
•Wrote a reference manual (adapting liberally from the Lua reference manual)
………..
Cours Lua: Bright –A C‐like Lua Derivative (268.84 KO) (Cours PDF)