Re: Version 2.4 and beyond
- Posted by euman at bellsouth.net Feb 14, 2002
- 506 views
While we're on the subject, didnt you write 2X threaded code for LCC? Mind sharing what/how you did this? Euman euman at bellsouth.net Q: Are we monetarily insane? A: YES ----- Original Message ----- From: <kbochert at ix.netcom.com> To: "EUforum" <EUforum at topica.com> Subject: Re: Version 2.4 and beyond Hi Mike Nelson, you wrote on 2/14/02 8:54:40 AM: >I've been studying the source code with a view to adding classes--it is >doable in priciple but the resulting interpreter will be significantly >bigger and slower. I may do this sometime as a custom interpreter, but for >for Rob to build in classes, etc. as a feature would be to impose OOP's >speed penalties on those who don't use OOP. While an OOP library is slower >than built in OOP would be, it imposes no speed penalty on non-users. > >-- Mike Nelson > I disagree. There is certainly no reason for the presence of classes to slow down programs that don't use them. All that happens is the addition of a few cases to a switch statement, which adds zero time. When using classes: The declaration of a class just adds symbol table entries which takes the same time as an equivalent number of 'normal' declarations. The instantiation of a class is the same as the declaration of a sequence. Dot-notation need be no slower than selecting elements of a sequence with '[]'. Polymorphic dispatch should be slightly slower than simple calls, involving a '[]' operation and a call_proc(). Classes might be slower to the extent that they led the programmer to use more complicated structures than he otherwise would. The interpreter would be a bit larger of course. I have implemented some convenience features and 3/4 of the code for classes. My LCC-ported interpreter has grown from 104,480 to 108,576 bytes. (4%) Karl Bochert