Docendo
discimus
Business Rules Technology and Rule-Based Systems

"Inference Engines for Everyone"

Aut inveniam
viam aut faciam
Home News About This Site All Pages All Tags Wiki

BitWiseHome

Original Home of the BitWiseApps Wiki

What This Site Is About, I think

This site is something like a personal quest to implement and perhaps popularize a set of techniques I'm calling Binary Logic Applications.

These techniques can seem very strange at first, maybe working around ones elbow to get to ones thumb, but they can produce very small, quick and, after some fairly tortuous debugging, very stable applications.

New Components

IOEngine

The prototype of IOEngine is a minimal Event-Condition-Action logic engine driving state transitions by triggering state-changing actions defined in an IOMap. IOEngine drives an IOMap, similar to a multi-step process engine.

The basic flow is from:

- a values dictionary binding external values 'out there in the world' ->

- to boolean evaluations of conditions using the values ->

- to actions using the conditions as triggers to perform the action, which then alter the source values in a closed loop fashion.

The forward mapping 'event' is a change of a value in the values dictionary.

See the IOEngine page.

IOMapper

A module for generalizing external bind requests, saving a lot of gory details about call structure and parameters. With a little logic thrown into the mix, it should provide a foundation for a fairly simple process engine.

See the IOMapper page.

Existing Components

  • vdict.py - VolatileDict class for tracking rapid changes to a dictionary. Can also declared read-only keys, write once only.
  • tuplestore.py - a column-oriented data store with:
    • a generalized structure for csv style lists
    • column name and default values
    • an indexing store for lists and tuples
    • can emit tuples from list structures
  • tablestore.py - TableStore is a column-oriented relational data store based on TupleStore with:
    • validation of Python types.
    • unique key constraints allowing access by name key rather than list-like slot access.
    • when used as part of a DataStore, maintain parent/child key relations between tables.
    • persistent storage using JSON, restoring lost tuple and namedtuple types.
  • A collection of tools and utilities, such as ( mostly ) optimized bitwise utilities, gentools ( derived from itertools ) and other modules to fill in for Python modules missing in MicoPython.
    • bitlogic.py - development/debugging tools and bit logic idioms.
    • bitslice.py - manipulation of binary integers, performing 'bit surgery'.

Future Directions

  • major improvements to IOEngine and IOMapper, such as exception handling and more powerful wrappers. Extension to handle async calls ???
  • major improvements to ListStore and TableStore, including better APIs, queries and indexing ... and debugging, they are in there, I can smell them.
  • Applications and examples of small, quick applications, primarily for limited resource micro-controllers such as the Raspberry Pi Pico and the ESP32 but runnable on full Python (3.9+). A good example of of another "One Python" project is microdot. They have some good solutions for Python/MicroPython compatibility issues, 'print_exception" for instance.


Other BBcom-related sites - Quick Links