Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #57396 > unrolled thread

Re: string-stack.4th

Started byhughaguilar96@gmail.com
First post2017-04-15 16:54 -0700
Last post2017-04-15 21:15 -0700
Articles 9 on this page of 49 — 13 participants

Back to article view | Back to comp.lang.forth

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-15 16:54 -0700
    Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-15 19:55 -0700
      Re: string-stack.4th Julian Fondren <julian.fondren@gmail.com> - 2017-04-15 20:08 -0700
      Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-16 13:50 +0000
        Re: string-stack.4th anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-16 15:51 +0000
          Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-16 22:16 +0000
            Re: string-stack.4th anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-04-17 12:04 +0000
              Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-17 13:11 -0700
                Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-17 23:18 +0000
                  Re: string-stack.4th albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-04-18 01:49 +0200
                    Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-19 23:03 +0000
                      Re: string-stack.4th "Elizabeth D. Rather" <erather@forth.com> - 2017-04-19 13:19 -1000
                        Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-20 00:15 +0000
                          Re: string-stack.4th "Elizabeth D. Rather" <erather@forth.com> - 2017-04-19 14:34 -1000
                            Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-20 17:16 +0000
                            Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-20 15:08 -0700
                        Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-20 00:16 +0000
                          Re: string-stack.4th albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-04-20 21:10 +0200
                            Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-21 09:59 +0000
                        Re: string-stack.4th albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-04-20 20:50 +0200
                  Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-17 19:47 -0700
                    Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-19 23:08 +0000
                Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-18 00:10 -0700
                  Re: string-stack.4th Alex <alex@rivadpm.com> - 2017-04-18 13:48 +0100
                    Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-18 09:15 -0700
                      Re: string-stack.4th Alex <alex@rivadpm.com> - 2017-04-18 18:23 +0100
              Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-17 23:07 +0000
              Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-18 09:09 -0700
                Re: string-stack.4th lehs <skydda.barnen@gmail.com> - 2017-04-18 10:27 -0700
        Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-16 19:26 -0700
          Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-17 23:13 +0000
            Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-23 12:39 -0700
              Re: string-stack.4th Michael Barry <barrym95838@yahoo.com> - 2017-04-23 22:25 -0700
                Re: string-stack.4th foxaudioresearch@gmail.com - 2017-04-24 14:06 -0700
                  Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-29 03:19 +0000
              Re: string-stack.4th Ron Aaron <rambamist@gmail.com> - 2017-04-24 08:35 +0300
                Re: string-stack.4th Paul Rubin <no.email@nospam.invalid> - 2017-04-23 23:51 -0700
                  Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-24 00:10 -0700
                  Re: string-stack.4th Ron Aaron <rambamist@gmail.com> - 2017-04-24 10:11 +0300
                    Re: string-stack.4th Lars Brinkhoff <lars.spam@nocrew.org> - 2017-04-24 09:27 +0200
                    Re: string-stack.4th Paul Rubin <no.email@nospam.invalid> - 2017-04-24 01:14 -0700
              Re: string-stack.4th Alex <alex@rivadpm.com> - 2017-04-24 14:38 +0100
              Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-29 03:18 +0000
              Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-29 03:27 +0000
                Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-28 22:13 -0700
                  Re: string-stack.4th Alex <alex@rivadpm.com> - 2017-04-29 09:41 +0100
                    Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-29 07:05 -0700
                  Re: string-stack.4th "Rudy Velthuis" <newsgroups@rvelthuis.de> - 2017-04-29 11:43 +0000
    Re: string-stack.4th hughaguilar96@gmail.com - 2017-04-15 21:15 -0700

Page 3 of 3 — ← Prev page 1 2 [3]


#57978

FromPaul Rubin <no.email@nospam.invalid>
Date2017-04-24 01:14 -0700
Message-ID<87h91enrwm.fsf@nightsong.com>
In reply to#57971
Ron Aaron <rambamist@gmail.com> writes:
> Yes, that's what I mean.  The danger is that you can't (reliably) rely
> on pointer layout in a cross-platform manner.   So it's a dangerous
> technique, IMO.

Well, about a gazillion and eleventeen language implementations work
that way, so I wouldn't worry.  You do some ugly stuff with pointer
casting and might conceivably need some conditional compilation
depending on the target architecture.  I've even heard of Lisp
implementations using unboxed floats, by stealing exponent bits for the
type tag.

[toc] | [prev] | [next] | [standalone]


#57993

FromAlex <alex@rivadpm.com>
Date2017-04-24 14:38 +0100
Message-ID<odkuu8$6ov$1@dont-email.me>
In reply to#57918
On 4/23/2017 20:39, hughaguilar96@gmail.com wrote:
> My intention with STRING-STACK.4TH was to bring ANS-Forth up to the level of BASIC that I was familiar with from the 1980s.

The 1980s. All that effort for big hair and men in tight lurex shorts.

-- 
Alex

[toc] | [prev] | [next] | [standalone]


#58329

From"Rudy Velthuis" <newsgroups@rvelthuis.de>
Date2017-04-29 03:18 +0000
Message-ID<xn0kpapuc2ngbjw006@nntp.aioe.org>
In reply to#57918
hughaguilar96@gmail.com wrote:

> On Monday, April 17, 2017 at 4:13:59 PM UTC-7, Rudy Velthuis wrote:
> > hughaguilar96@gmail.com wrote:
> > 
> > > My STRING-STACK.4TH does use COW (copy on write). Weirdly enough,
> > > you snipped my entire description of how I use COW and showed one
> > > sentence out of context that seemed to imply that I didn't use
> > > COW.
> > 
> > You seemed to think that storing on the heap requires a lot of
> > copying.  No, it doesn't necessarily do that.
> 
> Everybody wants me to be an idiot!

I can only go by your own words. If you say such things, expect people
(no matter who) to correct them.

-- 
Rudy Velthuis        http://www.rvelthuis.de

"I'm living so far beyond my income that we may almost be said 
 to be living apart." -- e e cummings (1894-1962)

[toc] | [prev] | [next] | [standalone]


#58331

From"Rudy Velthuis" <newsgroups@rvelthuis.de>
Date2017-04-29 03:27 +0000
Message-ID<xn0kpaq2d2nrx62008@nntp.aioe.org>
In reply to#57918
hughaguilar96@gmail.com wrote:

> It is ridiculous that this little troll is trying to educate me on
> the subject of COW after I've written STRING-STACK.4TH that does COW.

Ah, you seem to have problems with people who have a different opinion
than yours. I guess that also explains your rants against certain
persons.

And well, so what? You have written code that "does COW". Cool. So have
I. A lot. Just not in Forth.

BTW, how many people are actually using your code? Oh sorry, is that
trolling? If so, I apologize. But I heard that people here don't like
to use libraries written by others, so I really wonder.
 
> He wants me to use refcounting!

I don't want you to do anything. Why should I? I actually don't really
care what you do.

I merely said how I would do it, to make things easier. I never told
you to follow me. Who am I to do that?

-- 
Rudy Velthuis        http://www.rvelthuis.de

"The world is a tragedy to those who feel, but a comedy to those
 who think." -- Horace Walpole (1717-1797)

[toc] | [prev] | [next] | [standalone]


#58334

Fromhughaguilar96@gmail.com
Date2017-04-28 22:13 -0700
Message-ID<793882c9-7fd1-49e0-a570-b154760d2c95@googlegroups.com>
In reply to#58331
On Friday, April 28, 2017 at 8:27:43 PM UTC-7, Rudy Velthuis wrote:
> hughaguilar96@gmail.com wrote:
> 
> > It is ridiculous that this little troll is trying to educate me on
> > the subject of COW after I've written STRING-STACK.4TH that does COW.
> 
> Ah, you seem to have problems with people who have a different opinion
> than yours. 

Your opinion is that I should use COW --- the implication here is that I'm not using it, and I need to be educated on the subject by you --- that is not an opinion; that is an insult.

> BTW, how many people are actually using your code? Oh sorry, is that
> trolling? If so, I apologize. But I heard that people here don't like
> to use libraries written by others, so I really wonder.

No ANS-Forth programmer will ever use STRING-STACK.4TH --- this would contradict Elizabeth Rather who says that PAD is the standard way to store strings temporarily --- contradicting her is absolutely forbidden! 

My STRING-STACK.4TH primarily has the effect of killing ANS-Forth, because PAD is stupid and people don't want to be stupid in public. If I hadn't written STRING-STACK.4TH then they could say that PAD is the best Forth technology available, and anything else is just wild speculation, but when I wrote STRING-STACK.4TH I took that defense away from them. I put them in the awkward position of having to say that STRING-STACK.4TH doesn't work, and/or that I don't know what COW is, and/or various other blatant lies.

I think the reason why you showed up in this thread and told me that I don't know what COW is, and that I'm not using it in STRING-STACK.4TH, is because you were trying to impress Elizabeth Rather --- attacking my novice-package always impresses her --- you can become an ANS-Forth expert instantaneously by doing this!

> > He wants me to use refcounting!
> 
> I don't want you to do anything. Why should I? I actually don't really
> care what you do.
> 
> I merely said how I would do it, to make things easier. I never told
> you to follow me. Who am I to do that?

You are still trying to educate me --- tell me that using refcounting will make things easier --- the implication here is that, due to my ignorance, I'm doing things the hard way unnecessarily in my STRING-STACK.4TH package.

I haven't seen any code from you. You seem to be a typical troll --- you want to educate everybody on the internet --- you expect everybody to accept that you are their superior without any supporting evidence.

[toc] | [prev] | [next] | [standalone]


#58339

FromAlex <alex@rivadpm.com>
Date2017-04-29 09:41 +0100
Message-ID<oe1jcr$7i4$1@dont-email.me>
In reply to#58334
On 4/29/2017 06:13, hughaguilar96@gmail.com wrote:
> My STRING-STACK.4TH primarily has the effect of killing ANS-Forth

There's nothing that you would do to kill it, since you are its biggest 
fan. The evidence is in the same sentence; you wrote STRING-STACK.4TH to 
be ANS compliant. You love it really, even though it annoys you. Or 
perhaps because it annoys you; is it a satisfying itch to scratch?

-- 
Alex

[toc] | [prev] | [next] | [standalone]


#58354

Fromhughaguilar96@gmail.com
Date2017-04-29 07:05 -0700
Message-ID<ffd33ac2-005d-44a6-a05c-cf6f355b8328@googlegroups.com>
In reply to#58339
On Saturday, April 29, 2017 at 1:41:01 AM UTC-7, Alex wrote:
> On 4/29/2017 06:13, hughaguilar96@gmail.com wrote:
> > My STRING-STACK.4TH primarily has the effect of killing ANS-Forth
> 
> There's nothing that you would do to kill it, since you are its biggest 
> fan. The evidence is in the same sentence; you wrote STRING-STACK.4TH to 
> be ANS compliant. You love it really, even though it annoys you. Or 
> perhaps because it annoys you; is it a satisfying itch to scratch?

I'm killing ANS-Forth because I'm writing ANS-Forth code despite the fact that I'm not an ANS-Forth programmer.

In the late Middle-Ages we had trade guilds. In the trade guilds, we had journeymen, and to become a journeyman a guy had to work as an apprentice to a journeyman for some number of years and get a reference from his master to be allowed into the guild. This system seriously stifled progress. Obviously, the only way to get ahead was to brown-nose your master, so everybody who became a journeyman was guaranteed to be incapable of creative thinking. Also, the journeymen were motivated to keep trade secrets to themselves, rather than share knowledge. In those days, the concept of science didn't exist. It was impossible to study chemistry as a science. Most of the trade guilds (leather-making, soap-making, etc.) knew some chemistry, but they weren't sharing knowledge. For example, they all knew about acids and caustics, but they didn't have the PH scale so they couldn't communicate with each other about chemistry. Also, it was considered to be traitorous to communicate outside of the guild anyway, because this would allow non-members to compete. There was no way to learn chemistry outside of the context of any particular trade guild. Learning was also quite slow. The apprentice could spend years mixing the chemicals and applying them, without ever learning what chemicals he was working with.

I want to kill ANS-Forth because ANS-Forth is basically a trade guild --- a throwback to the 17th century. The Forth-200x committee have declared themselves to be journeymen, and have declared all other Forth programmers to be their apprentices. ANS-Forth is a purposely crippled language that is designed to prevent the writing of commercial software. The apprentices are required to be ANS-Forth programmers, and write toy programs, and eventually get a reference from the committee that allows them to upgrade to writing real programs. 

Elizabeth Rather and Stephen Pelc are both afraid of Forth programmers. They hate STRING-STACK.4TH because it is working Forth code, which is what they fear the most. They want the apprentices to spend years becoming an expert in the use of PAD --- they don't want the apprentices to write programs that work with more than one string --- they will never admit me to the ranks of journeymen Forthers, because I have refused to go through their apprenticeship. Elizabeth Rather has described herself as the "leading expert" of Forth --- this is a very heavily weighted term --- her use of this term implies that ANS-Forth is a trade guild.

I will never forgive Elizabeth Rather for describing herself as the "leading expert" of Forth --- I take this personally --- I routinely write code in ANS-Forth that the committee says is impossible, and I do this for the purpose of making the committee look stupid.

[toc] | [prev] | [next] | [standalone]


#58347

From"Rudy Velthuis" <newsgroups@rvelthuis.de>
Date2017-04-29 11:43 +0000
Message-ID<xn0kpb33a31exdb00e@nntp.aioe.org>
In reply to#58334
hughaguilar96@gmail.com wrote:

> > Ah, you seem to have problems with people who have a different
> > opinion than yours. 
> 
> Your opinion is that I should use COW --- the implication here is
> that I'm not using it

ISTM that I know my opinion better than anyone else, don't you think?

My opinion is that *I* would use COW. 

I don't care what you use. I have never seen your code, nor do I care
for it, so what makes you think I am telling you what to do?

-- 
Rudy Velthuis        http://www.rvelthuis.de

"How can I believe in God when just last week I got my tongue 
 caught in the roller of an electric typewriter?" -- Woody Allen.

[toc] | [prev] | [next] | [standalone]


#57419

