smlvm

Smallrepo Virtual Machine

  • Owner: shanhuio/smlvm
  • Platform:
  • License:: Other
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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.

Main metrics

Overview
Name With Ownershanhuio/smlvm
Primary LanguageGo
Program languageGo (Language Count: 3)
Platform
License:Other
所有者活动
Created At2014-11-20 23:58:49
Pushed At2021-07-16 14:16:20
Last Commit At2021-07-16 07:16:06
Release Count0
用户参与
Stargazers Count264
Watchers Count25
Fork Count31
Commits Count1.1k
Has Issues Enabled
Issues Count43
Issue Open Count11
Pull Requests Count37
Pull Requests Open Count0
Pull Requests Close Count3
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private