smlvm

Smallrepo Virtual Machine

  • 所有者: shanhuio/smlvm
  • 平台:
  • 許可證: Other
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

BuildStatus

Small VM

go get -u shanhu.io/smlvm/...

(Note that we use a custom domain rather than github.com.)

smlvm is a small, simulated virtual machine with a 32-bit
instruction set. It also comes with
a simple programming langauge called G. The language has a modern
Go language-like syntax, and a C-like semantics and runtime.

The project is a pure Go project that only depends on the standard
library. The compiler is written from scratch.

Try G language in the playground.

Using the makefile

The project comes with a makefile, which formats the code files,
check lints, check circular dependencies and build tags. Running the
makefile requires installing some tools.

go get -u shanhu.io/tools/...
go get -u github.com/golang/lint/golint
go get -u github.com/jstemmer/gotags

Comprehensible code

Go language is already fairly readable. To keep the project
modularized and properly structured, we follow two additional rules
on coding:

  1. Each file has no more than 300 lines. 80 characters max per line.
  2. No circular dependencies among files.

Note that Go language already forbids circular dependencies among
packages.

With no circular dependencies, the project architecture can be
visualized as a topology map. We find such maps extremely useful
on developing complicated projects.

Similarly, G language projects for the virtual machine also follows
the same rules. In fact, it is enforced by our compiler.
For example, G language's standard library can also be visualized into
into a topology map.

Copyright by Shanhu Coding Society. Licence Apache.

主要指標

概覽
名稱與所有者shanhuio/smlvm
主編程語言Go
編程語言Go (語言數: 3)
平台
許可證Other
所有者活动
創建於2014-11-20 23:58:49
推送於2021-07-16 14:16:20
最后一次提交2021-07-16 07:16:06
發布數0
用户参与
星數264
關注者數25
派生數31
提交數1.1k
已啟用問題?
問題數43
打開的問題數11
拉請求數37
打開的拉請求數0
關閉的拉請求數3
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?