Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #55667
| Newsgroups | comp.lang.forth |
|---|---|
| Date | 2017-03-11 21:14 -0800 |
| References | <ceefc5d8-9a13-4203-a0e9-9dcf56f572b8@googlegroups.com> <b4c74301-5261-497a-a6e4-be6d4dde45c2@googlegroups.com> <oa2223$asl$1@dont-email.me> <6d24530e-21a0-4b69-a6c8-032af88ae966@googlegroups.com> |
| Message-ID | <d0e6cebd-e4b1-46b2-b058-e283bd319d7c@googlegroups.com> (permalink) |
| Subject | Re: list processing in Forth tutorials |
| From | Julian Fondren <julian.fondren@gmail.com> |
On Saturday, March 11, 2017 at 6:24:43 PM UTC-6, hughag...@gmail.com wrote:
> You've got my support!
>
> I 100% support Alex McDonald and Julien Fondren being appointed to the Forth-200x committee ... there is nobody better qualified than Alex McDonald and Julien Fondren.
I appreciate how hard it must have been for you to say this.
Once I am appointed to the Forth-200x committee, I will pursue a
four-point plan to immediately improve the language:
> 1.) Mandate the W D F constants for data-type sizes to obtain portability between 16-bit, 32-bit and 64-bit systems.
1. Mandate the CELLS and FLOATS words for data-type sizes to obtain
portability between 16-bit, 32-bit and 64-bit systems.
> 2.) Mandate that LITERAL etc. should be vectored so we can have literal numbers in TARG colon words in a cross-compiler.
2. Declare that cross-compilers are not important. Forth shall not
become a language that people use *only* to write a cross-compiler in.
I'm honestly quite sick of all the "look at my cross compiler", "am I
doing this cross compiler right?", "my cross compiler isn't working on
gforth after upgrading!" posts that plague clf.
> 3.) Mandate { ... } (the John Hopkins format) for locals, make the locals provide an address, and make the locals large enough to hold doubles and floats as well as singles.
3. Mandate that Forth provide and document no less than three (3)
stacks: data, return, and float, so that Forth code can pass data
among words without having to stuff everything into the dictionary. At
the forefront of programming language research we find
combinator-heavy, 'point-free' programming in Haskell, and I believe
that Forth can adopt this style of programming at an even more
fundamental level.
> 4.) Mandate that my rquotations work.
4. Mandate the formalization of a 'control stack' and a control-flow
vocabulary that is both closer to the machine and much more flexible
than legacy quotations-only control flow. It should be possible to
write new control-flow words without resort to compiler hacks! Yes,
these new BEGIN WHILE IF ELSE words are not as 'postfix', and I admit
that quotations have a readability niche, but the advantages of
'coding with branches' must not be ignored any longer.
I will not mandate, but I will *strongly* suggest that literally every
Forth of note remain capable of elaborate return-stack manipulation,
as a powerful alternative to quotations. Consider the following:
begin-structure lab-item
cell + ( cdr )
cell +field odd?
128 +field prefix
end-structure
variable labs
: lab ( "prefix" f-odd? -- )
lab-item allocate throw
labs @ over ! dup labs !
tuck odd? !
parse-name rot prefix place ;
: call ( cont -- ) >r ;
: this ( -- x ) r> r> r@ -rot >r >r ;
: each-lab ( -- ) \ this cont: ( -- )
labs @ begin dup while
r@ swap >r call
r> @ repeat drop r> drop ;
: .labs ( -- )
each-lab
cr this odd? ? ." lab " this prefix count type ;
0 lab LABX7
0 lab LABX5
0 lab LABX3
-1 lab LABN11
-1 lab LRC
And then look at this interaction under a so-called 'optimizing'
compiler:
include labs.fs
Including labs.fs
PREFIX is redefined ok
.labs
-1 lab LRC
-1 lab LABN11
0 lab LABX3
0 lab LABX5
0 lab LABX7 ok
Outrageous.
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
list processing in Forth tutorials Julian Fondren <julian.fondren@gmail.com> - 2017-03-08 19:59 -0800
Re: list processing in Forth tutorials hughaguilar96@gmail.com - 2017-03-08 22:28 -0800
Re: list processing in Forth tutorials Julian Fondren <julian.fondren@gmail.com> - 2017-03-08 23:33 -0800
Re: list processing in Forth tutorials hughaguilar96@gmail.com - 2017-03-11 15:10 -0800
Re: list processing in Forth tutorials NN <november.nihal@gmail.com> - 2017-03-09 04:58 -0800
Re: list processing in Forth tutorials hughaguilar96@gmail.com - 2017-03-11 15:23 -0800
Re: list processing in Forth tutorials Alex <alex@rivadpm.com> - 2017-03-11 23:45 +0000
Re: list processing in Forth tutorials hughaguilar96@gmail.com - 2017-03-11 16:24 -0800
Re: list processing in Forth tutorials Julian Fondren <julian.fondren@gmail.com> - 2017-03-11 21:14 -0800
Re: list processing in Forth tutorials "Elizabeth D. Rather" <erather@forth.com> - 2017-03-11 19:29 -1000
Re: list processing in Forth tutorials mhx@iae.nl - 2017-03-12 00:36 -0800
Re: list processing in Forth tutorials hughaguilar96@gmail.com - 2017-03-12 19:10 -0700
Re: list processing in Forth tutorials mhx@iae.nl - 2017-03-12 00:24 -0800
Re: list processing in Forth tutorials Julian Fondren <julian.fondren@gmail.com> - 2017-03-12 07:35 -0700
Re: list processing in Forth tutorials minforth@arcor.de - 2017-03-12 01:19 -0800
Re: list processing in Forth tutorials NN <november.nihal@gmail.com> - 2017-03-14 07:40 -0700
Re: list processing in Forth tutorials Ron Aaron <rambamist@gmail.com> - 2017-03-12 11:24 +0200
Re: list processing in Forth tutorials humptydumpty <ouatubi@gmail.com> - 2017-03-12 10:48 -0700
Re: list processing in Forth tutorials humptydumpty <ouatubi@gmail.com> - 2017-03-12 10:56 -0700
Re: list processing in Forth tutorials hughaguilar96@gmail.com - 2017-03-12 19:31 -0700
Re: list processing in Forth tutorials hughaguilar96@gmail.com - 2017-03-11 18:31 -0800
Re: list processing in Forth tutorials hughaguilar96@gmail.com - 2017-03-15 13:18 -0700
Re: list processing in Forth tutorials NN <november.nihal@gmail.com> - 2017-03-16 06:02 -0700
Re: list processing in Forth tutorials hughaguilar96@gmail.com - 2017-03-16 12:11 -0700
Re: list processing in Forth tutorials NN <november.nihal@gmail.com> - 2017-03-17 04:14 -0700
Re: list processing in Forth tutorials hughaguilar96@gmail.com - 2017-03-17 15:13 -0700
Re: list processing in Forth tutorials hughaguilar96@gmail.com - 2017-03-17 15:19 -0700
Re: list processing in Forth tutorials Coherent Systems <CoherentSystems@cosy.com> - 2017-03-21 15:46 -0700
csiph-web