For Programmers: Free Programming Magazines  


Home > Archive > Functional > July 2007 > Re: shootout: implementing an interpreter for a simple procedural language Minim









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: shootout: implementing an interpreter for a simple procedural language Minim
Matthias Blume

2007-07-30, 7:07 pm

Rainer Joswig <joswig@lisp.de> writes:

> Say, my program needs primes as inputs. How will that be expressed in types
> other than it is an integer? In SML? In Haskell? How will it effect
> input of primes?


You can always define an abstract type of primes (whose concrete
implementation is int). The coercion from prime to int is free, the
coercion in the opposite direction requires a runtime test. While the
same runtime test is required in untyped languages as well, its
outcome will be tracked by the type system in the static case. (In
other words, you do the test only once.)

> Most domain dependent constraints on input data cannot be expressed
> as types.


Again, do you actually have experience with this?

> If SFPL has advantages for building software, then this advantage
> should be able to be demonstrated.


Oh, and it has been.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com