RetroForum Welcome, Guest. Please login or register.
September 07, 2010, 05:55:18 AM
Home Help Search Calendar Login Register

RetroForth Discussion  |  Older Boards  |  Development  |  Topic: Work on 9.2 « previous next »
Pages: 1 Go Down Print
Author Topic: Work on 9.2  (Read 3731 times)
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Work on 9.2
« on: June 04, 2006, 04:51:10 PM »

I've begun work on the 9.2 codebase (hosted only at the moment; once I have the bootstrap modules organized the way I want, I'll update the native system). For those who want to check it out, the repo is at http://retroforth.org/get/repos/902

I am making some changes to the filenamings in Rx, and also to the modules. This release will be more configurable at build time. I would recommend looking at MODULES and selecting the ones you want in modules.inc. There are some new words to play with in the std-ext and terse modules, including e: (from HelFORTH), [[ ]] (for creating internal, anonymous definitions, and some new control structures that may be handy.

I do plan to provide some words for manipulating strings and maybe others. Any ideas?

The help system will be redone in a far nicer fashion. I have added a :doc field to the dictionary which is intended to point to either a string containing documentation or the actual source of a word (possibly in Native). I may drop/change some things from 9.1; depending on input of course. (9.1 compatibility should be maintainable, with an optional compat module).

If there's anyone who wants to try a pre-built binary release, I can upload a snapshot. Otherwise using darcs to fetch the repo is the best way to keep up with development.
Logged
Icefall
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 1


View Profile
Re: Work on 9.2
« Reply #1 on: June 05, 2006, 08:52:39 PM »

I'd like to see invoke word which calls external stdcall functions in the Windows port. It would be useful when using COM interfaces for example.
Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Work on 9.2
« Reply #2 on: June 05, 2006, 09:35:11 PM »

I can add that. Any suggestions on other improvements to the FFI?
Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Work on 9.2
« Reply #3 on: June 10, 2006, 03:51:15 PM »

My changes have allowed me to drastically simplify the port-specific code. Each port now has three files (except netbsd, which has four at the moment), an assembly, a forth, and a dictionary file. Things are significantly more organized as a result. In addition, I pulled over the library/import macros from FreeForth for Windows, so the entire 'include' directory is now gone. This saves a lot of space in the file tree Smiley

And now I am working on the FFI. For invoke, I am thinking of ...args.... #args xt as the stack form. Does that seem reasonable?
Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Work on 9.2
« Reply #4 on: June 11, 2006, 03:00:38 PM »

The FFI now has two new words:

Code:
map: ( "name" -- xt )
invoke ( ...args... xt #args -- result )

As a simple example:

Code:
from libc.so
map: system
: run zt literal 1 invoke ;
" ls" run

invoke can handle both stdcall and cdecl type functions.

Update: The repo is now current with my local codebase, so this stuff can all be tested now.
« Last Edit: June 11, 2006, 03:44:55 PM by Charles Childers » Logged
SmallSqueak
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 2


View Profile
Re: Work on 9.2
« Reply #5 on: June 20, 2006, 10:12:49 PM »

Hi Charles,

  Would you please consider to add underscore to these procs in the librx*.asm files: rx_setup, rx_evaluate, rx_push, rx_pop, rx_define, rx_get_xt, rx_call_xt so that they can be linked to c programs.

  Maybe librx.asm and librx_dll.asm can share a common file, say, librx_core.asm

  Also, how about moving rx directory out of hosted directory and meant to be used for librx as well.

  Is it possible to have 3 directories at the top level: RX, librx and RetroForth?

  Would you also please consider to move the forth words out of the binary so that there is no need to build a new binary when there are changes in these forth words (currently embeded in the binary). the draw back is that librx will need file and memory words implemented in assembly (like revacore) but this would make librx more flexible and powerful.

  Many thanks for bringing RetroForth to the current state.

  Best regards,

  SmallSqueak

Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Work on 9.2
« Reply #6 on: June 21, 2006, 02:59:16 AM »

Quote
Would you please consider to add underscore to these procs in the librx*.asm files: rx_setup, rx_evaluate, rx_push, rx_pop, rx_define, rx_get_xt, rx_call_xt so that they can be linked to c programs.

Certainly. (Note: the underscore is not needed on the systems I work with the most, Linux and the *BSD's).


Quote
Maybe librx.asm and librx_dll.asm can share a common file, say, librx_core.asm

Quite possible. I'll look into this for the next update.


Quote
Also, how about moving rx directory out of hosted directory and meant to be used for librx as well.

Is it possible to have 3 directories at the top level: RX, librx and RetroForth?

Hmm. I had packaged the source as I did, since RetroForth needs to be compilable on many platforms, some of which don't support symlinks. (And I didn't want to rely too heavily on directory structure outside the main project directory). Since I'm reworking the file tree in 9.2, I'll see what can be done.

Quote
Would you also please consider to move the forth words out of the binary so that there is no need to build a new binary when there are changes in these forth words (currently embeded in the binary). the draw back is that librx will need file and memory words implemented in assembly (like revacore) but this would make librx more flexible and powerful.

This would require reworking parts of the Rx initialization stuff, apart from just librx. I'm not sure that I want to change this. The core words in Rx don't change that often, (a few relatively minor changes in each release). I do see some value in separating this out though. I will think on this more before making a final decision.
Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Work on 9.2
« Reply #7 on: June 21, 2006, 06:11:30 AM »

Suggestions 1, 2, and the first half of 3 are done and the results are on http://rx-core.org
Logged
SmallSqueak
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 2


View Profile
Re: Work on 9.2
« Reply #8 on: June 21, 2006, 04:03:34 PM »

> Suggestions 1, 2, and the first half of 3 are done and the results are on http://rx-core.org
 
Thanks for your considerations and quick response.

BTW, I experimenttally commented out from windows.asmL

;   pusha

;   push dword 0
;   call [GetModuleHandle]
;   mov [hinstance], eax

;   push dword eax
;   push dword 5
;   call [SetConsoleMode]

;   push dword title_string
;   call [SetConsoleTitle]
;   popa

...
...

; hinstance rd 1
; StdIn rd 1
; StdOut rd 1
; emit_buffer rd 1
; written_buffer rd 1
; tempX rd 1

...
...

;   GetModuleHandle,'GetModuleHandleA',\
;   GetStdHandle, 'GetStdHandle',\
;   SetConsoleMode, 'SetConsoleMode',\
;   SetConsoleTitle, 'SetConsoleTitleA',\
;   GetLastError,'GetLastError',\

and added codes to io.forth to make up for these.

They seem to be OK.

  Cheers,
 
  SmallSqueak
Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Work on 9.2
« Reply #9 on: June 21, 2006, 05:18:55 PM »

Excellent. I'll do this in my source tree tonight.
Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Work on 9.2
« Reply #10 on: July 01, 2006, 07:03:06 PM »

The Native build of 9.2-beta is now up.

darcs get http://retroforth.org/repos/902n
http://retroforth.org/902-beta.iso
Logged
Charles Childers
Administrator
Sr. Member
*****

Karma: +2/-0
Offline Offline

Posts: 745


View Profile WWW
Re: Work on 9.2
« Reply #11 on: July 02, 2006, 06:02:00 PM »

And now I have begun to work on documentation. See http://retroforth.org/book.html

This so far is focusing on the Rx Core. I do plan to expand it to cover RetroForth 9.2 as well. Suggestions welcome.
Logged
Pages: 1 Go Up Print 
RetroForth Discussion  |  Older Boards  |  Development  |  Topic: Work on 9.2 « previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1 RC2 | SMF © 2001-2005, Lewis Media Valid XHTML 1.0! Valid CSS!