Re: [q-lang-users] H/M-based typing for Q
Brought to you by:
agraef
From: Andrew B. <an...@vo...> - 2006-12-01 00:43:43
|
Speaking as a (only mostly) reformed ADA programmer, who cannot even = send in a bug report without mangling the script; I would love something = like perl's "use strict;" and "use warnings;" options. One thing I've always wanted from a dynamic type system is the ability = for it to run across my program and re-emit it with all the type = annotations it can figure out. This could be valuable right now to look = for typing errors, but it seems like in the case that there is a native = compiler which is going to use this information it would tell me where I = need to put type hints in order to help it optimize its output. I spent a few years looking at Smalltalk or Self type languages, and = thought that Self especially could benefit from having a bit more static = type information, but that putting it everywhere, and in every script, = was too much burden on the programmer. Just putting it where it is not = machine discoverable, and only in the performance sensitive areas of the = code seems like a better compromise. On a sort-of-but-not-quite-related theme, I've always wanted a compiler = which would re-emit the source code (with all comments retained) in some = normal form, with all the redundant parenthesis removed, and optionally = reformatted into the canonical format for that language. I think of it = as the "show me what you thought I said" mode. For C there are programs = like "indent" which do the reformatting, but to me this is better done = by the compiler, which has the advantage of having semantic information = to work from instead of just syntax. -andrew -----Original Message----- From: q-l...@li... [mailto:q-l...@li...]On Behalf Of Albert Graef Sent: Thursday, November 30, 2006 3:32 PM To: Discuss the Q language. Subject: Re: [q-lang-users] H/M-based typing for Q Yes sure, that's why Nathan's system is much more flexible than basic H/M. See http://www.cse.ucsc.edu/~nwhitehe/qt.html Don't worry, nobody wants to put on the concrete shoes of H/M over here. ;-) Q's dynamic typing is one of its distinguishing features and I certainly want it to stay that way. If someone wants something like Haskell he knows where to find it. However, it could be useful to have a tool which tries to infer as much typing information from a Q program as possible. That information could be used in a native code compiler, or to give warnings about possible typing errors in a script. Or we could have a separate program (kind of "lint" for Q) which does that job. Cheers, Albert |