F-Lower scripting language
F-Lower is a toy scripting language initially created as a learning project. As such it's limited and doesn't have clear goals yet. It started out as a clone of Ripen and retains key traits like string threading or the control structures. Otherwise F-Lower is much simpler, more like a Forth dialect.
Download
The latest version as of 10 April 2025 is 1.3.1 beta.
The source code (66K) builds on Haiku just fine. See also:
F-Lower is free and open source under the Artistic License 2.0; Free Pascal source code is included with all downloads. See inside for how to contact me.
Overview
See the manual page for how to use the interpreter. Otherwise, the basics are much like in Forth:
3.141592 constant PI
variable diagonal
: hypot dup * swap dup * + sqrt ;
3 4 hypot diagonal !
diagonal @ . cr
Note: F-Lower is case-sensitive and the data stack uses floating point!
2 3 < { ( Yay! ) cr } iftrue \ Parens print out text.
{ ( Ho! ) } 3 times cr /* Block comments are like in C instead. */
1 { ( Hey ) 1+ } while [ dup 3 <= ] repeat drop cr
Control structures on the other hand are more like in Logo. Note that code blocks of the same type can't nest!
For more details see the reference guide and the online API documentation.
A word on performance: until version 1.2 beta, F-Lower was several times slower than Ripen. Changing the dictionary implementation to a hash table brought them within 40% of each other, but F-Lower isn't going to win any prizes for speed. You can try this simple benchmark for fun:
variable a : nop ; 0 { dup 2 / 3 * 4 + 5 - a ! nop 1+ } 10000 times drop a @ . cr
To do
- Change semantics of
constant ✓
- Add
value and to words ✓
- Add
char word ✓
- Place
def_value into public API ✓
- Include recent additions in examples ✓
Frequently Asked Questions
- What was the point of creating F-Lower?
- Mainly it was a pretext to learn Free Pascal. This part was a success.
- What new insights did it yield?
- Forth does things a certain way for good reasons.