String Database

SD, the Multivalue String Database

SD is a multivalue database in the Pr1me Information tradition. It contains open source code from the Open Source databases openQM and ScarletDME and open source code developed by the SD developers after the fork from ScarletDME. While it shares many of the same features, it was forked to explore some new ideas as to what a modern multivalue database should contain.

High level:

The SD system operates as a Virtual Machine. The system executes stored precompiled bytecode (objects) generated by a compiler (BCOMP) and interpreted by the Virtual Machine (Kernel). There is a little more discussion found in the quoted text in the pcode file section.

I like this synopsis: https://en.wikipedia.org/wiki/Interpreter_(computing)#Bytecode_interpreters

“There is a spectrum of possibilities between interpreting and compiling, depending on the amount of analysis performed before the program is executed. For example, Emacs Lisp is compiled to bytecode, which is a highly compressed and optimized representation of the Lisp source, but is not machine code (and therefore not tied to any particular hardware). This “compiled” code is then interpreted by a bytecode interpreter (itself written in C). The compiled code in this case is machine code for a virtual machine, which is implemented not in hardware, but in the bytecode interpreter. In a bytecode interpreter each instruction starts with a byte, and therefore bytecode interpreters have up to 256 instructions, although not all may be used. Some bytecodes may take multiple bytes, and may be arbitrarily complicated.”

Also see:

<https://en.wikipedia.org/wiki/Bytecode> (Pick BASIC is listed as an example)

<https://en.wikipedia.org/wiki/P-code_machine>

<https://en.wikipedia.org/wiki/Stack_machine>

Major Components / Subsystems:

Written in C:

SD - SD Main Executable ../sdsys/gplsrc/qm.c

KERNEL - Virtual Machine ../sdsys/gplsrc/kernel.c

Written in BASIC and interpreted via the Kernel:

CPROC - Interactive Terminal Command Processor ../sdsys/GPL.BP/CPROC

APISRVR - SDCLIENT Command processor ../sdsys/GPL.BP/APISRVR

BASIC - BASIC compiler ../sdsys/GPL.BP/BCOMP

Other Notes:

The OP Code Object

Network Connections, stdin, stdout and xinetd

Special Notes on BASIC compile of internal modules.

Program Variables (Virtual Machine).

User Table.

Evaluation Stack.

SD Extension Project.