Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #18656 > unrolled thread
| Started by | gavino_himself <visploveslisp@gmail.com> |
|---|---|
| First post | 2013-01-11 04:22 -0800 |
| Last post | 2013-01-21 23:40 -0800 |
| Articles | 20 on this page of 108 — 25 participants |
Back to article view | Back to comp.lang.forth
structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-11 04:22 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Alex McDonald <blog@rivadpm.com> - 2013-01-11 05:47 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-11 06:12 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-11 06:18 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-11 06:20 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-11 06:19 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-11 06:38 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-11 06:51 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-11 07:10 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-11 07:58 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth rickman <gnuarm@gmail.com> - 2013-01-14 10:01 -0500
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-11 06:25 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-11 06:28 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-11 06:33 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-11 06:37 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-11 06:56 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-11 08:03 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-11 08:06 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-11 12:27 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-13 17:32 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-13 23:21 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-13 23:41 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Paul Rubin <no.email@nospam.invalid> - 2013-01-13 23:43 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-14 00:02 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth "Elizabeth D. Rather" <erather@forth.com> - 2013-01-14 22:43 +1300
Re: structure and interpretation of computer programs exercsie 1.3 in forth Paul Rubin <no.email@nospam.invalid> - 2013-01-14 02:41 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2013-01-14 11:13 +0000
Re: structure and interpretation of computer programs exercsie 1.3 in forth albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-01-14 11:16 +0000
Re: structure and interpretation of computer programs exercsie 1.3 in forth mhx@iae.nl (Marcel Hendrix) - 2013-01-14 21:27 +0200
Re: structure and interpretation of computer programs exercsie 1.3 in forth Howerd <howerdo@yahoo.co.uk> - 2013-01-14 03:34 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-01-14 12:53 +0000
Re: structure and interpretation of computer programs exercsie 1.3 in forth "Elizabeth D. Rather" <erather@forth.com> - 2013-01-17 17:31 +1300
Re: structure and interpretation of computer programs exercsie 1.3 in forth Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-01-21 19:35 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Paul Rubin <no.email@nospam.invalid> - 2013-01-14 02:55 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth rickman <gnuarm@gmail.com> - 2013-01-14 10:14 -0500
Re: structure and interpretation of computer programs exercsie 1.3 in forth Bernd Paysan <bernd.paysan@gmx.de> - 2013-01-14 20:04 +0100
Re: structure and interpretation of computer programs exercsie 1.3 in forth Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-01-21 19:57 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-21 23:19 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-01-24 18:58 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Alex McDonald <blog@rivadpm.com> - 2013-01-25 15:46 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Pablo Hugo Reda <pabloreda@gmail.com> - 2013-01-25 19:09 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Alex McDonald <blog@rivadpm.com> - 2013-01-26 01:12 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth mhx@iae.nl (Marcel Hendrix) - 2013-01-26 12:58 +0200
Re: structure and interpretation of computer programs exercsie 1.3 in forth Alex McDonald <blog@rivadpm.com> - 2013-01-26 04:42 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-01-26 14:35 +0000
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-21 22:38 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-11 12:36 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-13 17:33 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth "Elizabeth D. Rather" <erather@forth.com> - 2013-01-14 22:46 +1300
Re: structure and interpretation of computer programs exercsie 1.3 in forth rickman <gnuarm@gmail.com> - 2013-01-14 10:20 -0500
Re: structure and interpretation of computer programs exercsie 1.3 in forth Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-01-14 10:41 -0600
Re: structure and interpretation of computer programs exercsie 1.3 in forth "Elizabeth D. Rather" <erather@forth.com> - 2013-01-17 17:34 +1300
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-21 22:48 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-21 22:49 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-21 23:55 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth "Ed" <invalid@nospam.com> - 2013-01-18 12:50 +1100
Re: structure and interpretation of computer programs exercsie 1.3 in forth Bernd Paysan <bernd.paysan@gmx.de> - 2013-01-18 23:31 +0100
Re: structure and interpretation of computer programs exercsie 1.3 in forth "Ed" <invalid@nospam.com> - 2013-01-20 12:42 +1100
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <markrobertwills@yahoo.co.uk> - 2013-01-20 01:24 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-01-20 15:51 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth "Elizabeth D. Rather" <erather@forth.com> - 2013-01-21 22:14 +1300
Re: structure and interpretation of computer programs exercsie 1.3 in forth Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-01-21 19:14 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth "A. K." <akk@nospam.org> - 2013-01-20 11:13 +0100
Re: structure and interpretation of computer programs exercsie 1.3 in forth Paul Rubin <no.email@nospam.invalid> - 2013-01-20 02:45 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-01-21 17:14 +0000
Re: structure and interpretation of computer programs exercsie 1.3 in forth Paul Rubin <no.email@nospam.invalid> - 2013-01-23 01:52 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-01-23 04:25 -0600
Re: structure and interpretation of computer programs exercsie 1.3 in forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-01-23 15:20 +0000
Re: structure and interpretation of computer programs exercsie 1.3 in forth Paul Rubin <no.email@nospam.invalid> - 2013-01-23 09:29 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-01-23 17:40 +0000
Re: structure and interpretation of computer programs exercsie 1.3 in forth Paul Rubin <no.email@nospam.invalid> - 2013-01-23 22:03 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth "Elizabeth D. Rather" <erather@forth.com> - 2013-01-24 22:13 +1300
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-24 02:57 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Paul Rubin <no.email@nospam.invalid> - 2013-01-26 13:49 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth "Elizabeth D. Rather" <erather@forth.com> - 2013-01-26 12:40 -1000
Re: structure and interpretation of computer programs exercsie 1.3 in forth Paul Rubin <no.email@nospam.invalid> - 2013-01-26 23:20 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth mhx@iae.nl (Marcel Hendrix) - 2013-01-27 09:52 +0200
Re: structure and interpretation of computer programs exercsie 1.3 in forth "Paul E. Bennett" <Paul_E.Bennett@topmail.co.uk> - 2013-01-23 23:05 +0000
Re: structure and interpretation of computer programs exercsie 1.3 in forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-01-21 17:05 +0000
Re: structure and interpretation of computer programs exercsie 1.3 in forth "A. K." <akk@nospam.org> - 2013-01-21 19:28 +0100
Re: structure and interpretation of computer programs exercsie 1.3 in forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-01-22 17:43 +0000
Re: structure and interpretation of computer programs exercsie 1.3 in forth "Paul E. Bennett" <Paul_E.Bennett@topmail.co.uk> - 2013-01-22 19:12 +0000
Re: structure and interpretation of computer programs exercsie 1.3 in forth stephenXXX@mpeforth.com (Stephen Pelc) - 2013-01-21 12:13 +0000
Re: structure and interpretation of computer programs exercsie 1.3 in forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-01-21 17:28 +0000
Re: structure and interpretation of computer programs exercsie 1.3 in forth anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-01-22 18:06 +0000
Re: structure and interpretation of computer programs exercsie 1.3 in forth Bernd Paysan <bernd.paysan@gmx.de> - 2013-01-22 19:30 +0100
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-21 23:06 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-22 02:20 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-22 03:36 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-22 06:51 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth marko <marko@marko.marko> - 2013-01-24 22:14 +1100
Re: structure and interpretation of computer programs exercsie 1.3 in forth the_gavino_himself <visphatesjava@gmail.com> - 2013-01-27 20:39 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth marko <marko@marko.marko> - 2013-02-01 22:07 +1100
Re: structure and interpretation of computer programs exercsie 1.3 in forth marko <marko@marko.marko> - 2013-02-01 22:53 +1100
Re: structure and interpretation of computer programs exercsie 1.3 in forth the_gavino_himself <visphatesjava@gmail.com> - 2013-02-08 19:50 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Elizabeth D Rather <erather@forth.com> - 2013-02-08 19:22 -1000
Re: structure and interpretation of computer programs exercsie 1.3 in forth Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-01-11 11:44 -0600
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-11 12:34 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-11 06:18 -0800
Re:structure and interpretation of computer programs exercsie 1.3 in forth Hans Bezemer <the.beez.speaks@gmail.com> - 2013-01-14 00:13 +0100
Re: structure and interpretation of computer programs exercsie 1.3 in forth Doug Hoffman <glidedog@gmail.com> - 2013-01-13 19:12 -0500
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-13 18:26 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2013-01-14 08:29 +0000
Re: structure and interpretation of computer programs exercsie 1.3 in forth Hans Bezemer <the.beez.speaks@gmail.com> - 2013-01-14 23:52 +0100
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-13 18:31 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-13 23:19 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth gavino_himself <visploveslisp@gmail.com> - 2013-01-21 22:46 -0800
Re: structure and interpretation of computer programs exercsie 1.3 in forth Mark Wills <forthfreak@gmail.com> - 2013-01-21 23:40 -0800
Page 5 of 6 — ← Prev page 1 2 3 4 [5] 6 Next page →
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Date | 2013-01-22 17:43 +0000 |
| Subject | Re: structure and interpretation of computer programs exercsie 1.3 in forth |
| Message-ID | <2013Jan22.184337@mips.complang.tuwien.ac.at> |
| In reply to | #18970 |
"A. K." <akk@nospam.org> writes:
>Even here in c.l.f. (most here seem to be expert oldtimers) the Forth
>code published by one person does most often _not_ run unchanged on the
>favorite Forth of another person.
Yes, "running unchanged" is a concept that's completely alien to some
people here.
Even worse, Marcel Hendrix often takes code that runs perfectly fine
and unchanged on a number of systems, including his iForth, then
"improves" it in such a way that runs only on his system, and posts
the result.
- 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
EuroForth 2012: http://www.euroforth.org/ef12/
[toc] | [prev] | [next] | [standalone]
| From | "Paul E. Bennett" <Paul_E.Bennett@topmail.co.uk> |
|---|---|
| Date | 2013-01-22 19:12 +0000 |
| Message-ID | <am86p5Frg22U1@mid.individual.net> |
| In reply to | #18970 |
A. K. wrote: > Even here in c.l.f. (most here seem to be expert oldtimers) the Forth > code published by one person does most often _not_ run unchanged on the > favorite Forth of another person. It doesn't have to be that way. You just need to be clear about the "surfaces" where the code interfaces to the next bit of code. I have had no problem moving applications across several platforms but I have known the interfacing surfaces I am dealing with to a high level of detail. The ANS standard deals with some of the notions but you have to be aware of what the supplied Standard Forth's are giving you and when there are implementation dependent differences that you will need to adjust for. Start to think about where you might put in a compatibility layer. -- ******************************************************************** Paul E. Bennett...............<email://Paul_E.Bennett@topmail.co.uk> Forth based HIDECS Consultancy Mob: +44 (0)7811-639972 Tel: +44 (0)1235-510979 Going Forth Safely ..... EBA. www.electric-boat-association.org.uk.. ********************************************************************
[toc] | [prev] | [next] | [standalone]
| From | stephenXXX@mpeforth.com (Stephen Pelc) |
|---|---|
| Date | 2013-01-21 12:13 +0000 |
| Message-ID | <50fd2b7a.291053998@192.168.0.50> |
| In reply to | #18911 |
On Sun, 20 Jan 2013 12:42:18 +1100, "Ed" <invalid@nospam.com> wrote: >I don't accept every criticism Jeff made about ANS in his public writings >(and indeed some of it was far too personal) nevertheless I find myself >agreeing that the Forth in Standard Forth is increasingly hard to find. There's very little in the ANS and Forth200x standards that is required to be present in a Forth system. But there has to be a mechanism to extend the system. However many times members of the technical committee remind people of this, our statements are ignored. In consequence, the ANS and Forth200x desktop Forths contain almost everything. MPE has been criticised more than once for not providing floating point as part of the VFX Forth package. We support three FP packages. One of the critics is a TC member. The point to remember is that almost everything is optional according to the standard, regardless of how people misread the standard. Because of the standard, MPE uses far more third-party code than before the standard existed. >Take locals - allegedly "optional" in ANS. Should a Forth Standard expect >Forth CPU's to have the resources to efficiently implement foreign notions >such as locals because the Standard libraries that you load could well be >full of them? That depends on what the "Forth" CPU is for. Disciples of the minimalism will probably conclude that silicon can be replaced by clever programmers. People who want Forth CPUs to be commercially successful will probably conclude that a language-neutral instruction set is required. I have discussed the requirements of the C (Pasgol) and Forth virtual machines several times in Rochester, EuroForth and Dr Dobbs papers. It is probably a mistake to talk about Forth CPUs. What we see are silicon implementations of some two-stack architectures in which there is one stack mainly for data and another stack mainly for addresses. Stephen -- Stephen Pelc, stephenXXX@mpeforth.com MicroProcessor Engineering Ltd - More Real, Less Time 133 Hill Lane, Southampton SO15 5AF, England tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691 web: http://www.mpeforth.com - free VFX Forth downloads
[toc] | [prev] | [next] | [standalone]
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Date | 2013-01-21 17:28 +0000 |
| Message-ID | <2013Jan21.182830@mips.complang.tuwien.ac.at> |
| In reply to | #18911 |
"Ed" <invalid@nospam.com> writes:
>Take locals - allegedly "optional" in ANS. Should a Forth Standard expect
>Forth CPU's to have the resources to efficiently implement foreign notions
>such as locals because the Standard libraries that you load could well be
>full of them?
The standard does not expect anything of Forth CPUs. It describes the
interface between standard programs and standard systems.
If a Forth CPU designer wants to cater for the kind of libraries you
have in mind, he can provide hardware features that the system
implementor can then use to support locals efficiently. Or he might
decide not to provide such features, and the system implementor can
implement locals without them.
However, the minimal support that, e.g., VFX, has for locals
demonstrates that locals have less importance even among people
embracing the standard than you imagine.
>ANS may not be responsible for poorly written code but they provided the tools
>and the justification to use them. I've seen 40-line definitions that would have
>been impossible to write, were it not for the 12 locals scattered throughout.
A definition with 12 locals in not Forth-94 compliant.
>Had that many regular variables been used, it would almost certainly be
>regarded as unrepresentative of what Forth could/should be.
On the contrary, I regularly see here people twist themselves to
contortions to avoid locals, or to suggest using global variables in
place of locals, even though global variables are more problematic
than locals in nearly all respects.
- 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
EuroForth 2012: http://www.euroforth.org/ef12/
[toc] | [prev] | [next] | [standalone]
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Date | 2013-01-22 18:06 +0000 |
| Message-ID | <2013Jan22.190636@mips.complang.tuwien.ac.at> |
| In reply to | #18884 |
Bernd Paysan <bernd.paysan@gmx.de> writes:
>Make a CPU with many odd
>things, like 20 bit word-addressed memory, and then compile something
>that is designed for 32 bit byte addressed systems. And then watch it
>fail. It wasn't just the 32 bit thing, Chuck made it horribly difficult
>to implement ANS Forth on his CPU, apparently on purpose.
What is difficult to implement there? DEPTH? Ok, but that's not used
much. The shallow stack is a pretty heavy limitation, though.
>IMHO trying to build a web browser means that you first have to get the
>CPU byte addressed 32 or 64 bit, and then see about the rest. That's a
>deeply rooted assumption, not just in the code the programmers wrote,
>but also in the file formats.
Not in HTML. I would just use one char per word, which is not the
most efficient representation, but certainly the one that's easiest to
program for.
For GIFF, JPEG, also use one byte per word. Apart from memory
efficiency, what would these formats gain from using byte-addressed
32-bit hardware?
And that's basically all that had to be done. The memory is too small
for JavaScript, and I think there was no CSS at the time.
>That's how we got those 100x storries. Yes, it is possible to write a
>program that is 100x faster in machine Forth than in ANS Forth on one of
>Chuck's processors.
Yes, it's always this way with this kind of hardware design (I call it
the supercomputer mindset): It runs certain hand-tuned code very fast
and most other code pretty slowly. It's not limited to Chucks chips.
Stuff like the Cell processor in the PlayStation 3 or BlueGene/L also
suffers from this.
- 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
EuroForth 2012: http://www.euroforth.org/ef12/
[toc] | [prev] | [next] | [standalone]
| From | Bernd Paysan <bernd.paysan@gmx.de> |
|---|---|
| Date | 2013-01-22 19:30 +0100 |
| Message-ID | <2067629.3Lcx0zDprV@sunwukong.fritz.box> |
| In reply to | #19009 |
Anton Ertl wrote: > What is difficult to implement there? DEPTH? Ok, but that's not used > much. The shallow stack is a pretty heavy limitation, though. Yes, no bytes, shallow stacks, that's the most severe part. > Not in HTML. I would just use one char per word, which is not the > most efficient representation, but certainly the one that's easiest to > program for. I don't think it makes any sense to depart from the byte-oriented memory scheme when you want to interface with the rest of the world, which is byte-oriented. > For GIFF, JPEG, also use one byte per word. Apart from memory > efficiency, what would these formats gain from using byte-addressed > 32-bit hardware? Memory efficiency is one of the primary things you need for an efficient web browsing device. With a 32 bit datapath, the CPU would have been 30% larger. Does this 30% improvement in size really offer an advantage which is worth the price? > And that's basically all that had to be done. The memory is too small > for JavaScript, and I think there was no CSS at the time. With a 32 bit CPU, the memory probably wouldn't have been too small for JavaScript. There are small devices with some sort-of web capability, the Wikireader comes in mind. That's a normal controller, it comes even with a Forth on it (though that's not used for the Wiki rendering). >>That's how we got those 100x storries. Yes, it is possible to write a >>program that is 100x faster in machine Forth than in ANS Forth on one >>of Chuck's processors. > > Yes, it's always this way with this kind of hardware design (I call it > the supercomputer mindset): It runs certain hand-tuned code very fast > and most other code pretty slowly. It's not limited to Chucks chips. > Stuff like the Cell processor in the PlayStation 3 or BlueGene/L also > suffers from this. Indeed. The GPUs are also in this mindset, but at least they are targeted at an application that is much needed: graphics. -- Bernd Paysan "If you want it done right, you have to do it yourself" http://bernd-paysan.de/
[toc] | [prev] | [next] | [standalone]
| From | gavino_himself <visploveslisp@gmail.com> |
|---|---|
| Date | 2013-01-21 23:06 -0800 |
| Message-ID | <8a4f693d-5e64-4563-9932-ddfa048ca35a@googlegroups.com> |
| In reply to | #18679 |
On Friday, January 11, 2013 12:36:52 PM UTC-8, M.R.W Wills wrote: > On Jan 11, 4:06 pm, gavino_himself <visplovesl...@gmail.com> wrote: > > > > > > this takes a little getting used to > > > > > > > When you are used to other languages the "confusing" thing in Forth is > > understanding its total simplicity. It takes a while sink in just how > > *simple* it all is! I think to myself something like this: ok I see how the stack is this little conveyor belt, so ordering things is not a problem. Then I write works to slice and dice the results into what I want. I wonder to myself ok so say I had to sort 1000 numbers...what would I do? The immediate solution comes to mind that I would somehow compare 2, and put them in order smaller bigger, and then place the next number above or below ... or some such algorithm... hmm .. I guess forth has arrays which I have not gotten to yet, but as forth works through the list of 1000 numbers it places the next number in the right place.... safe to say forth is quite different than shell or tcl I am most used to and lisp as well.
[toc] | [prev] | [next] | [standalone]
| From | Mark Wills <forthfreak@gmail.com> |
|---|---|
| Date | 2013-01-22 02:20 -0800 |
| Message-ID | <8406ec56-6af5-40fa-b41a-ead06d2b9f70@hq4g2000vbb.googlegroups.com> |
| In reply to | #18984 |
On Jan 22, 7:06 am, gavino_himself <visplovesl...@gmail.com> wrote: > On Friday, January 11, 2013 12:36:52 PM UTC-8, M.R.W Wills wrote: > > On Jan 11, 4:06 pm, gavino_himself <visplovesl...@gmail.com> wrote: > > > > this takes a little getting used to > > > When you are used to other languages the "confusing" thing in Forth is > > > understanding its total simplicity. It takes a while sink in just how > > > *simple* it all is! > > I think to myself something like this: > ok I see how the stack is this little conveyor belt, so ordering things is not a problem. Then I write works to slice and dice the results into what I want. > I wonder to myself ok so say I had to sort 1000 numbers...what would I do? > The immediate solution comes to mind that I would somehow compare 2, and put them in order smaller bigger, and then place the next number above or below ... or some such algorithm... hmm .. I guess forth has arrays which I have not gotten to yet, but as forth works through the list of 1000 numbers it places the next number in the right place.... safe to say forth is quite different than shell or tcl I am most used to and lisp as well.- Hide quoted text - > > - Show quoted text - Since you expressed an interest in bubble sort, I thought I'd code something for you to look at. This code is written for GForth. It's factored, in the hope that the code would be easy to understand. Just digest one word at a time. The hardest word to understand is swapElements. I'm sure others could come up with better examples; there are many ways to skin the cat. Notice how, by the end of the code, the bubble sort algorithm is pretty much self explanatory: i getElements outOfOrder? if i swapElements then It's due to factoring that the code becomes self-explanatory/self- documenting at the high-level. At the low level, because each word just does a little bit of the overall job, the 'helper words' are also easy to understand, and, crucially, test. Once you have written and tested your low-level 'helper words' then the high-level words, which are built with the low-level words become self-documenting, easy to understand, and bug free, since they are built with the 'atoms' of low- level, already tested words. That's your bottom-up programming. That's Forth. Enjoy. ---------------------------- s" random.fs" included \ random numbers for GForth 100 value arraySize true value noSwaps create array arraySize cells allot : >elementAddress ( index -- element_address) \ given an element, return the address of the element cells array + ; : randomize ( -- ) \ randomize the array arraySize 0 do arraySize random i >elementAddress ! loop ; : showArray ( -- ) cr arraySize 0 do i >elementAddress @ . loop ; : getElements ( array_index -- a b ) \ fetch the values in the array from \ array_index and array_index+1 >elementAddress dup @ swap 1 cells + @ ; : outOfOrder? ( a b -- flag ) \ compare a and b, returning true if a>b > ; : swapElements ( array_index -- ) \ given an array index, swap the values at \ array_index and array_index+1 false to noSwaps >elementAddress dup >r @ r@ 1 cells + @ r@ ! r> 1 cells + ! ; : bubbleSort ( -- ) page randomize cr ." Array before sorting:" showArray cr ." Sorting..." begin true to noSwaps arraySize 0 do i getElements outOfOrder? if i swapElements then loop noSwaps until cr ." Array after sorting:" showArray ;
[toc] | [prev] | [next] | [standalone]
| From | Mark Wills <forthfreak@gmail.com> |
|---|---|
| Date | 2013-01-22 03:36 -0800 |
| Message-ID | <5586fa37-97ae-40fa-81f1-8a82405004fa@ho8g2000vbb.googlegroups.com> |
| In reply to | #18993 |
On Jan 22, 10:20 am, Mark Wills <forthfr...@gmail.com> wrote:
> On Jan 22, 7:06 am, gavino_himself <visplovesl...@gmail.com> wrote:
>
>
>
>
>
> > On Friday, January 11, 2013 12:36:52 PM UTC-8, M.R.W Wills wrote:
> > > On Jan 11, 4:06 pm, gavino_himself <visplovesl...@gmail.com> wrote:
>
> > > > this takes a little getting used to
>
> > > When you are used to other languages the "confusing" thing in Forth is
>
> > > understanding its total simplicity. It takes a while sink in just how
>
> > > *simple* it all is!
>
> > I think to myself something like this:
> > ok I see how the stack is this little conveyor belt, so ordering things is not a problem. Then I write works to slice and dice the results into what I want.
> > I wonder to myself ok so say I had to sort 1000 numbers...what would I do?
> > The immediate solution comes to mind that I would somehow compare 2, and put them in order smaller bigger, and then place the next number above or below ... or some such algorithm... hmm .. I guess forth has arrays which I have not gotten to yet, but as forth works through the list of 1000 numbers it places the next number in the right place.... safe to say forth is quite different than shell or tcl I am most used to and lisp as well.- Hide quoted text -
>
> > - Show quoted text -
>
> Since you expressed an interest in bubble sort, I thought I'd code
> something for you to look at. This code is written for GForth.
>
> It's factored, in the hope that the code would be easy to understand.
> Just digest one word at a time. The hardest word to understand is
> swapElements. I'm sure others could come up with better examples;
> there are many ways to skin the cat.
>
> Notice how, by the end of the code, the bubble sort algorithm is
> pretty much self explanatory:
>
> i getElements outOfOrder? if i swapElements then
>
> It's due to factoring that the code becomes self-explanatory/self-
> documenting at the high-level. At the low level, because each word
> just does a little bit of the overall job, the 'helper words' are also
> easy to understand, and, crucially, test. Once you have written and
> tested your low-level 'helper words' then the high-level words, which
> are built with the low-level words become self-documenting, easy to
> understand, and bug free, since they are built with the 'atoms' of low-
> level, already tested words. That's your bottom-up programming. That's
> Forth.
>
> Enjoy.
>
> ----------------------------
>
> s" random.fs" included \ random numbers for GForth
>
> 100 value arraySize
> true value noSwaps
>
> create array arraySize cells allot
>
> : >elementAddress ( index -- element_address)
> \ given an element, return the address of the element
> cells array + ;
>
> : randomize ( -- )
> \ randomize the array
> arraySize 0 do
> arraySize random i >elementAddress !
> loop ;
>
> : showArray ( -- )
> cr
> arraySize 0 do
> i >elementAddress @ .
> loop ;
>
> : getElements ( array_index -- a b )
> \ fetch the values in the array from
> \ array_index and array_index+1
> >elementAddress dup @ swap 1 cells + @ ;
>
> : outOfOrder? ( a b -- flag )
> \ compare a and b, returning true if a>b
> > ;
>
> : swapElements ( array_index -- )
> \ given an array index, swap the values at
> \ array_index and array_index+1
> false to noSwaps
> >elementAddress dup >r
> @ r@ 1 cells + @
> r@ ! r> 1 cells + ! ;
>
> : bubbleSort ( -- )
> page
> randomize
> cr ." Array before sorting:" showArray
> cr ." Sorting..."
> begin
> true to noSwaps
> arraySize 0 do
> i getElements outOfOrder? if i swapElements then
> loop
> noSwaps until
> cr ." Array after sorting:" showArray ;- Hide quoted text -
>
> - Show quoted text -
I changed the definition of swapElements to:
>elementAddress dup
1 cells + over @ over @ -rot swap ! swap !
Which is functionally identical, but cleaner IMHO. I wonder if it can
be done in fewer instructions?
Also, there's no real reason to use an array. PAD could be used
instead, so the memory after the end of the code becomes one huge
array, which would mean you change the array size without having to re-
compile. I'll leave that as an excercise for Gavino if he's so
inclined.
[toc] | [prev] | [next] | [standalone]
| From | Mark Wills <forthfreak@gmail.com> |
|---|---|
| Date | 2013-01-22 06:51 -0800 |
| Message-ID | <2bc93156-95c3-445a-bab1-2cdf7115d2dc@fd20g2000vbb.googlegroups.com> |
| In reply to | #18994 |
On Jan 22, 11:36 am, Mark Wills <forthfr...@gmail.com> wrote: > On Jan 22, 10:20 am, Mark Wills <forthfr...@gmail.com> wrote: > > > > > > > On Jan 22, 7:06 am, gavino_himself <visplovesl...@gmail.com> wrote: > > > > On Friday, January 11, 2013 12:36:52 PM UTC-8, M.R.W Wills wrote: > > > > On Jan 11, 4:06 pm, gavino_himself <visplovesl...@gmail.com> wrote: > > > > > > this takes a little getting used to > > > > > When you are used to other languages the "confusing" thing in Forth is > > > > > understanding its total simplicity. It takes a while sink in just how > > > > > *simple* it all is! > > > > I think to myself something like this: > > > ok I see how the stack is this little conveyor belt, so ordering things is not a problem. Then I write works to slice and dice the results into what I want. > > > I wonder to myself ok so say I had to sort 1000 numbers...what would I do? > > > The immediate solution comes to mind that I would somehow compare 2, and put them in order smaller bigger, and then place the next number above or below ... or some such algorithm... hmm .. I guess forth has arrays which I have not gotten to yet, but as forth works through the list of 1000 numbers it places the next number in the right place.... safe to say forth is quite different than shell or tcl I am most used to and lisp as well.- Hide quoted text - > > > > - Show quoted text - > > > Since you expressed an interest in bubble sort, I thought I'd code > > something for you to look at. This code is written for GForth. > > > It's factored, in the hope that the code would be easy to understand. > > Just digest one word at a time. The hardest word to understand is > > swapElements. I'm sure others could come up with better examples; > > there are many ways to skin the cat. > > > Notice how, by the end of the code, the bubble sort algorithm is > > pretty much self explanatory: > > > i getElements outOfOrder? if i swapElements then > > > It's due to factoring that the code becomes self-explanatory/self- > > documenting at the high-level. At the low level, because each word > > just does a little bit of the overall job, the 'helper words' are also > > easy to understand, and, crucially, test. Once you have written and > > tested your low-level 'helper words' then the high-level words, which > > are built with the low-level words become self-documenting, easy to > > understand, and bug free, since they are built with the 'atoms' of low- > > level, already tested words. That's your bottom-up programming. That's > > Forth. > > > Enjoy. > > > ---------------------------- > > > s" random.fs" included \ random numbers for GForth > > > 100 value arraySize > > true value noSwaps > > > create array arraySize cells allot > > > : >elementAddress ( index -- element_address) > > \ given an element, return the address of the element > > cells array + ; > > > : randomize ( -- ) > > \ randomize the array > > arraySize 0 do > > arraySize random i >elementAddress ! > > loop ; > > > : showArray ( -- ) > > cr > > arraySize 0 do > > i >elementAddress @ . > > loop ; > > > : getElements ( array_index -- a b ) > > \ fetch the values in the array from > > \ array_index and array_index+1 > > >elementAddress dup @ swap 1 cells + @ ; > > > : outOfOrder? ( a b -- flag ) > > \ compare a and b, returning true if a>b > > > ; > > > : swapElements ( array_index -- ) > > \ given an array index, swap the values at > > \ array_index and array_index+1 > > false to noSwaps > > >elementAddress dup >r > > @ r@ 1 cells + @ > > r@ ! r> 1 cells + ! ; > > > : bubbleSort ( -- ) > > page > > randomize > > cr ." Array before sorting:" showArray > > cr ." Sorting..." > > begin > > true to noSwaps > > arraySize 0 do > > i getElements outOfOrder? if i swapElements then > > loop > > noSwaps until > > cr ." Array after sorting:" showArray ;- Hide quoted text - > > > - Show quoted text - > > I changed the definition of swapElements to: > > >elementAddress dup > 1 cells + over @ over @ -rot swap ! swap ! > > Which is functionally identical, but cleaner IMHO. I wonder if it can > be done in fewer instructions? > > Also, there's no real reason to use an array. PAD could be used > instead, so the memory after the end of the code becomes one huge > array, which would mean you change the array size without having to re- > compile. I'll leave that as an excercise for Gavino if he's so > inclined.- Hide quoted text - > > - Show quoted text - Even better: : swapElements ( array_index -- ) false to noSwaps >elementAddress dup >r 2@ swap r> 2! ; My system doesn't have 2@ or 2! unless I load the double word extensions, so it didn't immediately occur to me.
[toc] | [prev] | [next] | [standalone]
| From | marko <marko@marko.marko> |
|---|---|
| Date | 2013-01-24 22:14 +1100 |
| Message-ID | <51011875$0$46962$c3e8da3$9b4ff22a@news.astraweb.com> |
| In reply to | #18984 |
gavino_himself wrote: > On Friday, January 11, 2013 12:36:52 PM UTC-8, M.R.W Wills wrote: >> On Jan 11, 4:06 pm, gavino_himself <visplovesl...@gmail.com> wrote: >> >> > >> >> > this takes a little getting used to >> >> > >> >> >> >> When you are used to other languages the "confusing" thing in Forth is >> >> understanding its total simplicity. It takes a while sink in just how >> >> *simple* it all is! > > I think to myself something like this: > ok I see how the stack is this little conveyor belt, so ordering things is > not a problem. Then I write works to slice and dice the results into what > I want. I wonder to myself ok so say I had to sort 1000 numbers...what > would I do? > The immediate solution comes to mind that I would somehow compare 2, and > put them in order smaller bigger, and then place the next number above or > below ... or some such algorithm... hmm .. I guess forth has arrays which > I have not gotten to yet, but as forth works through the list of 1000 > numbers it places the next number in the right place.... safe to say > forth is quite different than shell or tcl I am most used to and lisp as > well. Gav, you had the ocnveyer belt concept back in June, have you progressed no further? > I envision forth a a little ocnveyor belt that puts data on the belt and > then has lil robotic arms than do things an put results back on the > belt aka stack. At some point you have to say I am going to use this language or choose another one. You can reserve the right to change at a later date, but at some point you must commit and say "I will use language X for everything". This is the only way to find out what it is good for AND what you are good for. The best language is the one you can write software with. After you are good at a few languages you can start to compare them and maybe choose one that better suits the problem, but domain knowledge beats language knowledge everytime, particularly in a single programmer situation. Yours in indecision, marko
[toc] | [prev] | [next] | [standalone]
| From | the_gavino_himself <visphatesjava@gmail.com> |
|---|---|
| Date | 2013-01-27 20:39 -0800 |
| Message-ID | <7d05374d-8b16-42f2-9ee8-8a73fc405cc8@googlegroups.com> |
| In reply to | #19079 |
On Thursday, January 24, 2013 3:14:07 AM UTC-8, marko wrote: > gavino_himself wrote: > > > > > On Friday, January 11, 2013 12:36:52 PM UTC-8, M.R.W Wills wrote: > > >> On Jan 11, 4:06 pm, gavino_himself <visplovesl...@gmail.com> wrote: > > >> > > >> > > > >> > > >> > this takes a little getting used to > > >> > > >> > > > >> > > >> > > >> > > >> When you are used to other languages the "confusing" thing in Forth is > > >> > > >> understanding its total simplicity. It takes a while sink in just how > > >> > > >> *simple* it all is! > > > > > > I think to myself something like this: > > > ok I see how the stack is this little conveyor belt, so ordering things is > > > not a problem. Then I write works to slice and dice the results into what > > > I want. I wonder to myself ok so say I had to sort 1000 numbers...what > > > would I do? > > > The immediate solution comes to mind that I would somehow compare 2, and > > > put them in order smaller bigger, and then place the next number above or > > > below ... or some such algorithm... hmm .. I guess forth has arrays which > > > I have not gotten to yet, but as forth works through the list of 1000 > > > numbers it places the next number in the right place.... safe to say > > > forth is quite different than shell or tcl I am most used to and lisp as > > > well. > > > > > > Gav, > > > > you had the ocnveyer belt concept back in June, have you progressed no > > further? > > > > > I envision forth a a little ocnveyor belt that puts data on the belt and > > > then has lil robotic arms than do things an put results back on the > > > belt aka stack. > > > > At some point you have to say I am going to use this language or choose > > another one. You can reserve the right to change at a later date, but at > > some point you must commit and say "I will use language X for everything". > > This is the only way to find out what it is good for AND what you are good > > for. > > > > The best language is the one you can write software with. After you are > > good at a few languages you can start to compare them and maybe choose one > > that better suits the problem, but domain knowledge beats language knowledge > > everytime, particularly in a single programmer situation. > > > > Yours in indecision, > > > > marko Linux architect jobs are pressuring me to learn ruby and chef for cnofig management so that web site owners can roll out a dev environment or qa or production automatically. I dont know why this takes more than bash and some ssh keys. Have you seen hypertable as a bigtable implementation to replace postgresql and firebird as main database in the enterprise? http://hypertable.com/documentation/ I wonder how hard to do that in forth?
[toc] | [prev] | [next] | [standalone]
| From | marko <marko@marko.marko> |
|---|---|
| Date | 2013-02-01 22:07 +1100 |
| Message-ID | <510ba203$0$26935$c3e8da3$33881b6a@news.astraweb.com> |
| In reply to | #19205 |
the_gavino_himself wrote: > On Thursday, January 24, 2013 3:14:07 AM UTC-8, marko wrote: >> gavino_himself wrote: >> >> >> >> > On Friday, January 11, 2013 12:36:52 PM UTC-8, M.R.W Wills wrote: >> >> >> On Jan 11, 4:06 pm, gavino_himself <visplovesl...@gmail.com> wrote: >> >> >> >> >> >> > >> >> >> >> >> >> > this takes a little getting used to >> >> >> >> >> >> > >> >> >> >> >> >> >> >> >> >> >> >> When you are used to other languages the "confusing" thing in Forth is >> >> >> >> >> >> understanding its total simplicity. It takes a while sink in just how >> >> >> >> >> >> *simple* it all is! >> >> > >> >> > I think to myself something like this: >> >> > ok I see how the stack is this little conveyor belt, so ordering things >> > is >> >> > not a problem. Then I write works to slice and dice the results into >> > what >> >> > I want. I wonder to myself ok so say I had to sort 1000 numbers...what >> >> > would I do? >> >> > The immediate solution comes to mind that I would somehow compare 2, >> > and >> >> > put them in order smaller bigger, and then place the next number above >> > or >> >> > below ... or some such algorithm... hmm .. I guess forth has arrays >> > which >> >> > I have not gotten to yet, but as forth works through the list of 1000 >> >> > numbers it places the next number in the right place.... safe to say >> >> > forth is quite different than shell or tcl I am most used to and lisp >> > as >> >> > well. >> >> >> >> >> >> Gav, >> >> >> >> you had the ocnveyer belt concept back in June, have you progressed no >> >> further? >> >> >> >> > I envision forth a a little ocnveyor belt that puts data on the belt >> > and >> >> > then has lil robotic arms than do things an put results back on the >> >> > belt aka stack. >> >> >> >> At some point you have to say I am going to use this language or choose >> >> another one. You can reserve the right to change at a later date, but at >> >> some point you must commit and say "I will use language X for >> everything". >> >> This is the only way to find out what it is good for AND what you are >> good >> >> for. >> >> >> >> The best language is the one you can write software with. After you are >> >> good at a few languages you can start to compare them and maybe choose >> one >> >> that better suits the problem, but domain knowledge beats language >> knowledge >> >> everytime, particularly in a single programmer situation. >> >> >> >> Yours in indecision, >> >> >> >> marko > > Linux architect jobs are pressuring me to learn ruby and chef for cnofig > management so that web site owners can roll out a dev environment or qa or > production automatically. > > I dont know why this takes more than bash and some ssh keys. > > Have you seen hypertable as a bigtable implementation to replace > postgresql and firebird as main database in the enterprise? > http://hypertable.com/documentation/ > > I wonder how hard to do that in forth? I have no knowledge of that problem domain. If you understand the problem domain you can roll it out in Forth. You are the most qualified to determine if your problem is best solved in Forth.
[toc] | [prev] | [next] | [standalone]
| From | marko <marko@marko.marko> |
|---|---|
| Date | 2013-02-01 22:53 +1100 |
| Message-ID | <510baca4$0$28541$c3e8da3$aae71a0a@news.astraweb.com> |
| In reply to | #19205 |
the_gavino_himself wrote: > I dont know why this takes more than bash and some ssh keys. > You can know why, the choice is yours. The majority of contributers to this form choose to find out then post the results to this forum. This is what makes their posts and the forum valuable. You can suck or you can blow. Again, the choice is yours.
[toc] | [prev] | [next] | [standalone]
| From | the_gavino_himself <visphatesjava@gmail.com> |
|---|---|
| Date | 2013-02-08 19:50 -0800 |
| Message-ID | <2707420d-3e70-4395-b7c5-b3eee57bee85@googlegroups.com> |
| In reply to | #19350 |
On Friday, February 1, 2013 3:53:05 AM UTC-8, marko wrote: > the_gavino_himself wrote: > > > > > I dont know why this takes more than bash and some ssh keys. > > > > > > > > > You can know why, the choice is yours. > > > > The majority of contributers to this form choose to find out then post the > > results to this forum. This is what makes their posts and the forum > > valuable. You can suck or you can blow. > > > > Again, the choice is yours. lol I like to be blown. but seriously, lisp out of the gate has apply and sort, which I have no idea howto do in forth.... tcl is easy to use with the os and files and apparently with the web with aolserver and naviserver and ossweb and openACS etc. forth is attractive because of its simplicity and productivity and quick dev cycle but if I can never find out howto do certain things I get stuck..
[toc] | [prev] | [next] | [standalone]
| From | Elizabeth D Rather <erather@forth.com> |
|---|---|
| Date | 2013-02-08 19:22 -1000 |
| Message-ID | <GqmdnRRaRfWuQIjMnZ2dnUVZ_rCdnZ2d@supernews.com> |
| In reply to | #19568 |
On 2/8/2013 5:50 PM, the_gavino_himself wrote: ... > > but seriously, lisp out of the gate has apply and sort, which I have no idea howto do in forth.... > > tcl is easy to use with the os and files and apparently with the web with aolserver and naviserver and ossweb and openACS etc. > > forth is attractive because of its simplicity and productivity and quick dev cycle but if I can never find out howto do certain things I get stuck.. Lisp was designed for a very different market than Forth. So was tcl. They do what they were designed to do, and Forth does what it's designed to do. If you want to learn Forth, you have to start by learning how to do simple things, such as are found in the tutorial exercises. 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." ==================================================
[toc] | [prev] | [next] | [standalone]
| From | Andrew Haley <andrew29@littlepinkcloud.invalid> |
|---|---|
| Date | 2013-01-11 11:44 -0600 |
| Message-ID | <4Iadnf42S4rl0m3NnZ2dnUVZ_uednZ2d@supernews.com> |
| In reply to | #18658 |
Mark Wills <forthfreak@gmail.com> wrote: > On Jan 11, 1:47?pm, Alex McDonald <b...@rivadpm.com> wrote: >> On Jan 11, 12:22?pm, gavino_himself <visplovesl...@gmail.com> wrote: >> >> > Exercise 1.3. ?Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers. >> >> > Please post a forth solution. >> >> First you should post how you might go about doing it by hand. >> Describe how you might take 3 numbers and work out the sum of the >> squares of the two larger numbers. > > Alex, > > I hear you, but there's no chance of Gavino being able to concentrate > on *anything* for that long. I'd be surprised if he can piss while > standing up! > > Nicely factored: > > : swap? ( n1 n2 -- n1 n2 | n2 n1) > 2dup < if swap then ; > > : gavino ( n1 n2 n3 - n) > swap? rot swap? drop dup * swap dup * + ; A couple of things. Firstly, it's worth factoring out the sort phase and giving it a name. Secondly, and more seriously, this code is in severe danger of overflow, and I'd be very reluctant to put it into production like that. So: \ Sort two numbers : sort2 ( n1 n2 - hi lo ) 2dup < if swap then ; \ Move the smallest of three numbers to TOS : smallest ( n1 n2 n3 - n n lo ) sort2 rot sort2 ; : square ( n - d ) dup m* ; : godhelpusall ( n1 n2 n3 - d ) sort3 drop square rot square d+ ; Andrew.
[toc] | [prev] | [next] | [standalone]
| From | Mark Wills <forthfreak@gmail.com> |
|---|---|
| Date | 2013-01-11 12:34 -0800 |
| Message-ID | <b2538bb0-445c-4945-a6f4-ffb2caf66e76@eo2g2000vbb.googlegroups.com> |
| In reply to | #18674 |
On Jan 11, 5:44 pm, Andrew Haley <andre...@littlepinkcloud.invalid>
wrote:
> Mark Wills <forthfr...@gmail.com> wrote:
> > On Jan 11, 1:47?pm, Alex McDonald <b...@rivadpm.com> wrote:
> >> On Jan 11, 12:22?pm, gavino_himself <visplovesl...@gmail.com> wrote:
>
> >> > Exercise 1.3. ?Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers.
>
> >> > Please post a forth solution.
>
> >> First you should post how you might go about doing it by hand.
> >> Describe how you might take 3 numbers and work out the sum of the
> >> squares of the two larger numbers.
>
> > Alex,
>
> > I hear you, but there's no chance of Gavino being able to concentrate
> > on *anything* for that long. I'd be surprised if he can piss while
> > standing up!
>
> > Nicely factored:
>
> > : swap? ( n1 n2 -- n1 n2 | n2 n1)
> > 2dup < if swap then ;
>
> > : gavino ( n1 n2 n3 - n)
> > swap? rot swap? drop dup * swap dup * + ;
>
> A couple of things. Firstly, it's worth factoring out the sort phase
> and giving it a name. Secondly, and more seriously, this code is in
> severe danger of overflow, and I'd be very reluctant to put it into
> production like that.
>
> So:
>
> \ Sort two numbers
> : sort2 ( n1 n2 - hi lo ) 2dup < if swap then ;
>
> \ Move the smallest of three numbers to TOS
> : smallest ( n1 n2 n3 - n n lo ) sort2 rot sort2 ;
>
> : square ( n - d ) dup m* ;
>
> : godhelpusall ( n1 n2 n3 - d )
> sort3 drop square rot square d+ ;
>
> Andrew.
I like your factoring and the stack comments. The point about overflow
is well taken. I was just keeping it simple ;-)
Unfortunately your code has some errors. You define sort2 but you call
sort3 in godhelpusall. You define smallest, but you don't call it.
I think it should be:
\ Sort two numbers
: sort2 ( n1 n2 - hi lo ) 2dup < if swap then ;
\ Move the smallest of three numbers to TOS
: smallest ( n1 n2 n3 - n n lo ) sort2 rot sort2 ;
: square ( n - d ) dup m* ;
: godhelpusall ( n1 n2 n3 - d )
smallest drop square rot square d+ ;
12 16 19 godhelpusall d.
617 ok
[toc] | [prev] | [next] | [standalone]
| From | gavino_himself <visploveslisp@gmail.com> |
|---|---|
| Date | 2013-01-11 06:18 -0800 |
| Message-ID | <bf4e88f8-5ee7-438b-985f-a1ed826e8e90@googlegroups.com> |
| In reply to | #18657 |
On Friday, January 11, 2013 5:47:07 AM UTC-8, Alex McDonald wrote: > On Jan 11, 12:22 pm, gavino_himself <visplovesl...@gmail.com> wrote: > > > Exercise 1.3. Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers. > > > > > > Please post a forth solution. > > > > First you should post how you might go about doing it by hand. > > Describe how you might take 3 numbers and work out the sum of the > > squares of the two larger numbers. http://endthefed.livejournal.com/474405.html My scheme solution, the second I think is better. Is a bigger than b? If so Is c bigger than b? Then a c else a b Is b bigger than a? If so Is a bigger than c? Then b c else b a
[toc] | [prev] | [next] | [standalone]
| From | Hans Bezemer <the.beez.speaks@gmail.com> |
|---|---|
| Date | 2013-01-14 00:13 +0100 |
| Message-ID | <50f33fae$0$6915$e4fe514c@news2.news.xs4all.nl> |
| In reply to | #18656 |
gavino_himself <visploveslisp@gmail.com> Wrote in message: > Exercise 1.3. Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers. > > Please post a forth solution. > : square+ over max dup * >r max dup * r> + ; I don't like IF's. Hans Bezemer -- ----Android NewsGroup Reader---- http://www.piaohong.tk/newsgroup
[toc] | [prev] | [next] | [standalone]
Page 5 of 6 — ← Prev page 1 2 3 4 [5] 6 Next page →
Back to top | Article view | comp.lang.forth
csiph-web