The arithmetic operations now all default to 64bit doubles.
All features for Minimal BASIC have been implemented. All the NBS tests I have are passing. I shook out a few remaining bugs in handling of spaces, READ/DATA, and INPUT and no known bugs exist at this time. The emphasis of the project will now switch to more rigorous testing to verify the feature for which I cannot get the NBS tests sources.
The new INPUT subsystem has been written, and after some hard work all KNOWN bugs are gone, and the NBS tests for INPUT that I have all pass. If you have a copy of NBS MinimalBASIC test #109, I'd love a copy - that's the one INPUT test I don't have.
All known numeric formatting problems are fixed. I have entered all the NBS tests that I could find, and many of them pass now. The last remaining major feature is complete support for INPUT according to the ECMA55 standard, and work will begin on that next. Note that there is a bug in EXP() for negative value that I still haven't managed to fix yet. Otherwise, most genuine Minimal BASIC programs that do not use INPUT should work now.... read more
I have switched to using David M. Gay's dtoa and g_fmt routines and this has helped a lot towards getting NBS tests 9 and 10 to pass. I still haven't fixed output for things like .000022 (I get 2.2E-5) but decided to go ahead and commit what I have since it's a big improvement. The code I used before wasn't "wrong" but I just was not able to make it output in the admittedly peculiar way I need for this project.... read more
I learned that the exception flags in the MXCSR are 'sticky' and must be reset if you want to continue after detecting an exception. The binary_add, binary_subtract, binary_multiply, and binary_divide macros have been updated for this. I also learned that 0/0 does NOT give a divide by zero exception, but instead gives an Invalid Exception so I had to update binary_divide for that.
I have fixed the code generation so that a divide by zero or an arithmetic overflow on binary add, subtract, divide, or multiply will print an execption, then substitute the appropriately signed infinity and continue as required by section 8.6 of ECMA-55.
I'm happy to report that user-defined functions now work.
Well, after several days of difficult debugging, I got READ working. Minimal BASIC requires that any data can be read into a string variable, and that any string that can be converted to anumber can be read into a numeric variable, and it took me a while to get that right. Enjoy!
I have been hard at work on implementing an ECMA-55 Minimal BASIC compiler for Linux on AMD64 systems, and I have put a source file archive up at last. It is not completed yet, but progress has been steady. Flow control is done, and print zones finally work. Notably absent are INPUT and READ statements, but at least you can try out some simple programs. The compiler is written in C and the output is AT&T format assembly code for the GNU as assembly (from binutils). Enjoy!
The highlight of this release is that all known 64bit ABI violations have been fixed. In addition, string literal support in the SHOW statement has been implemented. Also, the code generation does not emit library functions that were never called. Finally, a nasty bug in the 64bit itoa function where stack space for locals was not reserved so the stack was getting corrupted and mysterious crashes would occur but only if you used an integer that was large (which wrote on more of the stack).
I am happy to announce that mutant version 2.18 has been released. This contains an all-new symbol table module that can properly handle nested scopes. It also contains a huge number of fixes to the code generation for both 16bit DOS and 64bit linux. The parser has been updated to ensure that the last line of a function body is a RETURN statement. I have tried to verify the 16bit DOS code uses only 808 instructions. I have tried to ensure the 64bit linux code obeys the AMD64 ABI rules for large code model programs, with the one exception that I still don't have the stack alignment guarantees implemented.
I have released a snapshot of the current working code for mutant. It's still quite rough and buggy, but both the DOS and 64bit code generation is much improved. I have uploaded the mutant-2.18a21.tar.xz snapshot for people who would like to see the new code without having to use mercurial.
Just when you thought you had it all, BASICK is released. This is an unstructured BASIC interpreter for the 1980's style BASIC that I used when I first learned to program. The Python-3.3.x, PHP-5.4.x, and Ruby-1.9.x versions work for the demonstration programs. The lua version is not yet finished. The only statements missing to be 1.0 are FOR/NEXT/STEP and READ/DATA. This BASIC has no support for strings or floats at all, but does support one-dimensional zero-based integer indexed arrays. Have fun!
Now it is tested on non-linux platforms, and a bad bug in the scanner's newline handling is fixed. Also, for non-linux people, a .ZIP file is now available.
Mutant is the replacement for the old Burapha Compiler Kit. Instead of using an interpreted intermediate language, mutant generates NASM 2.X output that uses system calls directly without the need for any other libraries. Mutant -2.13 can emit code for 16bit DOS, x86 Linux, or x86_64 Linux. This GPLv2 software is used to teach my students about compilers.
The phase2 code has been added to cvs; this is
a python compiler for a pico logo-like language.
This includes an interpreter to directly run
the asm-style output and display graphics with
PyGTK. This version was developed during this
semester as an example for the students, and
as it stands is still quite simple and easy enough
to read for people wishing to learn about compilers and interpreters.
Ok, the first cut at the GUI part of the interpreter written in Java is in cvs. Getting the layout managers to do anything intuitive is impossible. If you have a better way [using just java; no Visual Age or Jbuilder] to get the layout to behave, I'm open to suggestions.
Version 0.65 has been released. This version has a lot of structural cleanup in the interpreter. There should be no user visible changes.