Go to advanced search

by ejolson
Mon Apr 22, 2019 9:04 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

1. Computing 5-digit Fibonacci numbers using Basic. Fantastic! It would appear computing 5-digit Fibonacci numbers has been finished and the seven-step Smalltalk recovery plan now consists of only five steps. The recursive code is so slow that it gave me time to notice the rather pleasant feature t...
by ejolson
Mon Apr 22, 2019 5:37 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

3. Writing an event-driven cooperative-multitasking webserver using the ON ERROR keyword in Basic. Nothing to write. It comes with the ScriptBasic distribution. (sbhttpd) My next thread on the RaspberryBASIC.org forum will be how to use the application proxy server reusing code you did in the conso...
by ejolson
Mon Apr 22, 2019 5:21 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

Why would this carefully thought out design be more of a "train wreck" than the mess of the traditional approach Getting back to the off-topic topic of why Fibonacci is ideally suited for Smalltalk, I found the interesting statement Intel Nehalem can do 3 additions every cycle, but only 1 addition ...
by ejolson
Sun Apr 21, 2019 11:02 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

I looked for Yet Another Fibonacci Language and found GNU bc the Basic Calculator. Slight modifications of the GNU Basic Calculator Fibonacci code yielded a program compatible with the version of Basic Calculator included with Research Unix Release 7 as distributed by Charles Haley and Dennis Richi...
by ejolson
Sun Apr 21, 2019 9:26 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

You could even add it to Scratch ? Or try do it all in Scratch? No. Just no. I would greatly enjoy seeing that scratchy orange cat open it's mouth and utter the famous million-digit Fibonacci number. Given the TIOBE popularity of Scratch, I expect there are many who would be able to write (or click...
by ejolson
Sun Apr 21, 2019 5:49 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

RISC-V is an open, extensible design so one can't really complain when some do take advantage of that. I think the R means it's reduced; otherwise, it should have been called the EISC-MMXIX. Do you think the EISC-MMXX could add a Fibonacci instruction? Although it is often legal for the code of a s...
by ejolson
Sun Apr 21, 2019 3:17 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

Style? From the Racket Style Guide : https://docs.racket-lang.org/style 6.1 Where to Put Parentheses Racket isn’t C. Put all closing parentheses on one line, the last line of your code. Oh dear. #!/usr/bin/racket #lang racket (define memo (make-hash)) (define (memoize n f) (hash-set! memo n f) f) (...
by ejolson
Sun Apr 21, 2019 6:15 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

ejolson, Hey! I've been doing that too. Sorry. I woke up at an ungodly hour, could not sleep, so started tinkering. Did the runtime improve? I was expecting it to get worse. Thinking that "define" gives us a function to call whereas "let" gives a variable to reference. Turns out to be about the sam...
by ejolson
Sun Apr 21, 2019 4:52 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

Cool. You are raising the fibo(4784969) challenge to a whole new meta level. Not just calculate fibo(4784969) in the language of your choice but first build a language/compiler/runtime with which to calculate fibo(4784969). Does your extension actually produce a value that can be used in ScriptBasi...
by ejolson
Sun Apr 21, 2019 1:55 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

AIR makes a good point. It's one thing to create large integers but another to do something with them in the language you're using. (math functions) I think using one of ScriptBasic's strong points (thread safe dynamic strings) to hold integer / floats outside the type range and use GMP for the hea...
by ejolson
Sat Apr 20, 2019 11:09 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

Better idea is to take inspiration and code from the solutions in BASIC (C) that we have. ScriptBasic has it's first function in its new gmp extension module. DECLARE SUB fibo ALIAS "fibo" LIB "gmp" PRINT LEN(fibo(4784969)),"\n" [email protected]:~/sb/examples/test$ scriba fibo.sb 1000000 [email protected]...
by ejolson
Sat Apr 20, 2019 3:43 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

My main issue with Java is around licensing. Then there is the Java licensing swamp... After Basic had been banished while the Sun still shone, the object purity, verbosity and stimulating effects of Java seemed like a good idea to many computer science departments throughout the world. At about th...
by ejolson
Sat Apr 20, 2019 11:53 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

Assuming IEEE 574 encoding of doubles, I believe that should give 53 bits of storage for the mantissa and sign. That should allow up to 9007199254740990 to be stored with no loss of accuracy. And that seems the case up to Fibo(78)= 8944394323791464 which is correct. What you say sounds logical. Not...
by ejolson
Sat Apr 20, 2019 11:27 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

