Date
1 - 3 of 3
Lua Technical Discussion
Alistair Lowe
Hi guys,
I'm interested in the move to supporting Lua templates, is there a technical discussion or documentation discussing the reasoning behind Lua as a language choice? I would like to put forward Squirrel-lang as a potencial alternative, it is easily embedded and small footprint like Lua but features a more familiar and intuative C-based syntax, very close to Java script and has native JSON support with good end-user documentation. I'd like to understand more around the reasoning behind Lua and why it was selected to understand if this propos is a sensible one. Many thanks |
|
Matt Fisher <matt.fisher@...>
We were looking to use Lua as a pre- and post-hook event system when charts were being rendered.
The
post-render hook introduced in Helm 3.1 seems to handle most of the use cases the Lua event system would enable, so the need to implement a Lua-based event model was de-prioritized.
Lua was chosen over other languages for the following reasons:
More information on the implementation details (as well as the use cases we were targeting) can be found in the
Helm 3 proposal for the event-driven model. The
Lua plugin proposal was another potential area we could use Lua.
I guess I have two questions:
Matthew Fisher Caffeinated Software Engineer
Microsoft Canada From: cncf-helm@... <cncf-helm@...> on behalf of Alistair Lowe via Lists.Cncf.Io <alistair=skyiot.co.uk@...>
Sent: Wednesday, March 11, 2020 4:42 PM To: cncf-helm@... <cncf-helm@...> Cc: cncf-helm@... <cncf-helm@...> Subject: [cncf-helm] Lua Technical Discussion Hi guys,
I'm interested in the move to supporting Lua templates, is there a technical discussion or documentation discussing the reasoning behind Lua as a language choice? I would like to put forward Squirrel-lang as a potencial alternative, it is easily embedded and small footprint like Lua but features a more familiar and intuative C-based syntax, very close to Java script and has native JSON support with good end-user documentation. I'd like to understand more around the reasoning behind Lua and why it was selected to understand if this propos is a sensible one. Many thanks |
|
Alistair Lowe
Hi Matt, Thanks for the great briefing, it sounds like the biggest sticking-point in my suggestion is that AFAIK Squirrel doesn't have a Go implementation. It shares a lot in common with Lua and was inspired by it but addressed a few key points at the time:
You'll still find it today in Valve's Steam engine and Electric Imp's IoT platform and like Lua, it covers most of the points you've listed, it's portable, easily embeddable, small footprint, safer, free and open source. My motivation for suggesting this was simply the familiarity of the syntax for an end-user, Lua may be 24th in the PYPL popularity list but that only accounts for a 0.31% share, which has been dropping each year, and its syntax style is fairly distant from the more popular languages. Squirrel is so close to Javascript and other C-based languages that a large number of users could run with it after a few minutes (once you realise 'local' instead of 'let'), much as I did when first picking it up. An example of the Syntax: --- local myVar = 10.5; local myString = "hi"; local myVerbatimString = @"Lots of escape characters will be printed \n\n\n\n\n\n"; local myTable1 = { test = 1, test2 = 2 }; local myTable2 = { "test": 1, "test2": "2" }; // JSON notation version (also note C-based comments, including block comments) local myArray = [1, 2, 3, "hi"]; local myFunc = function(a,b) { if (a > b) { return 1; } else { return 0; } } local myLambda = @(a,b) a+b; foreach (key, value in myTable1) { myTable[key] = value + 1; } function someFunction() { return "hi"; } class MyClass { _privateParam = 10; constructor() { } function myFunc() { return _privateParam; } } local myInstance = myClass(); --- Documentation: http://squirrel-lang.org/squirreldoc/index.html Many thanks, Alistair Lowe On Thu, Mar 12, 2020 at 6:10 PM Matt Fisher <Matt.Fisher@...> wrote:
|
|