|
|
|
|
|
by jeswin
13 days ago
|
|
> Traditional OOP runtimes use vtables for method resolution, adding a layer of indirection on every call. Perry resolves all method calls statically during compilation, turning interface method calls into direct jumps. What? How is this possible, even with something as simple as: interface Animal {
speak(): string;
}
class Cat implements Animal {}
class Dog implements Animal {}
function makeSound(animal: Animal) {
return animal.speak();
}
|
|
[1]: https://github.com/PerryTS/perry/blob/39d5ba2e9db5adf7f7fc90...