lobsters score: 1 · tags: concatenative
I really wanted to like Factor. But figuring out how to run code and package it and the paths and whatever was just too annoying.
This stuff:
Since the vocabulary was already loaded when you scaffolded it, we need a way to refresh it from disk
“vocabulary”, “scaffold”, “refresh”?
score 1 · canonical
The word “vocabulary” is as basic to Factor as “module” or “crate” is in Rust, but I don’t know about the rest.
I generally feel negatively towards the mutable bags of state that are Smalltalk-inspired “images”, which might be rearing their heads here with the “refresh” verb.
score 2 · canonical
Yeah, on top of the (now fixed?) longstanding issue of the interactive UI being objectively unusable on HiDPI displays; the main reason I never got into Factor despite being intrigued by it is because it exclusively expected you to write code vendored in the Factor source directory itself, and programs were impossible to distribute other than “extract this tarball into your Factor source folder”. Versus e.g. Common Lisp, while having the Lisp machine “bag of state” sorta thing going on, people still expect programs to be reproducible from a standalone set of source code rather than shipping a binary “image”.
Although skimming the site it looks like they’ve added alternate “roots” and stuff now, where you can have more normal source trees? So maybe time for me to look into it again… https://docs.factorcode.org/content/article-add-vocab-roots.html
score 2 · canonical
to write code vendored in the Factor source directory itself, and programs were impossible to distribute other than “extract this tarball into your Factor source folder”.
I forgot about this. This too was wildly off-putting.
score 1 · canonical
We’ve had vocabulary roots for 20 years. These are just module search paths.
You can also ship binaries in a reproducible way using the deploy tool.
And we ship with a “work” directory where you can conveniently add any of your own code without configuring additional locations. I appreciate the feedback, thank you.
score 1 · canonical
Hmm, sorry, I don’t remember precisely what my issue was but I remember distributing source code was difficult in some fashion (since I didn’t want to just distribute binaries).
score 1 · canonical
There was never really an issue with distributing source code out-of-tree but for a long time it was just the idiomatic thing to do to add your code to Factor’s repository and let it be shipped/maintained with it. Libraries would change so fast in the early days that it made bitrot of third party code easier to manage.
score 3 · canonical
“scaffold” refers to the “scaffold tool” which generates stub files for a vocabulary (module). Similar to how “cargo new” in Rust builds a stub project to work from. “refresh” refers to reloading code changed code on disk in source files into the running Factor system.
score 1 · canonical
Oh I was looking for
image. I don’t think it’s anywhere in the documentation (because I couldn’t find a page for it just now) and an offhand explanation in a Discord channel really is not enough.
score 1 · canonical
What are you looking for in the docs?
https://docs.factorcode.org/content/article-images.html
score 1 · canonical
I couldn’t find that and that’s decent bare documentation but doesn’t explain why the concept of image keeps coming up. So arguably that’s pretty sparse for something that’s such a central concept.
(Not that I think there’s really a tutorial for factor linked on the site anyway.)
score 1 · canonical
(Not that I think there’s really a tutorial for factor linked on the site anyway.)
The root page of the documentation site points to a “Guided Tour of Factor” amongst other things. This is also available in the help browser shipped with Factor. This is linked from the Factor homepage, which lists a number of useful beginner resources, including tutorials under “Get started programming with Factor”. I agree there doesn’t seem to be an early introduction to images though, that’s good feedback.
score 1 · canonical
I know because I think I trawled all of that 1-2 years ago. The core language is great. All of the stuff around it is a bit difficult.
And I think the thing is that languages these days are more “the stuff around” than the actual thing and syntax itself.
score 1 · canonical
Does anyone know how to get Factor running with Musl Libc on Linux? I’m the sort of funny person who runs Alpine on their desktop.
score 1 · canonical
I’m in the same boat. Would love to play with factor but it simply won’t build w musl
score 1 · canonical
I played around with Factor a bit this year. It’s a very cool, ambitious, clickable language that’s a good workout for the mind if you’ve never tried concatenative programming (with more modern affordances like local variables instead of having to do everything on the Stack). Performance is great/competitive in the dynamically-typed, interpreted language space (like Chez Scheme). There’s been a lot of improvements recently too like GTK4 + hiDPI to deal with my initial first bad impressions starting up the listener. The biggest missing feature is aarch64 support (so you get limited on what you can actually release on), tho I hear the progress is happening.
As an aside, if you have a functional interest, this talk, From Ivory to Metal, by Jon Purdy did a wonderful job connecting ideas from FP to concatenatitve programming while providing insight on how by almost accident, the concept of the stack can model affine, linear, ordered linear types too 🤯
score 1 · canonical
Performance is great/competitive in the dynamically-typed, interpreted language space
You may already know this, but for others reading, Factor isn’t interpreted. It compiles down to machine code. You can dissasemble the generated code with built in libraries.
The biggest missing feature is aarch64 support
I believe the latest git builds and runs on Mac OS M series machines so it’s getting there.
score 1 · canonical
Well you can run it in an interpreted mode as you don’t have to compile. I’m loading/interpretting a script at runtime for one of the things I played with building earlier this year.
M-series
So long as it also gets to Linux…
score 1 · canonical
That mode also compiles it. Loading a script at runtime compiles it and runs it, like many Common Lisp systems do. There are two compilers - a non optimizing compiler that handles dynamically generated code written in C++ as part of the VM, and an optimized compiler written in Factor which does most of the compilation work of user code.
score 1 · canonical
The latest git builds also run on linux-arm and windows-arm. We are getting close to a Factor 0.102 release.
score 2 · canonical
