Join Today
+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Jun 2005
    Location
    Houston, USA
    Posts
    349

    Default Anyone interested in expanding a forth devkit for java?

    Hello all,

    I coded a forth machine for the jvm. It runs already on my e680i.

    Implemented are following commands:

    : ; rot dup drop swap words forget + - * / allot constant create loop do i j +loop if then . .dup ! @

    It runs within the jvm. My destination is to have a devkit completely on the phone without using a second computer. Coding everywhere.

    Is anyone interested in joining the development of the forth devkit?

    I use forth since 25 years and there is for shure no better language out there!
    % New UNIX password:
    > penis
    BAD PASSWORD: it's WAY too short
    % New UNIX password:

  2. #2

    Default Re: Anyone interested in expanding a forth devkit for java?

    That sounds cool, but i'm new to forth - what all can it do? can you suggest a starter's tutorial or some examples? thanks!

  3. #3
    Join Date
    May 2005
    Location
    Germany, Hannover
    Posts
    289

    Default Re: Anyone interested in expanding a forth devkit for java?

    never heard from this language, but its not fortran in english?

  4. #4
    Join Date
    Jun 2005
    Location
    Houston, USA
    Posts
    349

    Default Re: Anyone interested in expanding a forth devkit for java?

    Best books for forth are from Leo Brodie. They are also in the web:

    Starting forth, http://home.iae.nl/users/mhx/sf.html

    Thinking forth, http://thinking-forth.sourceforge.net/

    Ehm, and yeah there is wikipedia right now.

    Short description from me:

    As linux is just different from windows, forth is just different from java. I took java as opposite, because it's not only opposite but they have similar concepts, a virtual machine, for example.

    What I like most in forth is that it's a language far more similar to a natural language than any other programming languages I know of. Forth is like freedom where other languages are like prisons.

    Let me explain with a simple example:

    In C or even java the syntax is very restrictive. It is not possible to change the syntax, the compiler uses. Everytime there are these brackets {[()]} in the code. Brackets are needed, where programming languages are imperfect. Forth does the same without brackets. Everywhere! With postfix notation while calculating and with words while processing.

    If this is not enough freedom, you may change the compiler at compile time. Spaces are the fundamental delimiters in forth like in any natural language. But you may change this. Even you may change any other behavier in forth.

    Ok, that's enough for now. Look at wikipedia or the books. And, forth is just as far away from fortran as the sun from the earth.

    I've also enclosed the first midlet. The words above are available. Just type in a sequence in the input field and then press "Ok" for processing. You will see the output in the output field. You may for example try:

    Code:
    100 0
    do
      i dup * . 
    loop
    which will simply print square numbers from 0 to 99.

    Please look at the spaces - they are important delimiters in forth!

    Another example to try the dictionary of forth:

    Code:
    : squares
    do
     i dup * . 
    loop ;
    Will compile a new word "squares" when pressing Ok.

    You may then enter:

    Code:
    200 100 squares
    to print squares of 100 to 200. Or even other ranges.

    To look then at the dictionary you may enter

    Code:
    words
    to see the new created word "squares".

    If you don't like squares anymore you may enter

    Code:
    forget squares
    And then with

    Code:
    words
    you may see nothing than ok.
    % New UNIX password:
    > penis
    BAD PASSWORD: it's WAY too short
    % New UNIX password:

  5. #5

    Default Re: Anyone interested in expanding a forth devkit for java?

    Thanks for the info and explaination!! One (of probably many) question is what about file and/or device access via forth? I noticed on one of the links you suggested they have a filing program and I was wondering if this could be modified to access the phone (contact, calander, etc) db files, but I am not sure if the installed KVM has filesystem access.

  6. #6
    Join Date
    Jun 2005
    Location
    Houston, USA
    Posts
    349

    Default Re: Anyone interested in expanding a forth devkit for java?

    Welcome

    It is possible to save persistent data in records, which will also go to the filesystem.

    And it is also possible via midp 2.0 if I am not wrong, to access the phone database. Second, the docs at motorola stated, that filesystem access from java is possible, when the midlet is signed.

    While an old stager in forth, I am brand new to java, so be patient. I'd like to implement a recordstore to the forth machine shortly. And then it is possible to save forth programs, load and run them again and again.
    % New UNIX password:
    > penis
    BAD PASSWORD: it's WAY too short
    % New UNIX password:

  7. #7
    Join Date
    Jun 2005
    Location
    Houston, USA
    Posts
    349

    Default Re: Anyone interested in expanding a forth devkit for java?

    I just updated the "programs" a little bit and upload a new version with more help. It will be shortly available in the download section.

    update: it has now new words:

    cls (to clear the output screen)

    emit
    % New UNIX password:
    > penis
    BAD PASSWORD: it's WAY too short
    % New UNIX password:

  8. #8

    Default Re: Anyone interested in expanding a forth devkit for java?

    I've been looking at the forth references you provided and they are quite helpful, thanks!!

    One application I have in mind would be a FFT calculation, and possibly some plotting. I have found a FFT example in forth but I need to figure out about the "NEEDS " and how required code is somehow included.

    For something like this do you think a java based app would be easier? I am so new to this that I really don't know how the options compare.

  9. #9
    Join Date
    Jun 2005
    Location
    Houston, USA
    Posts
    349

    Default Re: Anyone interested in expanding a forth devkit for java?

    Hmm, I don't know what do you mean exactly with "java based app would be easier". Easier than what?

    @ the moment, cy4th is in its early stages. But the virtual machine works and it will be not much more work to get the complete forth basics at the phone. Even it is now possible to store files (new version 0.2.2). I hope, in a few days to get a version where it is possible to even have a file manager and automated save and load of multiple files.

    The rest of the work is to code most forth words in itself (in forth) and enable this "library" to load automaticly at startup of cy4th.

    When reached this state, forth is almost complete to work with. But: Only in "console" mode.

    After this, there are two more huge projects:

    1. Coding an api to permit forth produce gui elements like forms, textfields, ... on the phone.

    2. Coding an api to the canvas classes that will enable drawing functions and may be even using of 3d apis.

    If you like to draw fast fouriers you need part 2. (canvas api in forth) and that has to be coded from anyone in java (J2ME) first.

    But anyway, I guess in your part it's more a question of what programming language you prefer. I don't like to press you to learn forth. You could also code another language in java or use any other way. Or even code the fft in java. It is all possible now!

    For my way, I have used a dozen and more programming languages since more than 20 years and there is nothing near of forth if looking at portability, speed, elegance, rapid prototyping and freedom. So if you would ask me I would suggest to use forth.
    % New UNIX password:
    > penis
    BAD PASSWORD: it's WAY too short
    % New UNIX password:

  10. #10
    Join Date
    May 2005
    Location
    Germany, Hannover
    Posts
    289

    Default Re: Anyone interested in expanding a forth devkit for java?

    this forth sounds a little bit like smalltalk, but not oo


 
+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Anyone Interested in selling E680i?
    By imran_uh in forum Garage Sales
    Replies: 7
    Last Post: 11-11-2011, 03:27 PM
  2. ezx-devkit and crosstool
    By blackglasses in forum Development
    Replies: 10
    Last Post: 05-14-2011, 09:21 AM
  3. Interested in Rokr E6!
    By chanman in forum E6 General Chat
    Replies: 10
    Last Post: 03-23-2011, 12:06 PM
  4. No 1 interested in Z10?
    By devarshi84 in forum Motorola Z10
    Replies: 7
    Last Post: 09-01-2008, 12:40 PM
  5. Interested in this phone, need opinions
    By eviltuna in forum E6 General Chat
    Replies: 9
    Last Post: 01-03-2008, 06:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Single Sign On provided by vBSSO

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1