babygo👶 is a small Go compiler made from scratch, which can compile itself. It's going to be the smallest and simplest go compiler in the world.
MIT License
Published by DQNEO about 1 year ago
Full Changelog: https://github.com/DQNEO/babygo/compare/v0.4.0...v0.4.1
Published by DQNEO about 1 year ago
Full Changelog: https://github.com/DQNEO/babygo/compare/v0.3.0...v0.4.0
Published by DQNEO about 1 year ago
babygo build -x
option for verbose logdtype
labels to itab (interface table)Published by DQNEO about 1 year ago
.dcl.go
file as forward declarations so that a later compilation can reuse them.babygo
are now split into subcommands such as build
, list
, and compile
.os/exec
to execute any linux commands by fork-and-exec mechanismPublished by DQNEO about 1 year ago
internal/
packagescodegen
is not depend on ast
any more, but on semantic analyzer (sema
) and intermediate representation (ir
) objects.Published by DQNEO about 3 years ago
Published by DQNEO over 3 years ago
$ diff -U 0 pre/precompiler.go main.go
--- pre/precompiler.go 2021-03-09 09:31:23.000000000 +0900
+++ main.go 2021-03-09 09:30:50.000000000 +0900
@@ -8,3 +8,2 @@
- "go/ast"
- "go/parser"
- "go/token"
+ "github.com/DQNEO/babygo/lib/ast"
+ "github.com/DQNEO/babygo/lib/token"
@@ -20 +19 @@
-const ProgName string = "pre"
+const ProgName string = "babygo"
@@ -4399,7 +4397,0 @@
-
-// tweak to reduce diff with main.go
-const parserImportsOnly = parser.ImportsOnly
-
-func parserParseFile(fset *token.FileSet, filename string, src interface{}, mode parser.Mode) (*ast.File, error) {
- return parser.ParseFile(fset, filename, src, mode)
-}
Published by DQNEO about 4 years ago
Babygo officially supports self-hosting 🎉
make test-self-host