Saturday, November 14, 2009

DynamOS 'C'

My next step is to implement the DynamOS equivalent of 'C'. Sometimes C is considered to be almost assembly language - it's so close to the metal. Well I want a language that is just as close to the Virtual metal :)

I'm thinking something like this

(function numberFactory: vm
(local numberPrototype)
(local factory)

numberPrototype: newObject

(open numberPrototype
(function plus: number
result: (vm add: number to: this)
)

(function minus: number
result: (vm subtract: number from: this)
)

(function isLessThan: number
result: (vm value: this isLessThan: number)
)
)

factory: newObject
(open factory
(function numberFrom: value
value parent: numberPrototype
)
)

result: factory
)

some nice and simple brackets to make all the function calls really obvious. With just a few keywords (such as 'function' and 'open' and 'local')

After that I want to try implementing the compiler in DynamOS - which will require strings!! And that can then lead to a command line. Once we have the command line, well I think that will be enough to get moving with the C version.

No comments:

Post a Comment