Hasty Briefsbeta

Forth – is it still relevant?

14 days ago
  • #Forth
  • #Programming
  • #Multi-threading
  • Forth lost out to C due to broader appeal, standardization, and support ecosystem.
  • Bill Muench created eForth for simplicity and educational purposes.
  • Dictionary is modeled as an array of words for easier search and execution.
  • Data and Return Stacks are implemented as arrays with push, pop, and indexing methods.
  • No vocabulary or meta-compilation to focus on core concepts.
  • Multi-threading and message passing introduced in version 5.0.
  • Thread pool size defaults to the number of cores.
  • Message passing uses pthread mutex for synchronization.
  • Core implementation of eForth is in C/C++ for cross-platform support.
  • Code objects represent Forth words with fields for name, execution token, and parameters.
  • Polymorphic classes extend Code for literals, variables, strings, and branching.
  • Inner interpreter executes words recursively or via lambda functions.
  • Outer interpreter searches dictionary and handles compilation or execution.
  • Array implementation differs from traditional Forth memory access.
  • Dynamic arrays enable expanding variables and self-morphing code.
  • Modern Forth implementations aim to be more accessible with fewer lines of code.
  • Multi-threading support includes task creation, starting, joining, and message passing.
  • Performance benchmarks compare different threading and memory models.
  • Memory management considerations for C++ standard libraries on resource-constrained devices.
  • Refactoring efforts focus on cross-platform compatibility and performance optimization.