Message from discussion
why forth over lisp?
Newsgroups: comp.lang.forth,comp.lang.lisp,comp.lang.c,comp.lang.scheme,comp.lang.postscript
Path: g2news1.google.com!news1.google.com!news.glorb.com!news2.arglkargh.de!news.wiretrip.org!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!post.news.xs4all.nl!uucp.xs4all.nl!xs4all!spenarnc.xs4all.nl!not-for-mail
From: Albert van der Horst <alb...@spenarnc.xs4all.nl>
Subject: Re: why forth over lisp?
Date: 22 Aug 2010 13:23:31 GMT
Message-ID: <l7k2j7.fb2@spenarnc.xs4all.nl>
Lines: 61
Organization: Dutch Forth Workshop
References: <f4cc0c8d-7f99-47ea-8235-33dcab8c213c@g6g2000pro.googlegroups.com> <97ea7f26-11c5-4c65-8d75-c26f9d010b54@y11g2000yqm.googlegroups.com> <89eb4c90-5e83-4d49-9411-f1368c52291d@l20g2000yqm.googlegroups.com> <is2dnUzVYZBqhu3RnZ2dnUVZ_smdnZ2d@supernews.com>
In article <is2dnUzVYZBqhu3RnZ2dnUVZ_smdn...@supernews.com>,
Elizabeth D Rather <erat...@forth.com> wrote:
>On 8/21/10 5:45 AM, Paul N wrote:
>> On 21 Aug, 08:17, Standish P<stnd...@gmail.com> wrote:
>>> On Aug 14, 9:31 am, Brad Cantrell<cantre...@gmail.com> wrote:
>>>> I hate asking this question, but so far Ive read Leo Brodie's
>>>> "Starting Forth" and a few other Forth tutorials and they all mention
>>>> how Forth has very low level access to hardware that other languages
>>>> dont have and how it is a operating system unto itself, but Im having
>>>> trouble seeing this.
>>
>>>> And also I dont see how Forth has any lower access than any other
>>>> language like C. All these languages simply make OS system calls or
>>>> interface with system libraries. Im sorry for asking this, but could
>>>> anyone tell me what Im missing here?
>>
>>> Forth is nothing but structured assembly.
>>>
>>> One can write all the programming paradigms in assembly.
>>
>> As I understand it, C has no equivalent of the "in" and "out"
>> instructions of the Z80 processor, so on a Z80 system it could
>> directly access any memory-mapped peripherals but not any of the (more
>> common) I/O mapped peripherals. The ZX Spectrum had IN and OUT
>> commands that could do this. I don't know whether Forth offers such
>> features or not.
>
>Yes, Forth's @ ("fetch") and ! ("store") instructions can read and write
>memory-mapped I/O ports. There are variants of @ and ! for the most
>common sizes of data or port (8-bit, 16-bit, etc.). For platforms
>without naturally memory-mapped I/O it's common to find P@ and P! (Port
>fetch and store) commands, and for portability they are often available
>as alternative names to their standard equivalents (most commonly C@ and
>C! for 8-bit access).
It is interesting what happens if they are not there.
A Forther will type (or start his program with)
"
CODE P! POP|X, DX| POP|X, AX| OUT|D, X'| NEXT, END-CODE
"
and get it over with.
More than anything this sets Forth programmers apart :
they actually have the confidence to do this
they actually have the expertise to do this
they actually do this
>Cheers,
>Elizabeth
Groetjes Albert
[Disclaimer: code shown is ciforth's postit-fixup assembler.
Actual code differs among Forth compilers.]
--
--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst