User loginNavigation 
Static Types vs. Partially Evaluated Latent TypesHere's a question I've promoted from another thread (sorry for the multiple postings). What's the difference between static type inference (like in Haskell) and a latent (tagged) type system (think Scheme) with a real good partial evaluator? In the typeinference situation, we're using unification to solve a set of constraints. If there's no solution, we give up and say the program was illtyped. On the other hand, it seems like tag checking code in a latently typed lanugage would be a good candidate to get partially evaluated away at compile time. For example it seems like... ;; typed values are really pairs of values and types ;; e.g. (123 . 'number) ;; ("abc" . 'string) (define (isnumber n) (eq? (cdr n) 'number)) (define (add arg1 arg2) (if (and (isnumber arg1) (isnumber arg2)) (machineadd (car arg1) (car arg2)) (error "not a number"))) (add '(4 . number) '(5 . number))...should be easily changed into... (machindadd 4 5)... And after we're done partially evaluating our source, if we still have left over typecheck predicates like 'isnumber' in the code then we again declare that the program is illtyped. Are the two methods comparable in any way? Is one method more powerful than the other, or are they somehow duals of each other? Are there any papers available discussing this?
Anton van Straaten recommends looking at a previous typing thread, and the paper Types as Abstract Interpretations, as well as a posting of his to the LL mailing list. Any futher thoughts? By Greg Buchholz at 20050623 20:41  LtU Forum  previous forum topic  next forum topic  other blogs  4859 reads

Browse archivesActive forum topics 
Recent comments
1 hour 53 min ago
2 hours 47 min ago
3 hours 16 min ago
3 hours 24 min ago
3 hours 46 min ago
3 hours 47 min ago
3 hours 49 min ago
7 hours 21 min ago
7 hours 40 min ago
7 hours 56 min ago