Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.forth Subject: Re: string-stack.4th Date: Sun, 23 Apr 2017 23:51:13 -0700 Organization: A noiseless patient Spider Lines: 13 Message-ID: <87lgqqnvry.fsf@nightsong.com> References: <6aed5e5d-c9e2-42a3-b170-86e862d0f21f@googlegroups.com> <799b10b1-69a7-47ed-acdb-a791cbd4d248@googlegroups.com> <36f34016-ac87-4117-bff3-66bdc6e016d0@googlegroups.com> <5a9dd21c-5b85-45be-bbee-c444cb8243d8@googlegroups.com> <53d8fb40-e625-4c47-b09d-15663771fc9a@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="31f1087c76b8aada4fe154e7c0ed0e8b"; logging-data="18867"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18AZlbBq0b65WgCQwSTuolH" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:DjkNgCCIVTCIRRcjIdcLWOCLJw4= sha1:QjrGCJXDg94ejHS2Vre/AVRQLPc= Xref: csiph.com comp.lang.forth:57967 Ron Aaron writes: > You can also do something like what OForth does, e.g. play magic with > the pointers to the stack items so that the data pointer itself tells > you what kind of item is on the stack. That is (in my opinion) a > dangerous path, but if used with restraint it works nicely. If you mean Oforth uses aligned pointers and steal one or two bits for tags, that's a very common technique and works well. The SPARC processor even had hardware support for that, which nobody seems to have used. If you mean the heap uses different regions for different object types and figures out the type of a pointed-to object from its address, that's another venerable technique called BIBOP ("big bag of pages") though it was used mostly in older, smaller systems.