compiling a hope interpreter

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • wooks

    #1

    compiling a hope interpreter

    Sorry if this is very basic.

    I have bought a Functional Programming book that uses the language
    Hope.
    I have managed to locate and extract Ross Pattersons hope interpreter
    from http://www.soi.city.ac.uk/~ros s/Hope/

    However it seems what I have got is the C source code and I haven't got
    a clue what to do with it.

    Can someone step me through what i need to do to get the ball rolling -
    I am on Windows XP and the docs seem to be written for a unix bod who
    knows what he is doing.

  • Eric Lavigne

    #2
    Re: compiling a hope interpreter

    >Can someone step me through what i need to do to get the ball rolling -[color=blue]
    >I am on Windows XP and the docs seem to be written for a unix bod who
    >knows what he is doing.[/color]

    This "unix bod" would only need to know that he should look in the
    INSTALL file if he wants to install something. It would then give him
    the simple instruction to type "make install" It's only non-unix folks
    that have to know what they are doing :-)

    The first thing I would try, to get this interpreter working, would be
    to install cygwin. cygwin is a unix emulator, so you should be able to
    follow the installation instructions from a cygwin prompt, just as unix
    folks can follow them from a unix prompt.
    [color=blue]
    >I have bought a Functional Programming book that uses the language
    >Hope.
    >I have managed to locate and extract Ross Pattersons hope interpreter
    >from http://www.soi.city.ac.uk/~ros s/Hope/[/color]

    Alternatively, try a different language. Do you have reason to be
    attached to this particular language or book? The usual language for
    teaching functional programming is Scheme. There are many easy to
    install interpreters (and compilers). There is an active community that
    you can tap into at comp.lang.schem e. There are also plenty of
    functional programming books that you could use, including the Wizard
    Book, which is available online at
    http://mitpress.mit.edu/sicp/full-text/book/book.html

    Comment

    • wooks

      #3
      Re: compiling a hope interpreter


      Eric Lavigne wrote:[color=blue][color=green]
      > >Can someone step me through what i need to do to get the ball rolling -
      > >I am on Windows XP and the docs seem to be written for a unix bod who
      > >knows what he is doing.[/color]
      >
      > This "unix bod" would only need to know that he should look in the
      > INSTALL file if he wants to install something. It would then give him
      > the simple instruction to type "make install" It's only non-unix folks
      > that have to know what they are doing :-)
      >[/color]

      Well I did get that far but make install didn't make sense in windows
      hence I asked the question.
      [color=blue]
      > The first thing I would try, to get this interpreter working, would be
      > to install cygwin. cygwin is a unix emulator, so you should be able to
      > follow the installation instructions from a cygwin prompt, just as unix
      > folks can follow them from a unix prompt.
      >[/color]

      I have installed cygwin. I have moved the hope directory to be beneath
      the home directory that cygwin created for me (I presume that was the
      right thing to do).

      When I type make install it says
      bash: make: command not found.

      .......

      Here is what the INSTALL file says maybe u see what I mean ... it does
      seem a bit terse.

      INSTALLATION PROCEDURE

      Unix:
      make install

      That will put everything under /usr/local. If you want them somewhere
      else, set configure_args in the top-level Makefile.

      Others:
      - you will need to adjust hopelib.h for the target machine.
      - copy *.[hc] and ../lib/*.hop to your machine.
      - bash it till it fits.

      The Hope error message:
      fatal error - can't read module 'Standard'
      indicates a slip-up in hopelib.h.

      VARIABLES

      You might wish to (un)define the following cpp variables:

      REALS num.h represent numbers as double, rather than long.
      STATS runtime.c produce statistics on space usage and the
      garbage collector.
      STATS interpret.c produce statistics on expressions entered.

      There are also a number of variables in print.h which control the way
      expressions, values and types are parenthesized on output.

      You might also wish to adjust the variable MEMSIZE (in memory.c), which
      controls the amount of data space used.

      OTHER FILES

      NOTES maintenance notes
      HISTORY revision history

      [color=blue][color=green]
      > >I have bought a Functional Programming book that uses the language
      > >Hope.
      > >I have managed to locate and extract Ross Pattersons hope interpreter
      > >from http://www.soi.city.ac.uk/~ros s/Hope/[/color]
      >
      > Alternatively, try a different language. Do you have reason to be
      > attached to this particular language or book?[/color]

      Yes. I paid good money for it.

      Seriously I wish it used a different language but it doesn't I don't
      want the complication of simultaneously learning a new programming
      paradigm and having to translate into another language to follow the
      text or do the exercises.
      [color=blue]
      > The usual language for
      > teaching functional programming is Scheme. There are many easy to
      > install interpreters (and compilers). There is an active community that
      > you can tap into at comp.lang.schem e. There are also plenty of
      > functional programming books that you could use, including the Wizard
      > Book, which is available online at
      > http://mitpress.mit.edu/sicp/full-text/book/book.html[/color]

      Yep am learning scheme and keep dipping into HTDP. But I am bloody
      minded enough to want to read this book .... first couple of chapters
      are quite readable.

      So thank you for your help so far ..... if you can get me over the next
      hump I'll be very grateful.

      Comment

      • Eric Lavigne

        #4
        Re: compiling a hope interpreter

        >I have installed cygwin. I have moved the hope directory to be beneath[color=blue]
        >the home directory that cygwin created for me (I presume that was the
        >right thing to do).[/color]
        [color=blue]
        >When I type make install it says
        >bash: make: command not found.[/color]

        make is a unix program. You need it. It is almost certainly included by
        default in cygwin, so this error message means there is something wrong
        with your cygwin installation. The first thing I would do is search
        (windows start menu) for "make" and see if there is a file called make
        somewhere on your computer (probably buried somewhere in the cygwin
        folder). If you have it, then maybe there is some environment variable
        that you need to set in order to use it. There should be some sort of
        installation instructions that came with cygwin that would help you
        through this issue.

        Comment

        • Keith Thompson

          #5
          Re: compiling a hope interpreter

          "Eric Lavigne" <lavigne.eric@g mail.com> writes:[color=blue][color=green]
          >>I have installed cygwin. I have moved the hope directory to be beneath
          >>the home directory that cygwin created for me (I presume that was the
          >>right thing to do).[/color]
          >[color=green]
          >>When I type make install it says
          >>bash: make: command not found.[/color]
          >
          > make is a unix program. You need it. It is almost certainly included by
          > default in cygwin, so this error message means there is something wrong
          > with your cygwin installation. The first thing I would do is search
          > (windows start menu) for "make" and see if there is a file called make
          > somewhere on your computer (probably buried somewhere in the cygwin
          > folder). If you have it, then maybe there is some environment variable
          > that you need to set in order to use it. There should be some sort of
          > installation instructions that came with cygwin that would help you
          > through this issue.[/color]

          <OT>
          The Cygwin installer provides a multitude of options for what you want
          to install. I don't remember whether "make" is included by default.
          You may have to go through the menus in the installer to be sure that
          you install "make" and whatever else you need. There doesn't seem to
          be an easy way to tell it to install everything.

          See www.cygwin.com for a pointer to the mailing list where this is
          topical.
          </OT>

          --
          Keith Thompson (The_Other_Keit h) kst-u@mib.org <http://www.ghoti.net/~kst>
          San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
          We must do something. This is something. Therefore, we must do this.

          Comment

          • mensanator@aol.com

            #6
            Re: compiling a hope interpreter


            Keith Thompson wrote:[color=blue]
            > "Eric Lavigne" <lavigne.eric@g mail.com> writes:[color=green][color=darkred]
            > >>I have installed cygwin. I have moved the hope directory to be beneath
            > >>the home directory that cygwin created for me (I presume that was the
            > >>right thing to do).[/color]
            > >[color=darkred]
            > >>When I type make install it says
            > >>bash: make: command not found.[/color]
            > >
            > > make is a unix program. You need it. It is almost certainly included by
            > > default in cygwin, so this error message means there is something wrong
            > > with your cygwin installation. The first thing I would do is search
            > > (windows start menu) for "make" and see if there is a file called make
            > > somewhere on your computer (probably buried somewhere in the cygwin
            > > folder). If you have it, then maybe there is some environment variable
            > > that you need to set in order to use it. There should be some sort of
            > > installation instructions that came with cygwin that would help you
            > > through this issue.[/color]
            >
            > <OT>
            > The Cygwin installer provides a multitude of options for what you want
            > to install. I don't remember whether "make" is included by default.[/color]

            It isn't. I ran into the same problem trying to install GMP.
            Unfortunately, I don't recall exactly what all the missing pieces
            were. Definitely m4 in addition to make.

            But here's my setup log from Cygwin. Perhaps the OP can compare
            his setup log to see what I've got that he doesn't.

            2005/05/28 16:37:30 Visited: 101 nodes out of 559.
            2005/05/28 16:37:30 Dependency ordered install:
            2005/05/28 16:37:30 ash
            2005/05/28 16:37:30 aspell
            2005/05/28 16:37:30 aspell-en
            2005/05/28 16:37:30 base-files
            2005/05/28 16:37:30 base-passwd
            2005/05/28 16:37:30 bash
            2005/05/28 16:37:30 bc
            2005/05/28 16:37:30 binutils
            2005/05/28 16:37:30 bzip2
            2005/05/28 16:37:30 coreutils
            2005/05/28 16:37:30 crypt
            2005/05/28 16:37:30 cygutils
            2005/05/28 16:37:30 cygwin
            2005/05/28 16:37:30 cygwin-doc
            2005/05/28 16:37:30 diffutils
            2005/05/28 16:37:30 editrights
            2005/05/28 16:37:30 expat
            2005/05/28 16:37:30 findutils
            2005/05/28 16:37:30 fontconfig
            2005/05/28 16:37:30 freetype2
            2005/05/28 16:37:30 gawk
            2005/05/28 16:37:30 gcc
            2005/05/28 16:37:30 gcc-core
            2005/05/28 16:37:30 gcc-g++
            2005/05/28 16:37:30 gcc-mingw-core
            2005/05/28 16:37:30 gcc-mingw-g++
            2005/05/28 16:37:30 gdbm
            2005/05/28 16:37:30 gettext
            2005/05/28 16:37:30 gmp
            2005/05/28 16:37:30 gnuplot
            2005/05/28 16:37:30 grep
            2005/05/28 16:37:30 groff
            2005/05/28 16:37:30 gzip
            2005/05/28 16:37:30 less
            2005/05/28 16:37:30 libaspell15
            2005/05/28 16:37:30 libbz2_1
            2005/05/28 16:37:30 libcharset1
            2005/05/28 16:37:30 libdb4.2
            2005/05/28 16:37:30 libfontconfig1
            2005/05/28 16:37:30 libfreetype26
            2005/05/28 16:37:30 libgd2
            2005/05/28 16:37:30 libgdbm
            2005/05/28 16:37:30 libgdbm-devel
            2005/05/28 16:37:30 libgdbm3
            2005/05/28 16:37:30 libgdbm4
            2005/05/28 16:37:30 libiconv
            2005/05/28 16:37:30 libiconv2
            2005/05/28 16:37:30 libintl
            2005/05/28 16:37:30 libintl1
            2005/05/28 16:37:30 libintl2
            2005/05/28 16:37:30 libintl3
            2005/05/28 16:37:30 libjpeg62
            2005/05/28 16:37:30 libncurses5
            2005/05/28 16:37:30 libncurses6
            2005/05/28 16:37:30 libncurses7
            2005/05/28 16:37:30 libncurses8
            2005/05/28 16:37:30 libpcre
            2005/05/28 16:37:30 libpcre0
            2005/05/28 16:37:30 libpng12
            2005/05/28 16:37:30 libpopt0
            2005/05/28 16:37:30 libreadline4
            2005/05/28 16:37:30 libreadline5
            2005/05/28 16:37:30 libreadline6
            2005/05/28 16:37:30 libXft
            2005/05/28 16:37:30 libXft1
            2005/05/28 16:37:30 libXft2
            2005/05/28 16:37:30 login
            2005/05/28 16:37:30 m4
            2005/05/28 16:37:30 make
            2005/05/28 16:37:30 man
            2005/05/28 16:37:30 mingw-runtime
            2005/05/28 16:37:30 mktemp
            2005/05/28 16:37:30 ncurses
            2005/05/28 16:37:30 openssl
            2005/05/28 16:37:30 pcre
            2005/05/28 16:37:30 pcre-doc
            2005/05/28 16:37:30 perl
            2005/05/28 16:37:30 python
            2005/05/28 16:37:30 readline
            2005/05/28 16:37:30 ruby
            2005/05/28 16:37:30 sed
            2005/05/28 16:37:30 tar
            2005/05/28 16:37:30 tcltk
            2005/05/28 16:37:30 termcap
            2005/05/28 16:37:30 terminfo
            2005/05/28 16:37:30 texinfo
            2005/05/28 16:37:30 w32api
            2005/05/28 16:37:30 which
            2005/05/28 16:37:30 X-startup-scripts
            2005/05/28 16:37:30 xorg-x11-base
            2005/05/28 16:37:30 xorg-x11-bin
            2005/05/28 16:37:30 xorg-x11-bin-dlls
            2005/05/28 16:37:30 xorg-x11-bin-lndir
            2005/05/28 16:37:30 xorg-x11-etc
            2005/05/28 16:37:30 xorg-x11-fenc
            2005/05/28 16:37:30 xorg-x11-fnts
            2005/05/28 16:37:30 xorg-x11-libs-data
            2005/05/28 16:37:30 xorg-x11-xwin
            2005/05/28 16:37:30 xterm
            2005/05/28 16:37:30 zlib


            [color=blue]
            > You may have to go through the menus in the installer to be sure that
            > you install "make" and whatever else you need. There doesn't seem to
            > be an easy way to tell it to install everything.
            >
            > See www.cygwin.com for a pointer to the mailing list where this is
            > topical.
            > </OT>
            >
            > --
            > Keith Thompson (The_Other_Keit h) kst-u@mib.org <http://www.ghoti.net/~kst>
            > San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
            > We must do something. This is something. Therefore, we must do this.[/color]

            Comment

            • wooks

              #7
              Re: compiling a hope interpreter

              I have found the cygwin FAQ and hopefuly will go on from there.

              Thanks for all the help.

              Comment

              Working...