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?
已存档?
是复刻?
已锁定?
是镜像?
是私有?