Skip to content

A dynamically typed language built on top of a VM written in C#, exposing .NETs rich ecosystem of types and libraries

Notifications You must be signed in to change notification settings

OnyxFlames/Cflat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cb (Cflat)

A dynamically typed language built on top of a VM written in C#, exposing .NETs rich ecosystem of types and libraries The goal of Cb is to expose C#s rich libraries and type system to a quick-and-dirty scripting language without the need to set up Visual Studio projects for simple tasks such as data processing or cloud resource management.

Language

Cb is a dynamically typed language with the types backed by C#s types, and isn't dissimilar to other dynamically typed languages like Javascript. The biggest difference would the be the .NET embeddable runtime, and future access to C# libraries.

fn WriteInt(n)
{
    import "System.Console" as Console;
    // calls C#'s Console.WriteLine, but within Cb
    Console.WriteLine(n);
}

var x = 1 + (2 * 3) - 4 / 5;

WriteInt(x);

Types

All of C#'s primitive types are available in Cb, but with a dynamic type system, they are exposed via literals

var money = 1.5m; // C#'s decimal type

var percentage = 0.6f; // C#'s float type

var iterations = 100000000L // C#'s long type

// etc..

Progress

Cb is still currently in development, C# types can be imported but the reflection facilities are not yet implemented.

Core Implementation

✅ Lexer

❌ Parser

❌ Compiler

❌ Virtual Machine

C# Interop

❌ Access to C# types

❌ Calling C# functions

About

A dynamically typed language built on top of a VM written in C#, exposing .NETs rich ecosystem of types and libraries

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages