We passed Occam's razor on a few "features" of Prolog that are obsolete in modern programming environments and on some others that are, in our opinion, bad software practice.
Normally only one file at a time can be compiled in the interactive environment:
?-[myfile].
or
?- compile(myfile).
As BinProlog supports an include directive:
:-[include1]. :-[include2]. ....
this is probaly the best way to work, in a stateless always clean workspace.
BinProlog 5.75 allows consulting multiple files subject to dynamic recompilation (use dconsult/1 to get something close to SICStus/Quintus loading convention) or use command line switch l4 to have this as default behavior for reconsult (with shorthand file).
With dynamically recompiled consulted code, listing of sources and dynamic modification to any predicate is available while average performance stays close to statically compiled code (usually within a factor of 2-3).
This suggest to make a project *.pro file using a set of include directives each refereing to a *.pl file. When compiled to a file (by using the
?-make(MyProject).command) a make-like memoing facility will avoid useless recompilation of the included (*.pl) files by creation of precompiled (*.wam) files. For large projects this is the recommended technique. Creation of C-ified standalone files is also possible (see the pl2c directory).
Programs that work well can be added to the BinProlog kernel. This avoids repeated recompilation of working code and predicates in the kernel are protected against name clashing.
New programs can be loaded in the interactive environment. When they work well, they migrate to the kernel. You can prepare a good Makefile to automate this job. When everything is OK you can deliver it as a run-time-only application. Releases after 3.30 contain a basic make facility which avoids to recompile included *.pl files when a newer *.wam file exists.
Programs are searched with suffixes "", ".pl", ".pro" in the directories ., ../progs and ./myprogs.
There's no limit on the number of files you can compile to disk:
?- compile(wam,[file1,file2,...],'application.bp').
Now BinProlog does implement consult/1, reconsult/1 and listing/0 for interpreted code but use of compile/1 is highly recommended instead. See the file extra.pl for the implementation. Faster than asserted code is so called assumed code (see the next sections) i.e. intuitionistic and linear implication.
Here are some other limitations/features:
Mode is interactive by default (for compatibility with other Prologs) but if you use a modern, windows based environment you may want to switch it off with:
?- interactive(no).
or turn it on again with
?- interactive(yes).