Complexity Shock Horror II: the Sequel (was Re: MD5 in erlang .)
Wed Apr 2 06:42:02 CEST 2003
On Tue, 1 Apr 2003 12:35:05 +0200 (MEST)
Marc Ernst Eddy van Woerkom <Marc.Vanwoerkom@REDACTED> wrote:
> BTW dimensional analysis
> seems to be an instance of abstract interpretation
> used in physics. :)
Yes, it does! Thanks for the links.
> > For a while I tried designing a new language around measurements.
> Last time I did numerical simulations in engineering (around 1997)
> there was still FORTRAN in use and things were moving slowly towards
> C++. The next big thing might be general use of interval arithmetics
> (where numeric types get proven error bounds annotated for all
> calculations) in the compilers (Sun is active here).
> Annotating types with units for unit type safety I have not seen as a
> big concern yet.
Errors (that is, +/- tolerance) were also taken into account in my
proof-of-concept language - although they're less important in the
digital domain (i.e. if I call a function to get the size of a file (in
bytes) I can assume the result is either 100% accurate or entirely
suspect. But for other things such as sleep durations, they may still
have a use.)
Erlang ought to be a good language in which to introduce measurements,
if for no other reason than it shares it's name with a unit of
The last time I tried introducing them, there was (justifiable)
resistance because I immediately assumed they should freely intermix
with regular data using overloaded operators.
Right now, I'm just presenting them as an ADT like any other. This is
for two reasons. First: solely as an ADT they can provide a use as Twan
pointed out, to help build applications which deal in measurements.
Second: they needn't be used directly from Erlang. A simple parser and
evaluator could be written so that they could be used as a sublanguage
(not unlike how SQL is used in many languages.) This way the
distasteful subject of operator overloading can be completely avoided -
at the cost of it only being loosely coupled. (Gotta start somewhere)
I dug up my old measurement module, cleaned it up a bit, and put it on
my website ( http://www.catseye.mb.ca/projects/measurement-+ ) and in
the Jungerl, for anyone who's curious. It could stand improvement.
Thanks to everyone for your feedback,
More information about the erlang-questions