DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Open Source: A Pathway To Personal and Professional Growth
  • Enhancing Software Quality with Checkstyle and PMD: A Practical Guide
  • Linting Excellence: How Black, isort, and Ruff Elevate Python Code Quality
  • Mastering GitHub Copilot: Top 25 Metrics Redefining Developer Productivity

Trending

  • Infrastructure as Code (IaC) Beyond the Basics
  • The Future of Java and AI: Coding in 2025
  • Memory Leak Due to Time-Taking finalize() Method
  • Integrating Model Context Protocol (MCP) With Microsoft Copilot Studio AI Agents
  1. DZone
  2. Coding
  3. Languages
  4. Lizzie, a Scripting Language for .NET

Lizzie, a Scripting Language for .NET

We take a look at an open source language that one developer has created, and how he hopes it can reduce compile times and learning curves for developers.

By 
Thomas Hansen user avatar
Thomas Hansen
DZone Core CORE ·
Aug. 28, 18 · Analysis
Likes (2)
Comment
Save
Tweet
Share
9.6K Views

Join the DZone community and get the full member experience.

Join For Free

Lizzie is a dynamically compiled scripting language for .NET, allowing you to incorporate dynamically loaded pieces of code into your C# and F# projects. One of its defining traits, is that, first of all, out of the box, it is literally theoretically impossible to execute malicious code, simply since out of the box, it doesn't contain a single piece of functionality that changes the state of your computer in any way. If you need such functions, which I assume most would, then creating such functions is as easy as marking your method with an attribute, and making sure it has the correct signature. Below is an 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 = @"

var(@foo, function({
  +(bar, ""world"")
}, @bar))

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();
    }
}

Notice how we "bind" a C# method in the above code to our Lizzie lambda object. This makes the C# method available as a "function" internally within our Lizzie code. This trait allows you to easily extend the language, with whatever domain specific extensions you need to solve your particular problem. This makes the language particularly well suited for "Domain Specific Languages."

In a way, Lizzie is Lisp, with JavaScript's syntax. This makes it blisterinly fast to compile a Lizzie snippet. In fact, there is an example over at its GitHub project page, where I compile a snippet of Lizzie code 10,000 times, and the entire process only takes about 2,200 milliseconds on my machine. So compiling Lizzie code is probably some 5-10 orders of magnitudes faster than compiling the equivalent C#, F#, or Boo code.

The language is extremely dynamic, has no type safety, and also executes fairly fast, since the end result is basically just a bunch of statically compiled delegates, chained together to create a lambda Func<object>, where each of its "branches" are simply CLR delegates. Since it's also extremely secure, unless you mindlessly extend it with suicidal methods, it's also a perfect fit for passing code over the network, to evaluate the code somewhere else than where it was created. In such a way, it's arguably to code what JSON is to data.

Due to the fact that its syntax resembles JavaScript, you should be able to use JavaScript syntax highlighters to edit code snippets, but (of course) without AutoCompletion, since its has different ways of declaring functions and variables.

You can find it in NuGet as "lizzie", or download its source code on GitHub, here. The entire code for Lizzie is roughly 2,000 lines, where probably 50% of the code is comments. The entire documentation for it is only 12 pages of print, allowing you to literally learn the language in 20 minutes. You can see a video demonstration of the language here. The language is open source and licensed under the terms of the MIT license.

Scripting language code style

Opinions expressed by DZone contributors are their own.

Related

  • Open Source: A Pathway To Personal and Professional Growth
  • Enhancing Software Quality with Checkstyle and PMD: A Practical Guide
  • Linting Excellence: How Black, isort, and Ruff Elevate Python Code Quality
  • Mastering GitHub Copilot: Top 25 Metrics Redefining Developer Productivity

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: