Neat-Lang / neat

The Neat Language compiler. Early beta?
BSD 3-Clause "New" or "Revised" License
110 stars 9 forks source link

Update demos to work with 0.7 #49

Closed wilsonk closed 4 months ago

wilsonk commented 4 months ago

It seems like these demos aren't working with 0.7 (at least not for me here). Can I also ask which change led to these failures? Or perhaps the documentation also changed and I missed what the change was?

FeepingCreature commented 4 months ago

That doesn't look right. The mut was added specifically to support the current compiler. Can you post the failures you're getting? edit: I just tried with master and it works. Are you sure your repo is current and you're calling the right compiler?

FeepingCreature commented 4 months ago

The background with mut is that the compiler can elide the reference increment if you're accessing an immutable field on an immutable class variable with lexical scoping, because the field lives at least as long as the class variable does anyways. So there is considerable benefit from this. And even in classes, most fields are never changed.

wilsonk commented 4 months ago

Hmm, strange I rebuilt when I 'git pulled' the newest version yesterday, but apparently something was not recompiled in the cache or something because I was definitely using the new compiler, but I had all those failures. Today I removed the entire .obj directory and rebuilt and now the demos work correctly.

I suppose removing the .obj dir should be my first instinct in the future if I get some strange errors like this. Sorry to bother.

FeepingCreature commented 4 months ago

Yes, no, my apologies! There's something going wrong with the cache code. It should be noticing that the compiler's changed and basically invalidate everything. rm -rf .obj should never matter; the fact that it frequently does hints at a fundamental bug somewhere. But it's kind of hard to debug where... my kingdom for a small repro!

(Bug report: "Instead of hash 892367aa, hash was 15f80083"...)