Fromhughaguilar96@gmail.com
Date2017-04-15 21:15 -0700
Message-ID<1c9dc514-b782-4efe-8ba2-bdb1b269abdb@googlegroups.com>
In reply to#57396
On Saturday, April 15, 2017 at 4:54:24 PM UTC-7, hughag...@gmail.com wrote:
> Anton Ertl's post came from here:
> https://groups.google.com/forum/#!topic/comp.lang.forth/EkjxmjenL5s
> 
> I'm replying to it in this thread because this is where the answer is.
> 
> On Saturday, April 15, 2017 at 1:08:54 AM UTC-7, Anton Ertl wrote:
> > hughaguilar96@gmail.com writes:
> > >1.) I read that Forth-200x description of S\" and found this bizarre restri=
> > >ction:
> > >"A program shall not alter the returned string."
> > >I don't know why they have that restriction, and I certainly don't.
> > 
> > : foo s\" bla" ;
> > 'x foo drop c!
> > foo type
> > 
> > If programs were allowed to alter the returned string, what should the
> > output of TYPE be?  Is the returned string required to be in RAM?
> > Should it make a new copy every time it runs?  How long is that copy
> > guaranteed to live?
> 
> This is really the whole point of having a string-stack --- so you have somewhere to put your strings.
> 
> S" and S\" would create a string that can't be altered, but when they execute that push a string onto the string-stack. 

This was a typo. I meant:
S" and S\" would create a string that can't be altered, but when they execute they push a string onto the string-stack. 

I don't know what 'X does, so I don't understand your example.

Here is an example with the string-stack:

: foo  s" bla" >$ ;

Ideally, the >$ would be done internally by S" so there would never be an address/count pair on the data-stack.

foo  ok
.s$ 
STRING STACK:
derivative: |bla| ok
reverse$  ok
.s$ 
STRING STACK:
unique:     |alb| ok
 ok
.$ alb ok

Notice that when the S" string is pushed to the string-stack, it is a derivative string. This means that only the reference gets pushed. There is no need to call ALLOCATE and there is no need to copy the string. This is very fast. When the string gets modified however, then it first gets converted into a unique (which involves calling ALLOCATE and copying the string). When the string gets consumed by .$ it gets freed from the heap.

Here is another example:

foo dup$ reverse$  ok
.s$ 
STRING STACK:
unique:     |alb|
derivative: |bla| ok
dup$  ok
.s$ 
STRING STACK:
derivative: |alb|
unique:     |alb|
derivative: |bla| ok
.$ alb ok
.s$ 
STRING STACK:
unique:     |alb|
derivative: |bla| ok

Consuming the string with .$ is easy because the string is a derivative.

Here is another example:

foo dup$ reverse$  ok
.s$ 
STRING STACK:
unique:     |alb|
derivative: |bla| ok
dup$  ok
.s$ 
STRING STACK:
derivative: |alb|
unique:     |alb|
derivative: |bla| ok
swap$  ok
.s$ 
STRING STACK:
unique:     |alb|
derivative: |alb|
derivative: |bla| ok
.$ alb ok
.s$ 
STRING STACK:
unique:     |alb|
derivative: |bla| ok

This is the same as the last example except that there was a SWAP$ prior to the .$ that so the unique rather than the derivative was consumed. When a unique is consumed, we search the entire string-stack for any derivatives of that unique and change them into uniques. This is why we now have an |alb| string on the string-stack that is unique --- it is the string that had been a derivative prior to .$ being called --- it couldn't continue being a derivative because the unique that it is a derivative of is getting consumed.

Most of the time, there is no need to convert derivatives into uniques. This is because we typically have derivatives on top of uniques on the data-stack. SWAP$ and ROT$ mess this up though, so we end up with uniques on top of derivatives. In this case, it becomes necessary to convert derivatives into uniques. This is pretty rare, because stack-juggling of the data-stack is pretty rare --- it only causes a minor slowdown though --- all of this is taken care of internally, so the user doesn't have to worry about it (the user just assumes that the behavior is going to be the same as if everything on the string-stack were a unique).

Note that none of this can be put in Forth-200x because Forth-200x is mandated to be 100% compatible with ANS-Forth. ANS-Forth has a lot of legacy code that has address/count pairs being held on the data-stack and strings being modified willy-nilly, and ANS-Forth has strings (generated by S" and S\" and maybe some other words) that supposedly can't be modified, although there is nothing to prevent a program from modifying them, so there may be programs that modify these strings and these programs sometimes work and sometimes don't work.

ANS-Forth is just no good. ANS-Forth is the work of an idiot marketing-genius who has never written a Forth program in her life. If Forth is going to succeed, we need a new standard.

[toc] | [prev] | [standalone]


Page 3 of 3 — ← Prev page 1 2 [3]

Back to top | Article view | comp.lang.forth


csiph-web