Skip to content

NoDOM Forth

John O'Sullivan edited this page Oct 28, 2026 · 4 revisions

NoDOM has an embedded Forth subsystem: NoDOM Forth, or "NDF". Think of it as NoDOM's scripting system. JavaScript isn't suitable as the cost of crossing the JS/wasm boundary it too high. Consider the fin_server sample app for an example of NDF usage. Recall that the instruments table has "Sub" and "Unsub" buttons at it's foot. Those buttons enable and disable depending on which row of the table is selected.

Layout

{
    "rname":"Button",
    "widget_id":"i_am_sub_button",
    "cspec":{
        "text":"sub_text",
        "disabled":"ticker_symbols inst_sel_key in"
    }
},
{
    "rname":"Button",
    "widget_id":"i_am_unsub_button",
    "cspec":{
        "text":"unsub_text",
        "disabled":"ticker_symbols inst_sel_key in not"
    }
}

Both button widgets have cspec:disabled defined, but the expression on the RHS is not a simple reference. It's a Forth expression in Reverse Polish Notation. ticker_symbols and inst_sel_key are both elements in data; not and in are both operators, or words in Forth-speak.

Clone this wiki locally