orc-lang / orc

Orc programming language implementation
https://orc.csres.utexas.edu/
BSD 3-Clause "New" or "Revised" License
40 stars 3 forks source link

classes should declare their record type #126

Closed GoogleCodeExporter closed 7 years ago

GoogleCodeExporter commented 9 years ago
Description of Change:

def class MyClass() =
  def myMethod() = signal
should declare a type "MyClass" as "{. myMethod :: lambda() :: Signal .}"

Benefit of/Reason for Change Request:
Making types non-painful when using classes

Original issue reported on code.google.com by jthywissen on 3 Aug 2013 at 8:04

GoogleCodeExporter commented 9 years ago

Original comment by jthywissen on 12 Sep 2013 at 9:01

GoogleCodeExporter commented 9 years ago
This problem is deeper than expected and will be deferred until it can be 
solved more carefully. There are 2 major points that bring me to this decision:

1. Class types should actually be recursive record types (in fact, mutually 
recursive). So it's not clear how they would interact with the rest of the type 
system. The type checker cannot even type check recursive classes at the 
moment, so it's no surprise we cannot write down their type.

2. David mentioned that classes as implemented may not be the right unit of 
modularity for Orc and I think he has a point. Orc needs more than just 
glorified records of functions; for instance, subtyping and perhaps some form 
of derivation would be very nice. So I think more thought needs to go into this 
before we spend the time to make the types work for something that may not even 
be useful in the long run.

So this issue will be deferred pending someone (perhaps me, I am interested) 
having time to think hard about it and come up with a set of possible solutions 
and how those solutions compare.

Original comment by arthur.peters on 17 Sep 2013 at 7:57

arthurp commented 7 years ago

Closed won't fix because OrcO now replaces the old "classes" entirely.