Skip to content

Commit

Permalink
Interface namespaces (#1287)
Browse files Browse the repository at this point in the history
This implements namespaces for interface methods, as discussed in #1266.

In brief:
- each interface has a namespace
- interface method resolution uses a linearized (c4) search for
appropriate methods, bottoming at the unqualified method name (for UX
and backwards compatibility)
- it becomes undesirable (and not easy) to call a namespace method
dynamically; you really have to go through the interfrace -- and this is
the desirable and safe way to invoke an interface method, as the
contract is enforced. It is also now safe to assert the interface method
types in the method implementation as you really have to go out of your
way to bypass the contract.

Follow up:
- what is not implemented yet is to validate the method implementation
against the interface method signature and in fact inject the signature
into the method automatically. This has many benefits (both performance
and safety), but it is also more complicated to implement. We can tackle
this in a follow up pr.
  • Loading branch information
vyzo authored Dec 16, 2024
1 parent ebe750b commit 34a09d7
Show file tree
Hide file tree
Showing 102 changed files with 115,323 additions and 113,721 deletions.
502 changes: 251 additions & 251 deletions src/bootstrap/gerbil/compiler/base~0.scm

Large diffs are not rendered by default.

550 changes: 275 additions & 275 deletions src/bootstrap/gerbil/compiler/base~1.scm

Large diffs are not rendered by default.

15,440 changes: 7,720 additions & 7,720 deletions src/bootstrap/gerbil/compiler/compile~0.scm

Large diffs are not rendered by default.

1,284 changes: 642 additions & 642 deletions src/bootstrap/gerbil/compiler/compile~1.scm

Large diffs are not rendered by default.

3,278 changes: 1,639 additions & 1,639 deletions src/bootstrap/gerbil/compiler/driver~0.scm

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions src/bootstrap/gerbil/compiler/driver~1.scm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 34a09d7

Please sign in to comment.