1. 31
  1.  

  2. 13

    One of the Factor devs here. Feel free to ask any questions you might have, and I’ll do my best to answer.

    1. 6

      What do you think is the over arching goal for factor? Were you trying to solve a particular problem which was not solved well by other languages?

      1. 9

        I’m not the inventor, so I wasn’t trying to solve any particular problem as such. I just really liked what I saw.

        For me, Factor provides a sweet spot of easy and very powerful metaprogramming, a simple runtime, and incredible introspectability. The feel of doing development in it is somewhere near a Lisp Machine, since all objects have graphical representations, you have a full REPL with compiler the entire time, and yet you still compile down to fully native code at all times. This makes doing incremental development extremely easy, and I think the amazingly rich standard library and GUI toolkit (for a language with its user base, at least!) speaks to its productivity. And unlike, say, Pharo/Squeak Smalltalk (an old haunt of mine), it uses normal text files for code, so I can use traditional tooling like Git and GitHub to manage development.

        These days, I write a lot less in Factor. Most of that’s due to real life taking precedence as I get older, some of that’s due to other languages closing the gap quite a bit. (Things like Jupyter, or Swift Playgrounds, did not exist when Factor was created, for example.) But Factor remains my preferred environment when I’m trying to learn a new concept or explore a domain I’m not terribly familiar with. Most recently, I had a blast using it for Cryptopals, for example.

        1. 2

          These days, I write a lot less in Factor. Most of that’s due to real life taking precedence as I get older, some of that’s due to other languages closing the gap quite a bit. (Things like Jupyter, or Swift Playgrounds, did not exist when Factor was created, for example.) But Factor remains my preferred environment when I’m trying to learn a new concept or explore a domain I’m not terribly familiar with. Most recently, I had a blast using it for Cryptopals, for example.

          Not to make light of anyone’s excellent work, but whenever I’ve explored Factor this matches what I’ve seen. The community was incredibly vibrant and active a few years back, but recently activity seems to have really fallen off across the board.

          Am I mis-perceiving things or are you not alone in having moved on in some respects to other languages and environments?

          1. 5

            Eh, it’s mixed. Yes, things have slowed down: Slava left, the company using Factor commercially folded, and a lot of us (such as me) have kids and stuff that make coding for fun harder.

            On the other hand, there’s actually a lot of work going on (largely driven by @erg) to make the syntax and runtime a bit more standardized, there have been a number of library improvements from Alexander Iljin, when people have needed more libraries they’ve added them, and so on. If you look at the core repo, you’ll see there honestly been a tremendous amount of activity since the last release. Sure, the pace may be slower, but it’s steady.

            In other words: I don’t think development has stalled, but I think it’s stabilized. For me, that’s great: Factor’s library grows and its stability improves, but things are generally where I left them. I know that same kind of things draws a lot of people to the Common Lisps as well, which also have a slower churn rate.

            1. 2

              I guess I was referring less to the language itself than to the ecosystem around it - blog posts and the like. But you’re right, none of this is an actual measure of a project or community.

              1. 2

                Blog posts are definitely down, but the mailing list is still quite active. I think it depends a bit where you look. But yes, I hear your point.

      2. 3

        Factor is a dynamic language and that makes sense to me: You have values on the stack that know their own types. When you are going to use a value, you check it’s type.

        How do you think a statically typed concatenative language would look? My intuition is that it would be like a reduce operation over all of words in the program. I think I’m a bit hung up due to the lack of formal parameters.

        1. 4

          How do you think a statically typed concatenative language would look?

          Probably exactly like our (optional) static typing. Do note that the compiler could do a lot more than it currently does for optimizations, but you can play with optimized. to see what it’s able to pull off. For even relatively complex cases that involve fixnums, it can basically do ops on straight machine words.

          1. 1

            That is neat! Is it used a lot in practice?

            How is the data stack implemented in Factor? Is it just an array of pointers? Or does it use the top bits to determine the types? Tried looking at the repo, but wasn’t sure what file it might be in…

          2. 3

            There was also cat from Diggins and Kleffners thesis

          3. 2

            On the “See some example programs” page, the example program links all give me a 502 error.

            1. 1

              How related is concatenative programming related to array programming (APL)? I feel that some of the concatenative combinators seem familiar to transformers in Nial

              1. 1

                Can the REPL run in a console? I installed the factor package from AUR, and factor-vm seems to only be able to open its own graphical window.

                1. 3

                  I can’t speak to whatever Arch is doing, but I just double-checked that plain factor on my box kicks off a command-line REPL, so I’m not sure what’s going on with their package.

                  That said, I would strongly discourage using the vanilla command-line REPL; you’re missing so much awesomeness. If you really badly want to use a terminal for whatever reason, I would strongly suggest at least using FUEL (our SLIME workalike) in Emacs.

                  1. 1

                    ArchLinux doesn’t install a plain factor (perhaps because the name collides with the factor binary from the coreutils package). There is /usr/bin/factor-vm which is a symlink to /usr/lib/factor/factor. The latter also opens a GUI thing, but I just found out I could factor-vm -run=listener to get a TTY thing, so that’s cool.

                    Thanks.

                    1. 3

                      That’s exactly the reason why the factor binary is renamed in the package. Source: Arch Linux packager here.

                      It is kinda sad that there hasn’t been any new releases in years, so if you want to have the new features you’re better off with factor-git.

                      1. 1

                        Thanks, I’ll switch to factor-git.

                        1. 1

                          I’m not thrilled with that, but there’s an (in my opinion, wrong) attitude that our next release needs to be Perfect™, which means it’s forever delayed. The good news is, as you said and @kas is now doing, that Git is honestly quite stable, so that’s probably the route most people should go for now.

                          1. 1

                            I think cutting a release would also send out a signal that Factor is not dead. I can confirm that git is quite stable so maybe there could be a point where tagging a new release might make sense.

                            In any case, thanks for maintaining Factor. I’m not actively using it any more but honestly due to the whole environment and community this was the most fun learning a programming language I’ve ever had, especially a completely different paradigm.

                2. 9

                  I remember watching a talk from one of the Factor devs (maybe the creator?).

                  In the talk he said something like:

                  “As you can see, order is significant when we push and pop things off the stack. If we use order as the only way to differentiate arguments when constructing an object, we call this a constructor ‘by order of arguments’, or a BOA constructor.”

                  It was then that I knew I had a compatriot out there….

                  1. 6

                    Posted because I just saw Slava Pestov’s work on Swift and wondered what happened to his own language. Turns out, it’s definitely still a thing, five years after it was last posted here.

                    1. 3

                      I’d written an article about using Factor a couple years ago, and never really came back to it. It’s a very interesting language, once you get used to the stack-based nature of the basics, though I highly recommend getting familiar with the vocabularies for local variables. They aren’t entirely elegant in the stack-oriented fashion, but they can be quite helpful for when a problem doesn’t fit into a stack neatly (like the quadratic formula), or for as a means of getting you to a place where things can fit neatly on the stack.

                      Going to pick it up again for a side-scripting language, and see how it goes.

                      1. 4

                        Just to be clear, while we prefer stack-based approaches, we happily use lexical variables even in the core vocabularies when it’s easier. Hell, there’s a full-blown infix syntax that you can use when you need it. One of the great things about Factor is how flexible the syntax is.

                      Stories with similar links:

                      1. Factor via SeanTAllen 6 years ago | 24 points | 7 comments