Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

type optimizer #415

Open
rurban opened this issue Aug 6, 2020 · 0 comments
Open

type optimizer #415

rurban opened this issue Aug 6, 2020 · 0 comments
Assignees

Comments

@rurban
Copy link
Member

rurban commented Aug 6, 2020

Add several improvements for types, esp. runtype hints.
We need 3 new type bits per type to specifiy its origin:

  • TYPE_DECLARED: if the type was statically declared by the user. This is fixed and cannot be changed
  • TYPE_INFERRED: if the type was inferred by the compiler. This is also fixed, but has weaker guarantees. Esp. warnings and error messages are different. Not sure if we need that, but looks nice.
  • TYPE_HINT: if the type was optionally observed/guessed by the compiler or run-time. such as array[int] vs array[any] which can be broken by any change. This can be taken away, fallback to the original generalized code. (OSR?)

This is pre-work for the jit. In principle everything which can be done in the jit, can also be done in C before, such as observing run-time types, adding type hints, spezialising code (loops, methods), backout to the old code, method cache for generics (PIC - polymorphic inline cache) (needed for multi). Just rt patching (PIC or hooks) not.

@rurban rurban self-assigned this Aug 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant