Live data from Hacker News

Factor 0.96 now available – over 1,100 commits

re-factor.blogspot.com

61–67 of 67 posts

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

#61
post #50

Earlier quoted context omitted.

Woah 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…

Isn'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.

That's exactly what I'm thinking, but I haven't had time to stress-test the idea or find any precedent. And remember i'm talking about a ~36kilobtye forth, not this large-sized and resource-intensive kind of x86 forth that I don't understand the reason for.

Theoretically you would have the HLL incredibleness of a lisp with the low level genius of Forth. I asked some old timers if the idea made sense and they were silent in specifics but not discouraging. Which would indicate to me they think it is a huge learning opportunity for me one way or the other. Have you done any deeper analysis?

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

#62
post #52

Earlier quoted context omitted.

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.

Or virtually every language that is functional in a way. For example Lisp and Haskell.

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

#63
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…

That has nothing to do with the semantics ternary operator per se, but rather to do with how Java and C++ respectively type it. If you inserted the relevant casts to make sure both result halves have the same type, the difference would disappear.

You could expose the same semantic difference your example relies on with overload resolution, without needing to refer to the ternary operator at all. But I hope you wouldn't take that to mean that overloads are also a bad idea.

I also believe that the ternary operator is particularly nice when used in combination:

    x = a ? foo :
        b ? bar :
        c ? baz :
            blah;
The idiom tastes a little like pattern matching. Of course, you need to be a little cautious about your precedence, but I've never used a language supporting infix operators that didn't have gotchas around precedence.

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

#65

Earlier quoted context omitted.

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.

> How is this any different than saying "Avoid the + operator at all costs, because behavior is non-trivial and varies from language to language".

I never ever remotely said that. You are putting words in my mouth and I don't like it. I just rightfully pointed that there actually is a semantic difference between the two mentioned lines. I never implied using any of them was wrong. I didn't even emit a judgement of value on either construct.

Now, I don't have problem per see against the conditional operator. It's just not as simple as some people like to pretend and it makes your code depends on some non obvious and not broadly known language feature for what is usually a minimal gain. So, yes, I do tend to avoid it in anything which is going to end in the hand of others (in the same way I try to avoid any un-obvious language idiom as much as possible). It's like nested comprehensions in Python, the slightly shorter code produced is just not worth the added complexity.

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

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

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

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

#67

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

They are working on reimplementing ARM support in the next release. It is in an incomplete state ATM.
Post reply on HN