Re: [Factor-talk] Adding a stack effect to a quotation

2010-02-27 Thread Miles Gould
On Sat, Feb 27, 2010 at 10:48:26AM -0600, Daniel Ehrenberg wrote:
> > A possible GSoC project?
> Sure, though it would be difficult to e accepted without demonstrating
> to us that you would have a good chance in completing this task, with
> a concrete plan of what you're going to do. (I'm not sure if I would
> be.)

Oh, I wasn't volunteering: I'm no longer a student, and this project in
particular looks much too ambitious for my current state of Factor
knowledge (though some of the other ideas on the wiki look a bit more
tractable...). I just thought it might be worth adding to the ideas
list.

Miles

-- 
Manolo says, the fashion, it is not the nuclear rocket brain surgery.
  -- Manolo the Shoeblogger

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Adding a stack effect to a quotation

2010-02-27 Thread Daniel Ehrenberg
> A possible GSoC project?
>
> Miles

Sure, though it would be difficult to e accepted without demonstrating
to us that you would have a good chance in completing this task, with
a concrete plan of what you're going to do. (I'm not sure if I would
be.)

In general, you're much more likely to be accepted for GSoC if you
have prior contributions to Factor to show off. This demonstrates to
us that you're engaged in the Factor project and capable of writing
good code within Factor's unique model. The experience you would get
in this way would help you be capable of competing the task, too. Even
short of contributions, having some Factor code you've written to show
us would also help. The code doesn't need to be in the area that the
project is; the important thing is to show that you can do Factor.

For many people, the big thing of GSoC is not the money Google pays
you but the mentorship opportunities. If you're one of these people,
regardless of the GSoC outcome, you should be aware (if you're not
already) that the Factor community, though the mailing list and
#concatenative IRC channel, is already willing to mentor people who
are working on libraries or applications in Factor. I personally would
be willing to mentor anyone who comes to me wanting to contribute to
Factor, and I'm already doing this with one contributor.

Dan

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Adding a stack effect to a quotation

