/gofer

Experiments for running in browser

Primary LanguageC

gofer

This gofer is a fork of Mark Jones original with some additions and modifications, the most visible one being the Dijkstra dot for function application. See Notational Conventions – pg 8 onwards.

I used to call it pugofer since I was using it to teach when at Pune University in the early 90s.

Mark Jones is gratefully acknowledged for this pioneering work.

Setup

See installation/setup

Sample

To see how source looks with these changed syntaxes, look at the standard prelude: pustd.pre.

The alternate prelude pusimple is particularly neat for those who feel the need to grok Hindley-Milner before getting into typeclasses. With that you’ll get, for example:

? :t (+)
(+) : Int -> Int -> Int
? :t (==)
(==) : a -> a -> Bool

Syntax late-bound

You can switch back to classic Haskell syntax with :s -S

? map.(1+).[1,2,3]
[2, 3, 4] : [Int]

? :s -S
? map (1+) [1,2,3]
[2, 3, 4] :: [Int]

Building

  • cd src
  • Choose the architecture near line 25 following prelude.h
    Exactly one LINUX, WIN32 or NETBSD (for MacOS) should be 1; all the rest should be 0
  • If necessary, choose C compiler – CC – in Makefile
  • $ make

There is no configure to run.
Windows seems to build with mingw for 32 bit but not 64.

Literature

Justifications for these changes are explained in Notes on Notation

Also may be of interest:

Evidently at the end of his life Dijkstra did support FP