Saturday, August 25, 2018

Lizzie, a dynamic script language for .Net

Hi guys and gals, I have just now released the first release of "Lizzie". Lizzie is a dynamically compiled "script language" for .Net and the CLR, that among other things allows you to load snippets of code (securely) over the network, and evaluate these snippets dynamically, without even in theory being able to evaluate "malicious code".

It's blistering fast when compiling its code. In fact, compiling 10,000 snippets of Lizzie code on my computer takes roughly 2.5 seconds. In addition, it is super dynamic, and easily extendible, allowing you to create your own "Domain Specific Extensions" to it by simply creating a simple method, and binding your CLR type to your Lizzie code.

The thing is Open Source (MIT license), and in its entirety created in a couple of weekends, and contains only roughly 2,200 lines of code in total. The reference documentation for the entire languageis only 12 pages of printed text, implying you can learn it in 20 minutes. The compiled DLL is roughly 40KB in size, and it's not possible, not even in theory, to execute malicious code with it our of the box - Assuming you don't mindlessly create suicidal extensions to it (of course) ...

See a 5 minutes video introduction to it here - https://www.youtube.com/watch?v=hgRaTRJ2nUc

Source code - https://github.com/polterguy/lizzie

NuGet

PM > Install-Package lizzie 

The Hello World example ...

using System; using lizzie; class MainClass { [Bind(Name = "write")] object Write(Binder<MainClass> binder, Arguments arguments) { Console.WriteLine(arguments.Get(0)); return null; } public static void Main(string[] args) { // Some inline Lizzie code var code = @" // Creates a function name "foo" taking a "bar" argument var(@foo, function({ +(bar, ""world"") }, @bar)) // Evaluating "foo" and writing the results out on the console write(foo(""Hello "")) "; // Creating a Lizzie lambda object from the above code, and evaluating it var lambda = LambdaCompiler.Compile<MainClass>(new MainClass(), code); lambda(); // Waiting for user input Console.Read(); } } 
Lizzie, a dynamic script language for .Net Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team