Hacker News new | past | comments | ask | show | jobs | submit login
Simulation of Object-oriented Concepts and Mechanisms in Scheme (aau.dk)
29 points by mahmud on Jan 4, 2011 | hide | past | favorite | 3 comments



I posted this because it's a fun paper, and implementing object-systems is a fun project for the millions of newbie Lispers and on-the-fence programming language nerds out there.

The unique feature of this paper is that it uses simulation, as opposed to compilation or interpretation, in order to extend a language. I have been saying this for years, language implementation techniques as presented in undergrad studies are actually HARD; the fun, easy techniques are buried in "research" papers like this one.


Looks like they're using a message-passing dispatcher similar to SICP 2.1.3 [1]; it's only a shame that the article predates the formalization of eval [2], though, which leads to anachronisms such as: "In Scheme, [calculating the method given its selector] is not possible. What is missing is the possibility to evaluate a symbol in the environment of self."

[1] http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-14.html...

[2] http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z...


I did something similar to this, though much smaller, a while back, using (parts of) JavaScript as the host "functional" language, just as a thought experiment.

http://roboprogs.com/devel/2010.06.html#2010_06_02

It's interesting how much easier it is to assemble functionality with closures in many cases, when all you want is to initialize ("construct") something that you are going to make one (1) call to, or at least one kind of call, repeatedly. Interesting? Maybe obvious.

For a class with many methods, I think OOP does have value, but one does get tired of it being presented as the One Way.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: