scruss wrote: ↑Fri Jul 19, 2019 12:23 pm
DavidS wrote: ↑Fri Jul 19, 2019 4:12 am
Interesting results. Have you tried any of the well known graphics benchmarks (well known on BBC BASIC for RISC OS). I am curious of the results.
No, I don't know of those benchmarks, and I'm not sure if I can run them unchanged in Matrix Brandy.
… there are some differences in a good setup versus a minimal RISC OS setup.
Hey, if the RISC OS folks don't set up their distro for good performance, it's their product to show off. I only use stock settings with my distributions.
For now could you tell me what the run time is on an RPi 3B for FIBO 101000 with your RISC OS setup?
On my RPi 3B+ it is 5.82 in BASIC VI, and 6.80 seconds in BASIC V at stock clocks (in a task window). Compiled is slower (I think because of the limits of ABC with regard to floating point math).
As in:
this code, but with
250N=101000
?
Sure, I'll give that a shot this evening. I haven't yet dismantled the RISC OS setup, though I need the space this weekend.
Note, though, that any code that runs the "GET DYNAMIC RANGE" section and tunes the largest integer/carry threshold is not a fair comparison. That code currently fails on Matrix Brandy, so my code has:
8520F0=&7FFFFFFF:F0=INT(F0/2):GOTO 8610:REM F9=1
The value F0=7FFFFFFF is the largest integer that can be held in a 32-bit signed integer variable and designed to overcome the INT bug in certain implementations of BBC Basic. If you are not going to use the extra range of double precision floating point, you would certainly be better off running the integer version of the line-numbered Basic code which is called integer.bas in the repository. Note that integer.bas does not include the floating-point dynamic range tuning code but sets B7, B8 and B9 to reasonable values on line 260. It also relies on the Microsoft Basic implicit type declaration DEFLNG A-Z or DEFINT A-Z, therefore a bunch of explicit percent signs may be needed with BBC Basic.
It is interesting that the floating point routines in the original versions of Microsoft Basic were not written by either Bill Gates or Paul Allen but Monte Davidoff. There is evidence that Davidoff's contribution was more important than the other two for the success of the resulting programming language: Microsoft Basic would not have found its way into so many mathematics and science textbooks without the ability to express things like Newton's method for finding roots of nonlinear algebraic equations and the Simpson's quadrature formula for approximating definite integrals. The tiny and integer Basics written by hobbyists (and Steve Wozniak) didn't have this calculating ability, didn't appeal to such a wide audience and as a result didn't become universally popular.
Due to the code present in textbooks as well as general popularity, BBC Basic attempted to maintain compatibility with Microsoft Basic while adding extensions that supported structured flow-control but not structured data types. Unfortunately, they did not hire Monte Davidoff to do the floating point code. The BBC definition of INT appeared compatible when floating point numbers were five bytes but fell apart completely during the digital apocalypse of the huge Fibonacci challenge.
It seems reasonable to include the option
SYS "Brandy_INTusesFloat",1
in Matrix Brandy Basic to enable a sensible treatment of rounding for floating point numbers.
An alternative approach, that would mask the problem in a way similar to how things worked when floating point was five bytes, would be to use only 64-bit integer variables on versions of Basic in which floating point is double-precision. As the rest of the world (except for Raspberry Pi) has moved to 64-bit on the desktop, that would be a reasonable way, from my point of view, to preserve the traditional simplicity of Basic as technology evolves.