Nano-IRC client in Forth

Here it is: an IRC nano-client, with an extremely narrow purpose,
i.e. group-talk with people on #forth.

It's 85 lines of Forth, and needs a socket library (e.g. see my 
home pages).

For reference: the source code for ircll (text mode UNIX IRC client)
is around 1.64 MBytes of (C) text.

I tried to clean out iForthisms, but didn't test the code resulting 
from that operation.

The output to the console has a huge amount of address-info in front 
of each message, it would be nice to compact that to the nick of the 
talker. But for my own purposes, this version is usable.

-marcel
-- ----------
( *
  * LANGUAGE    : ANS Forth
  * PROJECT     : Forth Environments
  * DESCRIPTION : A nano-IRC client
  * CATEGORY    : Utility - check RFC-1459 for more functionality
  * AUTHOR      : Marcel Hendrix 
  * LAST CHANGE : Sunday, December 31, 2006, 14:12 PM, Marcel Hendrix; works for Linux with UTYPE 
  * LAST CHANGE : Saturday, December 30, 2006, 1:46 AM, Marcel Hendrix 
  * )

	DECIMAL
	NEEDS -sockets
	\ $+   concatenates two strings ( c-addr1 u1 c-addr2 u2 -- c-addr3 u3 )
	\ +CR  appends ^M and ^J control characters (network convention)
	ANEW -irc

0 [IF]
   Use socket API functions to perform IRC communication using TCP. 
   Connect to an (internally specified) IRC server, using predefined 
   REALNAME, USERNAME, and NICK strings.

   BUGS: There may be an "echo" when you resume HEAR after a SPEAK (text from other
         users typed during your absence is echoed prefixed with your nick).
[THEN]

\ standard tools --------------------------------------------------------------

0 VALUE lsocket				\ socket for IRC comms
0 VALUE #resp				\ response size
CREATE  response$ 512 CHARS ALLOT 	\ buffers response from server

\ Force interpretation of ^M and ^J (so they are the same in Windows and Linux)
: UTYPE		BOUNDS ?DO  I C@ EMIT  LOOP ; 				 ( -- )
: SEND$		lsocket WRITE-SOCKET ; 			        ( c-addr u -- )
: CMD		+CR SEND$ ;				        ( c-addr u -- )
: RECEIVE$	lsocket response$ 512 READ-SOCKET TO #resp DROP ;	 ( -- )
: ECHO-ALL 	BEGIN  RECEIVE$ #resp  WHILE  response$ #resp UTYPE  REPEAT ;

\ -----------------------------------------------------------------------------

6667 =: IPPORT_IRC 	\ standard IRC port address

CREATE server		," irc.freenode.net"
CREATE username		," mhx"
CREATE realname		," marcel hendrix"
CREATE nick		LINUX? [IF] ," BirdReynolds" [ELSE] ," gorgonzola" [THEN]

\ The server may challenge our vitality
: ?TEST-PING ( -- )
	response$ S" PING" TUCK COMPARE 
	0= IF  'O' response$ CHAR+ C! 
		response$ #resp +CR SEND$
		CLEAR #resp
	ENDIF ; 

: IRC-OPEN ( -- )
	server COUNT IPPORT_IRC OPEN-SERVICE TO lsocket 
	lsocket FALSE BLOCKING-MODE
	0 SET-SOCKET-TIMEOUT  RECEIVE$ 
	S" NICK " nick COUNT $+ CMD
	S" USER " username COUNT $+ S"  8 * :" $+ realname COUNT $+ CMD 
	S" JOIN #forth" CMD ;

: IRC-CLOSE ( -- ) 
	S" QUIT :a quit that really quits" CMD
	lsocket CLOSE-SOCKET ; 

: SPEAK ( -- )
	S" PRIVMSG #forth :" 0 WORD COUNT $+  
	CR ECHO-ALL CMD ; 

: HEAR ( -- )
	CR
	BEGIN 
	  RECEIVE$ 
	  ?TEST-PING
	  response$ #resp UTYPE
	  EKEY?
	UNTIL 
	EKEY DROP ;

: .ABOUT ( -- )
	CR ." Usage: IRC-OPEN    -- connect to #forth"
	CR ."        HEAR        -- listen what they say"
	CR ."        SPEAK text  -- write a message (text) to all on #forth"
	CR ."        IRC-CLOSE   -- disconnect from #forth" ; 

2
mhx (2135)
12/31/2006 7:41:57 PM
comp.lang.forth 6637 articles. 0 followers. markrobertwills (871) is leader. Post Follow

7 Replies
2317 Views

Similar Articles

[PageSpeed] 0

Marcel Hendrix wrote:
> Here it is: an IRC nano-client, with an extremely narrow purpose,
> i.e. group-talk with people on #forth.
>
> It's 85 lines of Forth, and needs a socket library (e.g. see my
> home pages).

Nice work!  That reminds me.  I think it would be really productive
if the Forth community could collaborate on a "FNL (Forth Net
Library) similair to how the FSL was built.  Perhaps if the "sockets"
wordset was used as a reference implementation with other
libraries built on top of it?

Regards,

John M. Drake

0
johnmdrake (128)
1/1/2007 4:31:41 AM
John M. Drake wrote:
> 
> Marcel Hendrix wrote:
> > Here it is: an IRC nano-client, with an extremely narrow purpose,
> > i.e. group-talk with people on #forth.
> >
> > It's 85 lines of Forth, and needs a socket library (e.g. see my
> > home pages).
> >
> > For reference: the source code for ircll (text mode UNIX IRC client)
> > is around 1.64 MBytes of (C) text.
> >
> > I tried to clean out iForthisms, but didn't test the code resulting
> > from that operation.
> 
> As an exercise I'm attempting to port this to another ANS Forth.
> I've chosen SP-Forth as my target.  (I tried Win32Forth, but the
> latest version of Win32Forth has an incompatibility issue that
> prevents it from loading it's own sockets.f library.  The offending
> word is &LOCAL.)

Add the following line at the start:
Synonym &local &of

Jos
==
4ePost: 844 bytes in mail. Elapsed time to buffer: .000088 sec.
0
josv (130)
1/3/2007 5:16:00 PM
Marcel Hendrix wrote:
> Here it is: an IRC nano-client, with an extremely narrow purpose,
> i.e. group-talk with people on #forth.
>
> It's 85 lines of Forth, and needs a socket library (e.g. see my
> home pages).
>
> For reference: the source code for ircll (text mode UNIX IRC client)
> is around 1.64 MBytes of (C) text.
>
> I tried to clean out iForthisms, but didn't test the code resulting
> from that operation.

As an exercise I'm attempting to port this to another ANS Forth.
I've chosen SP-Forth as my target.  (I tried Win32Forth, but the
latest version of Win32Forth has an incompatibility issue that
prevents it from loading it's own sockets.f library.  The offending
word is &LOCAL.)

I was able to find a lot of the non ANS words in the code such as
BOUNDS and ,".  I also figured out code for CR+ and +$ myself.
But there are still a couple of words I'm unsure about.

> 6667 =: IPPORT_IRC 	\ standard IRC port address

I'm guessing that's the same as:

6667 CONSTANT IPPORT_IRC

> : ?TEST-PING ( -- )
> 	response$ S" PING" TUCK COMPARE
> 	0= IF  'O' response$ CHAR+ C!
> 		response$ #resp +CR SEND$
> 		CLEAR #resp
> 	ENDIF ; 

What does "CLEAR #resp" do?
 
Regards,

John M. Drake

0
johnmdrake (128)
1/3/2007 5:43:07 PM
Jos van de Ven wrote:
> John M. Drake wrote:

> > As an exercise I'm attempting to port this to another ANS Forth.
> > I've chosen SP-Forth as my target.  (I tried Win32Forth, but the
> > latest version of Win32Forth has an incompatibility issue that
> > prevents it from loading it's own sockets.f library.  The offending
> > word is &LOCAL.)
>
> Add the following line at the start:
> Synonym &local &of
> 
> Jos

&of doesn't work either.  I'm using version 6.10.05 build 2.

0
johnmdrake (128)
1/3/2007 6:50:27 PM
John M. Drake wrote:
> 
> Jos van de Ven wrote:
> > John M. Drake wrote:
> 
> > > As an exercise I'm attempting to port this to another ANS Forth.
> > > I've chosen SP-Forth as my target.  (I tried Win32Forth, but the
> > > latest version of Win32Forth has an incompatibility issue that
> > > prevents it from loading it's own sockets.f library.  The offending
> > > word is &LOCAL.)
> >
> > Add the following line at the start:
> > Synonym &local &of
> > 
> > Jos
> 
> &of doesn't work either.  I'm using version 6.10.05 build 2.

It should work with Win32Forth V6.11.10
That can be downloaded from:
http://sourceforge.net/project/showfiles.php?group_id=55294

Jos
==
4ePost: 688 bytes in mail. Elapsed time to buffer: .000076 sec.
0
josv (130)
1/3/2007 7:04:35 PM
Jos van de Ven wrote:

> It should work with Win32Forth V6.11.10
> That can be downloaded from:
> http://sourceforge.net/project/showfiles.php?group_id=55294
>
> Jos

Thanks.  I've made the changes and it works now.  I also
got rid of REL>ABS and ABS>REL to stop all of the
irritating "Warning REL>ABS is a deprecated word"
messages.  I've uploaded the new file to the Win32Forth
Yahoo group.

Regards,

John M. Drake

0
johnmdrake (128)
1/4/2007 4:36:37 PM
mhx@iae.nl (Marcel Hendrix) writes:
>I tried to clean out iForthisms, but didn't test the code resulting 
>from that operation.

iForth has a feature that reports non-ANS words (that feature is
annoyingly on by default).  It might help for such cleaning jobs.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
Forth-Tagung 2007: http://www.complang.tuwien.ac.at/anton/forth-tagung07/
EuroForth 2007: September 13-16, 2007
0
anton (5320)
1/5/2007 8:38:35 PM
Reply:

Similar Artilces:

forth in forth
I came across this in the archives: >The widely shared belief (among both Forthies >and outsiders) that every "real" Forth programmer hacks together >his own compiler/interpreter/programming environment also makes >the Forth community look frivolous or at best naive. Most people >who program for a living know that there are more useful ways to >spend their time than building their own programming environment -- >the key to productivity is leveraging off other peoples' work. HERESY in the Forth community! Imagine... NOT coming up with your own CASE statement or local variable implemetation? Use OTHER PEOPLES TOOLS? Yuccch! One thing you can count on in the Forth community... try to establish a standard ANYTHING, and all that will happen is others will come up with their own implementation, defeating the purpose of standardization. Why is this? I mean, I'm usually quite happy to program in other languages without building my own interpreter or compiler. For instance with Ruby, the only time I even considered it's implementation was when I was learning how it's class structure was organised, and that was only because some of my references talked about the internals. Now with Forth, it seems like every step along the way makes me think about writing my own implementation! A couple of months back I designed (in outline) a prototype based OOPS for forth, and before I could finish it I was planning how to write a ...

