Factor is a high-level concatenative language in the spirit of FORTH. It compiles to native code, has a very rich IDE and development experience, and has a pretty thorough collection of libraries. This is the first release of Factor since 0.97 nearly four years ago.
I’m not as involved as I used to be, but I’m still on the core team, so feel free to ask me questions if you’ve got any.
Would you recommend Factor for production use given that it seems to be reaching a sort of plateau in support and community?
It’s a beautiful language, by the way. Thank you for your work.
I have Factor running in production. Although I don’t really maintain the web app much - it just ticks along - Factor runs tinyvid.tv and has for the past few years. I originally wrote it to test HTML 5 video implementations in browsers back when I worked on the Firefox implementation of video.
As always, it depends on what you’re doing—I’d definitely be nervous if you told me you were shoving Factor into an automobile, for example—but Factor the VM and Factor the language are both quite stable and reliable. On top of doublec’s comment, the main Factor website runs Factor (and its code is distributed as part of Factor itself for your perusal), and it’s been quite stable. (We do occasionally have to log in and kick either Factor or nginx, but it’s more common that the box needs to be rebooted for kernel updates.) I likewise ran most of my own stuff on Factor for a very long time, including some…maybe not mission-critical, but mission-important internal tooling at Fog Creek. And finally, we know others in the community who are building real-world things with Factor, including a backup/mirroring tool which I believe is being written for commercial sale.
The two main pain-points I tend to hit when using Factor in prod are that I need a vocabulary no one has written, or that I need to take an existing vocabulary in a new direction and have to fix/extend it myself. Examples are our previous lack of libsodium bindings (since added by another contributor) and our ORM lacking foreign key support (not a huge deal, just annoying). Both of these classes of issues are increasingly rare, but if you live in a world where everything’s just a dependency away, you’ll need to be ready for a bit of a change.
You can take a look at our current vocab list if you’re curious whether either of the above issues would impact anything in particular you have in mind.
What would you say is Factor’s best application domain, the kind of problem it solves best? I met Slava many years ago when he was presenting early versions of Factor to a local Lisp UG, and am curious to see where the language fits now, both in theory and practice.
My non-breezy answer is “anything you enjoy using it for.” There are vocabularies for all kinds of things, ranging from 3D sound to web servers to building GUIs to command-line scripts to encryption libraries to dozens of other things. Most of those were written because people were trying to do something that needed a library, so they wrote one. I think the breadth of subjects covered speaks well to the flexibility of the language.
That all said, there are two main areas where I think Factor really excels. The first is when I’m not really sure how to approach something. Factor’s interactive development environment is right up there with Smalltalk and the better Common Lisps, so it’s absolutely wonderful for exploring systems, poking around, and iterating on various approaches until you find one that actually seems to fit the problem domain. In that capacity, I frequently use it for reverse-engineering/working with binary data streams, exploring web APIs, playing with new data structures/exploring what high-level design seems likely to yield good real-world performance, and so on.
The second area I think Factor excels is DSLs. Factor’s syntax is almost ridiculously flexible, to the point that we’ve chatted on and off about making the syntax extension points a bit more uniform. (I believe this branch is the current experimental dive in that direction.) But that flexibility means that you can trivially extend the language to handle whatever you need to. Two silly/extreme examples of that would be Smalltalk and our deprecated alternative Lisp syntax (both done as libraries!), but two real examples would be regular expressions, which are done as just a normal library, despite having full syntax support, or strongly typed Factor, which again is done at the library level, not the language level. I have some code lying around somewhere where I needed to draft up an elaborate state machine, and I quickly realized the best path forward was to write a little DSL so I could just describe the state machine directly. So that’s exactly what I did. Lisps can do that, but few other languages can.
Were native threads added in this release, or are there plans to? And did anything ever come to fruition with the tree shaker that Slava was working on way back when?
Major props on the release. It’s really nice to see the language survive Slava disappearing into Google.
The threads are still green threads, if that’s what you’re asking, but we’ve got a really solid IPC story (around mailboxes, pattern matching, Erlang-style message passing, etc.), so it’s not a big deal to fire up a VM per meaningful parallel task and kick objects back and forth when you genuinely need to.
In terms of future directions, I don’t know we’ve got anything concrete. What I’d like to do is to make sure the VM is reentrant, allow launching multiple VMs in the same address space, and then make the IPC style more efficient. That’d make it a lot easier to keep multithreaded code safe while allowing real use of multiple cores. But that’s just an idea right now; we’ve not done anything concrete that direction, as far as I know.
Really off-topic, but isn’t Slava at Apple?
He is now. Works on Swift.
Where does the core factor team typically communicate these days? #concatenative on freenode seems kinda dead these days. Is there a mailing list, or on the yahoo group?
I have been following Factor from afar since the early beginning around 2008. The main thing that stands out to me is how much libraries a few developers were able to create. While most developers are happy if they publish 3-4 libraries here we have 3-4 core developers publishing hundreds of libraries. This goes from a rich C FFI, a network stack with all common protocols, a graphical stack with OpenGL rendering, a UI library, sound, all sorts of inputs, a great documentation system, … Each of these categories require great domain expertise. This is an incredible achievement.
I’ll have to give factor another spin. I previously bounced off of it in favor of making my own stack-based language, since I was very interested in writing any sort of programming language at the time (and getting started on a stack based language seems easy, even though the long work of getting it to a good quality still takes a long time). Factor definitely influenced my early designs in that project, but I’d be interested in revisiting it with I now know about various things.