https://github.com/chanwit/kgc
Korat Golang Compiler
https://github.com/chanwit/kgc
Last synced: 8 months ago
JSON representation
Korat Golang Compiler
- Host: GitHub
- URL: https://github.com/chanwit/kgc
- Owner: chanwit
- Created: 2011-04-15T09:12:22.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2011-08-15T03:46:15.000Z (almost 15 years ago)
- Last Synced: 2025-02-28T11:39:22.454Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 224 KB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
README
======
Korat Golang Compiler, KGC.
Copyright (c) 2011 Chanwit Kaewkasi / SUT.
This program is a front-end compiler for 8g and GCCGO.
It additionally supports the following language constructs:
* trait
* case struct
* pattern matching
Trait
-----
type Object trait {}
Case struct
-----------
type Something casestruct {
left Object
right Object
}
type SomeObject casestruct borrows Object {}
Pattern Matching
----------------
match s {
case Something(x, SomeObject(y)):
return Some(x,y)
case Something(SomeObject(), x):
return Some(x)
}