basgo compiles BASIC-lang to Golang
Branch: master
Clone or download
udhos Version up.
Latest commit 606cb09 Feb 15, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
basgo-build Improve TAB. Feb 14, 2019
basgo-run Trivial compiler. Dec 26, 2018
basgo Version up. Feb 15, 2019
baslex-run Lex shows current position. Dec 23, 2018
baslex-samples Unary not. Jan 13, 2019
baslex POS function: track screen column. Feb 14, 2019
baslib Improve TAB. Feb 14, 2019
basparser-run WHILE/WEND. Jan 25, 2019
basparser-samples Improve example. Jan 29, 2019
basparser POS function: track screen column. Feb 14, 2019
examples Fixes. Feb 15, 2019
gofunc _GOIMPORT and _GODECL can define Go functions directly in BASIC code. Feb 3, 2019
node trade.bas Feb 15, 2019
.gitignore Initial commit Dec 17, 2018
LICENSE Initial commit Dec 17, 2018 toc. Feb 13, 2019 Move SGN implementation to package baslib. Feb 2, 2019
go.mod Non-blocking inkey. Feb 13, 2019
go.sum Non-blocking inkey. Feb 13, 2019

license Go Report Card

basgo compiles BASIC-lang to Golang


In order to build the 'basgo-build' compiler, a recent version of Go is required.

If your system lacks Go, this recipe will install a current release of Go:

git clone
cd update-golang
sudo ./


The recipe below will install 'basgo-build' under "~/go/bin".

git clone
cd basgo

Run the Compiler

basgo-build < program.bas > program.go
go run program.go                      ;# builds and runs program.go

Status and Limitations

The compiler currently can handle many simple programs.

Limitations include lack of support for sound, graphics and hardware-specific instructions (POKE, PEEK, etc).

See also known issues:


basgo-build < examples/game.bas > game.go
go run game.go                            ;# builds and runs game.go

Sample - Hello World

$ echo '10 print "hello world!"' | basgo-build > a.go
$ go run a.go
hello world!

Use _GOFUNC to call Go function from BASIC code

_GOFUNC() is a BASIC keyword introduced by the 'basgo' compiler in order to call a Go function from BASIC code.

10 result = _GOFUNC("func_name", arg1, arg2, ..., argN)
20 print result

See gofunc

Run the Interpreter

Status: the interpreter currently can only parse simple programs, but is unable to execute anything.

# interpreter interactively reads from stdin

BASIC References

BASIC programs and games - Star Trek - Few GW-BASIC games - BASIC Games - A page about GWBASIC Games & Other Programs - Classic Basic Games Page - Classic BASIC Games - BASIC Computer Games

BASIC documentation - GW-BASIC User's Guide - GW-BASIC User's Guide - Operators - Language Guide

BASIC interpreters and compilers - GW-BASIC emulator - BASIC interpreter in Golang