
Factor: A Practical Stack Languge - otoburb
https://factorcode.org/
======
benhoyt
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](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](https://www.youtube.com/watch?v=f_0QlhYlS8g)

~~~
nautical
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.

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

~~~
yumaikas
I recommend a 4-function calculator, if you don't mind trying GUI code.

~~~
zentiggr
GUI handling is actually my biggest gray area, that's a great suggestion.

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

~~~
mnemonicsloth
> [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.

~~~
taneq
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.

------
didibus
> 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?

------
nemo1618
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](https://www.youtube.com/watch?v=_IgqJr8jG8M)

~~~
tluyben2
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...](https://gist.github.com/tluyben/16ee2645c4c8aed813005d51488d5c6a)

------
max_
What would this language do better than current languages?

~~~
Mathnerd314
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/](https://8th-dev.com/)

~~~
haolez
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.

~~~
butterisgood
[https://github.com/factor/factor](https://github.com/factor/factor)

~~~
kick
They were talking about 8th.

~~~
butterisgood
Ah whoops!

