Dynamics 0.2.htm 29.2 KB
Newer Older
Ronny Wichers Schreur's avatar
Ronny Wichers Schreur committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 10">
<meta name=Originator content="Microsoft Word 10">
<link rel=File-List href="Dynamics%200.2_files/filelist.xml">
<title>INTRODUCTION</title>
<!--[if gte mso 9]><xml>
 <o:DocumentProperties>
  <o:Author>Martijn Vervoort</o:Author>
  <o:LastAuthor>Martijn Vervoort</o:LastAuthor>
  <o:Revision>2</o:Revision>
  <o:TotalTime>592</o:TotalTime>
  <o:LastPrinted>2002-11-21T11:48:00Z</o:LastPrinted>
  <o:Created>2002-11-21T13:00:00Z</o:Created>
  <o:LastSaved>2002-11-21T13:00:00Z</o:LastSaved>
  <o:Pages>1</o:Pages>
  <o:Words>1463</o:Words>
  <o:Characters>8051</o:Characters>
  <o:Company>KUN</o:Company>
  <o:Lines>67</o:Lines>
  <o:Paragraphs>18</o:Paragraphs>
  <o:CharactersWithSpaces>9496</o:CharactersWithSpaces>
  <o:Version>10.2625</o:Version>
 </o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;
	mso-font-charset:2;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:0 268435456 0 0 -2147483648 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	mso-ansi-language:EN-GB;
	mso-fareast-language:EN-US;}
h1
	{mso-style-next:Normal;
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:1;
	font-size:16.0pt;
	mso-bidi-font-size:12.0pt;
	font-family:"Times New Roman";
	mso-font-kerning:0pt;
	mso-ansi-language:EN-GB;
	mso-fareast-language:EN-US;}
h2
	{mso-style-next:Normal;
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:2;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-ansi-language:EN-GB;
	mso-fareast-language:EN-US;
	font-weight:normal;
	text-decoration:underline;
	text-underline:single;}
h3
	{mso-style-next:Normal;
	margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:3;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-ansi-language:EN-GB;
	mso-fareast-language:EN-US;
	text-decoration:underline;
	text-underline:single;}
h4
	{mso-style-next:Normal;
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	page-break-after:avoid;
	mso-outline-level:4;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-ansi-language:EN-GB;
	mso-fareast-language:EN-US;
	text-decoration:underline;
	text-underline:single;}
