4 ms·
Hm that's a good question, not sure. Do Common Lisp implementations have a "core" that multiple inheritance and multiple dispatch can be desugared to? Or are
by chubot 7y ago
Hm that's a good question, not sure. Do Common Lisp implementations have a "core" that multiple inheritance and multiple dispatch can be desugared to? Or are those features "axiomatic" in the language?
If it's the former, I would say that optimizing a small core is easier than optimizing a big language. Python's core is 200-400K lines of C and there are a lot of nontrivial corners to get right.
I was surprised when looking at Racket's implemetation that it's written much like CPython. IIRC it was more than 200K lines of C code. Some of that was libraries but it's still quite big IMO. I would have thought that Racket, as a Scheme dialect, would have a smaller core.
AFAIK Racket is not significantly faster than Python; it's probably slower in many areas. Maybe it's just that SBCL put a focus on performance from the beginning?
(I looked at Racket since I heard they are moving to Chez Scheme, which also has a focus on performance.)
- cat199 7y ago> (I looked at Racket since I heard they are moving to Chez Scheme, which also has a focus on performance.) to wit, chez scheme was several generations into improving it's native code compilation abilities before python even existed: history of chez scheme (2006): https://www.cs.indiana.edu/~dyb/pubs/hocs.pdf https://www.cs.indiana.edu/~dyb/pubs/hocs.pdf
- flavio81 7y ago>Do Common Lisp implementations have a "core" that multiple inheritance and multiple dispatch can be desugared to? Yes, that's the Meta Object Protocol. It isn't on the standard, yet most Lisp implementation have it, and now you can use it in a portable way as well. >If it's the former, I would say that optimizing a small core is easier than optimizing a big language. Python's core is 200-400K lines of C Common Lisp's "core" (that means, not including "batteries") is considerably more involved and complex than Python's. Creating a new CL implementation is a big deal.
- soegaard 7y agoI expect Racket to be faster than CPython: https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/racket-python3.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... Note that the old C runtime of Racket has been rewritten to use Chez Scheme. The work is not completely done - but it is getting close. Talk by Matthew Flatt on the rewrite (almost a year old): https://www.youtube.com/watch?v=t09AJUK6IiM https://www.youtube.com/watch?v=t09AJUK6IiM