Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

why forth over lisp haskell and ada?

241 views
Skip to first unread message

endlessboo...@gmail.com

unread,
Jun 15, 2016, 3:15:59 PM6/15/16
to
why?

Ron Aaron

unread,
Jun 16, 2016, 12:59:14 AM6/16/16
to
On 15/06/2016 22:15, endlessboo...@gmail.com wrote:
> why?
Why ask why?

JUERGEN

unread,
Jun 16, 2016, 2:31:57 AM6/16/16
to
On Wednesday, June 15, 2016 at 8:15:59 PM UTC+1, endlessboo...@gmail.com wrote:
> why?

Forth is better
Lisp is better
Haskell is better
Ada is better
Just depends which group you are in otherwise you would change

lawren...@gmail.com

unread,
Jun 16, 2016, 4:35:44 AM6/16/16
to
On Thursday, June 16, 2016 at 7:15:59 AM UTC+12, endlessboo...@gmail.com wrote:
> why?

Ada is designed for writing robust, ultra-reliable code, like the life-support system on the International Space Station.

Lisp has continuations <http://www.codecodex.com/wiki/Continuations>.

Forth? Forth is ultra-small, and is low-level as you might want to go without resorting to assembly language.

foxaudio...@gmail.com

unread,
Jun 16, 2016, 2:09:56 PM6/16/16
to
Interestingly enough, there is a company in the UK that uses Forth for
high-reliability systems. Most people can get their head around certifying
their own code, but can you certify the compiler that use?

Apparently the simplicity of the Forth compiler lends itself to certification
for high reliability systems used in the railroad industry for safety related
applications.

Maybe Stephen or someone here can remember the name of the company/person who
used to post here.

BF

lawren...@gmail.com

unread,
Jun 16, 2016, 7:21:22 PM6/16/16
to
On Friday, June 17, 2016 at 6:09:56 AM UTC+12, foxaudio...@gmail.com wrote:
> Interestingly enough, there is a company in the UK that uses Forth for
> high-reliability systems.

Did you know your car systems might have been programmed in C <https://en.wikipedia.org/wiki/MISRA_C>?

HAA

unread,
Jun 16, 2016, 8:38:50 PM6/16/16
to

hughag...@gmail.com

unread,
Jun 16, 2016, 10:58:17 PM6/16/16
to
On Wednesday, June 15, 2016 at 12:15:59 PM UTC-7, endlessboo...@gmail.com wrote:
> why?

Lisp, Haskell and Ada are all very different from Forth, and very different from each other too.

This is a troll thread --- similar to WJ posting OCaml code, previously OForth code until Franck told him to stop, previously Gauche Scheme code, and often Ruby code --- you are just trying to start a flame-war of people saying: "my language can beat up your language!"

All of these languages are good in their own way --- that is why the all have their enthusiasts.

Gavino --- why don't you just write some programs in one of the languages --- it doesn't have to be Forth, although that would likely be the easiest to learn, but just pick one of them and write a program.

Programming is about writing programs --- not posting threads on the internet --- I really think the internet has been an overall negative factor in the advancement of programming, not positive.

hughag...@gmail.com

unread,
Jun 17, 2016, 2:16:09 AM6/17/16
to
On Thursday, June 16, 2016 at 7:58:17 PM UTC-7, hughag...@gmail.com wrote:
> On Wednesday, June 15, 2016 at 12:15:59 PM UTC-7, endlessboo...@gmail.com wrote:
> > why?
> Programming is about writing programs...

Gavino --- I'm going to be like a teacher and give you an assignment! These are the rules of the assignment:
1.) Until you finish your assignment, you are not allowed to start any more of these idiotic threads on comp.lang.forth (or comp.lang.lisp etc.) --- if you do, you will just be reminded that you haven't finished your assignment.
2.) When you finish your assignment, I will put your program in the novice-package --- you will be famous! --- there is no better path to Forth fame than this!

Here is the assignment: write a BreakOut game in ANS-Forth. I did this myself on the Commodore Vic-20 in line-number BASIC when I was about 16 years old (not as complicated as what I'm describing here; I ran into severe speed problems and had to keep things simple). I had to take recourse in unlawful carnal knowledge of BASIC to get my program to run at reasonable speed. You can write your program in ANS-Forth though because the modern computers are much faster than the Vic-20. Use these characters:
] these represent the left wall
[ these represent the right wall
O this represents your ball
[#] these represent the bricks, which form a wall along the top of the screen (a space between)
[=] these are like bricks, except that if you hit one you get another life
[V] these represent spikes which are among the bricks in the wall along the top
[O] these represent balls which are among the bricks in the wall along the top
===== this represents your paddle, which moves along the bottom of the screen

The game is like a one-player version of Pong. You slide your paddle left and right (the left and right arrow keys can be used) to hit the ball so it bounces upwards. The ball bounces off the walls and off the bricks.
1.) When the ball hits a [#] it not only bounces off the brick, but it causes the brick to disappear.
2.) When the ball hits a [V] it not only bounces off the spike, but it causes the V to fall. Also, the ball bounces at a random angle.
3.) When the ball hits a [O] it not only bounces off the ball, but it causes the ball to fly away in the direction that the original ball came from.

