Re: [Factor-talk] Newbie question about handbook
The simplest way of describing the pure stack effects of if, for a situation like this: t [ ] [ ] if would be ( ? quot quot -- ) You could write : example ( ? quot quot -- ) if ; inline t [ ] [ ] example ( The idea of inline is beyond my ability to explain. I add it, like a monkey, every time I see a compilation error like "Cannot apply “if” to an input parameter of a non-inline word") Inside the quotation could be stuff that doesn't actually do anything to the stack. I think of the syntax you're asking about as trying to be more visually descriptive for a new user, and it's making the point that the most common use case would be to transform some thing(s) that are on the stack, conditionally. So, I think ..a could be thought of as "the precondition of the stack before if's parameters" and ..b could be the stack condition after either path. This includes the idea of there being no stack as well. The inner parenthetical groups describe the expected stack effect of each branch of condition execution, and try to explain that it transforms the stack. This syntax is not trying to imply any comment about the depth of the stack. Jim On Sat, Sep 18, 2010 at 6:23 AM, Fabian Boucsein < fabian.boucs...@googlemail.com> wrote: > Thanks for your answer Anton. But what does the ..a exactly mean? > It is a stack effect row variable? Is there a connection with the number of > "arguements" it stands for? > > Greetings, > Fabian > > > > Anton Gorenko schrieb: > > if '?' is t, not '..a'. > > http://docs.factorcode.org/content/article-effects.html > > http://docs.factorcode.org/content/article-effects-variables.html > > > > 'true' and 'false' quotations have same stack effects, they take 'a' > > (a >= 0) values from the stack and leave 'b' (b >= 0) values on the > > stack. > > So '3 2 t [ + ] [ - ] if' is correct ('true' and 'false' have ( x x -- > > x ) stack effect, 'if' has ( x x ? true: ( x x -- x ) false: ( x x -- > > x ) -- x ) stack effect in this case), but > > '3 2 t [ + + ] [ - ] if', '3 t [ + ] [ - ] if', '3 2 t [ + ] [ 1 ] > > if', etc. are incorrect. > > > > 2010/9/18 Fabian Boucsein : > > > >> Hello Factor mailing list, > >> > >> i try to understand the definition of "if" in the factor handbook: > >> if ( ..a ? true: ( ..a -- ..b ) false: ( ..a -- ..b) -- ..b) > >> > >> I read if ..a is true execute the true codeblock else the false block > >> which is quite clear but what does the last ..b stands for? > >> Thanks for your help. > >> > >> Fabian > >> > >> > >> > -- > >> Start uncovering the many advantages of virtual appliances > >> and start using them to simplify application deployment and > >> accelerate your shift to cloud computing. > >> http://p.sf.net/sfu/novell-sfdev2dev > >> ___ > >> Factor-talk mailing list > >> Factor-talk@lists.sourceforge.net > >> https://lists.sourceforge.net/lists/listinfo/factor-talk > >> > >> > > > > > -- > > Start uncovering the many advantages of virtual appliances > > and start using them to simplify application deployment and > > accelerate your shift to cloud computing. > > http://p.sf.net/sfu/novell-sfdev2dev > > ___ > > Factor-talk mailing list > > Factor-talk@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/factor-talk > > > > > > > > -- > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > ___ > Factor-talk mailing list > Factor-talk@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/factor-talk > -- Jim "I'm for extending the working Medicare program for our seniors all the way back to contraception, so Americans can concentrate on living their lives without fear of changing a job, going bankrupt from deductibles or fighting HMO bureaucracy." -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Worthwhile Thesis Idea?
On Sat, Sep 18, 2010 at 4:36 PM, Alexander J. Vondrak wrote: > On the other hand, Slava discussed writing a GVN pass, so I was looking over > some GVN stuff -- mostly skimming the VanDrunen GVN-PRE thesis. I found that > really interesting; I think implementing some sort of GVN would make for a > good project (thesis or otherwise, though I think my advisor will like it). > If you're okay with me working on it: Great! > - We'd need the GC map refactoring first. Would it be part of the project, > or is it more of a "todo"? Maybe I should do it to get more familiar with > the code? The changes I was describing to compiler.cfg construction are mostly independent of a GVN pass. They will make GVN more effective though, by exposing more values. > - On that note, is there a recommended reading list of compiler.cfg vocabs to > get up to speed? I mean, I'd read all I could, but maybe there's handful of > important ones to make for a shorter adjustment period. I'd say the four most important passes are: compiler.cfg.value-numbering compiler.cfg.representations compiler.cfg.ssa.destruction compiler.cfg.linear-scan Slava -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Worthwhile Thesis Idea?
Okay, I've looked into the things discussed in the IRC session. First off, my initial idea is ill-defined, not really useful, and Factor's current DFAs are okay, or at least as efficient as they'd be in the Lerner/Grove/Chambers framework. Even though it's a little crufty, compiler.tree should be done away with someday anyhow. But that rewrite would be a lot of work (according to Daniel) and I'm not too excited about it as a project. On the other hand, Slava discussed writing a GVN pass, so I was looking over some GVN stuff -- mostly skimming the VanDrunen GVN-PRE thesis. I found that really interesting; I think implementing some sort of GVN would make for a good project (thesis or otherwise, though I think my advisor will like it). If you're okay with me working on it: - We'd need the GC map refactoring first. Would it be part of the project, or is it more of a "todo"? Maybe I should do it to get more familiar with the code? - On that note, is there a recommended reading list of compiler.cfg vocabs to get up to speed? I mean, I'd read all I could, but maybe there's handful of important ones to make for a shorter adjustment period. - Recommended non-code reading? Papers, books, slides, whatever? Thanks for the discussion, -- Alex Vondrak -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Newbie question about handbook
Thanks for your answer Anton. But what does the ..a exactly mean? It is a stack effect row variable? Is there a connection with the number of "arguements" it stands for? Greetings, Fabian Anton Gorenko schrieb: > if '?' is t, not '..a'. > http://docs.factorcode.org/content/article-effects.html > http://docs.factorcode.org/content/article-effects-variables.html > > 'true' and 'false' quotations have same stack effects, they take 'a' > (a >= 0) values from the stack and leave 'b' (b >= 0) values on the > stack. > So '3 2 t [ + ] [ - ] if' is correct ('true' and 'false' have ( x x -- > x ) stack effect, 'if' has ( x x ? true: ( x x -- x ) false: ( x x -- > x ) -- x ) stack effect in this case), but > '3 2 t [ + + ] [ - ] if', '3 t [ + ] [ - ] if', '3 2 t [ + ] [ 1 ] > if', etc. are incorrect. > > 2010/9/18 Fabian Boucsein : > >> Hello Factor mailing list, >> >> i try to understand the definition of "if" in the factor handbook: >> if ( ..a ? true: ( ..a -- ..b ) false: ( ..a -- ..b) -- ..b) >> >> I read if ..a is true execute the true codeblock else the false block >> which is quite clear but what does the last ..b stands for? >> Thanks for your help. >> >> Fabian >> >> >> -- >> Start uncovering the many advantages of virtual appliances >> and start using them to simplify application deployment and >> accelerate your shift to cloud computing. >> http://p.sf.net/sfu/novell-sfdev2dev >> ___ >> Factor-talk mailing list >> Factor-talk@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/factor-talk >> >> > > -- > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > ___ > Factor-talk mailing list > Factor-talk@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/factor-talk > > -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
Re: [Factor-talk] Newbie question about handbook
if '?' is t, not '..a'. http://docs.factorcode.org/content/article-effects.html http://docs.factorcode.org/content/article-effects-variables.html 'true' and 'false' quotations have same stack effects, they take 'a' (a >= 0) values from the stack and leave 'b' (b >= 0) values on the stack. So '3 2 t [ + ] [ - ] if' is correct ('true' and 'false' have ( x x -- x ) stack effect, 'if' has ( x x ? true: ( x x -- x ) false: ( x x -- x ) -- x ) stack effect in this case), but '3 2 t [ + + ] [ - ] if', '3 t [ + ] [ - ] if', '3 2 t [ + ] [ 1 ] if', etc. are incorrect. 2010/9/18 Fabian Boucsein : > Hello Factor mailing list, > > i try to understand the definition of "if" in the factor handbook: > if ( ..a ? true: ( ..a -- ..b ) false: ( ..a -- ..b) -- ..b) > > I read if ..a is true execute the true codeblock else the false block > which is quite clear but what does the last ..b stands for? > Thanks for your help. > > Fabian > > > -- > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > ___ > Factor-talk mailing list > Factor-talk@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/factor-talk > -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk
[Factor-talk] Newbie question about handbook
Hello Factor mailing list, i try to understand the definition of "if" in the factor handbook: if ( ..a ? true: ( ..a -- ..b ) false: ( ..a -- ..b) -- ..b) I read if ..a is true execute the true codeblock else the false block which is quite clear but what does the last ..b stands for? Thanks for your help. Fabian -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev ___ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk