Live data from Hacker News

Factor 0.96 now available – over 1,100 commits

re-factor.blogspot.com

51–60 of 67 posts

Re: Factor 0.96 now available – over 1,100 commits

#51
post #40

Earlier quoted context omitted.

Reverse 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.

But you can read left to right to get the order in which operations/transformations are performed: "hello world" uppercase print While in languages where function application is prefix, you have to go inside to outside, right to left: print(uppercase("hello world")) Additionally, if there are infix operators, the direction is switched mid statement: print(uppercase("hello" + "world")) hello -> world <- uppercase <- p…

I like the way Haskell uses it's composition function operator (.), it's very clean, e.g.

  λ>putStrLn . reverse .  map toUpper $ "hello world"
  DLROW OLLEH

Re: Factor 0.96 now available – over 1,100 commits

#52
post #34

Earlier quoted context omitted.

I 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.

If 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 b…

Yes, you are absolutely right. I forgot about this one major difference. However, you cannot generally say if-then-else is a statement; there are languages such as CoffeeScript in which if-then-else works exactly like the conditional operator and therefore has a type and return value.

As for the priority mess, I spend my brain cycles elsewhere and use parentheses, which also helps the next guy as well as me.

Re: Factor 0.96 now available – over 1,100 commits

#53
post #44

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. 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 u…

Factor is an impressive piece of work for sure, but, in my opinion, like many "modern" derivatives of Forth it loses the major strength of Forth, brutal simplicity. It has drawbacks, but it also has advantages. Introducing new "modern" features to Forth adds complexity, changes this balance, and I doubt these hybrids will ever attract 'hardcode' Forth programmers or non-Forth programmers. At least traditional Forth systems are small and simple enough for someone to understand (I learned myself from a tiny Forth named PygmyForth, but there are many others); it provides you with a kit you can modify and customize at will once you've absorbed it.

The postfix notation even for conditionals is really not an issue when you dive into the language. However, with most systems you should be able to translate IF into 'nop', THEN into IF, and END into THEN and it should do the trick. But then there are DO WHILE loops. etc. But everyone prefers to preserve the postfix logic at the end of the day. It's like infix notation systems in Lisp and Scheme that never caught up (and, I believe, never will).

About your second point: most of the library code, in any language, looks like gibberish and like a mess of arbitrary idioms. One simply cannot hope to inspect and understand non trivial library code just just by casually reading it. With Forth the situation is indeed even worse, because implementers generally cannot resort to spaghetti code too much, whose continuous nature, at least, helps the casual reader.

On the topic of cooperative multithreading, I think that the trend in recent programming languages in general is that, nobody wants to deal with pre-emptive threads anymore. It hurts kitties, it is dirty. It is like manual dynamic memory management. Cooperative threads (if I'm not mistaken, they're also sometimes called "lightweight threads", "green threads" or "fibers"), avoid most of the problems of preemptive threads (because the programmer controls when execution can switch to another thread and when it should not very easily), while retaining some benefits (background execution of low priority tasks). For a "modern" Forth system, I think it could be interesting to keep cooperative threads at user level (really hardcore implementers may just remove them completely, because it is expected that the programmer may prefer to implement some sort of cooperative tasking fitted to his needs), and use preemptive/OS threads in library code (typically implemented in C).

Now that's the point of view of a 'hardcore' kind of hobbyist Forth user (and implementor). There is another category that finds brutal simplicity simply not practical and I can understand that. But really for educational/curiosity purposes I would recommend the hardcore way. Like, abandon all the bloat you're addicted to, shut the up, try hard and sincerely. I tried Forth this way because I was very sceptical when reading Moore (inventor of Forth) and Fox (one of his collaborator and friend; Moore isn't very good at communication, so Fox [RIP] was sort of his Plato) that their approach could work. These experiments in extreme simplification brought me a lot when I was a young programmer.

Re: Factor 0.96 now available – over 1,100 commits

#55
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...

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.

Re: Factor 0.96 now available – over 1,100 commits

#56
post #44

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. 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 u…

>(It's under objects.)

That would be because Factor is OO.

Re: Factor 0.96 now available – over 1,100 commits

#57
Oh look, they're basically dissing this community to hell in the irc logs. For instance,

"10:10:24 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

Re: Factor 0.96 now available – over 1,100 commits

#58
post #57

Oh look, they're basically dissing this community to hell in the irc logs. For instance, "10:10:24 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 a…

That's not the case at all. We are anything but elitist...

Re: Factor 0.96 now available – over 1,100 commits

#59
post #34

Earlier quoted context omitted.

I 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.

If 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 b…

How is this any different than saying "Avoid the + operator at all costs, because behavior is non-trivial and varies from language to language". Of course there are going to be differences. You just have to learn the rules for the language you are working in.

Re: Factor 0.96 now available – over 1,100 commits

#60
post #57

Oh look, they're basically dissing this community to hell in the irc logs. For instance, "10:10:24 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 a…

If 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.
Post reply on HN