Skip to content
  • Facebook
  • LinkedIn
  • Twitter
  • Instagram
Sincere Flattery

Sincere Flattery

  • Sincere Flattery
  • About
  • Contact
  • Blog

Search

Category: forth

Forth Interpreting Itself adDendum

December 13, 2021 by jeremy pereira, posted in forth, refactoring

Last weekend I eliminated the last Swift from the interpreting loop. There are now two pre-predefined words: an outer loop that reads a line of text and calls the the interpreter from the last post and the inner loop that interprets words from a line. The code for each looks something like this: : .readLoop … Continue reading Forth Interpreting Itself adDendum

Tagged forthLeave a comment

Forth interpreting Itself

November 27, 2021 by jeremy pereira, posted in forth

In which we interpret Forth using Forth and a bit of cheating With an implementation of refill, we are in the position of implementing the interpreter loop in Forth itself. In the previous post, we defined the interpreter loop like this: attempt to read a line into the input buffer while last read was successful … Continue reading Forth interpreting Itself

Tagged forth, interpreter1 Comment

Forth Inside Out part 2

November 20, 2021 by jeremy pereira, posted in forth

In which we internalise the read-execute loop, or die in the attempt. In Forth: Inside Out I did some refactoring on the read-execute loop. In this part I and going to re-engineer it entirely and implement it in Forth. The reason for doing this is that it will play better with some of the core … Continue reading Forth Inside Out part 2

Tagged forth1 Comment

Forth: Inside Out

November 7, 2021 by jeremy pereira, posted in forth

In which we turn the interpreter inside out My Forth interpreter is working fairly well so far, but I think there is some unnecessary complexity. The interpreter is event driven, which means that everything it does is driven by some event, which is always receipt of some text input. This works OK and I chose … Continue reading Forth: Inside Out

Tagged evaluate, forth, refactoring1 Comment

The Forth Protocol

November 7, 2020 by jeremy pereira, posted in forth, refactoring

In which I accidentally discover a performance enhancement I'm really not a fan of the massive switch statement at the heart of the execution loop, so I have decided to see if I can do something with virtual functions or closures on a WordList. The execute function would be reduced to running a particular function … Continue reading The Forth Protocol

Tagged forth, optimisation, performanceLeave a comment

RE-Evaluating Forth

October 31, 2020 by jeremy pereira, posted in forth

In which I take another crack at the evaluation cherry Just a short post to note that I have finally cracked evaluate. After the refactoring exercise, I still had a number of issues mostly caused by the design decision to put the currently interpreting word in the word list at position 0 and to use … Continue reading RE-Evaluating Forth

Tagged evaluate, forthLeave a comment

Forth Refactored

October 24, 2020October 25, 2020 by jeremy pereira, posted in forth

In which my head exploded so I had to simplify things Because my Forth interpreter is effectively event driven i.e. the input parser parses and then calls the interpreter to interpret one word, it gets very complicated when an executing word needs to pull something off the input parser. It has to exit the interpreter … Continue reading Forth Refactored

Tagged forth, refactoringLeave a comment

Evaluating Forth

October 24, 2020October 24, 2020 by jeremy pereira, posted in forth

In which I evaluate some strings The evaluate word is next on the list of core tests. This allows a Forth program to evaluate a string as if it were another Forth program. The simplest way to implement this would seem to be to implement a stack of sequences of input characters. evaluate then simply … Continue reading Evaluating Forth

Tagged evaluate, forthLeave a comment

Defining Forth

September 14, 2020September 14, 2020 by jeremy pereira, posted in forth

In which I try to unify the defining expressions. There are a number of ways to add words to the dictionary. These include: :, create, constant, and variable. It seems to me that the "primitive" should really be to just add the word to the dictionary and then each of the above words can be … Continue reading Defining Forth

Tagged create, definition, forthLeave a comment

Forth does create

September 12, 2020 by jeremy pereira, posted in forth

In which we have to reimplement create and does>. Having implemented create and does> as described previously, there are two problems. Consider the following extract from my core tests: t(": DOES1 DOES> @ 1 + ;", expected: "") t(": DOES2 DOES> @ 2 + ;", expected: "") t("CREATE CR1", expected: "") t("CR1 here =", expected: … Continue reading Forth does create

Tagged create, does>, forthLeave a comment

Posts navigation

Older posts

Categories

  • 6502 (3)
  • Armchair Universe (1)
  • C64 (1)
  • Code Snippets (3)
  • Computer Science (4)
  • decoding (2)
  • Emulation (12)
  • Evolution (2)
  • forth (29)
  • Lambda Calculus (9)
  • machine learning (2)
  • Metal (3)
  • pandemic (2)
  • Programming (12)
  • progress (4)
  • protocol oriented programming (2)
  • Puzzle cheats (1)
  • refactoring (6)
  • Simulation (3)
  • Spectrum (1)
  • Swift (4)
  • Uncategorized (2)
  • Z80 (7)
Blog at WordPress.com.
Sincere Flattery
Blog at WordPress.com.
  • Follow Following
    • Sincere Flattery
    • Already have a WordPress.com account? Log in now.
    • Sincere Flattery
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...