[go: up one dir, main page]

Menu

[80c337]: / packages / README.txt  Maximize  Restore  History

Download this file

26 lines (21 with data), 1.7 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

For the definition of a "Lurch library," see the README.txt document in trunk/libraries.
A package is a library that's been hard-coded into the application itself to improve
performance.  It's a virtual document that can be used as a dependency, but whose features
are implemented in C++ (and thus compiled to machine code) instead of in JavaScript.

However, some packages have a percentage of their code still written in JavaScript, and thus
for many .h and .cpp files in this directory, you will see corresponding .js files that
they import.  This is for various reasons.
    - Some packages were easier to *first* implement in JavaScript, and can later be
      moved over to C++ code when performance becomes an issue.  Such packages may still
      be in an intermediate state awaiting later performance improvements as needed.
    - Some packages are most sensibly implemented in a hybrid C++/JavaScript way,
      implementing only the performance-critical portions in C++, and using JavaScript to
      make the implementation of the rest of the functions easier and simpler.
    - Some packages *needed* to be implemented half-and-half.  There are some things
      that it is very ugly to do in C++ but simple to do in script, thus necessitating
      script; there are some things it is not possible to do in script but are possible
      in C++, thus necessitating C++.

If you need to write a new package, it's useful to start by implementing it all in script,
in a .js file, and then running js2pkg.sh (in this folder) on that Javascript file, to create
a wrapper .h,.cpp file pair.  You can then selectively move some routines out of script and
into C++, as needed.