With results on my PC: $ time java Fibo | head -c 32 10727395641800477229364813596225 real 0m4.279s user 0m8.500s sys 0m2.297s $ time java Fibo | tail -c 32 4856539211500699706378405156269 real 0m4.025s user 0m7.406s sys 0m2.359s It is interesting that the Java code seems to be running on multiple ...
by ejolson
Sat Apr 20, 2019 5:12 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

Hmm... given that Java has such a big following on this forum how come nobody has stepped up with a fibo(4784969) solution in Java? I think you confuse the TIOBE index with this forum. From among the coffee flavoured languages we already have JavaScript. Maybe that's plenty. After finishing the sto...
by ejolson
Sat Apr 20, 2019 12:09 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

As there appears to be so many pythonistas, why one of them hasn't yet implemented a more efficient base-conversion algorithm is a mysterious mystery. Maybe none of them are interested in doing that, or don't see the point or usefulness of doing that. I can't think of any case where I would have th...
by ejolson
Fri Apr 19, 2019 7:04 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

So one could say that we're not actually benchmarking the algorithm or the language at all, mostly timing how long it takes some in-built library to output a big number. Python apparently does the calculation in base two and then uses an O(n^2) algorithm to convert the number to base 10 before prin...
by ejolson
Fri Apr 19, 2019 5:57 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

I'm going to blow my upgrade money on Raspberry Pi, FPGA boards, anything RISC V, electronics toys... Here is a table of Basic Calculator timings still missing any i9 results for the Fibonacci code . Basic Calculator Fibonacci Challenge PROCESSOR TIME RATIO Pi 3B+ 126.161 3.15 Pi 3B 147.222 2.69 Pi...
by ejolson
Fri Apr 19, 2019 8:32 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

Try a coffee-lake chip to see moores law still working ... https://www.intel.com/content/www/us/en/products/processors/core/i9-processors/i9-9900k.html I failed to find runtimes for any of our Fibonacci codes at that link. Could anyone with a recently-built i9 gaming rig stop avoiding Basic and bet...
by ejolson
Fri Apr 19, 2019 4:25 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

What is is a Ryzen 7? Is that one of those new fangled AMDs at 300 dollars a pop? On my ancient i7 2600K salvaged from office throw outs it takes 36 seconds: $ time ./fibo.bc | tail -c32 4856539211500699706378405156269 real 0m36.363s user 0m36.156s sys 0m0.203s The Ryzen 7 is an 8-core x86-compatib...
by ejolson
Fri Apr 19, 2019 12:36 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

I looked for Yet Another Fibonacci Language and found GNU bc the Basic Calculator. The code is #!/usr/bin/bc -q define fibo(n){ if(n==0){ a=0; b=1; return a; } y=fibo(n/2); if(n%2==0){ t1=2*b-a; a*=t1; b*=t1; if(n%4==0) b-=1 else b+=1; } else { t1=2*a+b; a*=t1; b*=t1; if(n%4==1) a+=1 else a-=1; } re...
by ejolson
Thu Apr 18, 2019 6:19 am
Forum: General discussion
Topic: Max Power Supply For Raspberry Pi 3 b +
Replies: 29
Views: 571

Re: Max Power Supply For Raspberry Pi 3 b +

Hi all, I was going through the setup of Raspberry Pi 3 b+ and found that it needs 5V and at least 2A to work that's fine. But I need to know that what is the Maximum Current Supply to Raspberry Pi with keeping in mind it won't damage it and how much current will I get from GPIO from this Maximum c...
by ejolson
Thu Apr 18, 2019 6:03 am
Forum: General discussion
Topic: Python programming on Cluster (MPICH or SLURM)
Replies: 14
Views: 324

Re: Python programming on Cluster (MPICH or SLURM)

I wanna see a document or explanation that can clarify the difference between MPICH cluster and SLRUM cluster: their behavior in processing , differences and any attribute that can clarify that. Instructions how to set up a cluster with both Slurm and MPICH may be found in this thread . It would al...
by ejolson
Thu Apr 18, 2019 2:32 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

Do I have to update the README's in the github repo? I get much better timing fibo(4784969) in C and C++ on a Pi 3. Between 1.1 and 3.6 seconds. Note that we all do karatsuba using arrays of decimal numbers to save the bother of writing code to convert binary big integers to decimal for display. Th...
by ejolson
Thu Apr 18, 2019 12:07 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 1917
Views: 72916

Re: Why Avoid BASIC on RPi?

So anyway, I loaded a karatsuba multiply method someone had kindly written a decade or so ago and it works quite nicely. I see on your gihub repo that the C version with 'hand code karatsuba multiplication' runs the fib(4784969) test in 62secs or thereabouts on a Pi. Was that a Pi 3 or 3b+? Because...

Go to advanced search