monte-language / typhon

A virtual machine for Monte.
Other
67 stars 10 forks source link

Modern Interfaces #94

Open MostAwesomeDude opened 8 years ago

MostAwesomeDude commented 8 years ago

The entirety of the interface subsystem needs an overhaul. In particular:

MostAwesomeDude commented 8 years ago

Note that one of the problems is related to module loading. Suppose that some module exports some interface IFace. Then two other modules, in a diamond diagram, both import that module and export objects which use IFace as a guard or auditor. It would seem that IFace should be structural, not nomative, but objects are not required to prove that they are structural if they are built with composition which the interfaces cannot prove is correct.

This situation reduces interfaces to an advisory mechanism at best.

MostAwesomeDude commented 8 years ago

We had a chat on IRC. We'll need to talk more later.

MostAwesomeDude commented 7 years ago

Another problem: Objects like Int don't actually implement the Interface interface! This is the cause of this annoying bug:

▲> help(42)
TRACE: ["In To obtain help on an object, try: help(anObject).run(42):"]
TRACE: ["In Int.getDocstring():"]
Parse error: Message refused: (Int, Atom(getDocstring/0), [])
MostAwesomeDude commented 7 years ago

As of 04c0b70b4201860c634ccce21a7a32766d5f2914, Int and friends now have automatically-generated correct interface methods.

MostAwesomeDude commented 7 years ago

We need to figure out the right story for the builtin objects using non-generated interfaces. Should we just stop doing that?

MostAwesomeDude commented 7 years ago

Named params were added to interfaces in b3d901e.