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

Browse archivesActive forum topics 
Recent comments
41 min 27 sec ago
3 hours 36 min ago
4 hours 3 min ago
5 hours 30 min ago
11 hours 6 min ago
11 hours 36 min ago
12 hours 23 min ago
12 hours 55 min ago
14 hours 37 min ago
15 hours 27 min ago