Urgent.News

What's breaking now, across thousands of outlets.

Tech

My OSS Projects: Mages

This is the second post in my "My Open-Source Projects" series, where I go through some of the OSS projects I started or maintain and tell you the story behind them. Last time it was AngleSharp - the HTML parser that started life as a plane-ride fever dream. This time: MAGES , a much smaller project with a surprisingly cool client list. What Is MAGES, Actually? MAGES - officially standing for…

MAGES is a small, fast expression parser and interpreter for .NET that enables embedding a tiny scripting language within an application without the need for a full runtime or extensive dependencies. Initially developed as YAMP - Yet Another Math Parser - MAGES evolved from a reflection-driven experiment to become a high-performance tool designed for speed.

The core of MAGES' performance comes from compiling expressions into compact bytecode that is then executed by a lightweight stack-based virtual machine. This approach allows for efficient execution and decouples the parsing process from the actual execution of instructions. MAGES supports a wide range of features, including variables, functions, closures, objects, lists, complex numbers, and JSX for a more modern feel.

Installation is straightforward with the command "dotnet add package Mages," and it offers methods for interpreting expressions, compiling them into reusable delegates, and even handling complex numbers and JSX syntax.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Wednesday 16 September →