p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
	{margin:0cm;
	margin-bottom:.0001pt;
	text-align:justify;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	mso-ansi-language:EN-GB;
	mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:70.85pt 70.85pt 70.85pt 70.85pt;
	mso-header-margin:35.4pt;
	mso-footer-margin:35.4pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 @list l0
	{mso-list-id:410353114;
	mso-list-type:hybrid;
	mso-list-template-ids:142630634 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
	{mso-level-start-at:0;
	mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:Symbol;
	mso-fareast-font-family:"Times New Roman";
	mso-bidi-font-family:"Times New Roman";}
@list l1
	{mso-list-id:548955436;
	mso-list-type:hybrid;
	mso-list-template-ids:797876306 68354049 68354051 68354053 68354049 68354051 68354053 68354049 68354051 68354053;}
@list l1:level1
	{mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:Symbol;}
@list l2
	{mso-list-id:847981818;
	mso-list-type:hybrid;
	mso-list-template-ids:1840513396 1093539782 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l2:level1
	{mso-level-start-at:0;
	mso-level-number-format:bullet;
	mso-level-text:\F0E8;
	mso-level-tab-stop:162.0pt;
	mso-level-number-position:left;
	margin-left:162.0pt;
	text-indent:-18.0pt;
	font-family:Wingdings;
	mso-fareast-font-family:"Times New Roman";
	mso-bidi-font-family:"Times New Roman";}
@list l3
	{mso-list-id:929895108;
	mso-list-type:hybrid;
	mso-list-template-ids:-1195365726 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l3:level1
	{mso-level-start-at:0;
	mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:Symbol;
	mso-fareast-font-family:"Times New Roman";
	mso-bidi-font-family:"Times New Roman";}
@list l4
	{mso-list-id:1672023976;
	mso-list-type:hybrid;
	mso-list-template-ids:-701698224 -1978352540 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l4:level1
	{mso-level-number-format:bullet;
	mso-level-text:-;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
@list l5
	{mso-list-id:2125229295;
	mso-list-type:hybrid;
	mso-list-template-ids:494161696 68354049 68354051 68354053 68354049 68354051 68354053 68354049 68354051 68354053;}
@list l5:level1
	{mso-level-start-at:0;
	mso-level-number-format:bullet;
	mso-level-text:\F0B7;
	mso-level-tab-stop:36.0pt;
	mso-level-number-position:left;
	text-indent:-18.0pt;
	font-family:Symbol;
	mso-fareast-font-family:"Times New Roman";
	mso-bidi-font-family:"Times New Roman";}
ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";}
</style>
<![endif]-->
</head>

<body lang=NL link=blue vlink=purple style='tab-interval:36.0pt'>

<div class=Section1>

<h1 style='text-align:justify'><span lang=EN-GB style='font-size:20.0pt;
mso-bidi-font-size:12.0pt;font-weight:normal'>Dynamics 0.2 (21<sup>th</sup> of November
2002)<o:p></o:p></span></h1>

<p class=MsoNormal><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><u><span lang=EN-GB>Changes<o:p></o:p></span></u></b></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='text-align:justify;mso-list:l5 level1 lfo5;
     tab-stops:list 36.0pt'><span lang=EN-GB>A lot of bugs have been fixed. The
     basic implementation is now being debugged.</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l5 level1 lfo5;
     tab-stops:list 36.0pt'><span lang=EN-GB>Polymorphic dynamics are allowed.
     For example and more information, please refer to the reference manual and
     the Unify-folder within the examples folder.</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l5 level1 lfo5;
     tab-stops:list 36.0pt'><span lang=EN-GB>Support for type synonyms</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l5 level1 lfo5;
     tab-stops:list 36.0pt'><span lang=EN-GB>Object IO support</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l5 level1 lfo5;
     tab-stops:list 36.0pt'><span lang=EN-GB>Various small bug fixes and
     changes </span></li>
</ul>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><u><span lang=EN-GB>Changes
(Dynamics 0.1, 25<sup>th</sup> of June 2002) <o:p></o:p></span></u></b></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='mso-list:l5 level1 lfo5;tab-stops:list 36.0pt'><span
     lang=EN-GB>A lot of bugs have been fixed. The basic implementation is now
     being debugged.</span></li>
 <li class=MsoNormal style='mso-list:l5 level1 lfo5;tab-stops:list 36.0pt'><span
     lang=EN-GB>More support for lazy dynamics by eliminating the three former
     restrictions in the section about Dynamic Pattern matches.</span></li>
 <li class=MsoNormal style='mso-list:l5 level1 lfo5;tab-stops:list 36.0pt'><span
     lang=EN-GB>Garbage collection on dynamics and their libraries.</span></li>
 <li class=MsoNormal style='mso-list:l5 level1 lfo5;tab-stops:list 36.0pt'><span
     lang=EN-GB>Dynamics now have (nearly) unique identifications which mean
     that they can move them as you wish.</span></li>
</ul>

<p class=MsoNormal><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<h4><span lang=EN-GB>Install</span></h4>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='mso-list:l3 level1 lfo4;tab-stops:list 36.0pt'><span
     lang=EN-GB>Unpack the dynamic-package in the root of the already unpacked
     Clean base distribution.</span></li>
 <li class=MsoNormal style='mso-list:l3 level1 lfo4;tab-stops:list 36.0pt'><span
     lang=EN-GB>Move the dynamic link libraries DynamicLink.dll and
     ServerChannel.dll to your Windows-system directory.</span></li>
 <li class=MsoNormal style='mso-list:l3 level1 lfo4;tab-stops:list 36.0pt'><span
     lang=EN-GB>Enter the proper path names for the dynamic projects by
     changing the definition of the p-function in the where clause of the
     Start-rule. Do not forget that slashes need to be escaped by putting
     another slash in front.</span></li>
 <li class=MsoNormal style='mso-list:l3 level1 lfo4;tab-stops:list 36.0pt'><span
     lang=EN-GB>If you installed Dynamics 0.{0,1} and you want to use
     dumpDynamic on your dynamic, then delete HKEY_CLASSES_ROOT\prjfile\Shell\dynamic
     link-key.</span></li>
</ul>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<h2 style='text-align:justify'><b><span lang=EN-GB>Introduction<o:p></o:p></span></b></h2>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>Dynamics are
still under development. It is therefore important to note that dynamics are
released for experiments only. Please re-read the last sentence.</span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>At least the
following restrictions apply:</span></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>Unsupported release. It is mainly
     intended for small experiments and to satisfy the curiosity.</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>Overloaded types, unique types,
     universally quantified types, existentially quantified types, abstract
     types cannot be packed and/or unpacked.</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>For the time being, windows only.
     It has been tested on windows 95/98. It has also been run under windows
     2000/XP.</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>Binary compatibility is not
     guaranteed i.e. you may need to recompile every dynamic when a next
     release occurs. To be sure delete and recompile your old dynamics.</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>Lazy dynamics i.e. a dynamic
     containing at least one reference into another different dynamic are not
     fully implemented.</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>Probably a lot of small bugs. </span></li>
</ul>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>However algebraic,
record, function and array typed objects can be safely packed and/or unpacked.</span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>The rest of this
text is a practical guide on using dynamics and its supporting tools. </span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<h3><span lang=EN-GB>Short introduction to dynamics</span></h3>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>A dynamic (of
static type <b>Dynamic)</b> consists of:</span></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>a value i.e. dynamic expression</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>the static type of the value i.e.
     dynamic type.</span></li>
</ul>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoBodyText><span lang=EN-GB>Basic operations on dynamics:</span></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>packing an object into a dynamic
     by using the <b>dynamic</b>-keyword.</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>unpacking an object from a dynamic
     by using a dynamic pattern match.</span></li>
</ul>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>In addition
there are type dependent functions i.e. the context determines the type of the
packed object.</span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>Please see the
Examples-folder for concrete syntax and examples.</span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<h3><span lang=EN-GB>Creating a dynamic project</span></h3>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>In addition to
the normal procedure to create a new Clean project:</span></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>Use an environment containing a
     Clean 2.0 compiler.</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>Mark it as the project as a
     dynamic project by marking Enable Dynamics in the Project Options-menu
     of CleanIDE.</span></li>
</ul>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<h3><span lang=EN-GB>Creating a dynamic</span></h3>

<p class=MsoNormal><span lang=EN-GB>A dynamic is created using the following
syntax:</span></p>

<p class=MsoNormal><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-GB><span style='mso-tab-count:1'> </span>dynamic
&lt;an arbitrarily Clean object&gt; :: &lt;external type&gt;</span></p>

<p class=MsoNormal><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoBodyText><span lang=EN-GB>Eventually most typed Clean objects can
be injected into a dynamic. Only for some objects e.g. World, File,  natural
restrictions will apply.</span></p>

<p class=MsoBodyText><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoBodyText><span lang=EN-GB>The external type of a dynamic is the
static type of the object injected into the dynamic. The internal type of a
dynamic are the types of all objects which help to create an object of the
external type. </span></p>

<p class=MsoBodyText><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoBodyText><span lang=EN-GB>An example (Clean fragment):</span></p>

<p class=MsoBodyText><span lang=EN-GB>dynamic (length [a,b,c]) :: Int</span></p>

<p class=MsoBodyText><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>The current
implementation need not perform the rather costly internal type check because
it is done at compile-time and the use of code repositories preserves the
validity of the compile-time check.</span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<h3><span lang=EN-GB>Building a dynamic project</span></h3>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>After a dynamic
project has been compiled and linked without errors, the static linker has
created:</span></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>a type and code repository. In
     contrast to an executable, a code repository contains symbolic definitions
     and references.</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>a batch-file to start the project
     from the code repository.</span></li>
</ul>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>Only the
batch-file is visible for the user and it replaces the executable that would
normally be generated by the linker.</span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>The code and
type repositories for the dynamic project have been stored in the
libraries-subfolder of the dynamic linker folder which has been set in the
Clean IDE.</span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<h4 style='text-align:justify'><span lang=EN-GB>Starting a dynamic project</span></h4>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>There are two
ways to start a dynamic project:</span></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>using the normal Run-option<span
     style='mso-spacerun:yes'> </span>of the Clean IDE which uses the
     batch-file to start the project.</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>clicking on the generated
     batch-file.</span></li>
</ul>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoBodyText><span lang=EN-GB>The batch-file starts the dynamic linker
by giving it the code repository for the dynamic application. The dynamic
linker then starts the application at its normal entry point. </span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<h3><span lang=EN-GB>Writing a dynamic using writeDynamic </span></h3>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>Each object in
Clean conceptually is a graph rewriting system. The graph at run-time consists
of:</span></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>a data graph i.e. that part of the
     graph containing constructors which is actually built at run-time.</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>descriptors which reference code
     for functions which implicitly rewrite the graph according to the
     reduction strategy.</span></li>
</ul>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoBodyText><span lang=EN-GB>In order to encode a dynamic e.g. write
it to disk the above components of the run-time graph need to be encoded:</span></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>the data graph is encoded using a
     top-down, left-to-right traversal.</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>a descriptors is encoded as: its
     code repository name, its module name and the descriptor name itself. </span></li>
</ul>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>In addition lazy
dynamics are supported. The dynamic version of the standard apply-function (see
also Examples-folder) creates references to other dynamics. These references
can be viewed using the dumpDynamic-tool. At run-time only those pieces of the
dynamic are constructed which are actually needed. This improves efficiency.</span></p>

<h3><span lang=EN-GB><o:p><span style='text-decoration:none'>&nbsp;</span></o:p></span></h3>

<h3><span lang=EN-GB>Reading a dynamic using readDynamic</span><span
lang=EN-GB style='font-weight:normal;mso-bidi-font-weight:bold;text-decoration:
none;text-underline:none'><o:p></o:p></span></h3>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>An object packed
into a dynamic on disk can be retrieved using the readDynamic-function. This
function converts the disk representation of a dynamic to its run-time
representation. The necessary functions are linked by a dynamic linker. As said
the retrieval of dynamic happens in pieces to increase efficiency.<o:p></o:p></span></p>

<h3><span lang=EN-GB><o:p><span style='text-decoration:none'>&nbsp;</span></o:p></span></h3>

<h3><span lang=EN-GB>Dynamic pattern matches</span></h3>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>A dynamic
pattern is transformed into the following actions that are performed in the
order of enumeration:</span></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>Unification of the dynamic pattern
     and type component in a dynamic. The unification of a variable with
     another variable or a type constructor name will always succeed. In case
     of two type constructor names, their names must be the same. The dynamic
     library implements the unification.</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>A type definition check for
     equally named type constructors. The dynamic linker implements the
     definition check and processes its results even further.</span></li>
</ul>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>Two type
constructors are considered equal if their implementations are syntactically
exactly the same modulo alpha-conversion. In case of an algebraic data-type the
constructor order is insignificant.</span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>The multiple
occurrence of a type pattern variable on the left hand side of a function
definition can be views as a means to do unification between different
dynamics. </span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><span
style='mso-spacerun:yes'></span></span></p>

<p class=MsoNormal style='text-align:justify'><b style='mso-bidi-font-weight:
normal'><u><span lang=EN-GB>Garbage collection for dynamics and libraries<o:p></o:p></span></u></b></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>The garbage
collector collects dynamics and libraries starting from some root mentioned on
the first line of the rootDir.txt-file in your Dynamics 0.1-folder. Only a
single root can be handled at the moment. You need to adapt the path for your
machine. The garbage collector itself is in the utilities folder.</span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-align:justify'><b style='mso-bidi-font-weight:
normal'><u><span lang=EN-GB>Practical tips<o:p></o:p></span></u></b></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB>Some practical
tips are given below:</span></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>There is a bug in the up-to-date
     cycle in the CleanIDE. Try a force recompile by shift+control+U on your
     dynamic projects.</span></li>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB>Dont mix different releases
     because they are binary incompatible.</span></li>
</ul>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<h3><span lang=EN-GB>Further references</span></h3>

<p class=MsoBodyText><span lang=EN-GB>From the paper-page (<a
href="http://www.cs.kun.nl/st/Onderzoek/Publicaties/publicaties.html">http://www.cs.kun.nl/st/Onderzoek/Publicaties/publicaties.html</a>):</span></p>

<p class=MsoBodyText><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoBodyText><b style='mso-bidi-font-weight:normal'><span lang=EN-GB>Papers
about dynamics:<o:p></o:p></span></b></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB><a
     href="ftp://ftp.cs.kun.nl/pub/Clean/papers/2002/verm2002-LazyDynamicIO2.pdf">ftp://ftp.cs.kun.nl/pub/Clean/papers/2002/verm2002-LazyDynamicIO2.pdf</a>
     </span></li>
</ul>

<p class=MsoNormal style='margin-left:36.0pt;text-align:justify'><span
lang=EN-GB>This paper describes the Input/Output of dynamics. This is called
dynamic I/O. It illustrates the most interesting problems and their solutions
to realize dynamic I/O.</span></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB><a
     href="ftp://ftp.cs.kun.nl/pub/Clean/papers/1999/pilm99-DynTypesIFL98.ps.gz">ftp://ftp.cs.kun.nl/pub/Clean/papers/1999/pilm99-DynTypesIFL98.ps.gz</a>
     </span></li>
</ul>

<p class=MsoNormal style='margin-left:36.0pt;text-align:justify'><span
lang=EN-GB>This paper describes type dependent functions. A type dependent
function can be use to enforce the static type context of the function upon a
dynamic.</span></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='text-align:justify;mso-list:l0 level1 lfo1;
     tab-stops:list 36.0pt'><span lang=EN-GB><a
     href="ftp://ftp.cs.kun.nl/pub/Clean/papers/1997/pilm97-FstClassIOIFL.96.ps.gz">ftp://ftp.cs.kun.nl/pub/Clean/papers/1997/pilm97-FstClassIOIFL.96.ps.gz</a></span></li>
</ul>

<p class=MsoNormal style='margin-left:36.0pt;text-align:justify'><span
lang=EN-GB>This paper introduces the notion of a dynamic and its two basic
operations for the lazy functional programming language Clean.</span></p>

<p class=MsoNormal style='text-align:justify'><span lang=EN-GB><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-align:justify'><b style='mso-bidi-font-weight:
normal'><span lang=EN-GB>Papers about the applications of dynamics:</span></b><span
lang=EN-GB><o:p></o:p></span></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='text-align:justify;mso-list:l1 level1 lfo6;
     tab-stops:list 36.0pt'><span lang=EN-GB><a
     href="ftp://ftp.cs.kun.nl/pub/Clean/papers/2002/achp2002-GenericDynamics2.pdf">ftp://ftp.cs.kun.nl/pub/Clean/papers/2002/achp2002-GenericDynamics2.pdf</a><o:p></o:p></span></li>
</ul>

<p class=MsoNormal style='margin-left:36.0pt;text-align:justify'><span
lang=EN-GB>This paper describes the combination of dynamics and generics. The
combination allows writing pretty printers and parser for dynamic in an easy
way.<o:p></o:p></span></p>

<ul style='margin-top:0cm' type=disc>
 <li class=MsoNormal style='text-align:justify;mso-list:l1 level1 lfo6;
     tab-stops:list 36.0pt'><span lang=EN-GB><a
     href="ftp://ftp.cs.kun.nl/pub/Clean/papers/2002/vWeA2002StronglyTypedOS.pdf">ftp://ftp.cs.kun.nl/pub/Clean/papers/2002/vWeA2002StronglyTypedOS.pdf</a></span></li>
</ul>

<p class=MsoNormal style='margin-left:36.0pt;text-align:justify'><span
lang=EN-GB>This paper describes a first step towards an operating system
written using Clean. It intensively uses dynamics.<o:p></o:p></span></p>

</div>

</body>

</html>