October 14th, 2024

Emit

Advancements in the Factor programming language enhance logic block extraction and reuse. A new syntax for named local variables improves clarity, demonstrated through practical examples, and encourages experimentation in the locals.lazy vocabulary.

Read original articleLink Icon
Emit

The article discusses advancements in the Factor programming language, particularly focusing on the ease of extracting and reusing logic blocks that operate on stack values. It illustrates how to refactor a word that processes stack values into smaller, named components for better clarity and reusability. The author presents a hypothetical syntax that allows for the extraction of logic operating on named local variables, aiming to enhance the language's functionality by reducing redundancy. The proposed syntax involves creating temporary syntax words and lazy variable bindings, which can be replaced when the defined words are called in a nested scope. The article concludes with a demonstration of the new syntax in action, confirming its effectiveness in a practical example. The author encourages experimentation with this new feature, which has been added to the locals.lazy vocabulary.

- Factor programming language allows easy extraction and reuse of logic blocks.

- New syntax enables operations on named local variables, enhancing code clarity.

- The article provides a practical example demonstrating the new syntax's functionality.

- The feature is available for experimentation in the locals.lazy vocabulary.

- The author expresses enthusiasm for building new functionalities within Factor.

Link Icon 5 comments
By @emmanueloga_ - 6 months
I know that they are unrelated but for whatever reason each time I see Factor I think of Io. I think I heard Slava Pestov is working at Apple but I wonder what’s Steve Dekorte up to these days. It doesn’t seem like Io is under development anymore.

Edit: Dekorte is working on https://strvct.net/

By @defactor - 6 months
This allows me to write code just like in plain english.no AI needed. I could not do this in Lisp. Writing code is like writing a novel now.Just a story with words.No type system needed to tell a story.

:: sibling ( node g -- sibling ) parent children remove-me first

Get a Node's parent, get the parents children, remove myself ( node ) and get the first child.

By @Pet_Ant - 6 months
Always glad to see Factor in the feed. Would love to see it get a type system though.
By @DidYaWipe - 6 months
Is what?