5 ms·
Factor: A Practical Stack Languge
- zentiggr 7y agoI 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.
- benhoyt 7y agoAs 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 7y agoUnrelated 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.
- max_ 7y agoWhat would this language do better than current languages?
- Mathnerd314 7y agoIt'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/
- PeCaN 7y agoFactor 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.
- haolez 7y agoLooks 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 7y agohttps://github.com/factor/factor https://github.com/factor/factor
- kick 7y agoThey were talking about 8th.
- butterisgood 7y agoAh whoops!
- deleted 7y ago[deleted]
- kwhitefoot 7y agoIs 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.
- erichocean 7y agohttps://factorcode.org/slava/dls.pdf 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.
- mnemonicsloth 7y ago> [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 7y agoThe 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.
- butterisgood 7y agoReasons? Hmm maybe not but if you work through a few examples here https://andreaferretti.github.io/factor-tutorial/ 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”.
- deleted 7y ago[deleted]
- nemo1618 7y agoI 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 7y agoI 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/16ee2645c4c8aed813005d51488d5c6a https://gist.github.com/tluyben/16ee2645c4c8aed813005d51488d...
- didibus 7y ago> 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?