Skip to content
Bushmills edited this page Jan 12, 2022 · 31 revisions
  • concepts:

    • (optional) forward references
    • not exactly a purely incremental compiler
      • semicolon triggers compilation. Up to then are words only buffered.
        This allows the compiler to do post processing the word, useful for
        • replacing code sequences against more efficient functional equivalents.
        • delegating some compilation tasks from words to post processing.
          For example, create ... does> defining words are ripped apart by the post processor. The run time "does>" part is stored separately, to give the define time words semantics applicator easier access to run time code. Mind you, this is bash targeted, which doesn't allow to simply point instruction pointer inside of a function.
  • specific words where deviating from ANS:

    • <#
      expects single, not double.
      yoda doesn't know doubles and has no support for those
    • / mod /mod are truncating, not floored
      This may change, though
    • query
      doesn't exist. Instead there's query$ which utilises string stack to store input.
    • evaluate
      not exposed. Instead, evaluate$ takes input from string stack (where query$ puts it)
    • abort, ?abort
      most likely somewhat different
    • quit
      can't do a "real" warm start. It just - optionally - empties stacks, then nests to a new instance of quit. Not a problem as long as it loops in its infinite loop, but you may want to avoid tapping ctrl-c thousands of times).
    • words
      without user defined vocabularies, words can't display words in only the context vocabulary, as there is none. "context vocabularies" do exist, but not as named vocabularies, made context by executing them. Therefore will words just display words in all populated vocabularies (4 exist, but not all of them are necessarily populated), each vocabulary under a header displaying its purpose: stateless, interpret, compile and unresolved.
    • r> >r
      return stack is not used to hold return addresses. yoda won't complain if "return stack" is used in an unbalanced way.
    • parse ( c -- ) ( string: -- $1 )
      parses input for delimiting character with ASCII c and places parsed portion as top item on string stack
    • convert, uconvert ( n / u -- ) ( string: -- $1 )
      convert signed or unsigned numeric n or u to string, pushed to string stack
    • from / from$ include yoda source code
      While from parses a space delimited string from input, from$ takes file name from string stack.
      Files without slash in their name are searched for through list of library dirs (configuration item).
      from works nicely with forward referenced items in resolving library files which aren't conditionally
      included from postlib: need word from libfile

Clone this wiki locally