News for hackers. Stuff that matters.
Re:Factor: A Practical Stack Languge by benhoyt on Thursday January 16, 2020 @04:03PM (#22068894)
As someone who built Forth compilers back in the day, I really like this language. There's a nice overview of Factor as a paper here: https://factorcode.org/slava/dls.pdf and a Google tech talk video of Slava Pestov (Factor's creator) showing off the language here: https://www.youtube.com/watch?v=f_0QlhYlS8g
Re:Factor: A Practical Stack Languge by nautical on Friday January 17, 2020 @12:39AM (#22072195)
Unrelated to the main topic, but I watched this video when I was in college and it was one of the factors that inspired me to pursue programming seriously.
Re:Factor: A Practical Stack Languge by zentiggr on Thursday January 16, 2020 @03:42PM (#22068673)
I have had Factor installed and ready to go on each of my last three personal machines, and never got to the point of having a solid project to attempt.

I absolutely love the idea of concatenative languages, I just haven't gotten my toes in the door, so to speak.

Maybe this year, as I'm back in a coding job.

Re:Factor: A Practical Stack Languge by yumaikas on Thursday January 16, 2020 @09:44PM (#22071402)
I recommend a 4-function calculator, if you don't mind trying GUI code.
Re:Factor: A Practical Stack Languge by zentiggr on Friday January 17, 2020 @08:31AM (#22074426)
GUI handling is actually my biggest gray area, that's a great suggestion.
Re:Factor: A Practical Stack Languge by kwhitefoot on Thursday January 16, 2020 @04:55PM (#22069430)
Is there a concise document somewhere that gives reasons why someone who uses an Algol style block structured imperative language (C, C++, C#, Pascal, etc.), or indeed any non-concatenative language, would benefit from switching to Factor?

The older I get the less willing I am to learn languages just because they are interesting.

Re:Factor: A Practical Stack Languge by mnemonicsloth on Thursday January 16, 2020 @08:49PM (#22071123)
> [why would I] benefit from switching to Factor?

Here's how it usually goes:

It works like this: You try Factor. You stick with its weirdness through one or two small projects. Somewhere in there your brain starts to accept the new way of doing things. Shortly after, you discover there are things you like and things you don't. You refine your opinion as you use the language more.

After a week or so, you will want to use an abstraction from Factor in a project for your day job. Maybe you implement it. You have confidence it will work because you've already seen it in Factor. But maybe you don't implement it for whatever reason. Even then, you have an advantage over your coworkers because you already have mental tools in place to help you reason about the problem.

Re:Factor: A Practical Stack Languge by taneq on Thursday January 16, 2020 @09:20PM (#22071281)
The Sapir-Whorf hypothesis sure seems to hold with programming languages. Some ideas are easier to have in some programming languages than in others, although once you have the idea you can often 'explain' it in a programming language where it's less obvious.
Re:Factor: A Practical Stack Languge by erichocean on Thursday January 16, 2020 @05:42PM (#22069826)
https://factorcode.org/slava/dls.pdf

That said, effectively no one would benefit from switching. I like Factor, and stack languages in general, but from a difficulty perspective, they are MUCH more difficult than languages from the Algol family to use.

Re:Factor: A Practical Stack Languge by LessDmesg on Friday January 17, 2020 @04:31AM (#22073214)
There is no reason. We identify things in terms of words, not positions on the stack. We think "multiply first vector's y coord by second vector's z coord", not "multiply item 15 on the stack by item 12 on the stack". Thus, stack-based languages lose out in usability and are really just a curiosity without much practical applications.
Re:Factor: A Practical Stack Languge by butterisgood on Thursday January 16, 2020 @11:56PM (#22071989)
Reasons? Hmm maybe not but if you work through a few examples here

https://andreaferretti.github.io/factor-tutorial/

I found it somewhat enlightening.

If you’ve ever coded Haskell in “point-free” style you might also get the gist of how “words compose”.

Re:Factor: A Practical Stack Languge by didibus on Friday January 17, 2020 @05:03AM (#22073379)
> it has powerful metaprogramming capabilities, exceeding even those of LISPs;

The part where it says it even exceeds that of Lisps, is it because it has access to change all prior tokens and later tokens? Basically factor parser words are like full program reader macros?

Re:Factor: A Practical Stack Languge by nemo1618 on Thursday January 16, 2020 @05:58PM (#22069983)
I don't know if it's Baader-Meinhof or what, but I'm seeing concatenative languages all over the place now. Which is great, because now I'm planning to write my own! My gut says that a concatenative language could be ideal for competitive programming, where you want to quickly apply various transformations to your input and immediately see the result.

Here's a talk I watched recently describing some of the neat mathematical properties of concatenative languages: https://www.youtube.com/watch?v=_IgqJr8jG8M

Re:Factor: A Practical Stack Languge by tluyben2 on Friday January 17, 2020 @03:22AM (#22072872)
I implement small Forth-likes quite a lot, for instance [0].

I really like having something to explore 70-80s machines (other than Basic), hardware and systems that have no/bad Repls (like Xamarin). This kind of thing is ideal for that as it takes a really short time to implement, gives full and flexible access and it is fast enough to prototype things with.

[0] https://gist.github.com/tluyben/16ee2645c4c8aed813005d51488d...

Re:Factor: A Practical Stack Languge by max_ on Thursday January 16, 2020 @04:53PM (#22069400)
What would this language do better than current languages?
Re:Factor: A Practical Stack Languge by Mathnerd314 on Thursday January 16, 2020 @05:09PM (#22069554)
It's small and easy to port. It might be useful in some embedded projects. Per Wikipedia the original use case was video game scripting.

A newer concatenative language with a better website: https://8th-dev.com/

Re:Factor: A Practical Stack Languge by PeCaN on Thursday January 16, 2020 @07:17PM (#22070565)
Factor is definitely not that small (there's a full optimizing compiler and a giant standard library…) and doesn't run on any embedded platforms. It's more like C# than like Forth in terms of usage scenarios.
Re:Factor: A Practical Stack Languge by haolez on Thursday January 16, 2020 @09:12PM (#22071240)
Looks fun! It's a shame that it's not open source, but I'm not in the owner's shoes, so there's that.
Re:Factor: A Practical Stack Languge by butterisgood on Thursday January 16, 2020 @11:54PM (#22071979)
Re:Factor: A Practical Stack Languge by kick on Thursday January 16, 2020 @11:59PM (#22072003)
They were talking about 8th.
Re:Factor: A Practical Stack Languge by butterisgood on Friday January 17, 2020 @12:38AM (#22072190)
Ah whoops!