<story><title>Factor 0.96 now available – over 1,100 commits</title><url>http://re-factor.blogspot.com/2013/04/factor-0-96-now-available.html</url><text></text></story><parent_chain><item><author>sherjilozair</author><text>I must say, that the syntax and semantics are not intuitive at all. I&apos;ve spent half an hour trying to learn how does this thing work, and have not been able to. I guess, a damn good tutorial is in order. I think one of the primary reasons Python took off really well, was because of very good tutorials available. The language of Factor&apos;s documentation is still only tuned for language designers, not language users.</text></item></parent_chain><comment><author>etfb</author><text>Concatenative language syntax is actually pretty easy at the basic level.  I don&apos;t know Factor, but I used to dabble a lot in Forth.  The single syntactical rule with Forth is that a symbol (called a &quot;word&quot;) is one or more non-space characters, delimited by spaces.  So the following three things are all words: &lt;i&gt;SWAP .&quot; -1&lt;/i&gt;&lt;p&gt;Next, there&apos;s the idea of the stack.  Every word is executed, one after the other, and the words operate on the stack.  So the four-word sequence &lt;i&gt;3 4 + .&lt;/i&gt; puts a 3 on the stack, then puts a 4 on the stack, then pops the top two numbers from the stack and puts their sum on the stack, then prints the top number on the stack.  So the result, naturally, is 11.  (Well, it is if you&apos;re operating in base 6 at the time.  Didn&apos;t want to make it TOO easy for you!)&lt;p&gt;Oh, and there&apos;s also the concept of interpreting vs compiling.  The colon word, which is spelled &lt;i&gt;:&lt;/i&gt;, reads the very next word from the input and begins the definition of that word.  Every word it encounters up to the next semi-colon is compiled, not executed.  So if I did this&lt;p&gt;&lt;pre&gt;&lt;code&gt;    3 4 + : FOO SWAP DROP ; .
&lt;/code&gt;&lt;/pre&gt;
... it would still print out the sum of 3 and 4, but in between it would also define a new word called FOO.  Which would be a silly way to program, but it demonstrates the point.&lt;p&gt;So the short form is: begin reading at the top left, continue rightward and downward until you reach the bottom.  There&apos;s no syntax as such, like Perl&apos;s &lt;i&gt;die &quot;Can&apos;t open file&quot; unless $fileopen;&lt;/i&gt; because Forth-like languages don&apos;t read ahead to the end of the line.&lt;p&gt;[Edited: HN doesn&apos;t do Markdown. WTF?  Also, I don&apos;t know my left and right.]</text></comment>
<story><title>Factor 0.96 now available – over 1,100 commits</title><url>http://re-factor.blogspot.com/2013/04/factor-0-96-now-available.html</url><text></text></story><parent_chain><item><author>sherjilozair</author><text>I must say, that the syntax and semantics are not intuitive at all. I&apos;ve spent half an hour trying to learn how does this thing work, and have not been able to. I guess, a damn good tutorial is in order. I think one of the primary reasons Python took off really well, was because of very good tutorials available. The language of Factor&apos;s documentation is still only tuned for language designers, not language users.</text></item></parent_chain><comment><author>digitailor</author><text>That&apos;s what&apos;s cool about the Forth idea, and why it can be so effective. It&apos;s not that it&apos;s unintuitive, it just doesn&apos;t take Algol-style semantics as a given as we do today. (It was being used before C was even developed.) If we&apos;re interested, it&apos;s our job to see if we can fit our thought process into the Forth idea, not vice versa.&lt;p&gt;And it&apos;s a very coherent idea. It&apos;s meant to respect processor architecture while maintaining a good level of comprehensibility to the human. And it keeps a MUCH closer correspondence between &quot;word&quot; (essentially a routine) and actual instruction. That got WAY lost with C, enter the beast-compiler.&lt;p&gt;I think of it as a concept layer above assembly, that has features far beyond just mnemonic value. It&apos;s like Lisp to me- a language whose &quot;syntax&quot; is dictated by the functional necessity of a computing methodology, not the decisions of language designers. For me at least, the approach leads to much higher productivity for a variety of reasons.&lt;p&gt;There&apos;s also a very high probability that Forth is the first thing to be run when you turn on the computer or cellphone you&apos;re reading this from.&lt;p&gt;Now as to Factor... see my post above and help me out!</text></comment>