<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 would propose that we require declaration of abstract methods in the core language. To me it is very much like the decision to require declarations of variables. If you want something to be recognized, it should be declared. Otherwise you get the same problem with typos as with missing variable declarations.<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 20, 2013, at 4:07 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 style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<div>
<div style="FONT-SIZE: 11pt; FONT-FAMILY: Calibri,sans-serif">The catch with that is the core language needs to support deferred. This is partly syntactic - any empty method body still nerds to be in brackets {}. If we went to layout syntax an empty body would just be empty. <br><br>But the point that - if we want to have abstract layered on top of the core, then abstract annotations can't change the syntax or semantics of correct programs. But they can of course change what is thought if as correct. The same is true if any annotation. The bet we're making is that the language will be simpler and more understandable that way<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:kim@cs.pomona.edu">Kim Bruce</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 19:26</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:kjx@ecs.vuw.ac.nz">James Noble</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:lex@lexspoon.org">Lex Spoon</a>; <a href="mailto:andrew.p.black@gmail.com">Andrew P Black</a>; <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>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="white-space: normal; border-collapse: separate; text-transform: none; word-spacing: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: normal; font-family: Helvetica; orphans: 2; widows: 2; letter-spacing: normal; text-indent: 0px; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">
<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">
<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><a href="https://mailhost.cecs.pdx.edu/mailman/listinfo/grace-core">https://mailhost.cecs.pdx.edu/mailman/listinfo/grace-core</a><br></div>_______________________________________________<br>Grace-core mailing list<br><a href="mailto:Grace-core@cecs.pdx.edu">Grace-core@cecs.pdx.edu</a><br><a href="https://mailhost.cecs.pdx.edu/mailman/listinfo/grace-core">https://mailhost.cecs.pdx.edu/mailman/listinfo/grace-core</a><br></blockquote></div><br></div></div></div></blockquote></div><br></div></body></html>