mutable records

Scott J, jscott@planetinternet.be
Tue, 10 Sep 2002 15:17:07 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0025_01C258DD.20593890
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Hi,

thx for this reply.

Is there any overhead using this mutable?

Are you also using Templates ?

With this mutable I can adapt a lot of software from Ocamel.

But the gnawing question remains: Shall it be possible to be almost as
efficient (in native code) as Ocamel's code, I refer here to Doug Bagley's
comparison of programming languages. Remarkably the fibonacci numbers test
scores almost as well. But the code is not the same. Comparable code would
have been to use the same code of Ocamel, to be more specific: how
efficiently is recusivity implemented in Haskell. I cannot compare this on
my Windows XP since I need MSVC6.0 on this machine which I don't have. On
the other hand I have cygwin installed now. Unfortunately I can't make
makefiles. Probably on the web I can find an explanation. In this way I can
recompile Ocamel with Cygwin and compare the results a bit.
There are also 5(?) failures of Haskell programms . Is there a flaw in these
programms?

Thx

Scott

P.S. does anyone know a good Haskell  IDE for Windows XP?
  ----- Original Message -----
  From: Iavor S. Diatchki
  Cc: haskell-cafe@haskell.org
  Sent: Monday, September 09, 2002 10:45 PM
  Subject: Re: mutable records


  hi,

  > Is it possible to define parts of a record  with the help of the *ST s*
  > monad *mutable* during the whole program? (As is possible in Ocamel)?

  you can find an example of how to do that at:
  http://icfpcontest.cse.ogi.edu/simulator/

  look inside module Robo for example.  there you will find examples of
  records with mutable fields and some useful functions to manipulate
  them.  the state of the "objects" is not hidden so it is available for
  anyone to modify.  to hide the state you could use fancy types as people
  already pointed out, or you could use the Haskell module system.
  unfortunatelly with the Haskell module system approach you soon run into
  recursive modules (when objects depend on each other) and this is not
  well supported by Haskell implementations at the moment.

  bye
  iavor

  --
  ==================================================
  | Iavor S. Diatchki, Ph.D. student               |
  | Department of Computer Science and Engineering |
  | School of OGI at OHSU                          |
  | http://www.cse.ogi.edu/~diatchki               |
  ==================================================

  _______________________________________________
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe


------=_NextPart_000_0025_01C258DD.20593890
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2719.2200" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thx for this reply. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Is there any overhead using this=20
mutable?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Are you also using Templates =
?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>With this mutable I can adapt a lot of =
software=20
from Ocamel.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>But the gnawing question remains: Shall =
it be=20
possible to be almost as efficient (in native code) as Ocamel's code, I =
refer=20
here to Doug Bagley's comparison of programming languages. Remarkably =
the=20
fibonacci numbers test scores almost as well. But the code is not the =
same.=20
Comparable code would have been to use the same code of Ocamel, to be =
more=20
specific: how efficiently is recusivity implemented in Haskell. I cannot =
compare=20
this on my Windows XP since I need MSVC6.0 on this machine which I don't =
have.=20
On the other hand I have cygwin installed now. Unfortunately I can't =
make=20
makefiles. Probably on the web I can find an explanation. In this way I =
can=20
recompile Ocamel with Cygwin and compare the results a bit.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>There are also 5(?) failures of Haskell =
programms .=20
Is there a flaw in these programms?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thx</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Scott</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>P.S. does anyone know a good =
Haskell&nbsp; IDE for=20
Windows XP?</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Ddiatchki@cse.ogi.edu =
href=3D"mailto:diatchki@cse.ogi.edu">Iavor S.=20
  Diatchki</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Cc:</B> <A =
title=3Dhaskell-cafe@haskell.org=20
  href=3D"mailto:haskell-cafe@haskell.org">haskell-cafe@haskell.org</A> =
</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Monday, September 09, =
2002 10:45=20
  PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: mutable =
records</DIV>
  <DIV><BR></DIV>hi,<BR><BR>&gt; Is it possible to define parts of a=20
  record&nbsp; with the help of the *ST s* <BR>&gt; monad *mutable* =
during the=20
  whole program? (As is possible in Ocamel)?<BR><BR>you can find an =
example of=20
  how to do that at:<BR><A=20
  =
href=3D"http://icfpcontest.cse.ogi.edu/simulator/">http://icfpcontest.cse=
.ogi.edu/simulator/</A><BR><BR>look=20
  inside module Robo for example.&nbsp; there you will find examples of=20
  <BR>records with mutable fields and some useful functions to =
manipulate=20
  <BR>them.&nbsp; the state of the "objects" is not hidden so it is =
available=20
  for <BR>anyone to modify.&nbsp; to hide the state you could use fancy =
types as=20
  people <BR>already pointed out, or you could use the Haskell module =
system.=20
  <BR>unfortunatelly with the Haskell module system approach you soon =
run into=20
  <BR>recursive modules (when objects depend on each other) and this is =
not=20
  <BR>well supported by Haskell implementations at the=20
  moment.<BR><BR>bye<BR>iavor<BR><BR>--=20
  =
<BR>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D<BR>| Iavor S. Diatchki,=20
  Ph.D.=20
  =
student&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;=20
  |<BR>| Department of Computer Science and Engineering |<BR>| School of =
OGI at=20
  =
OHSU&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;=20
  |<BR>| <A=20
  =
href=3D"http://www.cse.ogi.edu/~diatchki">http://www.cse.ogi.edu/~diatchk=
i</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;=20
  =
|<BR>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D<BR><BR>_______________________________________________<BR>Haskell-=
Cafe=20
  mailing list<BR><A=20
  =
href=3D"mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</A><BR>=
<A=20
  =
href=3D"http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.=
haskell.org/mailman/listinfo/haskell-cafe</A><BR></BLOCKQUOTE></BODY></HT=
ML>

------=_NextPart_000_0025_01C258DD.20593890--