Here are the 50 most commonly used words in Factor's core, filtered
for ones which are basically only in automatically generated code:
[
dup if drop nip delegate swap t r>
>r get keep over rot *
length = curry 2drop map 2dup each call
when set construct-boa +
not first , - make pick throw append
clone curry* shift 2array
1+ at write 2keep dupd unless
nth tuck empty? first2 cond -rot
]
You can get the most common 50, unfiltered, by writing this at the
listener after making sure everything is loaded:
all-words [ dup usage length ] { } map>assoc sort-values 50 tail* keys
reverse >quotation .
I'm not sure what the 10 most common idioms are, but you'd definitely
need to explain exactly how >r r>, keep and the other combinators work
in describing the stack effect of these 50 most common words. One
idiom is recursion, and another idiom is looping through the integers
using each or map. Maybe a third idiom is using sequences as alists on
the assoc protocol when it's convenient (like in the above example)
and a fourth might be defining something new on the sequence or assoc
protocols. But it's hard for me to think of any of these as idioms,
for some reason. Generally, I don't like using an idiom because that
means I'm writing code that's already been written in some other use
of that idiom (kinda like a design pattern); it's better to abstract
over as many idioms as possible, which is what we've tried to do with
Factor.
Dan
On Jan 1, 2008 1:58 AM, Zed A. Shaw <[EMAIL PROTECTED]> wrote:
> On Mon, 31 Dec 2007 12:26:06 -0500
> Slava Pestov <[EMAIL PROTECTED]> wrote:
>
> > Sorry I'm late to the party guys, my net access is sporadic here.
> >
> <snip>
> > > As a programmer it tends to not matter how things are, so long as they
> > > are explained clearly and I get a decent reason that doesn't make me
> > > scream "bullshit". If the rule's #2 then that's the rule, but I
> > > haven't seen any "standard stack protocol design guide" yet.
> > >
> > Let's write one :-) Also, check out
> > http://www.cs.rit.edu/usr/local/doc/gforth/Designing-the-stack-effect-Tutorial.html#Designing%20the%20stack%20effect%20Tutorial
>
> So, I'm inspired to write this, but I'll need some help. First off,
> this is an awesome kind of clustering of the concepts behind an API:
>
> http://hackety.org/2007/10/31/theEntiretyOfTheShoesFamily.html
>
> Sure, it's in why's style of pictures, but that's what I think I'll
> write.
>
> Second, someone mentioned that you need 50 words to be proficient in
> Factor. Alright, can people pitch in a list of those 50, and maybe a
> loose categorization of them? I'll then take the time to document them
> and see what comes out.
>
> Third, a list of the 10 most important idioms to start studying would
> be the bridge to the next part.
>
> Thanks!
>
> --
> Zed A. Shaw
> - Hate: http://savingtheinternetwithhate.com/
> - Good: http://www.zedshaw.com/
> - Evil: http://yearofevil.com/
>
> -------------------------------------------------------------------------
>
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Factor-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk