modify upstream makefile to allow hardening build flags to apply
[debian/yforth] / README
1 yForth? v0.2+beta - READ THIS (AND ONLY THIS) TO GET yForth? RUNNING.
2
3 0) Hello world!
4 Here's a little file which will help you having yForth? running in few
5 minutes on your system. 
6
7 1) What's yForth? ?
8 yForth? is a Forth environment written entirely in ANSI C, making it 
9 extremely portable. The first thing I want to tell you about yForth? is
10 that it seems a joke compared to other systems such as gForth or PFE.
11 The only things it has in common with PFE are that it's written in C, and
12 it's been written for fun.
13 It's rude, it hasn't anything odd, there's no reason to choose yForth? instead 
14 of other Forth environments. 
15 Nevertheless, you could find yForth? nice, in this case you're invited to 
16 explore yForth? in the following lines. 
17 yForth? is based on the draft of ANS Forth, but it's NOT complete. 
18 The reason is very simple: not all the words included in ANS Forth can be 
19 written using only ANSI C. In particular, those words which interact with 
20 system hardware almost directly, such as words which control the terminal, 
21 can't be written using solely ANSI C (and related libraries).
22 In fact, you'll find that all the device dependent routines are grouped
23 together in the file "udio.c". If you're using Turbo C, Borland C, or any
24 compiler which supplies the "conio.h", you can define HAVE_CONIO in 
25 your "config.h" file and go. 
26
27 2) Where does the name yForth? came from?
28 I've been charmed by Forth since the first time I "played" with it, but 
29 I've never been able to find some book (here in Italy, obviously) to learn it. 
30 When I've put my hands on the draft of ANS Forth I thought that 
31 the best way to learn it was to write an environment. I was wondering what
32 features made Forth so popular. I asked myself: Why Forth?
33
34 3) How do I compile yForth? for my system?
35 It's simple. First of all you'll have to modify "config.h" accordingly with
36 your system AND compiler requirements. In order:
37 - modules
38 You can exclude some modules to make a smaller environment, but keep
39 in mind that all the modules will be compiled anyway. You must rely on
40 your compiler "smart-linking" to cut off unused functions.
41 - big/little endian
42 Define LITTLE_ENDIAN if your machine "is" little-endian (e.g. Intel), 
43 undefine it if it's big-endian (e.g. Motorola, SPARC).
44 - double-cell transfer
45 You can choose two ways for moving a DCell data from data stack to C internal
46 variables. If DCELL_MEM is defined moving is performed via memory copy,
47 if it's undefined moving is performed via shift operators (<< and >>).
48 - data types
49 The most important thing is choosing what C types will identify Cells and
50 Double Cells in yForth?. Be sure that 2 * sizeof(Cell) == sizeof(DCell).
51 Note that using GCC makes this things trivial, since it has a "long long"
52 type which allows having 32bit Cells. Using Turbo C that's not possible.
53 Below data definition you'll have to change the maximum values of your
54 system. See "limits.h".
55 - terminal
56 Finally, define HAVE_CONIO to 1 if you're using Turbo C, Borland C or GCC 
57 for DOS. You'll have some nice words such as "page"...
58 - special functions
59 "asinh", "acosh", "atanh" aren't provided by all the libraries, if you don't
60 have them reset the definitions at the end of "config.h".
61
62 The second thing to do now is configuring the "Makefile". At the moment 
63 "Makefile" is ready for GCC (under Linux), it's simple and you won't find any 
64 problem modifying it.
65
66 Third, type "make all". Yes, that's all.
67
68 4) I have yForth? running, and now?
69 It's your, you can make anything you want with. If you want an explanation
70 of the words provided by yForth? please refer to the draft of ANS Forth or
71 something equivalent. The Net will help you.
72 Do not expect the prompt "ok" to come up when you run yForth?, the standard
73 says that "ok" shall be printed AFTER every succesful command execution...
74
75 5) What about yForth? in 1997?
76 Well, I think yForth? will be available since January 1997, and at the moment
77 I've no idea of some future developlment. I've learned a lot writing it, both
78 Forth and C, but I can't say I've learned programming in Forth.
79 Ideas come and go, now they're all gone. But don't despair, if you have some
80 fantastic intuition you want to share, email me, I'll listen to you!
81 Furthermore, this package is still incomplete. The source code can be better
82 organized, more documentation could be written, and so on. If you want to
83 work on it, you can, and I'd be happy to work together to make some improvement.
84
85 6) Hey, just a moment!
86 Don't forget:
87         - yForth? is a "beta" release, I think it has bugs, but, most 
88                 important, I'm afraid that some words don't behave as the
89                 standard says they have to.
90         - yForth? is NOT a complete ANS Forth.
91         - yForth? is written in ANSI C. Ok, you could see some warning while
92                 compiling it, and I've to check it with lint, but it 
93                 doesn't make use of any capability other than those provided
94                 by the standard (well, "long long" doesn't belong to the
95                 standard, but you're anxious to work whit 32bit Cells,
96                 aren't you?).
97         - yForth? comes with it's nice logo (yforthlogo.gif).
98         - yForth? comes with some word not included in ANS Forth. The most
99                 useful ones are those you find in "ycore.c". Each comes with
100                 a short description just before its implementation.
101         - yForth? may not support "page" on systems where "conio.h" is unknown.
102                 Since I love clearing screens, here's a little tip, define:
103                 : page s" clear" system drop ;
104                 And you'll have "page" working on your Unix system.
105
106 7) Please report bugs
107 I'll be very happy if you report me some bug. Obviously I'll be happy even
108 more if you tell me how fo fix it, but I can't pretend so much, even 'cause
109 my C is not very readable (few comments...).
110
111 email: lpadovan@cs.unibo.it
112
113 Enjoy yForth?
114
115 **********************************************************************
116                              CONTRIBUTORS 
117 **********************************************************************
118