brucehsu / GobiesVM

A Ruby VM written in Go aims to exploit parallelism via Software Transactional Memory
MIT License
184 stars 8 forks source link

Class abstraction #5

Open brucehsu opened 10 years ago

brucehsu commented 10 years ago

Currently every object is internally a instance of certain struct. For example, a string is created as a RString instance, which distinguish itself from other RString instances. Thus no shared data, class variable for example, can fit in this schema. Ideally, it should work just like that in the MRI, split hierarchy into classes and meta-classes.

brucehsu commented 10 years ago

https://github.com/brucehsu/GobiesVM/commit/d2f5a21faaf9b40fa72f0922037f0b53b658a6ba Now every object and even class is a RObject instance. This lead to more simplified internal type inferences. Meanwhile, objects that comes within a bytecode instruction are now primitive types, such as int64 or string in Go, for less overhead.