[Vm-dev] VM Maker: VMMaker.oscog-AlistairGrant.2455.mcz

Eliot Miranda eliot.miranda at gmail.com
Tue Oct 16 13:33:38 UTC 2018




> On Oct 15, 2018, at 11:21 PM, Alistair Grant <akgrant0710 at gmail.com> wrote:
> 
> 
> Hi Eliot,
> 
>> On Mon, 15 Oct 2018 at 21:58, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>> 
>> 
>> Hi Alistair,
>> 
>> also
>>    var := (self getenv: (self cCode: [key] inSmalltalk: [key allButLast])) ifNil: [0].
>> doesn't make sense to me.  In C nil == 0.  So ifNil: [0] is a no-op in C.  Either the genenv: simulation should answer 0 or it should answer nil.  But we shouldn't fix the primitive two handle incorrect simulation; we should instead implement the simulated getenv: to match what the primitive expects.  Make sense?
> 
> Sorry I didn't get to this last night.

No probs.  It was < 5 mins work.

>> On Mon, 15 Oct 2018 at 21:55, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>> 
>>    support code like this should be tuned for simulation speed.  Don't bother with the asserts: (asserts belong in code that will be translated to C, or tests), and try and use and ifTrue:ifFalse: style rather than foo isBar ifTrue: []. foo isBaz ifTrue: [], to reduce the number of types comparisons done.
> 
> Done.

Thanks!

> Thanks for your feedback,

Please don’t hesitate to question and critique my work too!!

> Alistair


More information about the Vm-dev mailing list