Page 3 of 3 FirstFirst 123
Results 21 to 23 of 23

Thread: Factoring 1

  1. #21
    Member Johannes's Avatar
    Join Date
    Nov 2010
    Location
    Wuustwezel, Belgium
    Age
    56
    Posts
    95
    Rep Power
    25
    Quote Originally Posted by danbaron View Post
    Thinbasic is an interpreter, Racket is compiled into byte code, and, as far as I know, Powerbasic is compiled into machine code; and, we didn't create any of them.
    PowerBASIC does generate pure machine code, and very efficient machine code at that. And don't forget that the only reason that I managed to get this speed was to use a gigantic amount of memory. I can write the program in assembler, no (big) problem, but multi-megabyte memory management in a Windows environment?

    Racket generates pseudo code? And still is that fast? I'm very impressed.

    In the end this became a contest with myself. The earlier thinBasic script mimicked your Racket program in that it continued with previously created data. And in the final version it would have determined all primes in a week or so. Perhaps with some assembler coding I could have gotten that time down to a day. But that PowerBASIC is something else. And I enjoyed the mental challenge of working entirely with bits.

    And thank you for giving me this mental challenge. I love to program but sometimes it's difficult to come up with something to program.
    Boole and Turing, help me!

    Primary programming: 200 MHz ARM StrongARM, RISC OS 4.02, BASIC V, ARM assembler.
    Secondary programming: 3.16 GHz Intel Core 2 Duo E8500, Vista Home Premium SP2, thinBasic, x86 assembler.

  2. #22
    Member Johannes's Avatar
    Join Date
    Nov 2010
    Location
    Wuustwezel, Belgium
    Age
    56
    Posts
    95
    Rep Power
    25
    Quote Originally Posted by ErosOlmi View Post
    Consider that, if you like, I can add those keywords as thinBasic native commands in Core engine.
    Eros,

    For these commands to work you would need that gigantic primes file. For all 32-bit primes it's 98.2 megabytes. Zipped it's still well over 80 megabytes so including it in a thinBasic release is not workable. Supplying the compiled PowerBASIC program (10 kBytes) to generate the primes file is of course possible but that generates its own problems.

    Apart from the loading of that file there is also the need to create a 5760-entry table before that file can be processed. That doesn't take too long in compiled form but the overhead is still there.

    But if you still think this is interesting for the thinBasic core I will write the necessary code. After I finish my BigInt module, because this was "just" an intermezzo.
    Boole and Turing, help me!

    Primary programming: 200 MHz ARM StrongARM, RISC OS 4.02, BASIC V, ARM assembler.
    Secondary programming: 3.16 GHz Intel Core 2 Duo E8500, Vista Home Premium SP2, thinBasic, x86 assembler.

  3. #23
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    Quote Originally Posted by Johannes View Post
    But if you still think this is interesting for the thinBasic core I will write the necessary code. After I finish my BigInt module, because this was "just" an intermezzo.
    For me adding new native commands (compiled in Core or other modules) is always good as far as the commands are generic and usable in different situations.

    Of course I will never create a command that has a dependancy file (even if the file is small) but if the only problem is needed memory I do not see any problem: important is to mention in help file what will happen when using that specific keyword so the programmer is informed.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Page 3 of 3 FirstFirst 123

Similar Threads

  1. Haskell: factoring into primes
    By danbaron in forum Science
    Replies: 0
    Last Post: 12-06-2011, 08:47
  2. Factoring 2
    By danbaron in forum Science
    Replies: 0
    Last Post: 09-05-2011, 06:05

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •