4 ms·
> You end up with people that can write assembly but have no idea what a functor is New challenge to self: write a functor in pure assembly.
by anthomtb 3y ago
> You end up with people that can write assembly but have no idea what a functor is
New challenge to self: write a functor in pure assembly.
- galdosdi 3y agoWhat, such as a linked list? This is a first week assignment in a systems course.
- anthomtb 3y agoAfter some reading I have come to two conclusions: 1) I have written many functors in my life without describing them as such 2) "Pure assembly" functor doesn't make much sense. Functors, both in the CS and mathematics sense, require the concept of type. Which is absent once you are dealing with stacks and registers. My best idea is something when you have mixed-width registers - eg, say you've got some 128 bit and 256 bit registers. Your functor could apply a mapping from one to the other (and would probably be nothing more than a move instruction with the appropriate sign extension).