Shop OBEX P1 Docs P2 Docs Learn Events
General questions? — Parallax Forums

General questions?

Is TAQOZ a full implementation on the P2? Does it occupy 32Kb or more space.

I am playing around with TAQOZ using PropFlex, which is way more useful, for me, than trying to load Tachyon on a P1 platform.

Since Forth has its own forum, will anybody be doing a tutorial type thread for beginners like myself?

Ray

Comments

  • Actually the ROM based TAQOZ uses the bottom 64K of HUB of the P2, TAQOZ reloaded uses the bottom 128K of Hub.

    Mike

  • What is "TAQOZ reloaded ", and how does that work. If "reloaded" means, is loaded from an external source, then, I wonder why it does not use the full 512K.

    Ray

  • ErNaErNa Posts: 1,738

    Imagine to use all the money you have to drive as far as possible. Then, when you arrive, you are out of money and why should you want to be there? If you are not running for president ;-) So, that tells us: if TAQOZ would use the full 512K, you would have no resources to do something on your own. TAQOZ is not like windows were you blow up you memory requirements by 24 bit colored high res icons and using such fonts. I believe Peter creates TAQOZ to use 64k just to demonstrate: it's a full blown FORTH ;-)

  • Back to the original question:

    Since Forth has its own forum, will anybody be doing a tutorial type thread for beginners like myself?

    I don't know, but if I was to start one I would like to know what information do you expect to find it's way to such a beginners' tutorial.
    And at what level of knowledge we actually consider a user to be a beginner ?

    What you ask seems simple on the surface of it but I would need to know what are the prerequisites, meaning what such a beginner has to know before he even reaches out for such a tutorial.
    And at the other end of the story I would like to know at which point a beginner is no longer a beginner.

  • ErNaErNa Posts: 1,738

    Indeed, there is already a thread dedicated to beginners: try-these-taqoz-code-snippets-and-learn
    The point is: it is very easy to ask a question. Definitely harder to give an answer. And even harder to ask a good questions. So you should never try to do, what is easy. But what is hard.

  • You may find this link useful.
    https://docs.google.com/document/d/1Gtl-reIMuTBZLs37nvlon23n4jwicV9g9Ub2U1BtB6o/edit?usp=sharing

    Comments are most appreciated. Maybe even add the answers to your questions to that page.

  • A question for possibly some clarity.

    Below I have a test program, using FlexBASIC, as a prototyping language. Now, the big question is - how would you use TAQOZ Forth to accomplish the same thing. In other words, what would a Forth program look like to produce the same or similar results as the FlexBASIC program.

    I am not sure if that is a fair question to ask, but seeing the Forth code might show whether it is just as easy to do some programming in Forth.

    Ray

    ' solsta3.bas
    '
    ' Aug 8, 2021
    
    dim rpi as class using "spin/SimpleSerial.spin2"
    
    
    rpi.startx(1,0,0,115200)
    Open SendRecvDevice(@rpi.tx,@rpi.rx) as #2
    
    const HEAPSIZE = 8192
    
    '' Filesystem
    mount "/host", _vfs_open_host()
    
    '' Variables
    dim inBuff as string
    
    
    '' Stack
    
    
    '' Main
    print #2, "Test prototype use."
    
    do
        print #2, "> ";
        input #2, inBuff
        if inBuff = "quit" then
            exit
        else if inBuff = "test1" then
            print #2, "This is the P2!"
        else
            print #2, "??"
        end if
        ''pausems 1000
    
    loop
    
    '' Program stopped
    print #2, "Program Ended!"
    close #2
    end
    
    
    '' Subroutines
    
    
  • MaciekMaciek Posts: 668
    edited 2021-08-09 13:56

    @Rsadeika ,

    Ray, I have no knowledge of the FlexBASIC hence the description of what your program is actually doing would be helpful, either as a simple algorithm drawing or as a simple list.
    I think I can pretty much guess of what it is doing as it's a rather simple code but you'd like to compare the resulting code written in TAQOZ that gives the exact same result as your sample, so there is no room for guessing here for me.

    It looks like your code:
    1. opens the serial connection to the host (rpi ?) with these parameters (1,0,0,115200) - or maybe the rpi is just a name and you use rpi as your input/output console ?
    2. declares the buffer of 8192 bytes (?)
    3. makes that buffer available to the serial connection, declared as character string
    4. if the text in that buffer says quit your program exits and says Program Ended, if it says test1 it displays This is the P2! message or, if it says anything else it displays ?? waits a second and takes new input from the buffer

    Is that guessing of mine correct or maybe I missed something ?

  • @Rsadeika said:
    A question for possibly some clarity.

    Below I have a test program, using FlexBASIC, as a prototyping language. Now, the big question is - how would you use TAQOZ Forth to accomplish the same thing. In other words, what would a Forth program look like to produce the same or similar results as the FlexBASIC program.

    I am not sure if that is a fair question to ask, but seeing the Forth code might show whether it is just as easy to do some programming in Forth.

    Hi,
    I do not know, if someone will be there to translate your code to Forth. If someone would do it, you would find, that the readability of Forth is worse and that Forth is less mainstream and therefore needs more time to learn. If you ask me, what is my favourite language is for programming my PC, then I will answer, that I use Excel and do not program often. If I have to my favourite language is FreeBasic. Or maybe even Python.

    So why use this weird Forth for the Propellers and other controllers?
    It is interactive and still significantly faster than Micropython. (I do not know about P2, but at an ARM processor the speed factor was >5) Why is it faster? Because it is simple. (Simplicity makes it small too.) So you are dealing readability and some learning time and responsibility against a combination of speed and interactivity (and a lot of freedom). Interactivity is very interesting while developing and for experiments, if you want to try out things. It is then very nice to work with.
    For P2 there is the problem, that Micropython does not support more than one COG, which -in my eyes- makes it pretty senseless for P2. (I doubt, if it will ever support more than one COG.) - So if you want to have an interactive language then Forth will perhaps make sense. Tachyon and Taquoz use wordecode, one instruction takes 2 bytes. This makes the code quite compact, because assembler code needs 4 bytes per instruction.

    I you want to compare languages, http://www.rosettacode.org/wiki/Category:Forth

  • ErNaErNa Posts: 1,738

    Actually, the program is a good starting point. I looked around and found this website And so I found some particles to answer, but not the full sentence. But I will try to see it the solution is there.

  • @Maciek, your guessing, is generally correct. There are a couple of items that just might be FlexBASIC only options. So, I would not expect Forth to handle that, for the P2 anyway.

    @Christof Eb, you mentioned that you use FreeBASIC, on occasion, well for your information, ersmith developed FlexBASIC, using FreeBASIC as the model. I also have used FreeBASIC, so I like FlexBASIC.

    I have this feeling that using my FlexBASIC example, and trying to create a Forth version will not be an easy task. I just cannot imagine creating a "word" that will do all of the basics of my example. I think my brain would go haywire.

    Ray

  • Christof Eb.Christof Eb. Posts: 1,087
    edited 2021-08-10 17:07

    @Rsadeika said:
    @Maciek, your guessing, is generally correct. There are a couple of items that just might be FlexBASIC only options. So, I would not expect Forth to handle that, for the P2 anyway.

    @Christof Eb, you mentioned that you use FreeBASIC, on occasion, well for your information, ersmith developed FlexBASIC, using FreeBASIC as the model. I also have used FreeBASIC, so I like FlexBASIC.

    I have this feeling that using my FlexBASIC example, and trying to create a Forth version will not be an easy task. I just cannot imagine creating a "word" that will do all of the basics of my example. I think my brain would go haywire.

    Ray

    The way to go on in Forth is to split the program in many very tiny words.
    Oh, I had a more detailed look.
    You want the controller to answer "This is P2", if you type "test1".

    So the solution is extremely simple:

    : test1 cr ." This is P2" ;
    

    Forth is already interactive, so it can react to input. You define a word with the name test1. This will be executed, if you type it's name. If you type something unknown it will react with ??? and quit makes no sense.

  • ErNaErNa Posts: 1,738

    ingenious!

Sign In or Register to comment.