Does it replicate the behavio开发者_开发知识库ur of the various libraries (so the calls are exactly the same) or just codes them from scratch using unique optimizations and new ways to do their stuff?
There are different kinds of reverse engineering grouped roughly into Dirty-Room and Clean-Room. Dirty-Room basically involves disassembling machine code in some way to figure out what it does and using the disassembled code to create new code. Dirty-Room creates the problem of copyright infringement, you're basically plagiarizing the old system to create the new system either directly or indirectly through direct knowledge of the old systems implementation. Clean-Room involves implementing the same API's using documentation and testing against the system to be re-implemented. These two techniques can be used on their own or in various combinations together. For example the PC BIOS was reverse engineered using two teams, a Dirty-Room team which disassembled the original BIOS and created a specification and a Clean-Room team which implemented the new BIOS using the specification. High stake business situations for reverse engineering usually involves lawyers specializing in the field to create a proper new implementation which does not infringe on the old one.
Cocotron is a Clean-Room implementation. I/We use the documentation and test programs to create a new implementation (Cocotron) which matches the behavior of the old implementation (Cocoa). The Apple documentation is very good, the API's are organized well and it is easy to create test programs when needed. Cocotron is pretty good if I do say so, but it is definitely not Cocoa and I would imagine the sources vary wildly between the two.
Cocotron's internal implementation is fairly different from Cocoa's. I wouldn't say there's any "reverse engineering" involved.
You should know there's a history of having separate implementations of Cocoa's API (sort of). Cocoa grew out of OpenStep, which was originally designed as a specification with many different implementations on different platforms.
精彩评论