Hi Peter,

On Mon, Nov 7, 2016 at 3:07 PM, <pet...@riseup.net> wrote:

> Hello,
>
> I am tinkering with factor and was wondering if it is OK to pick your
> brains here? As I play around with the language questions come up that
> are probably easy for you to answer. I don't see much action on the
> #concatenative IRC channel so I thought the maling list might be a
> better place?
>
> Questions are always welcome. The mailing list or #concatenative on IRC
are both good places to ask. Several people read the logs of #concatenative
and may answer your questions some time after you sent it, so don't give up.

As a starter:
>
> - I see a common pattern in definitions of using `dip` instead of
> `swap`. Is there some special reason for that? Is it more performant? I
> know the words aren't interchangeable but e.g. `with-directory-files`
> has `[ [ "" directory-files ] ] dip` which as far as I can tell is
> equivalent to `[ "" directory-files ] swap`. I saw this pattern in more
> definitions.
>
I guess it's a matter of personal style. I would argue that the 'meaning'
of swap ( x y -- y x ) is that there's the same importance on pushing y
down the stack than on puling x up the stack. Whereas [ y ] dip would focus
more putting y down the stack.

Regarding the performance, you can often see for yourself using the
optimized. word of compiler.tree.debugger. You could even install libudis
and use the disassemble word of tools.disassembler.
I would be surprised if the performance of swap vs dip mattered in a real
application.


>
> - is there any sequence generator/iterator vocabulary? Something that
> gives or computes values on demand. One can find it in many languages
> with a bit different flavor, e.g. Scheme, Rust, Python. I saw that there
> is lists.lazy which can serve a similar purpose but is a bit more heavy
> weight in some cases. Maybe this isn't needed in factor at all and you
> use a different pattern to solve a similar problem?
>
I've seen discussions on this mailing list about the extra/cursors
vocabulary about that. I've never used it though. For example Joe talked
about it in 2009: https://sourceforge.net/p/factor/mailman/message/23878123

Cheers,
Jon
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to