The wall looks like this:

[#] [#] [#] [O] [#] [#] [#] [#] [V] [#] [O] [#] [#] [V] [#] [#] [#] [#] [#]
[#] [#] [V] [#] [#] [V] [#] [O] [#] [#] [#] [#] [#] [#] [O] [#] [#] [#] [#]
[#] [#] [#] [#] [V] [#] [#] [V] [#] [#] [#] [=] [#] [#] [#] [V] [#] [#] [#]
[V] [#] [#] [#] [#] [=] [#] [#] [#] [#] [#] [V] [V] [#] [#] [#] [V] [#] [#]

The [V] and [O] and [=] are distributed randomly in the wall. You can have several levels of difficulty. The first level would have only [#] in the wall. The next level would have some [V] in the wall. The next level would also have some [O] in the wall.

The goal of the game is to break through the wall.
If you fail to hit a ball with your paddle and the ball goes out the bottom of the screen, then you lose a life.
If you hit a [=] then it disappears like a brick, but you also get another life.
If you hit a [V] then the V drops (also, the ball bounces at a random angle) --- you have to avoid the falling spike because if it hits your paddle then you lose a life.
If you hit a [O] then that O becomes live --- now you have more than one ball that you must keep in play with your paddle.

Because we are using characters rather than graphics, there are a limited number of vectors that the ball can travel on:
up 1 right 1
up 1 right 2
up 2 right 1
up 1 left 1
up 1 left 2
up 2 left 1
down 1 right 1
down 1 right 2
down 2 right 1
down 1 left 1
down 1 left 2
down 2 left 1

Write your program as a paced loop. This means that every X milliseconds, your ball(s) and spike(s) move up or down 1 char (you will have to figure out X by experimentation; determine what speed makes the game fun, but not so fast as to be unplayable). Unfortunately, one of the many failings of ANS-Forth is that it doesn't provide a standard way to check the system clock to determine how many milliseconds have elapsed (the TIME&DATE word is only accurate to seconds). You need these words:
INIT-TIME ( -- ) initializes the time to zero
TIME ( -- ms ) returns the number of milliseconds since SET-TIME was called
Just choose an ANS-Forth compiler and ask your friendly compiler-vendor to provide these words for you. I recommend that you choose VFX because SwiftForth might be too slow for your game to be playable without recourse to assembly-language --- you don't want to have to delve into assembly-language on your first-ever program (these aren't the bad-old-days of the Vic-20 in which assembly-language was a must for almost any program; you have that advantage over me when I was writing this program).

Good luck with your assignment! You can post messages on comp.lang.forth asking specific questions related to your assignment. You can't post any more idiotic messages such as: "could you re-implement myth2 soul-blighter game in forth?" You also can't post vague messages such as: "Um, my source-code file is empty. How should I, um, begin?" Note that these rules apply whether you accept the assignment or not --- quite frankly, we are all sick and tired of your idiotic questions --- you have to complete the assignment or nobody will respond to your posts any more! Programming is all about discipline --- you have to force yourself to work on the assignment until it is complete!

Note that there is an element of irony in the choice of BreakOut as your first-ever Forth program. You have been trapped in the doldrums of attention-deficit-disorder for over 30 years --- now it is time to break out of the doldrums and write an actual computer program! --- you will have something to be proud of when you succeed!

hughag...@gmail.com

unread,
Jun 17, 2016, 2:36:47 AM6/17/16
to
On Thursday, June 16, 2016 at 11:16:09 PM UTC-7, hughag...@gmail.com wrote:
> Good luck with your assignment! You can post messages on comp.lang.forth asking specific questions related to your assignment. You can't post any more idiotic messages such as: "could you re-implement myth2 soul-blighter game in forth?" You also can't post vague messages such as: "Um, my source-code file is empty. How should I, um, begin?" Note that these rules apply whether you accept the assignment or not --- quite frankly, we are all sick and tired of your idiotic questions --- you have to complete the assignment or nobody will respond to your posts any more! Programming is all about discipline --- you have to force yourself to work on the assignment until it is complete!

You can write your program in Lisp or whatever if you prefer that language to Forth (you can even use Haskell or Ada; this would likely be the first time anybody has written a video game in either of those language!). Obviously, if you want technical help on comp.lang.forth then you must use Forth. Also, if you want the awesome fame of getting your program in included in my novice-package, then you must use Forth. Learning Lisp is arguably more useful in the real-world than learning Forth though, so you might choose Lisp for that reason. Use whatever language you want! But, you must write the program and get it to work --- you can't just continue talk on the internet about programming, without doing any programming.

foxaudio...@gmail.com

unread,
Jun 17, 2016, 9:27:13 AM6/17/16
to
Thank you. Paul Bennet of course. He has developed some very rigorous coding
procedures that demonstrate even though Forth is a low level, non-typed,
un-protected environment, that very same flexibility allows one to test it down
to the hardware. I like the counter-intuitive nature of the work.

It seems very supportive of the original concepts that Chuck Moore said were
true about this alternative way to develop software.

BF

lawren...@gmail.com

unread,
Jun 17, 2016, 7:16:16 PM6/17/16
to
On Friday, June 17, 2016 at 12:38:50 PM UTC+12, HAA wrote:
> http://www.forth.org/forth_coding.html

“public domain for non-commercial use” ... very mysterious.

endlessboo...@gmail.com

unread,
Jun 18, 2016, 11:35:34 PM6/18/16
to
fuk u

hughag...@gmail.com

unread,
Jun 19, 2016, 12:56:46 AM6/19/16
to
On Thursday, June 16, 2016 at 11:16:09 PM UTC-7, hughag...@gmail.com wrote:
> Write your program as a paced loop. This means that every X milliseconds, your ball(s) and spike(s) move up or down 1 char (you will have to figure out X by experimentation; determine what speed makes the game fun, but not so fast as to be unplayable). Unfortunately, one of the many failings of ANS-Forth is that it doesn't provide a standard way to check the system clock to determine how many milliseconds have elapsed (the TIME&DATE word is only accurate to seconds). You need these words:
> INIT-TIME ( -- ) initializes the time to zero
> TIME ( -- ms ) returns the number of milliseconds since SET-TIME was called
> Just choose an ANS-Forth compiler and ask your friendly compiler-vendor to provide these words for you. I recommend that you choose VFX because SwiftForth might be too slow for your game to be playable without recourse to assembly-language --- you don't want to have to delve into assembly-language on your first-ever program (these aren't the bad-old-days of the Vic-20 in which assembly-language was a must for almost any program; you have that advantage over me when I was writing this program).

Well, disproving Stephen Pelc's assertion that I don't know how to read, I looked up timers in the VFX manual.

He has a word called TICKS that is like my TIME above, but unfortunately he doesn't anything like my INIT-TIME so his TICKS is not very useful.

He does have this though:
--------------------------------------------------------------------------
These basic words are defined for applications to use the [timer].

START-TIMERS \ -- ; must do this first
STOP-TIMERS \ -- ; closes timers
AFTER \ xt ms -- timerid/0 ; runs xt once after ms
EVERY \ xt ms -- timerid/0 ; runs xt every ms
TSTOP \ timerid -- ; stops the timer
MS \ period -- ; wait for ms

After the timers have been started, actions can be added. The example below starts a timer
which puts a character on the debug console every two seconds.

start-timers
: t \ -- ; will run every 2 seconds
[char] * emit
;
’ t 2 seconds every \ returns timerid, use TSTOP to stop it

The item on stack is a timer handle, use TSTOP to halt this timer.
--------------------------------------------------------------------------

EVERY would work quite well for a paced loop. The idea is that the paddle, ball(s) and spike(s) all move at a consistent speed no matter how many objects are in motion at the same time, or what angle the ball(s) are traveling at.

We still don't have a dual-buffer video, but that isn't really needed because this is just a character display not a graphics display. I don't really want to delve into using a graphics package for an entry-level program --- also, I didn't find anything in the VFX manual to indicate any support for graphics (I'm not volunteering to write a graphics package myself!).

So, the program could be written in VFX. I might do this later and add it to my several example programs in the novice-package. For now, I just leave this as an exercise for those who are learning Forth.

JUERGEN

unread,
Jun 19, 2016, 4:06:25 AM6/19/16
to
There is nothing mysterious about this - more detailed work then changes to paid work.

lawren...@gmail.com

unread,
Jun 19, 2016, 5:48:14 AM6/19/16
to
On Sunday, June 19, 2016 at 8:06:25 PM UTC+12, JUERGEN wrote:
> On Saturday, June 18, 2016 at 12:16:16 AM UTC+1, Lawrence D’Oliveiro wrote:
>> On Friday, June 17, 2016 at 12:38:50 PM UTC+12, HAA wrote:
>>> http://www.forth.org/forth_coding.html
>>
>> “public domain for non-commercial use” ... very mysterious.
>
> There is nothing mysterious about this - more detailed work then changes to
> paid work.

If it’s “for non-commercial use”, then it cannot be “public domain”.

endlessboo...@gmail.com

unread,
Jun 20, 2016, 12:59:08 AM6/20/16
to
because I have fear
0 new messages