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

The difference in speed has a lot more to do with memory layout. Javascript will never be as fast for this reason.

You could make a JIT language as fast as C so long as it supported value types properly. Most programs in the "slow" languages spend most of their time chasing pointers around.



To elaborate on your point, its not just chasing pointers, it’s that those pointers point into random heap locations, each of which needs to be allocated individually and garbage collected. Also, because of the haphazard locations of these objects in the heap, you have way more cache misses than you would with value types.


Julia comes fairly close.


And Julia's tuples, named tuples, and structs are value-types without pointers.




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

Search: