Live data from Hacker News

Factor: A Practical Stack Language

factorcode.org

11–20 of 46 posts

Re: Factor: A Practical Stack Language

#11
post #9
post #2

Be careful. Factor is a gateway to lower level stack based languages. I saw Zed Shaw do a presentation using factor and decided to spend a weekend playing with it. It was the start of a two year journey that ended with me writing forth for microcontrollers. That was time I should have studied but was somehow always sidelined by other things.

Have you found #forth-hardware-projects and #mecrisp?

There’s also a pretty active Forth channel on Discord

Re: Factor: A Practical Stack Language

#15
post #2

Be careful. Factor is a gateway to lower level stack based languages. I saw Zed Shaw do a presentation using factor and decided to spend a weekend playing with it. It was the start of a two year journey that ended with me writing forth for microcontrollers. That was time I should have studied but was somehow always sidelined by other things.

Hah, you could have done worse. The double-dose introduction to stack-based programming via HP calculators and Adobe PostScript in the 90s led me to spend on the order of 3000 hours developing Onyx (https://github.com/canonware/onyx), which started off as a PostScript clone minus graphics, and ended up a thing of its own.

On the bright side, I learned a tremendous amount about lexing, interpreters, exceptions, tail-call optimization, data structures, garbage collection, etc., which opened up lots of possibilities in later projects. With the benefit of hard experience I would never recommend using a stack-based language for a large project, but as a learning tool it has some nice qualities.

Re: Factor: A Practical Stack Language

#16
post #2

Be careful. Factor is a gateway to lower level stack based languages. I saw Zed Shaw do a presentation using factor and decided to spend a weekend playing with it. It was the start of a two year journey that ended with me writing forth for microcontrollers. That was time I should have studied but was somehow always sidelined by other things.

This is how you get hired at weird (good way) places you never forget, though.

Re: Factor: A Practical Stack Language

#17
I used to play around with Factor in 05-10ish. Had all of a semester of C and a few physics labs worth of Matlab under my belt so I never actually managed anything interesting in it but god damned if it hasn't ruined me for every other language.

Re: Factor: A Practical Stack Language

#20
post #19

Damn, that indeed looks interesting. Could someone give here a Factor vs Forth tl;dr? Forth appears to be tailored for embedded systems, but the velociraptor is growing quick on me.

From the FAQ [0]:

> How is Factor different from Forth?

> Forth is untyped, not garbage collected, and close to the machine. For flow control, Forth code tends to use immediate words. Variables and arrays tend to be global, and programs aren't usually written in a functional manner. Factor is very different from this. It is dynamically typed, offering a high degree of reflection. Unreferenced objects are garbage collected with a generational garbage collector. Factor code is a little bit more distant from the machine, though the C FFI allows using words like malloc and mmap. For flow control, Factor generally uses quotations, allowing flexible higher order functions; parsing words are used mostly for definitions and data literals. Variables are dynamically or statically scoped (see below), and arrays are just objects which don't need to be treated specially.

[0] https://concatenative.org/wiki/view/Factor/FAQ/Why%3F

Post reply on HN