home *** CD-ROM | disk | FTP | other *** search
- Archimedes notes
- ----------------
-
- This is a port of the Bin Prolog interpreter to the acorn archimedes.
- It is small (bytecode interpreter is a mere 28k stripped..),
- fast (c. 130Klips on RPC600 (allegedly a sparc 20 does 800 odd klips))
- [actually you sink down to a mere 60 odd klips if you run it in a task-
- window...], and has some novel features (blackboards, DCGs, bestof).
-
-
- Running BinProlog
- -----------------
- Double clicking on the icon does one of two things - either runs binprolog
- full screen or simply in a taskwindow - uncomment whicher line you like
- in !BinPro.!Run .
-
- [Actually, there are two aliases
- o bp
- runs bin prolog full screen
- o bpw
- runs bin prolog in a taskwindow...
- ]
-
-
- Loading Prolog sources
- ----------------------
- See !BinPro.!Boot for where it looks for things.
- It'll also happily cope with the likes of
-
- ?- ['$.languages.binpro.!binpro.library.high'].
-
- to load things specified by full pathnames.
- Note, there is a difference between the following syntaxes :
-
- ?- ['foo']. % load and compile foo
- ?- consult('foo'). % consult foo
-
- This becomes apparent when you try listing/0 after compiling -
- the first syntax means no listing appears, using consult means that you
- do get a listing of what you just loaded into working memory (much like
- any other prolog).
-
-
- Memory requirements
- -------------------
- Basic is about 1.6Meg. Running small stuff won't add onto this significantly,
- however read on...
- Benchmarks and suchlike are designed for maximum horridness towards
- memory usage and assume you are running on a unixalike workstation and hence
- have ungodly amounts of memory.
- Therefore - if you are running the benchmarks and get errors from
- binprolog about heaps being corrupted or suchlike - this means it has run
- out of memory...
- However, if you give it a tad more (along the lines of a couple of meg....
- upwards to about 5 which stops it complaining about all but the really
- nasty combinatorial problems), then it ceases to complain.
-
- Moral of the story is essentially expect to get useful work done in it,
- but don't expect the benchmarks to always run, unless you have heaps of
- memory.
- (I suspect this doesn't garbage collect its heap.....yet - it might
- improve in future?)
-
-
- Things to note
- --------------
- 1.
- get/1 and get0/1 get(I) behaves much as you might expect - only
- succeeds when you have typed a valid printable
- character, followed by return.
-
- get0(I) behaves slightly differently to what you
- might expect - it succeeds with any character,
- which is correct as far as I understand it, but it
- also needs to be followed by return like get/1.
- I've seen a few other prologs that succeed
- immediately with get0 and don't wait for return;
- however I cannot see from the sources how it would
- do this under unix as there is no terminal handling
- code to put it into cbreak mode or similar.
- In short - it works but behaves to my mind
- slightly curiously....(watch this space - I may
- fix it after talking to the author).
-
- 2.
- Timing is disabled due to it using unixy timing functions that the Arc
- hasnt got - might fix. Doesnt hurt not to have?
-
- 3.
- I've re-bootstrapped this to look for files in more archi specific places
- and with less horrid file extensions - see the !BinPro.!Boot file
- for what and wherefor.
-
- 4.
- However, it does successfully rebootstrap itself; which is surely some
- indication that it is correct? ;-)
-
- (If you are interested in re-bootstrapping it / fiddling with the internals,
- then get the boot sources, put these in a directory called 'boot' and
- peer at !BinPro.bootstrap for how to get it going -> the docs arent
- entirely correct with the description - it uses compile0 and NOT compile...)
- [changed as of 3.09..]
-
- 5.
- Dont end your prolog sources on the end of a line - it requires a blank
- line before the end of file or it will whinge at you.
-
- 6.
- If you have prolog sources that have embedded loads in, it tends to get upset
- due it allowing only one compiled file loaded - getting around this is to
- use a file to load all the other files you want loaded - along the lines of
-
- /* load other files */
- :-module(prolog).
- :-['a']. % load in 'a'
- :-['b']. % load in 'b'
- :-['c']. % load in 'c'
- :-module(user).
-
- Note - this also brings up another point; if you have prolog sources that use
- ?- whatever.
- inside them to execute rules whilst loading, change them to
- :-whatever.
- and then it seems to behave itself.
-
- 7.
- Due to my relaxing the filename extensions looked for, it is possible using
- the cmake/1 command to get it stuck in a loop reloading itself.
- Solution - name the project file differently to anything it includes, or
- explicitly end your project filenames in _pro.
-
- 8.
- make_appl does now actually work okay - however you'll probably need all
- of the boot sources required and the thing you wish to make an app out of
- in the current directory before trying to get it to work...
- (Gives errors about functions left unlinked but does actually run the
- traditional 'hello world' example correctly - probably wouldn't give
- errors about unlinked functions if it had more of the bootstrap sources
- included...)
-
- 9.
- (And there was me thinking I had found a bug ;-)
- If you load in a file using compile, i.e.
- ?- ['foo'].
- and then consult it thereafter, i.e.
- ?- consult('foo').
- You will get some rather odd effects - try this with some facts and
- findall/3 to gather up all the possibilities and you might see what I
- mean.
- Solution is to remember to use restart/0 if you want to use consult after
- compile. (In actual fact, you should get a warning about interpreted code
- shadowing compiled code which will give you a hint strange things might
- happen)
- (This is of course not a problem if you are using different files, merely
- if you try it on the same one).
-
-
-
- Thanks to Paul Tarau for letting me in on the sources.
-
-
- Comments / bug reports / postcards to
-
- snailmail:
- al slater
- kintail,
- barclay park,
- aboyne,
- aberdeenshire.
- ab34 5jf.
-
- email:
- ams@csd.abdn.ac.uk ; ok til june 95.
-
-
- hope someone finds it useful,
-
- cheers,
- al.
- 13/2/95
-
- [PPS - before anyone remarks that this appears not to be the standalone
- version as per the previous release....the machine generated C from
- the prolog bootstrap sources breaks _every_ compiler I have ...
- ]