318 karma · joined May 29, 2011
As mentioned about though, GC algorithms can be transferred to higher-level system as well. For example, here is a basic Mark-Sweep algorithm implemented in JavaScript on JS objects in a collection: https://gist.github.com/DmitrySoshnikov/4391763
As mentioned below in this comments thread, GC algorithms are not only specific to objects in raw heap memory. These algorithms are transferrable to higher-level systems as well.
As to specific implementation, yes, I'm planning to have a GitHub repo with all the algorithms implemented in C++.
Yes, there will be more courses related to implementation of programming languages: Automata Theory, Theory of Parsing, Essentials of Interpretation, and others.
There are some lab sessions for the Garbage Collectors class, e.g. Writing a Memory Allocator from Lecture 6, where we implement an allocator similar to `malloc` function: http://dmitrysoshnikov.com/compilers/writing-a-memory-alloca...
As to materials, yes, there will be an accompanying book for this course.
Guys, don't spread ignorance.
Implementation details aren't essential, therefore a "bad practice" in this respect is just an ignorance.
Once again: the difference between classical and prototype-based (delegation-based in this case) inheritance is _ideological_.
In first case (classical) we have systematized (classified) code reuse, in the later (prototypal) -- unclassified (or "chaotic") code reuse, i.e. "I reuse/inherit the behavior and state from that object from which I want".
There are no other differences. The implementation details are derived stuff. Moreover, the same implementation can provide both, classical and prototypal _approaches_ of a code reuse (good examples: Python - prototype-based language, CoffeeScript, JavaScript, etc). Because a "class" isn't a syntactic construct, inst' some specific implementation. It's the _ability to classify_ objects. And this ability can be achieved in different systems regardless an implementation.
So if you need a classical code reuse with predefined "shapes" of your objects - you build a classical system reusing the code form linear ("tower") chain of inheritance. If instead you need just reuse a small functionality regardless of the classical hierarchy -- you use prototypal inheritance, that is delegation based traits/mixins/prototypes. And JS has both of them -- classes (without sugar) and prototypes -- and they both can be used when needed, there is no "bad practice" in this case.
Regarding classes and their kinds (that's why Python is also prototype-based langauge with "classes as sugar", the same as in Coffee, the same as is planed for ECMAScript): https://gist.github.com/977034
You may find additional info on common theory of OOP and in particular in ECMAScript with all details in "ECMA-262-3 in detail. Chapter 7.1 / 7.2".
Dmitry.