sampsyo / cs6120

advanced compilers
https://www.cs.cornell.edu/courses/cs6120/2023fa/
MIT License
746 stars 158 forks source link

Project Report: Object implementation for Bril #341

Closed yy665 closed 1 year ago

yy665 commented 2 years ago

Thanks for the reviews!

There are currently still some bugs which prevent some scenarios from working (though the example in the post did work), and I am trying to fix them right now. One particular scenerio I found valuable is to compare two objects of same type. There is a work around in terms of passing object as function arguments, though not for return values. In addition, I feel like my evaluation plan is sort of hollow and could not provide actual insight which is the benefit of this work. It’s difficult to empirically measure how much would the abstraction change would help programmers in this case. I would appreciate some inputs on what types of evaluation would best suit this work.

I would like to add a clarification that this work is more like a middle ground in between high level OO language and core Bril itself.

Also for the parametric type, I kind of forgot that when I was implementing it, but I did think about it when I was almost done with this work. I think that’s one of the missing pieces of this project and it definitely should be a parametric type. However, it would require a lot of change on my existing code which was already a bit of complicated and messy so I didn’t change it right away. On the other hand, it’s currently functional without having parametric type on refs since unlike pointers which the Bril interpreter would require type information to do type checking, ref doesn’t get passed into interpreter — the translation pass would figure it out.

sampsyo commented 1 year ago

Same question for this one: how about finishing this up so it's ready to publish?

yy665 commented 1 year ago

Same question for this one: how about finishing this up so it's ready to publish?

Sorry! I should've done it long time ago. Can I have a few more days to wrap this (and the blog) up, maybe till the end of this week?

sampsyo commented 1 year ago

Sure; there's no particular urgency, obviously!

sampsyo commented 1 year ago

Hello! I am closing old issues from last year's offering to prepare for the next iteration of the course. If you would like to have this blog post published, please just leave a note and we can reopen the thread.