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  4491 reads

Browse archivesActive forum topics
New forum topics

Recent comments
6 hours 9 min ago
12 hours 12 min ago
13 hours 37 min ago
13 hours 44 min ago
22 hours 54 min ago
22 hours 54 min ago
1 day 3 hours ago
1 day 3 hours ago
1 day 7 hours ago
1 day 18 hours ago