Win32Forth Nano-IRC client in Forth
Here is my socket library ported to Win32Forth (tested on vsn 6.10.04). After loading socket.frt you can test with .TIME-OF-DAY and .QUOTE (There's something wrong with Win32Forth's TYPE that I'm not going to fix :-) The latest file is irc.frt. I have verified that it works. This gives some confidence that there aren't too many bugs in socket.frt. Modify and enhance as much as you like, but please try to keep the functionality of socket.frt (names, stack diagrams, actions) the same. I did not try to add Bernd Paysan's httpd server as I still don't know how to do that on Windows. -marcel -- begin itools.frt -------------------------------------------------------------------------------- \ preamble, words needed for portability : 0<= 0> 0= ; [UNDEFINED] ENDIF [IF] : ENDIF POSTPONE THEN ; IMMEDIATE [THEN] FALSE VALUE debug? : .debug ( c-addr u -- c-addr u ) debug? IF DUP 0 > IF 2DUP TYPE THEN THEN ; : ?FILE ( ior -- ) DUP IF ." file error# " DUP U. . ABORT THEN DROP ; : strlen ( addr -- count ) 0 SWAP BEGIN COUNT WHILE SWAP 1+ SWAP REPEAT DROP ; : PIN ( c-addr1 u1 c-addr2 -- ) SWAP CMOVE ; : STR+ ( c-addr1 u1 c-addr2 u2 -- c-addr3 u3 ) LOCALS| u2 c-addr2 u1 c-addr1 | u1 u2 + ALLOCATE THROW c-addr1 u1 2 PICK PIN c-addr2 u2 2 PICK u1 + PIN u1 u2 + ; : >STR ( c-addr1 u1 -- c-addr2 u2 ) PAD 0 STR+ ; CHAR [ CONSTANT '[' CHAR ] CONSTANT ']' CHAR...

applications in forth or forth libraries
is there a archive of applications built in forth? something like cpan for perl? etc.? On Dec 2, 3:46=A0pm, gavino <gavcom...@gmail.com> wrote: > is there a archive of applications built in forth? > > something like cpan for perl? etc.? Well, you'll find some things. Take a look at forthfreak.net to get the pointers. The main problem is that even "ANS compatible" Forths are not compatible at all if you add the mindset of the programmer to the standard. There are some classes of problems that are better solved by non-ANS extensions than with ANS. And almost every problem of some complexity involves such problems. So programmers that are used to one specific Forth system learn a domain specific way how to deal with such problems and sometimes they are (me too, indeed) surprised that a specific feature "is not ANS"... Perl has not that problem. You've one dominating implementation. Regards, -Helmar gavino wrote: > is there a archive of applications built in forth? > > something like cpan for perl? etc.? I think the vast majority of them are proprietary in nature, and hence not published. Cheers, Elizabeth -- ================================================== Elizabeth D. Rather (US & Canada) 800-55-FORTH FORTH Inc. +1 310.999.6784 5959 West Century Blvd. Suite 700 Los Angeles, CA 90045 http://www.forth.com "Forth-based products and Services for real-time applications since 1973.&...

Forth is to program , Forth is NOT to study ..
Forth is to program , not to learn , nor study . Study is for students , Students dont eat well . They seek help and subsidy , and credencials .. all , far from productive programming . There is NO arguement , NO arguement in Forth , cause it is always done LEAST WORK , FASTEST runtime . In 40 years , Humans have built up school systems , universities, industries and factories Since it is a "system" , its uncompetitive . Competition and profits are impossible from any system . Accountants can see the "books" indicate this is the last of those 40 years of educational systems . For the lack of profits . Productivity/Profits comes ONLY from individuals , working alone ( competition) . They create their own "tools" . They NEVER write manuals cause every tool is the simplest it can be , Needs no explanation . Forth Dictionary is not for teaching Forth , its for organizing WORDS . Its for taking work and details away from the programmer . Forth is to program , not to learn , nor study . Study is for students , Students dont eat well . They seek help and subsidy , and credencials .. This is not programming. There is NO arguement in Forth , cause it is always done LEAST WORK , FASTEST , no BLOAT . -------- In 40 years , Humans have built up school systems , universities, industries and factories Since it is a "system" , its uncom...

no forth pc? no forth replacement for mysqL? a la www.prevayler.org? no forth appserver?
how about a forth clone of iceWM in 1% the code? On Wednesday, February 12, 2014 8:36:49 PM UTC-6, the_gavino_himself wrote: > how about a forth clone of iceWM in 1% the code? Right now, what I'm interested in is niche RPGMaker-type games on Android. I've done some of this work already in Java, including creating a map editor (on Android) and a playable demo, using First Seed Material (http://www.tekepon.net/fsm/index.php) assets I gave up on my last alternatives to Java when I found Terminal IDE, which allowed me to move code all the way from Java source to installable .apks on the device itself. But now there is a Forth system on Android! https://play.google.com/store/apps/details?id=gnu.gforth&hl=en I don't know if it'll have on-device turnkey facilities soon or ever, or how deployment will otherwise work. I've some familiarity with Java API, the Android way of XML-specified interfaces and the like (fortunately, games mostly ignore that part of Android), but JNI and friends is still a mystery to me. But you can get the satisfaction of being able to touch an icon and have your Forth app start up.... by the roundabout method of having an auxiliary app that 1) slides Forth source into starta.fs on the SD card and then 2) launches gforth. It's satisfying anyway. So in the manner of someone laying down track with the expectation that there will be a tunnel through the mountain by the time the mountain is reache...

Forth
Anyone know of a version of Forth for RISC OS? I used to use Forthmacs by Hanno Schwalm a few years ago, but I've been out of the Acorn scene since 2000, recently returned with an Iyonix. Hanno's site seems to be down and no reply from his old e-mail address. Anton -- Hi, By the process of poking various fingers onto keys Anton generated this: > Anyone know of a version of Forth for RISC OS? > > I used to use Forthmacs by Hanno Schwalm a few years ago, but I've been out > of the Acorn scene since 2000, recently returned with an Iyonix. Hanno's > site see...

FORTH
Has anyone got an implementation working on a TREO 600? Ian implementation of what On Fri, 23 Apr 2004 18:44:49 +0000 (UTC), "Ian Jones" <bellevueparkw@btinternet.com> wrote: |Has anyone got an implementation working on a TREO 600? | |Ian | Alien at Large wrote: > On Fri, 23 Apr 2004 18:44:49 +0000 (UTC), "Ian Jones" > <bellevueparkw@btinternet.com> wrote: > > |Has anyone got an implementation working on a TREO 600? > | > |Ian > > implementation of what What he said in the subject line. (Hint: it&#...

Id love to surf web with 4megs ram forth pc using forth and forth chips
when will this happen? cant wait!! On 9/27/2013 11:52 AM, the_gavino_himself wrote: > when will this happen? > > cant wait!! > I'll happen when someone comes up with several $M in funding. Cheers, Elizabeth -- ================================================== Elizabeth D. Rather (US & Canada) 800-55-FORTH FORTH Inc. +1 310.999.6784 5959 West Century Blvd. Suite 700 Los Angeles, CA 90045 http://www.forth.com "Forth-based products and Services for real-time applications since 1973." ================================================== Elizabeth D Rather wrote: > On 9/27/2013 11:52 AM, the_gavino_himself wrote: >> when will this happen? >> >> cant wait!! >> > > I'll happen when someone comes up with several $M in funding. With 4 megs of RAM? I wouldn't do that even if I had large funding. This is not enough memory to display a single cat image, so it's not worth considering. -- Bernd Paysan "If you want it done right, you have to do it yourself" http://bernd-paysan.de/ On Tuesday, October 1, 2013 11:01:15 PM UTC+1, Bernd Paysan wrote: > With 4 megs of RAM? I wouldn't do that even if I had large funding. Thi= s=20 > is not enough memory to display a single cat image, so it's not worth=20 > considering. This is true. Cat images are big. Especially images of lions - because they= ar...

3 books on eBay: Starting FORTH; Thinking FORTH; FORTH Programmer's Handbook
Forth Programmer's Handbook by Conklin and Rather Search for eBay Item # 4129534182 Excellent (like new) condition, second EDITION (August 1998), sixth PRINTING (August 2000). Thinking Forth by Leo Brodie (1984) Search for eBay Item # 4129545378 Excellent (like new) condition, this is the 1994 reprint from Fig Leaf Press (Forth Interest Group, Inc). Starting Forth by Leo Brodie (1987) Search for eBay Item # 4129553634 Second edition, in very good condition. Shows slight wear, but very clean. The softcover binding is in excellent shape. ...

3 books on eBay: Starting FORTH; Thinking FORTH; FORTH Programmer's Handbook #2
Forth Programmer's Handbook by Conklin and Rather Search for eBay Item # 4129534182 Excellent (like new) condition, second EDITION (August 1998), sixth PRINTING (August 2000). Thinking Forth by Leo Brodie (1984) Search for eBay Item # 4129545378 Excellent (like new) condition, this is the 1994 reprint from Fig Leaf Press (Forth Interest Group, Inc). Starting Forth by Leo Brodie (1987) Search for eBay Item # 4129553634 Second edition, in very good condition. Shows slight wear, but very clean. The softcover binding is in excellent shape. ...

Differences between ANS Forth and Forth-79
Hello all, I have recently accquired the german edition of Leo Brodies's "Starting Forth". Since it uses the Forth-79 standard, I would like to know if there is a document that lists the differences between Forth-79 and ANS-Forth. Appendix D.6 of the dpANS draft details the differences between Forth-83 and ANS Forth, but I would like to know, if there are other things to be aware of. I know that there are several ANS-Forth versions of "Starting Forth" available on the web, but I would prefer to read the dead trees version. Many thanks in advance, Alex Alexander Shendi wrote: > Hello all, > > I have recently accquired the german edition of Leo Brodies's > "Starting Forth". Since it uses the Forth-79 standard, I would like > to know if there is a document that lists the differences between > Forth-79 and ANS-Forth. > > Appendix D.6 of the dpANS draft details the differences between > Forth-83 and ANS Forth, but I would like to know, if there are > other things to be aware of. > > I know that there are several ANS-Forth versions of "Starting > Forth" available on the web, but I would prefer to read the > dead trees version. > > Many thanks in advance, There was a Forth-83 version of Starting Forth published in the mid-80's, but I don't know if it was translated into German. The biggest problem you'll encounter is that the difference between Forth as descr...

Writing ANS Forth in ANS Forth
Hi I'm currently attempting to write an ANS-compliant ITC Forth system for the ARM as a personal learning project. I've implemented my system primitives as code words and am now starting to look at the implementation of the high-level words. I've noticed that a number of systems use non-ANS definitions or user variables such as LATEST in their implementation of high-level words. I'm currently trying to decide how this fits in with a strictly ANS-compliant system. Here are my thoughts so far regarding two possible approaches... 1) Implement non-ANS words and use them in high-level ANS word definitions. Pros - Makes implementation of some words easier(?). Cons - Non-ANS words visible to the user. System always has bespoke extensions whether you want it to or not. High-level definitions not portable. 2) Only implement high-level ANS words in terms of other ANS words. Pros - 'Cleaner' implementation(?). System has no bespoke extensions. Using SEE on high-level words only shows ANS source, so the user only sees standard documented words. Cons - Some words that would have previously been high-level would have to be implemented as code words where no suitable ANS primitives exist. So, should a strictly ANS-compliant Forth only ever be implemented in ANS Forth? (and is that even possible/practical?) I guess that without the visibility provided by WORDS and SEE this really becomes a non-issue with the user being unaware that there are a number of und...

Forth Application and Technique OR Forth Handbook
hello I buy 1 week ago on amazon U.S. "Forth applications and technical" I would like to know if this book is worth knowing - I do not familiarized with programming language ? and if it is sufficient to have familiarized high in this language ? is that the book "Forth programming" handbook is necessary ? i have not a good level of english and i use a translator thanks On Wednesday, April 10, 2013 7:37:15 AM UTC-7, michael wrote: > hello > > > > I buy 1 week ago on amazon U.S. "Forth applications and technical" > > > > I would like to know if this book is worth knowing > > > > - I do not familiarized with programming language ? > > > > and if it is sufficient to have familiarized high in this language ? > > > > is that the book "Forth programming" handbook is necessary ? > > > > i have not a good level of english and i use a translator > > > > thanks Best book to learn from beginner. Starting Forth Free Online Version http://www.forth.com/starting-forth/ Also get an old paper book copy Jason In comp.lang.forth, michael wrote: > i have not a good level of english and i use a translator If you need some French materials - maybe try Turboforth for DOS? http://forth.free.fr/apprentissage/turbo-forth/page00.htm -- The consensus was, as usual in this co...

JavaScript to Forth translator (shift-forth)
Hi All, I am working on experimental tool to translate JavaScript (subset) into Forth. https://github.com/drom/shift-forth It takes JavaScript program in Single Static Assignment (SSA) form, implements very simple stack scheduling algorithm, using PICK for deep stack access. And runs peephole optimizer on top. I am working to add basic control structures to to it: Call, if, while Any suggestions are welcome. --Alexey ...

Forth as Assembly Language (Was Re: FORTH levels)
Guy Macon wrote: > > John Doty wrote: > > >It's pretty clear from the contents of the development kits > >that the dominant language for small widgets must be C. > > Your viewpoint is skewed. Those development kits are for > *medium*- sized low volume widgets. When the quantities > become high (some of my designs have reached quantities of > 100,000 per hour) the usual choices (PIC, 8051, ARM...) cost > too much. At those volumes you are more likely to see > microcontrollers made by by GeneralPlus/SunPlus, Elan/EMC, > WinBond, Sonix, etc, and nearly 100% of the software is > written in highly optimized assembly language with > Forth making some inroads. This is an entire world that is > invisible to you unless you are a designer of talking barbie > dolls, computer mice, or musical greeting cards. > > References: > http://www.embedded.com/story/OEG20010221S0034 > http://www.aes.org/sections/la/archive/2000/2000_docs/soundfortoys200004.doc > > -- > misc.business.product-dev: a Usenet newsgroup > about the Business of Product Development. > -- Guy Macon <http://www.guymacon.com/> > Forth can be used as an assembler. What is keeping Forth from replacing a conventional assembler? Can't a Forth development system do whatever optimization is needed for machine code faster and better than ancient assembly language? By the way John Doty is involved in the des...

FORTH source foundation or FORTH groupware system
Is it possible to create some FORTH groupware to share sources, libs, application code and so on ? FORTH can't work fine with traditional library oriented way -- FORTH needs small sized peaces of code, traditional libraryes have much more size Dmitry Ponyatov wrote: > Is it possible to create some FORTH groupware to share sources, libs, > application code and so > on ? > > FORTH can't work fine with traditional library oriented way -- FORTH > needs small sized peaces of code, traditional libraryes have much more > size Wikis are a good fit for this model. I've shared a lot of my Forth code on http://wiki.forthfreak.net/ for example. Searching the archives of comp.lang.forth for nuggets is also worthwhile. Ian "Dmitry Ponyatov" <google@akps.ssau.ru> wrote in message news:1136716071.397980.207880@g43g2000cwa.googlegroups.com... > Is it possible to create some FORTH groupware to share sources, libs, > application code and so > on ? > > FORTH can't work fine with traditional library oriented way -- FORTH > needs small sized peaces of code, traditional libraryes have much more > size I don't know that any special "groupware" is required. Most of the popular Forth implementations have some form of user's groups for sharing code (in source form, since that's the preferred mode in Forth). FORTH, Inc., for example, maintains user email lists and a wiki for our main products, Sw...

With Forth
With Forth I can pretend that I am sometimes connected to reality while attempting to write a computer program. Jason ...

How would you do this in Forth?
Hi all, I'm wondering how you guys would solve the following problem in Forth. You're given a string (just a count and chars in memory, or a pointer to chars plus a count, or a null-terminated string, doesn't matter) and you wish to tokenize it in much the same way that /bin/sh does, splitting it on whitespace boundaries but respecting escaping and quoting. As output, you want to produce a list of strings (again, represented in any way which is most convenient.) It should support the following: - Simple whitespace-separated tokens, with varying amounts of whitespace: foo bar foo bar - Escaping the space to form one token, eg the following parses as two tokens not three: foo\ bar baz - Quoting text to form tokens: "hello world" "how are you" 'hello world' 'how are you' - Escaping the quotes inside a quoted token: "hello\"world" Slava On Nov 24, 3:43 pm, Slava Pestov <sl...@jedit.org> wrote: > Hi all, > > I'm wondering how you guys would solve the following problem in Forth. > You're given a string (just a count and chars in memory, or a pointer > to chars plus a count, or a null-terminated string, doesn't matter) > and you wish to tokenize it in much the same way that /bin/sh does, > splitting it on whitespace boundaries but respecting escaping and > quoting. As output, you want to produce a list of strings (again, > represented in any way which is mo...

Re: Differences between ANS Forth and Forth-79
-------------------------------1162045838 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In a message dated 10/26/2006 5:50:22 P.M. US Mountain Standard Time, eratherXXX@forth.com writes: The biggest problem you'll encounter is that the difference between Forth as described in either edition of Starting Forth and any contemporary Forth you might want to use is vast. For example, SF assumes that your program source is in 1024-byte "blocks" that must be edited with a special Forth editor. There may be a few systems that still work this way, not many. Most use standard OS files and you can use the editor of your choice. SF also assumes an implementation strategy that is not used by the most popular implementations today. I liked blocks, and still do. I wrote blocks to convert FIG-Forth to Forth-79 and Forth-79 to Forth-83 and it seemed very simple at the time. Naturally, those blocks are lost because they were written for the Commodore 64. As I recall, my biggest problem was remembering the numbering change for PICK and ROLL. It was almost as bad as the change in NOT in ANSI Forth. I had to change all my NOTs to 0= and if I had a -1 XOR I could change it to NOT. The changes made sense but I had to change some of my words. The early editions of SwiftForth gave me serious headaches in their effort to be ANSI compliant. I used 3-dimensional bit arrays in some of my programs and ...

Is Forth up to it?
Might be of interest to Forthers with a vision / mission: http://hardware.slashdot.org/article.pl?sid=09/08/11/1242217 -- duke On Aug 11, 6:26=A0am, Duke Normandin <dukeofp...@ml1.net> wrote: > Might be of interest to Forthers with a vision / mission: > > http://hardware.slashdot.org/article.pl?sid=3D09/08/11/1242217 > -- > duke I'm sure somebody will argue that it needs a full-blown OS with swap- space :-) -Mux Mux schrieb: > On Aug 11, 6:26 am, Duke Normandin <dukeofp...@ml1.net> wrote: >> Might be of interest to Forthers with a vision / mission: >> >> http://hardware.slashdot.org/article.pl?sid=09/08/11/1242217 >> -- >> duke > > I'm sure somebody will argue that it needs a full-blown OS with swap- > space :-) > > -Mux I argue that it needs a full-blown OS with swap-space. On Aug 12, 9:44 am, Mux <Yvo.Z...@gmail.com> wrote: > On Aug 11, 6:26 am, Duke Normandin <dukeofp...@ml1.net> wrote: > > > Might be of interest to Forthers with a vision / mission: > > >http://hardware.slashdot.org/article.pl?sid=09/08/11/1242217 > > -- > > duke > > I'm sure somebody will argue that it needs a full-blown OS with swap- > space :-) > > -Mux so a forther would say full blown os is overkill, that forth can solve the problem directly, without all the crust.... awesome! forth I see has its own multitasking abilities....gosh forth seems pow...

ITS NOT FORTH
What i read here has nothing to with Forth . Forth is to nix the overhead and noise and simplify . If your SW compiles , it cant be Forth . Forth is imediate programming at any level , without reading manuals . It is intuitive . You dont have to figure the Kernel , while programming . Tomas Scott Guadalajara MX Cell 33 1449 2609 ( Call for routes in GDL ) KC7CC Ham Radio The new PC is Nientendo DS Lite . It will destroy existing WEB , cell phones providers I offer free programming advice and help on DS Lite BIOS . ...

Any Forths out there...
Are there any Forths in the wild that support use of >R and R> with interspersed locals? For instance (pointless example, I know); : x { a b } a >r b r> ; From what I get from the standard, this isn't allowed (although I find the reference to "Immediate words" mystifying); 13.3.3.2 Syntax restrictions Immediate words in a program may use (LOCAL) to implement syntaxes for local declarations with the following restrictions: .... d) After a definition=92s locals have been declared, a program may place data on the return stack. However, if this is done, locals shall not be accessed until those values have been removed from the return stack; Plus, e, g and h seem to explicitly forbid certain actions; e) Words that return execution tokens, such as =92 (tick), [=92], or FIND, shall not be used with local names; g) Locals may be accessed or updated within control structures, including do-loops; h) Local names shall not be referenced by POSTPONE and [COMPILE]. Why are these not "an environmental dependency"? On Sep 6, 7:38=A0am, Alex McDonald <b...@rivadpm.com> wrote: > d) After a definition=92s locals have been declared, a program may place > data on the return stack. However, > if this is done, locals shall not be accessed until those values have > been removed from the return > stack; > g) Locals may be accessed or updated within control structures, > including do-loops; It seems to me if you're going to m...

What is Forth?
I thought that it might be fun to start a thread asking the question, what is Forth? I have heard it stated that Forth is Words and Stacks. But, with the new Forth chips, the use of stacks is discouraged, because they are so shallow. Also, it seems that unstructured programming is encouraged with the new chips, lots of jumps to save on a few bytes of code. If that be true then perhaps Forth is no longer Words and Stacks?? In my mind Forth is programming in the extensible macro assembler of a mind wrenchingly simple virutal machine, while for contrast, Java is programming in C++ on top of a mind wrenchingly complex virutal machine. More verbosely, Forth is programming in the extensible macro assembler of a mind wrenchingly simple virtual machine, which features two Stacks which are used implicitly, and which also features Words. What's your definition? Honestly, I don't know enough about hardware to make a statement one way or another about chips in general, and the new Intellasys chips in particular, I only know microcomputer programming. Jason Jason Damisch wrote: > I thought that it might be fun to start a thread asking the question, > what is Forth? > > I have heard it stated that Forth is Words and Stacks. But, with the > new Forth chips, the use of stacks is discouraged, because they are so > shallow. Also, it seems that unstructured programming is encouraged > with the new chips, lots of jumps to save on a few bytes of code. I...

Forth is written in Forth and it boots ur PC
Forth is written in Forth Forth must boot Forth ... My stuff is called ForthRite , if no U.C. i'll have to read it as forthrite , certainly a new English verb meaning proper and unarguebale .... !! Same thing , my stuff is proper and unargueable .... Forthrite shell is the first 400 bytes in an ARM 128KB NOR-Flash boot ROM . It I/O's to RS232c serial port , but also on same wires is a 4 by 4 keypad to send breaks to RS232c .. It can create permanent code in its tiny dictionary located in SRAM . If the normal boot process is successful , there s no need to understand any of this , because Forthrite always allows one to program at the highest level . You can learn to use Forthrite by experimenting with [ Expand_Explain ] key . This key works at all levels without any input . If you hit this key , it will use MRU to disassemble that last frag/level . If you hit [ Expand Not ] key it will delete what it normally adds to MRU . You can assemble OpCodes , in Forthrite at any level . You are not forced to assemble code from an assembler . My 1st project is an ARM9 to create a replacement for the IBM PC . I will be able to enter text w/o using a key board and at 300 WPM . I want a voice input pocket PC , ARM7 , it doesnt bog down with IBM voice recognition , because it takes ur keystrokes to "improve" werty wrote: > Forth is written in Forth > > Forth must boot Forth ... > >...

Web resources about - Nano-IRC client in Forth - comp.lang.forth

Resources last updated: 3/26/2016 3:03:06 PM