Skip to content
forked from vorov2/dyalect

Dyalect is a dynamic programming language for .NET Core.

License

Notifications You must be signed in to change notification settings

buybackoff/dyalect

 
 

Repository files navigation

Dyalect GitHub tag (latest SemVer)

.NET Core Build status AppVeyor tests

Dyalect is a dynamic programming language for .NET Core platform. It is lightweight, fast and modern. Dyalect (or Dy for short) is written in C# and has zero dependencies except for standard .NET Core libraries, which means that it can seamlessly run on Windows, MacOS and Linux. Moreover you can use the same binaries on any of these platforms!

Dy doesn't utilize DLR nor does it compile to IL (.NET assembly). Instead it runs on the top of its own high performance virtual machine. It compiles fast and can be used as an embeddable language or as a scripting language of your choice. It is also a good language to learn programming.

Dyalect offers modern syntax, inspired by such languages as C#, Swift, Go and Rust, first class functions, coroutines, expressive modules, a dynamic type system with an ability to extend existing types with new functions and much more.

A taste of Dy:

func fib(n) {
    return n when n < 2
    fib(n - 1) + fib(n - 2)
}

//Calculate the n-th fibonacci number
fib(11)

Extending standard types:

func Float.pow(n) {
    var result = 1.0
    if n > 0 {
        for i in 1..n {
            result *= this
        }
    }
    else if n < 0 {
        for i in (-1)..n {
            result /= this
        }
    }
    result
}

20.12.pow(3) //Outputs: 8144.865728

And a small example with iterators (coroutines):

func fetch() { 
    yield "Hello, world!"
    yield 22 * 1.25
}

for x in fetch() {
    print(x)
}

Outputs:

Hello, world!
27.5

Dy is shipped with a crossplatform interactive console which can help you to familiarize yourself with the language.

Please refer to wiki for more information.

Links

About

Dyalect is a dynamic programming language for .NET Core.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.3%
  • Other 0.7%