<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I'd like to be able to annotate methods and classes as abstract without requiring bodies. It's a very useful style in OO programming.<div><br></div><div>Perhaps the body could just be the constant "deferred" which could have any type but blow up when touched at run time. A static checker could consider it an error to construct an object with "deferred" appearing in it. We'd have to explore the ramifications, but it might be a reasonable compromise.<br><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div>Kim</div><div><br></div></span><br class="Apple-interchange-newline">
</div>
<br><div><div>On Jul 19, 2013, at 10:49 AM, James Noble <<a href="mailto:kjx@ecs.vuw.ac.nz">kjx@ecs.vuw.ac.nz</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<div>
<div>
<div style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif">"I'm not sure, but it might help to make abstractness be gradual."<br><br>This is a good principle I can't remember being elucidated before. Not just abstract but a bunch of other principles too... Valueness, constness, a bunch of other stuff. Having extensible annotations is part of this but there will no doubt be more...<br><br>I like abstract as an annotation, but that means e.g. Abstract methods or classes still need bodies, if abstract is in a level above the core language <br><br>J</div></div>
<div dir="ltr">
<hr>
<span style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif; FONT-WEIGHT: bold">From: </span><span style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif"><a href="mailto:lex@lexspoon.org">Lex Spoon</a></span><br><span style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif; FONT-WEIGHT: bold">Sent: </span><span style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif">19/07/2013 14:08</span><br><span style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif; FONT-WEIGHT: bold">To: </span><span style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif"><a href="mailto:andrew.p.black@gmail.com">Andrew P Black</a></span><br><span style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif; FONT-WEIGHT: bold">Cc: </span><span style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif"><a href="mailto:grace-core@cecs.pdx.edu">grace-core@cecs.pdx.edu</a></span><br><span style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif; FONT-WEIGHT: bold">Subject: </span><span style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif">Re: [Grace-core] On Gradual Typing</span><br><br></div>>> The point is that you don't know what inherits from it (statically,<br>>> probably), and so with a static typechecker it is an error. It isn't<br>>> necessarily wrong dynamically, and if the typechecker is fully<br>>> disabled by an out-of-band lever then the program should be fine.<br>><br>> I had assumed that the point of a type-checker was to help me find errors,<br>> not to stop me writing an abstract superclass.<br><br>That seems like a killer observation.<br><br>I'm not sure, but it might help to make abstractness be gradual. It's<br>fun to say anyway. :) The idea would be that if a class is marked<br>neither "abstract" nor "concrete", then the compiler should assume the<br>class might be abstract and further that it might have abstract<br>members that the programmer has not specified. In the strict mode of<br>the compiler, all classes would need to be marked as either abstract<br>or concrete; gradually concrete would no longer be allowed.<br><br>For the larger story Michael has raised about gradual type checking, I<br>find it easier to think about literals, because literals normally<br>don't require a type annotation. Here's a simple example:<br><br> print(3 + 4 - "not a number")<br><br>The story about how gradual typers leave out error messages is that<br>the programmer leaves out type annotations in parts of the program<br>that they don't want type checking to happen. In this code, there are<br>no types to leave out, because even in the strictest type-checking<br>mode, the code has no type annotations. As such, this code must do the<br>same thing in gradual mode and strict mode. Presuming the code has an<br>error in strict mode, that means it must have an error in gradual mode<br>as well.<br><br>That might well be considered fine. Unlike with the possibly abstract<br>class example, this code really is a definite error.<br><br>Lex<br>_______________________________________________<br>Grace-core mailing list<br><a href="mailto:Grace-core@cecs.pdx.edu">Grace-core@cecs.pdx.edu</a><br>https://mailhost.cecs.pdx.edu/mailman/listinfo/grace-core<br></div>_______________________________________________<br>Grace-core mailing list<br><a href="mailto:Grace-core@cecs.pdx.edu">Grace-core@cecs.pdx.edu</a><br>https://mailhost.cecs.pdx.edu/mailman/listinfo/grace-core<br></blockquote></div><br></div></div></body></html>