Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 29 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,7 @@ Want pattern matching? Enable it. Want sum types? Already working. Think you can
### Installation

```bash
# Clone the repository
git clone https://github.com/MadAppGang/dingo.git
cd dingo

# Build the compiler
go build -o dingo ./cmd/dingo

# Add to PATH (optional)
export PATH=$PATH:$(pwd)
go install github.com/MadAppGang/dingo/cmd/dingo@main
```

### Your First Dingo Program
Expand Down Expand Up @@ -125,26 +117,43 @@ dingo go hello.dingo

**Sum Types with Pattern Matching:**

For now this requires a `go.mod`, you might initialize one like that:

```bash
mkdir playground
go mod init playground
go get github.com/MadAppGang/dingo/pkg/dgo@main
```

```go
enum Result {
Ok(value: int),
Error(message: string)
}
package main

func divide(a: int, b: int) Result {
import (
"fmt"
)

func divide(a: int, b: int) Result[int, string] {
if b == 0 {
return Error("division by zero")
return Err[int]("division by zero")
}
return Ok(a / b)
return Ok[int, string](a / b)
}

result := divide(10, 2)
match result {
Ok(value) => fmt.Printf("Success: %d\n", value),
Error(msg) => fmt.Printf("Error: %s\n", msg)
func main() {
result := divide(10, 2)
match result {
Ok { value } => fmt.Printf("success: %d\n", value),
Err { msg } => fmt.Printf("error: %s\n", msg)
}
}
```

Then you can run it:

```bash
dingo run pattern_matching.dingo
```

**Safe Navigation and Null Coalescing (Phase 7 ✅):**

```go
Expand Down
18 changes: 13 additions & 5 deletions editors/vscode/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dingo Language Support for VS Code

Syntax highlighting and language support for [Dingo](https://github.com/yourusername/dingo) - a modern meta-language for Go with Result types, error propagation, pattern matching, and more.
Syntax highlighting and language support for [Dingo](https://github.com/MadAppGang/dingo) - a modern meta-language for Go with Result types, error propagation, pattern matching, and more.

## Features

Expand Down Expand Up @@ -98,14 +98,22 @@ Search for "Dingo" in the VS Code Extensions marketplace.

1. Clone the Dingo repository:
```bash
git clone https://github.com/yourusername/dingo.git
git clone https://github.com/MadAppGang/dingo.git
```

2. Copy the extension to your VS Code extensions folder:
2. Copy or symlink the extension to your VS Code extensions folder:
```bash
cp -r dingo/editors/vscode ~/.vscode/extensions/dingo-language
```

or:

```bash
ln -s $(pwd)/editors/vscode ~/.vscode/extensions/dingo-language
```

Replace `~/.vscode/` with `~/.vscode-oss` if your using vscodium.

3. Reload VS Code

### Development
Expand Down Expand Up @@ -328,14 +336,14 @@ If you see "dingo-lsp binary not found":

## Contributing

See the main [Dingo repository](https://github.com/yourusername/dingo) for contribution guidelines.
See the main [Dingo repository](https://github.com/MadAppGang/dingo) for contribution guidelines.

## License

Same as Dingo project (see root LICENSE file).

## Resources

- [Dingo Documentation](https://github.com/yourusername/dingo)
- [Dingo Documentation](https://github.com/MadAppGang/dingo)
- [VS Code Language Extension Guide](https://code.visualstudio.com/api/language-extensions/overview)
- [TextMate Grammar Guide](https://macromates.com/manual/en/language_grammars)