Permalink
Browse files

Examples, minor documentation

  • Loading branch information...
kpocza committed Jan 30, 2017
1 parent 429b6a3 commit eaecb649f7ed2b91d10dee5c4f7f3a64c4ddd473
View
@@ -30,4 +30,6 @@ _NCrunch_*
*.ncrunchsolution
**/nCrunchTemp_*
go/*.exe
.*.swp
View
@@ -1,6 +1,52 @@
# GoSharp
# Go\# project
Go-like DSL for C#
This library provides a mini embedded DSL for C# that mimics Go types and statements like channels and select.
This library provides a mini embedded DSL for C# that mimics Go concurrency statements like channels and select.
For example the following Go code
```go
func sendRecv() {
messages := make(chan string)
go func() {
messages <- "ping"
}()
msg := <-messages
fmt.Println(msg)
}
```
looks like this in C# powered by Go#:
```c#
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](docs/examples.md).
TODO:
- Channel input validation
- Select input validation
- Timer, ticker
- Select timeout support
- Nuget package
- Performance docs
More documentation to be done later.
Oops, something went wrong.

0 comments on commit eaecb64

Please sign in to comment.