8 ms·
Factor 0.96 now available – over 1,100 commits
- rhdoenges 13y agoI like the old logo better, http://re-factor.blogspot.com/2012/11/new-logo.html http://re-factor.blogspot.com/2012/11/new-logo.html is waaay too busy.
- rhdoenges 13y agoThat nitpick aside--wow! Factor is getting more and more impressive every day.
- msutherl 13y agoAh, the new logo is hideous! I don't see anything better about it other than the fact that it fits in a square. What's the purpose of the late-90's computer graphics style round triangle button thing? It's like a big skeuomorphic upvote button with an airbrushed Mario level in the background. Just get rid of it!
- ninetax 13y agoMy TA for a cryptography class worked on this. I had the pleasure of messing with it one afternoon. Pretty cool stuff.
- deleted 13y ago[deleted]
- jnxfgf456 13y agofactor makes Lisp wilt,
- jeffdavis 13y agoLooks very interesting. What distributions package it?
- LeonidasXIV 13y agoArch Linux has it in AUR, I'm currently in process of updating it to 0.96.
- LAMike 13y agoIs there a HelloWorld example I can try?
- elasticdog 13y ago"hello world" print ...although, more realistically, you're probably interested in something like the gettings started section of the docs [1]. There are also some great short example posts on the planet feed [2] from various blogs. EDIT: I'll plug my own blog for this too, as I started writing a Beginning Factor series of posts a long time ago [3], but never got beyond a couple entries. [1] http://docs.factorcode.org/content/article-handbook.html http://docs.factorcode.org/content/article-handbook.html [2] http://planet.factorcode.org/ http://planet.factorcode.org/ [3] http://elasticdog.com/2008/11/beginning-factor-introduction/ http://elasticdog.com/2008/11/beginning-factor-introduction/
- saurabh 13y agoHey Aaron, From your second article[1] introducing Factor "Next time we’ll stick with a theme of “flow” and discuss control flow for your words and after that, the typical work flow when developing code with Factor. Hope you enjoyed this installment!" I am still waiting for that article. Your introductions to Factor are awesome and more would be delightful. [1] http://elasticdog.com/2008/12/beginning-factor-shufflers-and-combinators/ http://elasticdog.com/2008/12/beginning-factor-shufflers-and...
- ShiningRay 13y agoWhere is Slava Pestov now? Haven't seen him for a long time.
- elasticdog 13y agoHe got a job at Google back in 2010 and pretty much handed over the reins at that time due to lack of free time to work on Factor. He still posts on the mailing list though periodically.
- lukego 13y agoThis is really cool! I have always admired the engineering work on Factor, but had thought the project would die when Slava Pestov took his job at Google. Great to see it continue to improve.
- sherjilozair 13y agoI must say, that the syntax and semantics are not intuitive at all. I'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's documentation is still only tuned for language designers, not language users.
- zimbatm 13y agoTo be fair Factor/Forth's way of thinking is really foreign to the usual Pascal/C derivatives. Learning how to program from scratch certainly too you more than 30min.
- ShiningRay 13y agoI think that's true. Forth is so called "ultimate low-level language".
- pandaman 13y agoActually, Forth (the predecessor of concatenate languages) has the best tutorials I've ever read - Starting Forth and Thinking Forth by Leo Brodie. http://www.forth.com/starting-forth/ http://www.forth.com/starting-forth/ http://thinking-forth.sourceforge.net http://thinking-forth.sourceforge.net
- digitailor 13y agoThat's what's cool about the Forth idea, and why it can be so effective. It's not that it's unintuitive, it just doesn't take Algol-style semantics as a given as we do today. (It was being used before C was even developed.) If we're interested, it's our job to see if we can fit our thought process into the Forth idea, not vice versa. And it's a very coherent idea. It's meant to respect processor architecture while maintaining a good level of comprehensibility to the human. And it keeps a MUCH closer correspondence between "word" (essentially a routine) and actual instruction. That got WAY lost with C, enter the beast-compiler. I think of it as a concept layer above assembly, that has features far beyond just mnemonic value. It's like Lisp to me- a language whose "syntax" 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. There's also a very high probability that Forth is the first thing to be run when you turn on the computer or cellphone you're reading this from. Now as to Factor... see my post above and help me out!
- Rayne 13y agoUnder new libraries I see a reddit API lib listed. Why are they including things like this in Factor itself. Doesn't it kind of bloat things? Factor can strip this out if it isn't used of course, but can you really maintain all of these libraries? If you just add random things to Factor itself you're eventually going to end up with something that is impossible to maintain without a very large number of invested people.
- zimbatm 13y agoBecause there are like 10 person using it. Until the language grows and acquires a package manager it's easier to just put everything in the stdlib.
- Rayne 13y agoSure, but I'd vote for doing things right to begin with rather than waiting for complaining users. But I guess we might disagree on what 'right' means in this context. :)
- zimbatm 13y agoThere is another aspect too: when everything is in the stdlib it forces developers to collaborate and not create their Nth implementation of the same lib because theirs is better. There is a breaking point in number of developers where it becomes more efficient to distribute the work trough a package manager but then you also introduce package hunting which can become quite a time consuming task.
- doublec 13y agoThe 'extra' directory basically acts as a package manager. The "Batteries Included" approach Factor uses here makes it much more likely that libraries work out of the box. This was very useful in the early days of Factor when language and base library changes caused bitrot in contributions. If the contributed library wasn't updated it was moved to an 'unmaintained' directory for later correction.
- MrBra 13y agoWhat is it? Why should I learn it? What are its "killer" features? Ain't nobody got time to learn about every new prog. language.. :)
- exch 13y agoYou don't have to learn it. It is probably mostly interesting to users of concatenative languages, or those who just want to broaden their horizons.. Personally, I've fallen in love with it a few years ago. Even though I don't use Factor for anything practical, the language itself (as well as Forth) has taught me a completely new way of thinking about problem solving. Something that I benefit from in other languages I use. So if there is one reason you should at least check it out, it is that it will make you a better programmer. And I think anyone who's been writing code long enough, will know that there is always room for self-improvement.
- MrBra 13y agoOk, but that is not true for any new programming language. So why downvote my question?
- raganwald 13y agoMy suggestion is that learning to write programs in a concatenative language will teach you to think in combinatorial logic, a fundamental basis for computation. I outlined this idea a while back and mentioned Factor in "Finding Joy in Combinators:" https://github.com/raganwald/homoiconic/blob/master/2008-11-16/joy.md https://github.com/raganwald/homoiconic/blob/master/2008-11-...
- bjourne 13y agoIt takes a few hours to get used to, but once you get the hang of it it becomes an amazing language. For most things postfix notation that Factor uses reads better than applicative (prefix) notation other languages uses. It's like jQuery's or linq's method chaining, only better :) and with less syntax. For example here is the solution to problem 22 in Project Euler (http://projecteuler.net/problem=22 http://projecteuler.net/problem=22): : names ( -- seq ) "names.txt" ascii file-contents [ quotable? ] filter "," split ; : score ( str -- n ) [ 64 - ] map sum ; : solution-22 ( -- n ) names natural-sort [ 1 + swap score * ] map-index sum ;
- thomasfl 13y agoReverse polish notation means you have to start reading from the end of the expression: "hello world" print This is also why ternary expressions in C like languages is hard to read.
- pestaa 13y agoI find the ternary expressions very easy to read and understand and never understood why others find it difficult at all. I see no semantical difference between if(expr1) expr2 else expr3; and expr1 ? expr2 : expr3; Okay you need to learn the syntax, but it should be second nature after a few times. I also think the question mark is very intuitive.
- benbataille 13y agoIf it was that simple, people wouldn't have any issue with the conditional operator. The problem is there actually is a semantic difference between the two lines you wrote in most languages. If-Then-Else is a statement. It doesn't return a value. It's just a branching operation between the two blocks. The conditional operator is an expression. It returns a value hence it has a type. And that's where things start to be messy. Typing rules for the conditional operator are, well, not trivial and varie from language to language. Let's use an exemple from Java Puzzlers (Joshua Bloch and Neal Gafter) : char x = 'X'; int i = 0; System.out.print(true ? x : 0); System.out.print(false ? i : x); will print X88 but the same thing in C++ char x = 'X'; int i = 0; cout << (true ? x : 0); cout << (false ? i : x); will print 8888. And I am not even talking about the priority mess when you try to use a conditional operator in a conditional operator.
- digitailor 13y agoAs cool as an approach that Factor has, I cannot fathom why it is being developed for x86 for the life of me. (Besides claims of cross-platform native executable compilation.) On ARM it would be interesting- or if it had a highly modular structure that would allow it to be "easily" ported to other microprocessors. But on x86? What niche is it trying to serve? Is it a language-lover's-language? I guess what I'm asking is, why would I use a "high-level" Forth on x86? There has to be a reason, I'm just missing it.
- doublec 13y agoFactor used to run on ARM [1]. Back then Windows Mobile only had 64MB of ram and it wasn't quite enough to do anything useful in Factor. I used to run a video sharing website written in Factor [2], sadly the server crashed a few weeks ago and I haven't recovered the data from the disk yet. Factor feels more like a Scheme than a Forth to me when programming. [1] http://web.archive.org/web/20111117015025/http://www.bluishcoder.co.nz/2007/02/factor-on-windows-mobile-5.html http://web.archive.org/web/20111117015025/http://www.bluishc... [2] http://web.archive.org/web/20130118204336/http://tinyvid.tv/ http://web.archive.org/web/20130118204336/http://tinyvid.tv/
- digitailor 13y agoWoah thanks for that link, there could be some assembly worth salvaging there. Currently working on an ARM forth-idea with some scheme-ideas. There's this nagging intuition I have that there's a symbiosis between Lisp atom/Forth word and S-expression/Forth dictionary. I have to get something going pretty quickly so I can't get too pure about the idea, as I don't want to get bogged down in the necessary GC yet. Thanks for your reply, it already made me more interested in Factor from an implementation standpoint, even if I wouldn't use it on x86.
- colomon 13y agoIsn't Factor (at some level of abstraction) basically Lisp/Scheme with more minimal syntax? It replaces prefix notation and parentheses with postfix notation and a stack. All the benefits Lisps get from minimal syntax, Factor gets too.
- doublec 13y agoFor those looking for "Why Factor" material you might like to look at some of Manfred von Thun's writings on the Joy programming language [1]. Joy is similar to Factor and Manfred wrote a lot of theory on the "why" of concatenative programming languages. [1] http://www.latrobe.edu.au/humanities/research/research-projects/past-projects/joy-programming-language http://www.latrobe.edu.au/humanities/research/research-proje...
- stesch 13y agoOr "Why Factor?": http://concatenative.org/wiki/view/Factor/FAQ/Why%3F http://concatenative.org/wiki/view/Factor/FAQ/Why%3F
- zvrba 13y agoHaving been a long-time user of HP series of calculators (HP48g, HP50g), postfix notation is not foreign to me. So I tried Factor, and gave up on it for several reasons. First, there were obligatory stack effect declarations on each word. Want to refactor your program? Sure, rewrite your words, together with stack effect declarations. That part was extremely annoying when it came to exploratory programming. For the uninitiated: stack effect declarations are akin to function prototypes in C, only lacking type information. IMO, once you have them, and they're obligatory, you get all the drawbacks of postfix languages, and no benefits. Second, the language and standard library rely heavily on stack combinators. Reading the standard library code requires intimate familiarity of what words like bi, bi@ and bi* do (among a whole lot of others). Third, I find Factor's documentation extremely confusing. For example, there are "Vocabulary index" and "Libraries" sections, with little or no overlap between them. But vocabulary is a library (or package, whatever, same thing), so WTF?! Then there are important and powerful features like generic words, but if you click on the "Language reference" link on the docs homepage, you get a menu with no mention of generics, and you have little clue in which section to look for them. (It's under objects.) Then you eventually find out (sorry, I was unable to dig up reference to the docs) that generics support only single dispatch, and only "math" generics (plus, minus, etc.) support double dispatch. In short, the manual is a maze of cross-references with no head or tail. Fourth, I dislike writing control structures in postfix. This is the part that, IMO, RPL on HP's calculators got right. Instead of forcing you to write something like 10 "Less than 10" "Greater than 10" [ < ] 2dip if ! 2dip is a stack combinator, guess what it does! you could write IF 10 < THEN "Less than 10" ELSE "Greater than 10" END (Postfix conditionals were available for the rare cases where they were the most convenient form.) Last but not least, it supports only cooperative threads.
- doublec 13y agoYou wouldn't write a conditional like that, you'd do: 10 < [ "less than 10" ] [ "greater than 10" ] if This is pretty easy to read. If the boolean condition is true, run the first quotation, if it is false, run the second. The unusual names lke 'dip', 'bi', etc are just common names that once learned make code easier to read. 'dip' is from Joy IIRC. I do agree that combinator heaviness can make things difficult for a beginner. Especially if code uses a combinator that isn't common it requires time to look up and see what it does. You really need to immerse in Factor development for a while to get familiar with them. Stack effect declarations exist to make refactoring safer. Prior to having them enforced by the compiler it was common to change a words stack effect only to find it broke random code using it elsewhere. Making the check enforced provided a safety check that you hadn't forgotten to change word usage elsewhere.
- swah 13y agoIts interesting how Factor avoided "library fragmentation" by trying to include everything in the main distribution - definitely a win here, given that in the smaller communities you can't afford duplication. The average quality of the libraries is higher because of that... I could never get over the syntax though - even though the #factor folks say its a matter of getting used to and theoretically not "harder" than Lisp, Lisp feels very natural to me, but Factor always required a big overhead.
- dscrd 13y agoOh look, they're basically dissing this community to hell in the irc logs. For instance, "10:10:24 <RodgerTheGreat> another HN gem: "I must say, that the syntax and semantics are not intuitive at all. I've spent half an hour trying to learn how does this thing work, and have not been able to."" It's horrible to watch when a language community has this sort of a elitistic attitude, especially when it's doubtful that the language has any future. Source: http://bespin.org/~nef/logs/concatenative/13.04.21 http://bespin.org/~nef/logs/concatenative/13.04.21
- gre 13y agoThat's not the case at all. We are anything but elitist...
- jabbernotty 13y agoIf a person says that something is a gem, they can be sincerely saying that they think it has positive value. Your interpretation was that the phrase was being used in a sarcastic manner. That may well have been the case here, but it doesn't have to be so.
- jufo 13y agoI think the "half an hour" bit is significant. If someone complained that they tried to learn Prolog and gave up after half an hour they wouldn't get much sympathy from me.
- swah 13y agoAnyone knows how one could compile to Factor VM? Slava once said that would be a good idea - imagine having a Lisp in that modern environment? (I love Slime don't hit me).