On 21 Apr., 17:44, "Auric__" <not.my.r...@[EMAIL PROTECTED]
> wrote:
> On Mon, 21 Apr 2008 14:26:57 GMT, wrote:
> > On 14 Apr., 17:55, "Auric__" <not.my.r...@[EMAIL PROTECTED]
> wrote:
> >> On Sun, 13 Apr 2008 11:08:56 GMT, wrote:
> >> > On 11 Apr., 18:30, "Auric__" <not.my.r...@[EMAIL PROTECTED]
> wrote:
> >> >> INSTALLING:
> >> >> The compile had no errors, but lots of warnings -- maybe double
> >> >> the last time. The previous warnings were all complaints about
> >> >> type casting; they're still there but this one added
> >> >> "'variablename' is declared but not used" and "'variablename'
> >> >> may be used uninitialized". [shrug]
>
> >> > Interestingly gcc is not able to recognize when the states of
> >> > two variables are connected. Such as a global fail_flag variable
> >> > and a local condition variable (cond). The connection is: As
> >> > long as fail_flag is FALSE the cond variable is initialised.
> >> > When the fail_flag is TRUE the cond variable is not used and
> >> > therefore it could be in an uninitialized state. At several
> >> > places I use such connected variable states which are not
> >> > recognized by the gcc optimizer and are therefore flagged with a
> >> > warning. I accept such warnings in performance critical paths. I
> >> > am not willing to do "unnecessary" initialisations in
> >> > performance critical paths of the program. At places that are
> >> > not performance critical I do some of this "unnecessary"
> >> > initialisations just to avoid such warnings. OTOH I was able to
> >> > remove some of this "may be used uninitialized" messages by
> >> > reordering program code.
>
> >> As I've said, I'm not much of a C-family programmer. [shrug]
>
> > This is ok.The Seed7 package should not require too much
> > C knowledge. Sorry for the delay in my response. I was
> > busy doing the next release. This time I was not able
> > to add something to the Bas7 interpreter, sorry for that.
> > But at least I added a chapter about C compiler warnings
> > to the file seed7/src/read_me.txt . BTW.: Instead of
> > improvements for Bas7, several improvements were done to
> > sup****t bigInteger's better. Really big integers with
> > unlimited precision. Well, unlimited as long as you do not
> > run out of memory. Some small programs which compute PI to
> > 1000 digits were also added.
>
> That's interesting. How'd you do the bigints?
If you want to know how bigints are implemented:
Essentially they are arrays of bigdigits. A bigdigit is a 32 bit
unsigned value (my library can also work with 8 and 16 bit
bigdigits, but it is preset to use 32 bit bigdigits since they
provide the best performance). The first element in the array is the
least significant bigdigit and the last element in the array is the
most significant bigdigit. The basic arithmetic operations for (add,
subtract, multiply and divide) are done with the same principles you
learned in the school for the decimal system. Just instead of digits
between 0 and 9 as you learned in school there are digits between 0
and 2 ** 32 - 1. For negative values the two's complement
representation is used. If you want to know the sign of a number
just look at the higest bit in the most significant bigdigit.
Leading zero bigdigits and bigdigits with all bits sets are ommitted
if the next bigdigit has the correct sign. The library also manages
the memory used for the bigdigit arrays. A description of how to
implement big integer operations can also be found in Knuth's
The art of computer programming / Part 2 - seminumerical algorithms.
If you want to know how bigints are used in Seed7:
To enable the bigInteger sup****t the library "bigint.s7i" needs to
be included. The literals of the type bigInteger have an undersocre
(_) at the end. E.g. 1_ is the bigInteger literal for 1. The type
bigInteger can just be used as any other type. You can just write
something like 'write(2_**1000 - 1_);'. The bigInteger operations
are described here:
http://seed7.sourceforge.net/manual/types.htm#bigInteger
The current release contains example programs (printpi1 and
printpi2) which use the type bigInteger.
> >> >> The BASIC programs all run a bit slow. (I can't recall if this
> >> >> was happening in the previous version; I was mostly looking to
> >> >> see if they worked at all.) I chalk it up to the fact that the
> >> >> interpreter is itself interpreted, but you may want to check
> >> >> for yourself.
>
> >> > Yes, if you call Bas7 with './hi bas7 myProg', the Bas7
> >> > interpreter is itself interpreted. That way you have two levels
> >> > of interpretation. But it is also possible to compile the Bas7
> >> > interpreter with './hi comp bas7' in the seed7/prg directory.
> >> > This should produce a bas7 executable which can be used to
> >> > execute basic programs with './bas7 myProg'.
>
> >> I never noticed that. I'll try it tonight or so.
>
> > Did you do tests with the compiled Bas7 interpreter?
>
> Sorry, no. Last week was a little bit of hell for me; I didn't get
> much of anything done. If I can keep my eyes open tonight, I'll try
> it, but no promises.
Ok.
> >> >> Also, text-mode colors still aren't there. (I realize they're
> >> >> probably pretty low on the todo list.) *This* is what I meant
> >> >> last time by "no colors". (I ran a BASIC program that "tests"
> >> >> VGA colors.)
>
> >> > The text colors work in graphic windows (but there are lots of
> >> > other problems with graphic windows). The solution I plan for
> >> > text colors is to have always graphic windows (also for text
> >> > only programs). That way it would not be necessary to improve my
> >> > console (screen) driver to work with colors.
>
> >> Not for me. I tried a few different BASIC color toys under plain
> >> terminal (no X), xterm, Konsole, and GNOME Terminal. I'll send
> >> them to you tomorrow so you can see if it's just me.
>
> > I am looking forward for them
>
> I'll try to remember to bring them tomorrow -- but again, no promises.
>
> >> >> I haven't tried any actual graphical programs, but then, I
> >> >> don't think that I have any with line numbers...
>
> >> > Bas7 can also execute basic programs without line numbers.
> >> > It has also sup****t for various features of QBasic (DO, SELECT,
> >> > structured IF, ...). Several im****tant features of QBasic are
> >> > currently not sup****ted with Bas7: Subprograms and functions
> >> > with parameters (subprograms without parameters work), user
> >> > defined types, common blocks... I do not want to advertise the
> >> > features of QBasic that Bas7 sup****ts, until more of them work.
>
> >> I'll try some of the demos I wrote (they're all pretty simple) and
> >> let you know.
>
> > Ok.
>
> As long as bas7 sup****ts something resembling QBASIC's SCREEN 12, they
> *should* work. As with everything else, I'll try to test tonight, but
> no promises.
There is a SCREEN 12 mode, but text and graphics of this and other
graphic modes may not fit together.
Greetings Thomas Mertes
Seed7 Homepage: http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch, statically typed,
interpreted or compiled, ****table, runs under linux/unix/windows.


|