TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Factor 0.96 now available – over 1,100 commits

129 点作者 mrjbq7大约 12 年前

16 条评论

zvrba大约 12 年前
Having 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.<p>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.<p>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).<p>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?!<p>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.<p>In short, the manual is a maze of cross-references with no head or tail.<p>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<p><pre><code> 10 "Less than 10" "Greater than 10" [ &#60; ] 2dip if ! 2dip is a stack combinator, guess what it does! </code></pre> you could write<p><pre><code> IF 10 &#60; THEN "Less than 10" ELSE "Greater than 10" END </code></pre> (Postfix conditionals were available for the rare cases where they were the most convenient form.)<p>Last but not least, it supports only cooperative threads.
评论 #5585533 未加载
评论 #5584755 未加载
评论 #5585763 未加载
bjourne大约 12 年前
It 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 (<a href="http://projecteuler.net/problem=22" rel="nofollow">http://projecteuler.net/problem=22</a>):<p><pre><code> : 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 ;</code></pre>
评论 #5584496 未加载
sherjilozair大约 12 年前
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. 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.
评论 #5584459 未加载
评论 #5584458 未加载
评论 #5584429 未加载
评论 #5584296 未加载
评论 #5584682 未加载
评论 #5584540 未加载
评论 #5584390 未加载
swah大约 12 年前
Its 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...<p>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.
doublec大约 12 年前
For 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.<p>[1] <a href="http://www.latrobe.edu.au/humanities/research/research-projects/past-projects/joy-programming-language" rel="nofollow">http://www.latrobe.edu.au/humanities/research/research-proje...</a>
评论 #5584697 未加载
lukego大约 12 年前
This is really cool!<p>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.
rhdoenges大约 12 年前
I like the old logo better, <a href="http://re-factor.blogspot.com/2012/11/new-logo.html" rel="nofollow">http://re-factor.blogspot.com/2012/11/new-logo.html</a> is waaay too busy.
评论 #5584212 未加载
评论 #5583982 未加载
ninetax大约 12 年前
My TA for a cryptography class worked on this. I had the pleasure of messing with it one afternoon. Pretty cool stuff.
评论 #5584301 未加载
digitailor大约 12 年前
As 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.)<p>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.<p>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.
评论 #5584442 未加载
评论 #5598253 未加载
Rayne大约 12 年前
Under 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 <i>all</i> 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.
评论 #5584407 未加载
评论 #5584305 未加载
ShiningRay大约 12 年前
Where is Slava Pestov now? Haven't seen him for a long time.
评论 #5584263 未加载
LAMike大约 12 年前
Is there a HelloWorld example I can try?
评论 #5584206 未加载
swah大约 12 年前
Anyone 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).
MrBra大约 12 年前
What is it? Why should I learn it? What are its "killer" features? Ain't nobody got time to learn about every new prog. language.. :)
评论 #5584532 未加载
评论 #5584443 未加载
jeffdavis大约 12 年前
Looks very interesting. What distributions package it?
评论 #5584526 未加载
dscrd大约 12 年前
Oh look, they're basically dissing this community to hell in the irc logs. For instance,<p>"10:10:24 &#60;RodgerTheGreat&#62; 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.""<p>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.<p>Source: <a href="http://bespin.org/~nef/logs/concatenative/13.04.21" rel="nofollow">http://bespin.org/~nef/logs/concatenative/13.04.21</a>
评论 #5586121 未加载
评论 #5585812 未加载