Path: csiph.com!aioe.org!.POSTED!not-for-mail From: Rod Pemberton Newsgroups: comp.lang.forth Subject: Re: Stack Operator Symbols Date: Sat, 5 Nov 2016 03:16:12 -0400 Organization: Aioe.org NNTP Server Lines: 40 Message-ID: <20161105031612.7c74c720@_> References: <4e481228-bd80-4e39-a629-90a690e50756@googlegroups.com> <20161027191345.4f524e44@_> <-Lmdneii--uHXI_FnZ2dnUU7-VnNnZ2d@supernews.com> <87d1ijmwc3.fsf@nightsong.com> <874m3un959.fsf@nightsong.com> <2016Nov5.000427@mips.complang.tuwien.ac.at> NNTP-Posting-Host: n4wpt9zq8xR26Ttf9mo2BA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Claws Mail 3.13.1 (GTK+ 2.24.13; x86_64-unknown-linux-gnu) Xref: csiph.com comp.lang.forth:52452 On Fri, 04 Nov 2016 23:04:27 GMT anton@mips.complang.tuwien.ac.at (Anton Ertl) wrote: > hughaguilar96@gmail.com writes: > >Here is yet another version: > > > >: tak ( x y z -- n ) > > >r \ -- x y > > dup third >= if > > 2drop r> > > else > > over 1- over r@ recurse -rot \ -- > > new-x x y dup 1- r@ fourth recurse -rot \ -- > > new-x new-y x y > > r> 1- rot rot recurse \ -- > > r> new-x new-y new-z > > recurse then ; > > > >This was pretty meaningless, but I was bored... > > 3dup-builtin 3dup-2pick locals tak1 tak2 > tak-hugh gforth 1160859139 1023792580 816129237 > 633233631 964385503 sf 472184708 533401690 4529954652 > 356164897 253178697 484259253 vfxlin 490283220 401685949 > 700320112 352936074 238431403 330347074 > As Hugh's code wasn't the fastest, I guess Hugh will need links to the tak benchmark code to compare. tak benchmark, code, and timings for various languages: http://web.archive.org/web/20050306154941/http://www.lib.uchicago.edu/keith/crisis/benchmarks/tak/ tak for Forth (this4th link in "The Programs" section) http://web.archive.org/web/20050306172823/http://www.lib.uchicago.edu/keith/crisis/benchmarks/tak/tak.4th Rod Pemberton