-
Notifications
You must be signed in to change notification settings - Fork 0
A naive very incomplete Forth interpreter for teaching myself some Swift
License
nthery/NotQuiteForthInSwift
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A naive very incomplete Forth interpreter hacked to teach myself some Swift. DISCLAIMER: I have never programmed in Forth. Forth reference used: http://www.forth.com/starting-forth/. XCode 6.1 used. FEATURES ======== * read-eval-print loop. * Forth API (ForthEvaluator.eval()). * Pushing integers on stack. * Addition, subtraction, multiplication and division. * Defining new words. * IF ELSE THEN. * EMIT. * CR. See tests for usage. DESIGN ====== Forth source statements are compiled into instructions for a virtual machine by the Compiler class. Compilation occurs when defining new words but also in immediate mode. The VM class interprets virtual machine code. The ForthEvaluator class coordinates the compiler and VM. BACKLOG ======= TODO: test stack level at end of tests TODO: add support for while loops TODO: add support for more primitive Forth words TODO: test recursivity (fibonnacci) TODO: add support for strings TODO: add support for arrays and pointers
About
A naive very incomplete Forth interpreter for teaching myself some Swift
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published