2010-02-27 Thread Miles Gould
On Fri, Feb 26, 2010 at 01:31:39PM -0600, Daniel Ehrenberg wrote:
> However, no concatenative language has yet been designed which is both
> dynamically typed and supports call( with row polymorphism. Andreas
> Rossberg specified a static type system for a concatenative language
> with row polymorphism
> (http://lambda-the-ultimate.org/node/1899#comment-23169), but that
> alone wouldn't be enough for Factor. It has to be worked out how this
> feature would interact with the rest of Factor, not to mention the
> need for convenient and intuitive syntax. It would also be nice to
> have type inference here, though that's not necessary.
> 
> This would be an interesting project for a theoretically-inclined
> contributor who is OK with a high chance of failure (or even in the
> event of some kind of success, a chance that the result will not be
> included in the core Factor language). I would be very pleased to see
> someone work on a project like this.

A possible GSoC project?

Miles

-- 
Those who do not understand Unix are condemned to reinvent it, poorly.
  -- Henry Spencer

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Adding a stack effect to a quotation

2010-02-26 Thread Paul Moore
On 26 February 2010 20:04, Daniel Ehrenberg  wrote:
> A good starting point is the article, "Combinator stack effects"

Ah, I follow now. I had read that article before, but the implications
hadn't sunk in.

Thanks,
Paul

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Adding a stack effect to a quotation

2010-02-26 Thread Daniel Ehrenberg
A good starting point is the article, "Combinator stack effects"

On Fri, Feb 26, 2010 at 1:39 PM, Paul Moore  wrote:
> On 26 February 2010 19:31, Daniel Ehrenberg  wrote:
>> One solution to the whole set of incompatiblities between call and
>> call( would be to eliminate call in favor of call(, eliminating the
>> combinator inlining system in the process. In my opinion, this would
>> make the whole language much cleaner and nicer. No combinator inlining
>> semantics to remember when writing your program; you can just think
>> about how the compiler works when optimizing your code.
>
> That intrigued me - for the (pretty simple) code I've written, I've
> never thought about combinator inlining semantics - makes me wonder
> what I'm missing :-)
>
> Can you give a pointer to the docs where I can find out a bit more
> about this (or explain it here)? Factor's performance features
> fascinate me...
>
> Thanks,
> Paul
>
> --
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Adding a stack effect to a quotation

2010-02-26 Thread Paul Moore
On 26 February 2010 19:31, Daniel Ehrenberg  wrote:
> One solution to the whole set of incompatiblities between call and
> call( would be to eliminate call in favor of call(, eliminating the
> combinator inlining system in the process. In my opinion, this would
> make the whole language much cleaner and nicer. No combinator inlining
> semantics to remember when writing your program; you can just think
> about how the compiler works when optimizing your code.

That intrigued me - for the (pretty simple) code I've written, I've
never thought about combinator inlining semantics - makes me wonder
what I'm missing :-)

Can you give a pointer to the docs where I can find out a bit more
about this (or explain it here)? Factor's performance features
fascinate me...

Thanks,
Paul

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Adding a stack effect to a quotation

2010-02-26 Thread Daniel Ehrenberg
Well, almost everything uses call rather than call(, because it is
more flexible in a subtle way. The difference is that call allows what
the shadowy Factor council likes to refer to as "row polymorphism",
that is, quotations passed to call can refer to items lower on the
stack. For example, you can use this to define reduce in terms of
each: you can pass any quotation you want to each, as long as its
stack effect is that it reduces the height of the stack by one.
Another example is that the quotation for with-scope can have any
stack effect.

One solution to the whole set of incompatiblities between call and
call( would be to eliminate call in favor of call(, eliminating the
combinator inlining system in the process. In my opinion, this would
make the whole language much cleaner and nicer. No combinator inlining
semantics to remember when writing your program; you can just think
about how the compiler works when optimizing your code. Everything
would work with dynamic quotations just like static ones. Unlike call,
call( has a runtime fallback and doesn't require that quotations are
inlined. Call( gives better error messages because it is actually
explicitly specified what the intended stack effect of quotations is.

However, no concatenative language has yet been designed which is both
dynamically typed and supports call( with row polymorphism. Andreas
Rossberg specified a static type system for a concatenative language
with row polymorphism
(http://lambda-the-ultimate.org/node/1899#comment-23169), but that
alone wouldn't be enough for Factor. It has to be worked out how this
feature would interact with the rest of Factor, not to mention the
need for convenient and intuitive syntax. It would also be nice to
have type inference here, though that's not necessary.

This would be an interesting project for a theoretically-inclined
contributor who is OK with a high chance of failure (or even in the
event of some kind of success, a chance that the result will not be
included in the core Factor language). I would be very pleased to see
someone work on a project like this.

Coming back to your original point, it would cause a lot of
duplication to have 'paren' versions of several combinators: bi@(,
cleave(, map(, with-variable(--there's no end! So this wouldn't be a
very good idea. It's not *too* verbose, I think, to just write '[ _
call( x -- y ) ] bi@ rather than bi@( x -- y ), in my opinion, and it
expresses the programmer's intent very clearly.

Dan

On Fri, Feb 26, 2010 at 11:57 AM, Jon Harper  wrote:
> Here's where the code is : http://rosettacode.org/wiki/Active_object#Factor
> I really need dynamic quotations because quotations are inputted by the user.
>
> I was surprised that no combinator defines a similar word to call(.
> For example, I thought there would be a bi@( word. Maybe even for all
> combinators : cleave(, keep(, etc. However that makes many many new
> words.. So add-stack-effect seemed like a good compromise. It's true
> though that dynamic quotations are rarely needed and I guess that's
> why those words aren't defined.
>
> Also, I was wondering why the slot changer uses "call" instead of
> "call( x -- x )". I find it easier to understand when extra arguments
> are currified in the quotation rather than left on the stack behind
> the object with "with" anyway. And that makes it work with dynamic
> quotations.
>
> Jon Harper
>
>
>
> On Fri, Feb 26, 2010 at 6:31 PM, Samuel Tardieu  wrote:
>>
>>
>> 2010/2/26 Daniel Ehrenberg 
>>
>>> Well, I think you could also do this:
>>>
>>> build-dynamic-quotation '[ _ call( x -- y ) ] bi@
>>
>> Sure, this is equivalent.But we wanted to be able to "tag" several
>> quotations with different stack effects, hence the separate word.
>>
>>>
>>> However, you should reconsider whether you really need to build a
>>> dynamic quotation. Remember, building a quotation with curry and
>>> compose and fry doesn't necessarily make it dynamic.
>>
>> Agreed. I'll let Jon explain in which context he did it. I only assisted in
>> answering a specific question :)
>>
>>   Sam
>>
>> --
>> Download Intel® Parallel Studio Eval
>> Try the new software tools for yourself. Speed compiling, find bugs
>> proactively, and fine-tune applications for parallel performance.
>> See why Intel Parallel Studio got high marks during beta.
>> http://p.sf.net/sfu/intel-sw-dev
>> ___
>> Factor-talk mailing list
>> Factor-talk@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/factor-talk
>>
>>
>
> --
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _

Re: [Factor-talk] Adding a stack effect to a quotation

2010-02-26 Thread Jon Harper
Here's where the code is : http://rosettacode.org/wiki/Active_object#Factor
I really need dynamic quotations because quotations are inputted by the user.

I was surprised that no combinator defines a similar word to call(.
For example, I thought there would be a bi@( word. Maybe even for all
combinators : cleave(, keep(, etc. However that makes many many new
words.. So add-stack-effect seemed like a good compromise. It's true
though that dynamic quotations are rarely needed and I guess that's
why those words aren't defined.

Also, I was wondering why the slot changer uses "call" instead of
"call( x -- x )". I find it easier to understand when extra arguments
are currified in the quotation rather than left on the stack behind
the object with "with" anyway. And that makes it work with dynamic
quotations.

Jon Harper



On Fri, Feb 26, 2010 at 6:31 PM, Samuel Tardieu  wrote:
>
>
> 2010/2/26 Daniel Ehrenberg 
>
>> Well, I think you could also do this:
>>
>> build-dynamic-quotation '[ _ call( x -- y ) ] bi@
>
> Sure, this is equivalent.But we wanted to be able to "tag" several
> quotations with different stack effects, hence the separate word.
>
>>
>> However, you should reconsider whether you really need to build a
>> dynamic quotation. Remember, building a quotation with curry and
>> compose and fry doesn't necessarily make it dynamic.
>
> Agreed. I'll let Jon explain in which context he did it. I only assisted in
> answering a specific question :)
>
>   Sam
>
> --
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Adding a stack effect to a quotation

2010-02-26 Thread Samuel Tardieu
2010/2/26 Daniel Ehrenberg 

Well, I think you could also do this:
>
> build-dynamic-quotation '[ _ call( x -- y ) ] bi@
>

Sure, this is equivalent.But we wanted to be able to "tag" several
quotations with different stack effects, hence the separate word.


> However, you should reconsider whether you really need to build a
> dynamic quotation. Remember, building a quotation with curry and
> compose and fry doesn't necessarily make it dynamic.
>

Agreed. I'll let Jon explain in which context he did it. I only assisted in
answering a specific question :)

  Sam
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] Adding a stack effect to a quotation

2010-02-26 Thread Daniel Ehrenberg
Well, I think you could also do this:

build-dynamic-quotation '[ _ call( x -- y ) ] bi@

However, you should reconsider whether you really need to build a
dynamic quotation. Remember, building a quotation with curry and
compose and fry doesn't necessarily make it dynamic. In the current
Factor code base, the main use cases of dynamic quotations is when
using quotations stored in places like dynamically scoped variables
(for example in the parser), word properties (in the compiler) or
tuple slots (in Furnace), or in genuinely dynamic situations (like the
listener). Most other situations can be handled with high-level code
without building quotations dynamically.

Dan

On Fri, Feb 26, 2010 at 11:13 AM, Samuel Tardieu  wrote:
> Jon and I were discussing earlier today of a way to use a dynamically built
> quotation with "bi@" and other combinators.
>
> I suggested the word
>
> : add-stack-effect ( quot effect -- quot' ) [ call-effect ] 2curry ; inline
>
> so that we can call
>
> build-dynamic-quotation (( x -- y )) add-stack-effect bi@
>
> Is there a better way to do it?
>
>   Sam
>
> --
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> ___
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


[Factor-talk] Adding a stack effect to a quotation

2010-02-26 Thread Samuel Tardieu
Jon and I were discussing earlier today of a way to use a dynamically built
quotation with "bi@" and other combinators.

I suggested the word

: add-stack-effect ( quot effect -- quot' ) [ call-effect ] 2curry ; inline

so that we can call

build-dynamic-quotation (( x -- y )) add-stack-effect bi@

Is there a better way to do it?

  Sam
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk