Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #44965 > unrolled thread
| Started by | lehs <skydda.barnen@gmail.com> |
|---|---|
| First post | 2016-01-20 10:19 -0800 |
| Last post | 2016-01-22 15:28 +0000 |
| Articles | 16 on this page of 36 — 12 participants |
Back to article view | Back to comp.lang.forth
I need a real big data stack lehs <skydda.barnen@gmail.com> - 2016-01-20 10:19 -0800
Re: I need a real big data stack "Elizabeth D. Rather" <erather@forth.com> - 2016-01-20 09:45 -1000
Re: I need a real big data stack lehs <skydda.barnen@gmail.com> - 2016-01-20 12:33 -0800
Re: I need a real big data stack anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-21 13:53 +0000
Re: I need a real big data stack lehs <skydda.barnen@gmail.com> - 2016-02-13 09:41 -0800
Re: I need a real big data stack anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-02-14 15:09 +0000
Re: I need a real big data stack lehs <skydda.barnen@gmail.com> - 2016-02-14 11:11 -0800
Re: I need a real big data stack Coos Haak <chforth@hccnet.nl> - 2016-02-14 20:41 +0100
Re: I need a real big data stack lehs <skydda.barnen@gmail.com> - 2016-02-14 14:24 -0800
Re: I need a real big data stack Whammo <sidciavic@gmail.com> - 2016-01-20 11:46 -0800
Re: I need a real big data stack lehs <skydda.barnen@gmail.com> - 2016-01-20 12:36 -0800
Re: I need a real big data stack Whammo <sidciavic@gmail.com> - 2016-01-21 19:12 -0800
Re: I need a real big data stack lehs <skydda.barnen@gmail.com> - 2016-01-22 02:25 -0800
Re: I need a real big data stack lehs <skydda.barnen@gmail.com> - 2016-01-20 12:38 -0800
Re: I need a real big data stack Pablo Hugo Reda <pabloreda@gmail.com> - 2016-01-20 12:04 -0800
Re: I need a real big data stack Jan Coombs <jenfhaomndgfwutc@murmic.plus.com> - 2016-01-20 20:15 +0000
Re: I need a real big data stack lehs <skydda.barnen@gmail.com> - 2016-01-20 12:40 -0800
Re: I need a real big data stack Jan Coombs <jenfhaomndgfwutc@murmic.plus.com> - 2016-01-21 00:00 +0000
Re: I need a real big data stack Paul Rubin <no.email@nospam.invalid> - 2016-01-20 17:42 -0800
Re: I need a real big data stack Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-01-21 10:45 +0000
Re: I need a real big data stack Paul Rubin <no.email@nospam.invalid> - 2016-01-21 10:41 -0800
Re: I need a real big data stack "Elizabeth D. Rather" <erather@forth.com> - 2016-01-21 09:02 -1000
Re: I need a real big data stack hughaguilar96@gmail.com - 2016-01-21 16:42 -0800
Re: I need a real big data stack lehs <skydda.barnen@gmail.com> - 2016-01-21 15:24 -0800
Re: I need a real big data stack Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-01-22 01:13 +0000
Re: I need a real big data stack hughaguilar96@gmail.com - 2016-01-21 17:53 -0800
Re: I need a real big data stack Julian Fondren <julian.fondren@gmail.com> - 2016-01-21 19:09 -0800
Re: I need a real big data stack Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-01-22 15:24 +0000
Re: I need a real big data stack Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-01-22 15:16 +0000
Re: I need a real big data stack "Elizabeth D. Rather" <erather@forth.com> - 2016-01-22 09:07 -1000
Re: I need a real big data stack Coos Haak <chforth@hccnet.nl> - 2016-01-22 15:03 +0100
Re: I need a real big data stack Albert van der Horst <albert@spenarnc.xs4all.nl> - 2016-01-21 10:36 +0000
Re: I need a real big data stack anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-21 13:32 +0000
Re: I need a real big data stack Ron Aaron <rambamist@gmail.com> - 2016-01-21 15:51 +0200
Re: I need a real big data stack lehs <skydda.barnen@gmail.com> - 2016-01-21 15:20 -0800
Re: I need a real big data stack anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2016-01-22 15:28 +0000
Page 2 of 2 — ← Prev page 1 [2]
| From | Paul Rubin <no.email@nospam.invalid> |
|---|---|
| Date | 2016-01-21 10:41 -0800 |
| Message-ID | <87egdapyff.fsf@nightsong.com> |
| In reply to | #44987 |
Albert van der Horst <albert@spenarnc.xs4all.nl> writes: > E.g. one of the rosetta codes ask for the first N k-almost primes. > One could combine a set of N k-1-almost with a set of N 1-almost > given N^2 elements on the stack. Sort them and keep the N smallest > in the permanent store for k-almost primes. How do you sort N^2 elements on the stack, without randomly accessing its interior so you're not really using it as a stack?
[toc] | [prev] | [next] | [standalone]
| From | "Elizabeth D. Rather" <erather@forth.com> |
|---|---|
| Date | 2016-01-21 09:02 -1000 |
| Message-ID | <J4-dnX849PbatjzLnZ2dnUU7-eWdnZ2d@supernews.com> |
| In reply to | #44996 |
On 1/21/16 8:41 AM, Paul Rubin wrote: > Albert van der Horst <albert@spenarnc.xs4all.nl> writes: >> E.g. one of the rosetta codes ask for the first N k-almost primes. >> One could combine a set of N k-1-almost with a set of N 1-almost >> given N^2 elements on the stack. Sort them and keep the N smallest >> in the permanent store for k-almost primes. > > How do you sort N^2 elements on the stack, without randomly accessing > its interior so you're not really using it as a stack? > A bunch of elements to be sorted, when you know how many there are, should properly go into an array. 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 | hughaguilar96@gmail.com |
|---|---|
| Date | 2016-01-21 16:42 -0800 |
| Message-ID | <535f9b28-28b0-4d38-b2fe-96c0303a7f61@googlegroups.com> |
| In reply to | #44997 |
On Thursday, January 21, 2016 at 12:02:33 PM UTC-7, Elizabeth D. Rather wrote: > On 1/21/16 8:41 AM, Paul Rubin wrote: > > Albert van der Horst <albert@spenarnc.xs4all.nl> writes: > >> E.g. one of the rosetta codes ask for the first N k-almost primes. > >> One could combine a set of N k-1-almost with a set of N 1-almost > >> given N^2 elements on the stack. Sort them and keep the N smallest > >> in the permanent store for k-almost primes. > > > > How do you sort N^2 elements on the stack, without randomly accessing > > its interior so you're not really using it as a stack? You could use a Bubble Sort, moving them to and from the return-stack for each pass --- this is pretty inefficient and I would only do this with a small amount of data --- normally you want some kind of data-structure rather than just hold all the data on the stack. > A bunch of elements to be sorted, when you know how many there are, > should properly go into an array. I almost never use arrays. Typically, the data are being generated one at a time, so I insert them into a self-balancing binary tree. This is a good technique on multi-core processors because inserting the item into the tree can be done concurrently with acquiring the next item. You've never written a computer program in your life --- you know nothing about sorting algorithms --- it is offensive that you should tell any programmer what should "properly" be done.
[toc] | [prev] | [next] | [standalone]
| From | lehs <skydda.barnen@gmail.com> |
|---|---|
| Date | 2016-01-21 15:24 -0800 |
| Message-ID | <e5b31655-626f-4e0d-ade6-f239c1b92a01@googlegroups.com> |
| In reply to | #44996 |
Den torsdag 21 januari 2016 kl. 19:41:58 UTC+1 skrev Paul Rubin:
> Albert van der Horst <albert@spenarnc.xs4all.nl> writes:
> > E.g. one of the rosetta codes ask for the first N k-almost primes.
> > One could combine a set of N k-1-almost with a set of N 1-almost
> > given N^2 elements on the stack. Sort them and keep the N smallest
> > in the permanent store for k-almost primes.
>
> How do you sort N^2 elements on the stack, without randomly accessing
> its interior so you're not really using it as a stack?
It can be done like this:
: lower \ m1 ... mn m n+1 -- m1 ... m ... mi n+1
\ lower m on stack until next number not is greater
dup 2 =
if drop 2dup u>
if swap
then 2 exit
then >r 2dup u> 0=
if r> exit
then r> rot >r
1- recurse 1+ r> swap ;
: sort \ m1 ... mn n -- s1 ... sn n o(n²)
dup 3 <
if dup 2 =
if drop 2dup u>
if swap
then 2
then exit
then dup >r
1- recurse roll
r> lower ;
But as Elizabeth Rather wrote, the proper way is to sort in an array.
[toc] | [prev] | [next] | [standalone]
| From | Albert van der Horst <albert@spenarnc.xs4all.nl> |
|---|---|
| Date | 2016-01-22 01:13 +0000 |
| Message-ID | <56a18230$0$23726$e4fe514c@news.xs4all.nl> |
| In reply to | #45001 |
lehs <skydda.barnen@gmail.com> writes: >Den torsdag 21 januari 2016 kl. 19:41:58 UTC+1 skrev Paul Rubin: >> Albert van der Horst <albert@spenarnc.xs4all.nl> writes: >> > E.g. one of the rosetta codes ask for the first N k-almost primes. >> > One could combine a set of N k-1-almost with a set of N 1-almost >> > given N^2 elements on the stack. Sort them and keep the N smallest >> > in the permanent store for k-almost primes. >>=20 >> How do you sort N^2 elements on the stack, without randomly accessing >> its interior so you're not really using it as a stack? >It can be done like this: >: lower \ m1 ... mn m n+1 -- m1 ... m ... mi n+1 =20 >\ lower m on stack until next number not is greater > dup 2 =3D > if drop 2dup u> > if swap > then 2 exit > then >r 2dup u> 0=3D=20 > if r> exit > then r> rot >r=20 > 1- recurse 1+ r> swap ; >: sort \ m1 ... mn n -- s1 ... sn n o(n=B2) > dup 3 < > if dup 2 =3D > if drop 2dup u>=20 > if swap=20 > then 2=20 > then exit > then dup >r > 1- recurse roll=20 > r> lower ; >But as Elizabeth Rather wrote, the proper way is to sort in an array. The proper way is to use libraries as much as one can. If the stack is addressable, you can apply SORT-X (sorting cells) to it. ( ciforth) WANT SORT-X DSP@ SQ VARIABLE N DATA BUFFER N @ CELLS ALLOT \ Assuming N^2 elements on the stack DSP@ N @ SQ SORT-X \ Now sorted, keep N lowest DSP@ BUFFER N @ CELLS MOVE \ Remove N^2 elemens from the stack DSP@ N @ SQ CELLS + DSP! Using DSP@ is a very useful idiom. Understand the following definition EMIT in terms of TYPE and let it sink in (requires big-endian, Intel style) : EMIT DSP@ 1 TYPE DROP ( !) ; Groetjes Albert -- 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
[toc] | [prev] | [next] | [standalone]
| From | hughaguilar96@gmail.com |
|---|---|
| Date | 2016-01-21 17:53 -0800 |
| Message-ID | <0666b1fc-e354-460b-b9b4-69303acd2549@googlegroups.com> |
| In reply to | #45003 |
On Thursday, January 21, 2016 at 6:13:22 PM UTC-7, Albert van der Horst wrote: > lehs <skydda.barnen@gmail.com> writes: > >But as Elizabeth Rather wrote, the proper way is to sort in an array. > > The proper way is to use libraries as much as one can. > If the stack is addressable, you can apply SORT-X (sorting cells) > to it. It is unusual that your data consist of integers. Maybe this comes up in number-theory problems. Most of the time, the data that you are sorting is going to be a struct of some kind --- this would be put in a data-structure --- I would expect most code-libraries to involve data-structures containing structs. Our problem statement as presented by Elizabeth Rather is: "Sort an array of integers." For the most part, these kinds of problems are textbook exercises --- like WJ's programming challenges, these don't represent real-world programming. Of course, I haven't worked as a programmer in quite a while, so I'm not exactly an expert on real-world programming --- most of the programs in my novice-package (such as LowDraw poker analysis) don't really represent real-world programming either.
[toc] | [prev] | [next] | [standalone]
| From | Julian Fondren <julian.fondren@gmail.com> |
|---|---|
| Date | 2016-01-21 19:09 -0800 |
| Message-ID | <4549815a-616f-4007-93b1-b98cf7216efc@googlegroups.com> |
| In reply to | #45005 |
On Thursday, January 21, 2016 at 7:53:46 PM UTC-6, hughag...@gmail.com wrote: > It is unusual that your data consist of integers. Maybe this comes up in number-theory problems. Most of the time, the data that you are sorting is going to be a struct of some kind --- this would be put in a data-structure --- I would expect most code-libraries to involve data-structures containing structs. Write a sorting routing for an array of numbers. Then, generalize it so that you can pass any comparison operator for those numbers. Then, pass a 'comparison operator' that doesn't compare the numbers directly, but treats them as addresses to structures with subcomponents that are themselves compared. Congratulations! You're now sorting arrays of (addreses of) structures! And you barely changed the code you wrote in step #1. You can use the array-of-addresses as a sorted view of your larger collection of structures. If that collection is difficult or expensive to rearrange, no worries, your array of cells is very easily rearranged. If you later decide that you do want the larger collection to be sorted, you can iterate over your sorted view to reconstruct a sorted copy of the collection. Less memory efficient, but if the larger collection is so large that it's actually on the disk, making a copy means never not having a valid copy of it around. OK, it's also easy to generalize the code in step #1 to swap structures instead of cells -- but only if the structures are the same size. They aren't with list-like collections, where you have to inspect the current node in order to get to the next node ( CDR @ for a linked list; D_NEXT W@ O + for linux dirents; COUNT + for a packed sequence of counted strings). -- Julian
[toc] | [prev] | [next] | [standalone]
| From | Albert van der Horst <albert@spenarnc.xs4all.nl> |
|---|---|
| Date | 2016-01-22 15:24 +0000 |
| Message-ID | <56a249a7$0$23739$e4fe514c@news.xs4all.nl> |
| In reply to | #45007 |
Julian Fondren <julian.fondren@gmail.com> writes:
>On Thursday, January 21, 2016 at 7:53:46 PM UTC-6, hughag...@gmail.com wrot=
>e:
>> It is unusual that your data consist of integers. Maybe this comes up in =
>number-theory problems. Most of the time, the data that you are sorting is =
>going to be a struct of some kind --- this would be put in a data-structure=
> --- I would expect most code-libraries to involve data-structures containi=
>ng structs.
>Write a sorting routing for an array of numbers. Then,
>generalize it so that you can pass any comparison operator for
>those numbers. Then, pass a 'comparison operator' that doesn't
>compare the numbers directly, but treats them as addresses to
>structures with subcomponents that are themselves compared.
>Congratulations! You're now sorting arrays of (addreses of)
>structures!
Actually I do it the other way arround. X-SORT is a specialisation
of QSORT with fixed XT's.
<SNIP>
>OK, it's also easy to generalize the code in step #1 to swap
>structures instead of cells -- but only if the structures are
>the same size. They aren't with list-like collections, where
>you have to inspect the current node in order to get to the next
>node ( CDR @ for a linked list; D_NEXT W@ O + for linux dirents;
>COUNT + for a packed sequence of counted strings).
That is also present in the library of ciforth called MERGE-SORT ,
with the API:
\ For compare XT, next XT, linked LIST , leave a sorted LIST1.
With the proper XT's it can be used to have the Forth dictionary
in alphabetic order. E.g. for ciforth a proper next XT is
:NONAME >LFA @ ;
>-- Julian
--
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
[toc] | [prev] | [next] | [standalone]
| From | Albert van der Horst <albert@spenarnc.xs4all.nl> |
|---|---|
| Date | 2016-01-22 15:16 +0000 |
| Message-ID | <56a247db$0$23739$e4fe514c@news.xs4all.nl> |
| In reply to | #45005 |
hughaguilar96@gmail.com writes: >On Thursday, January 21, 2016 at 6:13:22 PM UTC-7, Albert van der Horst wro= >te: >> lehs <skydda.barnen@gmail.com> writes: >> >But as Elizabeth Rather wrote, the proper way is to sort in an array. >>=20 >> The proper way is to use libraries as much as one can. >> If the stack is addressable, you can apply SORT-X (sorting cells) >> to it. >It is unusual that your data consist of integers. Maybe this comes up in nu= >mber-theory problems. Most of the time, the data that you are sorting is go= >ing to be a struct of some kind --- this would be put in a data-structure -= >-- I would expect most code-libraries to involve data-structures containing= > structs. Of course you're right. One can have an array of pointers to structs, or an array of like-size structs, and I;ve to pass an execution token to my QSORT. I didn't want to complicate matters with that. >Our problem statement as presented by Elizabeth Rather is: "Sort an array o= >f integers." For the most part, these kinds of problems are textbook exerci= >ses --- like WJ's programming challenges, these don't represent real-world = >programming. >Of course, I haven't worked as a programmer in quite a while, so I'm not ex= >actly an expert on real-world programming --- most of the programs in my no= >vice-package (such as LowDraw poker analysis) don't really represent real-w= >orld programming either. I could brag about some real world progams I've worked on, but I don't think I can earn your respect. Groetjes Albert -- 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
[toc] | [prev] | [next] | [standalone]
| From | "Elizabeth D. Rather" <erather@forth.com> |
|---|---|
| Date | 2016-01-22 09:07 -1000 |
| Message-ID | <NemdnUB9o7F34D_LnZ2dnUU7-cWdnZ2d@supernews.com> |
| In reply to | #45025 |
On 1/22/16 5:16 AM, Albert van der Horst wrote: > hughaguilar96@gmail.com writes: > >> On Thursday, January 21, 2016 at 6:13:22 PM UTC-7, Albert van der Horst wro= >> te: >>> lehs <skydda.barnen@gmail.com> writes: >>>> But as Elizabeth Rather wrote, the proper way is to sort in an array. >>> =20 >>> The proper way is to use libraries as much as one can. >>> If the stack is addressable, you can apply SORT-X (sorting cells) >>> to it. > >> It is unusual that your data consist of integers. Maybe this comes up in nu= >> mber-theory problems. Most of the time, the data that you are sorting is go= >> ing to be a struct of some kind --- this would be put in a data-structure -= >> -- I would expect most code-libraries to involve data-structures containing= >> structs. > > Of course you're right. One can have an array of pointers to structs, > or an array of like-size structs, and I;ve to pass an execution token > to my QSORT. I didn't want to complicate matters with that. > >> Our problem statement as presented by Elizabeth Rather is: "Sort an array o= >> f integers." For the most part, these kinds of problems are textbook exerci= >> ses --- like WJ's programming challenges, these don't represent real-world = >> programming. > >> Of course, I haven't worked as a programmer in quite a while, so I'm not ex= >> actly an expert on real-world programming --- most of the programs in my no= >> vice-package (such as LowDraw poker analysis) don't really represent real-w= >> orld programming either. > > I could brag about some real world progams I've worked on, but I don't > think I can earn your respect. Well, I didn't "present" this problem, I was responding to a request for sorting items on the data stack, and just suggested that the items to be sorted should be in an array. A stack is designed for last-in-first-out access, which is inappropriate for any known sort algorithm. That said, in over 40 years of programming (30 of which used Forth) I found very few requirements for sorting. That may be more characteristic of "data processing" or "IT" applications, whereas most of my experience involved scientific analysis, instrumentation, and control applications. 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 | Coos Haak <chforth@hccnet.nl> |
|---|---|
| Date | 2016-01-22 15:03 +0100 |
| Message-ID | <7v8pgb13v3a3.26ibdj8aa59u.dlg@40tude.net> |
| In reply to | #45003 |
Op 22 Jan 2016 01:13:20 GMT schreef Albert van der Horst: <snip> > Using DSP@ is a very useful idiom. > Understand the following definition EMIT in terms of TYPE and > let it sink in (requires big-endian, Intel style) > >: EMIT DSP@ 1 TYPE DROP ( !) ; As this works on Intel/AMD it must be a little-endian machine. Does not work on 6800, 6809, 68000, 1802. Camelforth for 1802 cheats: the data stack is little endian. " $ ./1802sim CF1802 Starting address: 0000 RCA1802 CamelForth v1.1 11 Apr 2009 : EMIT SP@ 1 TYPE DROP ; ok 65 EMIT 42 EMIT A* ok " > > Groetjes Albert groet Coos
[toc] | [prev] | [next] | [standalone]
| From | Albert van der Horst <albert@spenarnc.xs4all.nl> |
|---|---|
| Date | 2016-01-21 10:36 +0000 |
| Message-ID | <56a0b4b3$0$23801$e4fe514c@news.xs4all.nl> |
| In reply to | #44971 |
Jan Coombs <jenfhaomndgfwutc@murmic.plus.com> writes: >On Wed, 20 Jan 2016 10:19:36 -0800 (PST) >lehs <skydda.barnen@gmail.com> wrote: >> I can do it in SP-Forth and I could do it in FIG-Forth. I >> understand that it creates problem with portability and that >> there are no standard words to change the stack buffer area, >> but I would like to be able to do it anyway. >> >> Is it possible in GForth? >Yes, but googled as I was too lazy to read manual: >https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Stack-and-Dictionary-Sizes.html >> >> http://forthmath.blogspot.se/ It is also easy in lina lina -g 4000 lina+ extends the data stack (that runs into the dictionary figforth style) to 4000 MByte and stores the resulting forth in lina+ I routinely use 8 Gbyte in my 64 bit Forth. It may not make sense to set it larger than the physical memory you have. E.g. If I set the memory to 32 gbyte on my 16 gbyte system the command HEX HERE 8,0000,0000 takes forever, and slows down the system notably (on an 8 core amd 4 Gbz). Groetjes Albert -- 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
[toc] | [prev] | [next] | [standalone]
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Date | 2016-01-21 13:32 +0000 |
| Message-ID | <2016Jan21.143200@mips.complang.tuwien.ac.at> |
| In reply to | #44965 |
lehs <skydda.barnen@gmail.com> writes:
>I can do it in SP-Forth and I could do it in FIG-Forth. I understand that it creates problem with portability and that there are no standard words to change the stack buffer area, but I would like to be able to do it anyway.
>
>Is it possible in GForth?
>gforth --help
Usage: gforth [engine options] ['--'] [image arguments]
Engine Options:
...
-d SIZE, --data-stack-size=SIZE Specify data stack size
...
SIZE arguments consist of an integer followed by a unit. The unit can be
`b' (byte), `e' (element; default), `k' (KB), `M' (MB), `G' (GB) or `T' (TB).
>gforth -d 1T
Gforth 0.7.2, Copyright (C) 1995-2008 Free Software Foundation, Inc.
Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `bye' to exit
sh cat /proc/$PPID/maps
...
7e489d3bf000-7f489d3bf000 rwxp 00000000 00:00 0
...
sh ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
...
anton 12926 0.0 0.0 1073766336 2720 pts/8 S+ 14:38 0:00 gforth -d 1T
...
Big enough?
- 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 2015: http://www.rigwit.co.uk/EuroForth2015/
[toc] | [prev] | [next] | [standalone]
| From | Ron Aaron <rambamist@gmail.com> |
|---|---|
| Date | 2016-01-21 15:51 +0200 |
| Message-ID | <n7qnkr$4nu$1@dont-email.me> |
| In reply to | #44990 |
On 01/21/2016 15:32, Anton Ertl wrote: >> gforth --help > Usage: gforth [engine options] ['--'] [image arguments] > Engine Options: > ... > -d SIZE, --data-stack-size=SIZE Specify data stack size Just for completeness, you can do the same in 8th, either by giving the command-line "-k nnn" where 'nnn' is the number of items you want to be able to have on the stack, or via code (at the start of your app): nnn stack-size Though if you need a really big stack, you're better off just asking for one as big as you want: nnnn st:new
[toc] | [prev] | [next] | [standalone]
| From | lehs <skydda.barnen@gmail.com> |
|---|---|
| Date | 2016-01-21 15:20 -0800 |
| Message-ID | <5e051e75-4e0f-47a7-9e0d-59556fb39fa3@googlegroups.com> |
| In reply to | #44990 |
Den torsdag 21 januari 2016 kl. 14:45:13 UTC+1 skrev Anton Ertl: > lehs <skydda.barnen@gmail.com> writes: > >I can do it in SP-Forth and I could do it in FIG-Forth. I understand that it creates problem with portability and that there are no standard words to change the stack buffer area, but I would like to be able to do it anyway. > > > >Is it possible in GForth? > > >gforth --help > Usage: gforth [engine options] ['--'] [image arguments] > Engine Options: > ... > -d SIZE, --data-stack-size=SIZE Specify data stack size > ... > SIZE arguments consist of an integer followed by a unit. The unit can be > `b' (byte), `e' (element; default), `k' (KB), `M' (MB), `G' (GB) or `T' (TB). > > >gforth -d 1T > Gforth 0.7.2, Copyright (C) 1995-2008 Free Software Foundation, Inc. > Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license' > Type `bye' to exit > sh cat /proc/$PPID/maps > ... > 7e489d3bf000-7f489d3bf000 rwxp 00000000 00:00 0 > ... > sh ps aux > USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND > ... > anton 12926 0.0 0.0 1073766336 2720 pts/8 S+ 14:38 0:00 gforth -d 1T > ... > > Big enough? > > - 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 2015: http://www.rigwit.co.uk/EuroForth2015/ I never learned the DOS commandos and could only with some patience come to C:\Program Files (x86)\gforth64> But C:\Program Files (x86)\gforth64>gforth -d 1M or something is a good way. However, 1024 dup * dup aligned allocate throw + dup sp0 ! sp! is an alternative that suits better for my blog. http://forthmath.blogspot.se/ Thanks all of you!
[toc] | [prev] | [next] | [standalone]
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Date | 2016-01-22 15:28 +0000 |
| Message-ID | <2016Jan22.162845@mips.complang.tuwien.ac.at> |
| In reply to | #45000 |
lehs <skydda.barnen@gmail.com> writes:
>However,
>1024 dup * dup aligned allocate throw + dup sp0 ! sp!
>is an alternative that suits better for my blog.
Note that you should do the "sp0 ! sp!" in a colon definition, not on
the command line. Otherwise, if the ALLOCATEd memory is below the
stack, ?STACK will strike between ! and sp!.
- 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 2015: http://www.rigwit.co.uk/EuroForth2015/
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | comp.lang.forth
csiph-web