Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
go
 
 
src
 
 
 
 
 
 
 
 
 
 

README.md

Go# project

Go-like DSL for C#

This library provides a mini embedded DSL for C# that mimics Go concurrency statements like channels, select, timers and tickers.

In addition some higher level constructs (merge, zip, buffer, broadcast, pipeline, etc.) are also supported based on the core features of GoSharp.

The official NuGet package called GoSharp is hosted by nuget.org and supports .NET Standard 2.0 (.NET Core 2.0, .NET Framework 4.6.1) and .NET Framework 4.5.2.

For example the following Go code

func sendRecv() {
	messages := make(chan string)

	go func() { 
		messages <- "ping"
	}()
	
	msg := <-messages
	fmt.Println(msg)
}

looks like this way in C# powered by Go#:

private async Task sendRecv()
{
    var messages = Channel<string>.CreateNonBuffered();

    Go.Run(async () =>
    {
        await messages.SendAsync("ping");
    });

    var msg = await messages.RecvAsync();
    Console.WriteLine(msg);
}

For more examples and detailed explanation go here.

For examples of high-level constructs go here.

TODO:

  • More Pipeline features

About

Go-like DSL for C#

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.