Search the web
Sign In
New User? Sign Up
concatenative · Discuss the concatenative variety of computer languages: Joy, Forth, Postscript
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Concatenative macros?   Message List  
Reply | Forward Message #3197 of 4643 |
Re: [stack] Re: Concatenative macros?

My apologies to the many people (I hope) reading this list and hoping
for something useful. This stuff is a LONG way from usefulness. I hope
that it will sharpen our understanding of what it means to be
concatenative; I hope that after I understand this I'll be better
equipped to explain the potential benefits.

For now, just treat this as a puzzle: to be solved if it entertains,
and skipped otherwise.

iepos <bkerby@...> wrote:
> Also, it
> is certainly possible that a more clever choice of basis could lead
> to smaller constructions.

I chose a different basis which results in shorter constructions for
the primitives we're producing. I think it's universally shorter; my
reason for suspecting that is that your 'o' and 'i' operations have
very asymmetric stack effects, so in general you have to execute a LOT
of 'i's for every 'o'. I also personally found it to be much simpler
to derive results for.

Let
0 = [] [q] [k]
1 = k

In this experiment, I didn't change the sequence of the 'o'
combinator. One interesting (to me) implication is that 'k' is very
exposed -- it's the last operation in both combinators. The other
simple choice would be to define 0 as [] [k] [q]; doing that seems to
result in slightly more complex forms for some primitives, but might
make others much simpler. (I need to work that out in full.) The other
permutations should be interesting as well, but now we're talking
computer work, not human work.

I originally chose 'k' so that the VM only needs to define 2
operations, q and k (rather than having to define q, k, and i). I also
suspect that it'll reduce faster, since there's less asymmetry between
'0' producing stack items and '1' consuming them.

Construct 'k':
1 =
k

Construct 'zap':
01 =
[] [q] [k] k =
[] k =
zap

(A simple 'zap' is very useful. It allows me to easily get at the
functions contained in '0'. It also promises a nice peephole
optimizer, since I have meanings for both "1" and "01"!)

Construct 'q':
0011 =
0 01 1 =
[] [q] [k] zap k =
[] [q] k =
q

Construct '[]':
00101 =
0 01 01 =
0 zap zap =
[] [q] [k] zap zap =
[]

Construct 'i':
00101 0011 1 =
[] q k =
i

Construct 'unit':
00101 0011 01 =
[] q zap =
unit

Construct 'nip':
00101001101 1 =
unit k =
nip

Construct 'swat':
0011 001010011011 =
q nip

> [] == oooooiiiiiiioooooiiiiiiii

[] = 00101

> [k] == oooooiiiiiiioooooiiiiiiioooooiiiiiiiioii

[k] = 0 nip nip ==
0 001010011011 001010011011

(That's 26 bits for the k system, versus 41 when using 'i'. This is
the closest thing to a tie.)

> unit == oooooiiiiiiioooooiiiiiiiioioooooiiiiiiii

unit == 00101001101

> swat ==
> oioooooiiiiiiioooooiiiiiiiioioooooiiiiiiiioooooiiiiiiioooooiiiiiiioooo
> oiiiiiiiioiii

swat == 0011001010011011

> [q] ==
> ooooooiiiiiiiioooooiiiiiiioooooiiiiiiiioioooooiiiiiiiioooooiiiiiiioooo
> oiiiiiiioooooiiiiiiiioiii

[q] = 0 zap nip ==
0 01 001010011011

Seems like I had a good intuition. Balance them combinators!

I still need to explore the effect of using cake instead of q. I also
need to (just as an exercise) express 'dip' and 'swap' in this system.
So far I haven't (I've tried...).

> - Brent

-Billy



Thu Feb 8, 2007 12:01 am

wtanksle
Offline Offline
Send Email Send Email

Forward
Message #3197 of 4643 |
Expand Messages Author Sort by Date

... Included at the end of this post. ... Indeed. Although I'm also interested in genetic systems, my main interest is in understanding languages for use by...
William Tanksley, Jr
wtanksle
Offline Send Email
Feb 9, 2007
7:45 pm

My apologies to the many people (I hope) reading this list and hoping for something useful. This stuff is a LONG way from usefulness. I hope that it will...
William Tanksley, Jr
wtanksle
Offline Send Email
Feb 8, 2007
12:01 am

... Wow! That's much better. Nice work. ... Well, what exactly do you mean by that? There's certainly one combinator which is shorter in my {o,i}, namely "i"....
iepos
Offline Send Email
Feb 8, 2007
3:35 am

Billy & all, I hacked at my old Joy searcher for a while and was at last able to persuade it to deal with improper combinators; so I've been able to determine...
iepos
Offline Send Email
Feb 9, 2007
8:35 am

... Okay; and then you posted it where? :-) Let me get my credit card. -Billy...
William Tanksley, Jr
wtanksle
Offline Send Email
Feb 9, 2007
8:09 pm

... Thanks, but obviously it builds on your work -- you actually know what you're doing, and you get all the credit for making it make sense. I suspect that...
William Tanksley, Jr
wtanksle
Offline Send Email
Feb 9, 2007
6:48 pm

i would be extremely interested in reading a description of the algorithm. (my dog ate my credit card) ... From: "William Tanksley, Jr" <wtanksleyjr@...>...
stevan apter
sa@...
Send Email
Feb 9, 2007
10:03 pm

... Oh, yeah, I forgot to mention that. It's at http://www.tunes.org/~iepos/joys.zip (it's linked from the article "Theory of Concatenative Combinators"); I...
Brent L Kerby
iepos
Offline Send Email
Feb 9, 2007
10:58 pm

... It basically works by trying all programs of size 0 (There aren't too many of these :-) ), then all programs of size 1, and so forth, testing each program...
Brent L Kerby
iepos
Offline Send Email
Feb 10, 2007
3:31 am

thanks brent as usual, work that you consider throw-away contains more insights than can fit in a standard published article, much less the margins of one. ......
stevan apter
sa@...
Send Email
Feb 11, 2007
12:07 am

... I'm looking forward to your genetic system -- one would expect that it would be useful for the same purpose. Perhaps you should tailor a version of it to...
William Tanksley, Jr
wtanksle
Offline Send Email
Feb 11, 2007
12:27 am

Great stuff! Still, I don't see the need for a flat binary base (except for extreme simplicity and fun). Why not allow 4 flat primitives that follow the 4...
Robbert van Dalen
r_v_dalen
Offline Send Email
Feb 11, 2007
11:27 am

... That's a great reason :-). I'm using it to better understand perfect flatness, in hopes that I can see whether flatness has any desirable properties. It's...
William Tanksley, Jr
wtanksle
Offline Send Email
Feb 11, 2007
6:58 pm

... I played with this -- it definitely does make things simpler, since you don't need to have a "do everything" 'o' combinator; the other combinators can help...
William Tanksley, Jr
wtanksle
Offline Send Email
Feb 26, 2007
12:12 am

... From: "William Tanksley, Jr" <wtanksleyjr@...> To: <concatenative@yahoogroups.com> Sent: Friday, January 05, 2007 11:16 AM Subject: Re: [stack]...
stevan apter
sa@...
Send Email
Jan 5, 2007
8:27 pm

... An improper list is one whose final cons does not have a car of nil. -- He played King Lear as though John Cowan <cowan@...> someone had...
John Cowan
johnwcowan
Online Now Send Email
Jan 5, 2007
9:01 pm

... My system tries not to specify the shape of lists -- I consider it a bad habit. Even being able to take apart lists is mathematically problematic within a...
William Tanksley, Jr
wtanksle
Offline Send Email
Jan 6, 2007
7:01 am

... From: "John Cowan" <cowan@...> To: <concatenative@yahoogroups.com> Sent: Friday, January 05, 2007 3:52 PM Subject: Re: [stack] Concatenative macros? ...
stevan apter
sa@...
Send Email
Jan 5, 2007
10:33 pm

between you and john, i now understand the point about "improper lists". i think the two notations can be made equivalent by adding a special symbol to each. ...
stevan apter
sa@...
Send Email
Jan 6, 2007
12:17 pm

... Yes, that would make them equivalent (although "." wouldn't mean 'nil' for me; instead, it would be a code that meant that the previous item was the end of...
William Tanksley, Jr
wtanksle
Offline Send Email
Jan 7, 2007
2:01 am

... From: "William Tanksley, Jr" <wtanksleyjr@...> To: <concatenative@yahoogroups.com> Sent: Saturday, January 06, 2007 8:56 PM Subject: Re: [stack]...
stevan apter
sa@...
Send Email
Jan 8, 2007
1:16 pm

... From the rest of your message, it's clear that you didn't want support for "improper lists"; what you wanted was the ability to get the last item out of a...
William Tanksley, Jr
wtanksle
Offline Send Email
Jan 10, 2007
5:32 pm

i think i've formulated a version which captures your requirements. since setting down the rules is more difficult than grasping the notation by way of...
sa@...
Send Email
Jan 10, 2007
8:29 pm

... I think I see some ambiguities. ... Agreed. ... I do like your notation of uppercase meaning "the rest of the list". ... But this is a contradiction. B on...
William Tanksley, Jr
wtanksle
Offline Send Email
Jan 11, 2007
7:11 pm

i think i like this....
sa@...
Send Email
Jan 11, 2007
7:36 pm

... I just noticed a problem with my idea. Help me... ... [...snip...] ... I'm wrong about i2. It won't correctly execute a list, because if i1 works, the...
William Tanksley, Jr
wtanksle
Offline Send Email
Jan 11, 2007
8:18 pm

i don't quite follow the reasoning here, but it has always seemed to me that joy's 'i' (and other combinators as well) was unduly restrictive in requiring a...
sa@...
Send Email
Jan 11, 2007
8:50 pm

... I think that Joy's 'i' will work with a bare function (i.e., 2 2 [+] car i == 4). Manfred mentioned that he'd never thought of that while he was building...
William Tanksley, Jr
wtanksle
Offline Send Email
Jan 12, 2007
5:33 pm

solve the 99 lisp (haskell/prolog/etc.) problems in enchilada....
sa@...
Send Email
Jan 15, 2007
4:34 pm

I'd rather solve 99 lisp problems with the Game Of Live - now *thats* a challenge! but yes, it would be interesting to see how many symbols are needed to solve...
Robbert van Dalen
r_v_dalen
Offline Send Email
Jan 16, 2007
7:30 pm
 First  |  |  Last 
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help