ARCH=`uname` export PATH=/home/amulinks/lard/v5/$ARCH/bin:$PATH export LDB_SRC_DIR=/home/amulinks/lard/v5/ldb export LCD_OPTS="-L/home/amulinks/lard/v5/$ARCH/lib -L. -lio"N.B. those are supposed to be back-ticks around uname - does anyone know how to make them come out properly in HTML?
In this version each source file is compiled separately into a .bcode file, and these .bcode files are then linked to form the executable. This greatly speeds compilation when only a few of the source files have changed. Please see the new lcd documentation for details.
In addition to the speed increase resulting from separate compilation, new more efficient symbol table handling in the compiler and assembler help further increase performance.
An improved scheduler means that run-time performance is significantly improved. If you have written code that makes explicit calls to yield or spawn you will have to alter it to work with the new scheduler. If your code makes extensive use of wait_until you may not get the full benefit of the improvements; please check with me for details.
Changes to the memory allocation mechanism in the interpretter mean that simulations should use substantially less memory, increasing performance on most machines.
SunOS and Linux versions of the tools are now installed. If you set your path and library directory using uname as described above you will pick up the version appropriate for the machine you are using. The AMULET PCs fred and jim are somewhat faster than Suns at running LARD simulations but compile more slowly due to their poor NFS performance.
Note that because PCs and Suns have different endianness bcode files are not portable from one to the other.
I have at last implemented a proper top-down recursive descent parser for infix expressions. This should mean that you need parentheses only in the places where you would need parentheses or braces in C. I fear that some expressions may defeat the parser's optimisations and prove rather slow - please let me know if you come across any code that causes long or infinite compile times.
The standard language now includes case statements. The following example shows the syntax:
print ( case i when 0 => "zero" when 1 => "one" when 2 => "two" default "very many" );If there is no default label then a run-time error occurs if the expression doesn't match any of the labels. At present there is no way of specifying don't care values or ranges in the labels - this will come later.
There is currently a limit of 20 labels in a case statement. Let me know if you want more.
printhex and fprinthex are now built in to the io library. Using these functions will be significantly faster than using your own.
The improvements to the parser have allowed me to implement a better syntax for the vector constructor functions; commas should be used in place of colons to separate the elements. For example
[ 10 : 20 : a+1 ]should be replaced by
[ 10 , 20 , a+1 ]There is currently a limit of 20 elements in a vector constructor (though the number of elements in a vector variable is unlimited). Let me know if you want more.
A set of record constructor functions has been introduced with similar syntax to the vector constructors above. Because the constructor returns an "anonymous" record it will normally be necessary to cast the result; here is a short example:
T:type=record(a::int,b::bool). foo:var(T). foo:=cast(T,{100,1>3})There is currently a limit of 20 elements in a record constructor. Let me know if you want more.
One of the most common causes of run-time errors is forgetting to call init_chan for every channel. To help detect this there is now a modified version of the channels library that uses magic numbers to try and spot accesses to uninitialised channels. To enable this checking, compile with -lchannels_chk rather than -lchannels. There is a time penalty in performing the checking so don't use this for "production" simulations. Also note that the magic number mechanism is not infalible.
In conjunction with changes to the channel viewer in ldb the syntax of init_chan has changed. For a channel that you will never want to view write
init_chan(C)For a channel that you do or may want to view, write
init_chan(C,"Meaningful name")
Thanks to Oleg we now have a psuedo-random number generator that gives the same results on all platforms.
The maximum number of fields in a record has been increased to 64. Let me know if you want more.
The online documentation now has an experimental keyword search facility.
A simlple test coverage utility, lcov, has been added. This reports unreached functions, expressions and types.
Miscellaneous bug fixes in the compiler and interpretter.
I have made a number of improvements to ldb. It is now possible to save and restore the layout of the time view window and to specify formats (sprintf style) for the displayed data. Further improvements to ldb will be the main theme of the next release and these changes are not yet documented (though there is an example of the formatting in the tutorial). Please ask for a demo if it is not intuitive!
The documentation for the standard library has been overhauled, and the tutorial has been extended. There is also some new material about defining infix functions and the operation of the scheduler. I am keen to get feedback from you about what sort of documentation is needed - writing it is time-consuming and I want to know that it is useful! I would be particularly grateful for contributions of short bits of code for tutorial examples.
(foo(T:type):expr(T)=foo(T)).null