Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Special-casing (only) ints and floats in VM is too trivial and a bloat for quite minor benefit. To start with, faster VMs are not VMs, but JITs. And they are able to specialize for arbitrary types, not just 2 random ones. I thought there were some "lessons learned" from ParrotVM... ;-).


This has nothing to do with parrot. Every self respecting VM treats value types differently than reference types, and esp. objects. Ruby, Perl, Javascript, every lisp, lua... That's why they are all so much faster than python. Python made the weird/ insane decision to overload + for strings, so treating numbers as classes goes from there. It just cannot be fast then. But even most Common Lisp's treat every value as class, with an atom being a struct of class and value. So it can be made fast if you do it properly.

Lessons learned: Don't ever look at the python vm, if you want to look for a well designed VM. Even Ruby is miles better there.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: