Skip to content

Commit

Permalink
docs + make gfxdemo require gfx
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotlinski committed May 21, 2019
1 parent 71b03ac commit c48b0d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
14 changes: 4 additions & 10 deletions docs/intro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@ \section{Forth, the Language}

\subsection{Why Forth?}

Forth is a unique language. What is so special about it? It is a very low-level and minimal language with its fair share of quirks and rough edges. At the same time, it is easy to scale it up to become a very high-level and domain-specific language, much like Lisp.
Forth is a unique language. What is so special about it? It is a small, low-level language, which can easily be extended to a high-level, domain-specific language that does anything you want it to do. Compared to C64 Basic, Forth is more attractive in almost every way. It is a lot faster, more memory effective, and more powerful.

Compared to C64 Basic, Forth is more attractive in almost every way. It is a lot faster, more memory effective, and more powerful.

Compared to C, the story is a little different. It's hard to make a fair comparison. Theoretically Forth code can be very memory efficient, and it's possible to make Forth code that is leaner than C code, but it is also true that cc65 code is generally faster than Forth code.

The main advantage of Forth is that the environment runs on the actual machine. It would not be a lot of fun to use a C compiler that runs on a standard C64, but with Forth, it's possible to create an entire development suite with editor, compiler and assembler that runs entirely on the C64.

Another advantage is that Forth has an interpreter. Compared to cross-compiling, it is really nice to make small edits and tweaks without going through the entire edit-compile-link-transfer-boot-run cycle.
Compared to C, the nice thing about Forth is that you can run the full development environment on your C64,
with text editor, compiler, assembler and debugger. It makes for a more interactive and fun experience than running a cross-compiler on PC.

For a Forth introduction, please refer to the excellent
\href{http://www.forth.com/starting-forth/}{Starting Forth} by Leo Brodie. As a follow-up, I
Expand Down Expand Up @@ -42,10 +37,9 @@ \section{Appetizers}

\subsection{Graphics}

The gfxdemo package demonstrates the high-resolution graphics, with some examples adapted from the book "Step-By-Step Programming C64 Graphics" by Phil Cornes.
The gfxdemo package demonstrates the high-resolution graphics, with some examples adapted from the book "Step-By-Step Programming C64 Graphics" by Phil Cornes.
Show the demos by entering:

\texttt{include gfx}
\texttt{include gfxdemo}

When a demo has finished drawing, press any key to continue.
Expand Down
1 change: 1 addition & 0 deletions forth_src/gfxdemo.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
\ examples from c64 step by step
\ programming, gfx book 3, phil cornes

require gfx
require rnd
require sin

Expand Down

0 comments on commit c48b0d8

Please sign in to comment.