Live data from Hacker News

Finite State Machines in Forth (1995)

galileo.phys.virginia.edu

1–10 of 33 posts

Re: Finite State Machines in Forth (1995)

#2
With the veritable flurry of state machine posts today[0,1] I thought I'd (re)submit[2] one of my favorite posts on finite state machines in Forth.

The specific example is of number input routine allows signed decimal numbers without power-of-10 exponents (fixed-point, in FORTRAN parlance) and comes from the author's book Scientific Forth, where a fuller example is used ... to determine whether a piece of text is a proper identifier (that is, the name of a variable, subroutine or function) according to the rules of FORTRAN.

I originally heard of Scientific Forth from Programming in the Twenty First Century where it made a list of "Five Memorable Books about Programming"[3] with the following description:

Dr. Noble demonstrates how he uses Forth for hardcore matrix work and, when he realizes that RPN notation isn't ideal in all circumstances, develops a translator from infix expressions to Forth.

[0]: https://news.ycombinator.com/item?id=22746708

[1]: https://news.ycombinator.com/item?id=22748785

[2]: previously 3, 6 and 8 years ago, never any comments: https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...

[3]: https://prog21.dadgum.com/19.html

Re: Finite State Machines in Forth (1995)

#7
FSM is something I've always been curious about but I can't seem to find any good intro on. Does anyone have a good recommendations? I sort of don't want one tied to a specific language but rather one that helps me understand it from a conceptual level.

Thanks!

Re: Finite State Machines in Forth (1995)

#8
post #6

Earlier quoted context omitted.

Forth is mentioned in the title, do you really need to add that it's before the 2000's if that's the case? ;)

Forth is still alive and kicking!

Of course! Have friends who work with it on a daily basis. My comment was mostly tongue in cheek, didn't mean that Forth is completely dead. Usually when seeing Forth though, it's bit older stuff than say PHP. My friends for example, are stuck trying to refactor very old code, written in Forth.

Didn't mean no harm :)

Re: Finite State Machines in Forth (1995)

#9
post #7

FSM is something I've always been curious about but I can't seem to find any good intro on. Does anyone have a good recommendations? I sort of don't want one tied to a specific language but rather one that helps me understand it from a conceptual level. Thanks!

The first example is a machine with two states.

https://en.wikipedia.org/wiki/Finite-state_machine

From there you can deep dive into subjects like digital logic and automata theory.

Re: Finite State Machines in Forth (1995)

#10
post #7

FSM is something I've always been curious about but I can't seem to find any good intro on. Does anyone have a good recommendations? I sort of don't want one tied to a specific language but rather one that helps me understand it from a conceptual level. Thanks!

Any intro level logic design textbook should have a discussion of state machines. My copy of Bebop to the Boolean Boogie has a few pages about them. That's a good freshman level EE book.
Post reply on HN