User Tools

Site Tools


distributing_20crunched_20libraries

Distributing crunched libraries

by Richard Russell, March 2010

The libraries distributed with BBC BASIC for Windows are supplied in their original source form. This is mainly because an experienced BBC BASIC programmer might want to examine their code for ideas, or base new libraries on them. Admittedly, most of the supplied libraries contain 'terse' code, and are only minimally commented (mainly for reasons of speed and so they will fit in the trial version), but they are at least editable and readable to a degree.

The author of a 'third-party' BBC BASIC for Windows library might be equally happy to distribute it in the original source form, but sometimes he may prefer to supply it 'pre compiled' (in other words 'pre crunched'). The potential advantages of doing so are that the library is smaller, runs more quickly (even when used in the context of the IDE rather than a standalone executable) and the IPR (Intellectual Property Rights) of the author are better protected because the code is uncommented and is harder to read.

To distribute a 'pre crunched' library one can use the technique described at Using the built-in program cruncher, or otherwise, to extract the crunched code into a separate file. Note that although crunched code can be loaded into the editor and viewed, it cannot in general be modified (spaces necessary to ensure correct parsing may have been removed).

There are some significant compatibility issues associated with distributing a 'pre crunched' library (even if it has been developed fully in accordance with the recommendations at Guide to writing libraries):

  1. The procedures and/or functions intended to be called from outside the library must retain their 'advertised' names.
  2. The name of a procedure or function in the library must not clash with the name of a procedure or function in the main program (even if also crunched).
  3. The name of a 'local' variable in the library must not clash with the name of a global variable in the calling program, since this can cause problems with asynchronous interrupts (e.g. ON TIME, ON SYS).


The practical upshot of this is that the Abbreviate names option should normally be disabled when pre-crunching a library.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
distributing_20crunched_20libraries.txt · Last modified: 2024/01/05 00:22 by 127.0.0.1