Friday, 19 December 2014

Programming with LLDB

Some notes on poking around with LLDB programatically.

Build

Building on OSX was a bit of a pain - use `./configure` then `make` as suggested here, but to build the debugserver you need to open and build debugserver from tools/debugserver. You'll need to set up code signing like this.

LLDB Text API

Start with  `lldb`

Has a Complete API - complex to parse responses programatically, no way to tie a response to the commnd that triggered it.

A ruby example invoking the lldb text api https://gist.github.com/jorj1988/e6c3df64199b6932f39d

LLDB Machine Interface

Start with `lldb-mi --interpreter`

Incomplete API (seemed to be missing a reasonable amount of commands?), easier to tie responses to commands. Still requires parsing. 


C++ Interface

Include `include/lldb/API`, link to `liblldb.dylib`

Has a stable api here. Example here.


Python Interface

Mirrors C++ API. Example of usage here.


Summary

The python API seem like the most sensible option for interacting with LLDB... But I don't think I want to program a large project in python - maybe C++?

Saturday, 8 October 2011

Databases and file formats

The database is the core of Synapse, allowing it to save and load data, undo and redo, and generate user interfaces automatically from user defined nodes. Synapse 1 used an XML file format, and used a database system written specifically for Synapse (called Alter), this system was written quite quickly in order to get Synapse going, and had some relatively major flaws.

With more time to write Synapse 2 the database system has been rewritten to give several key improvements:

Smaller Components
Alter has now been split into several core libraries, initially it was an application framework with a database built in, now Alter is only an application framework. The database component initially built into Alter is now Shift, with a sub component of Graphics related data types.

The entire source for Alter is only a few files, all it really does is load some plugins. Its quite neat, but is also one of the areas I think needs a bit more work before its finished. However, it completes its purpose for now of providing a base for all the other components to work from.

Speed
Synapse 1 was bad at handling itself when loading large files, especially when creating and deleting a lot of data. We are now supporting a range of file formats, aiming for much improved speed and readability, all faster than the original XML format. The main format planned for use is currently not finalised, but will most likely be JSON.

Flexibility
Synapse 1 was based heavily on Qt's data types, and while we still rely on Qt at the core of Shift for string types and containers, data types are now stripped away from Qt, are much more efficient and flexible too.

The basic data type in Shift is the property (called an attribute in Alter 1), we then build on these properties by adding more functionality in derived classes until we have an Entity, similar to Alter 1, an Entity holds a bunch of properties/attributes and can also have child Entities. This flexibility to store anything in a property, including other properties makes Shift much more powerful than the previous version of Synapse.


Scripting
Properties are exposed at a low level to the script system (currently built around Qt's javascript system). Creating editing and displaying these entities should be really simple and quick in the built in script editor. You can even define your own scripted Property types inside shift through script, for example you could add your own Number type, if you felt like that. This core support for your own types will later support defining your own types of Synapse node through exactly the same API.


Document Structure
The latest work going on for Synapse 2 is the Part and Document interfaces, a document is any file you may have open in Alter, so for example, you could open a Synapse composite, that is a document. You could also open a Synapse Node, and edit its contents, that is a Document too. Saving the node document will (in theory) automatically edit and replace any nodes in any document you've used it in. automatically. The node document is also a Part, as it has defined inputs and outputs, and is conceptually a reusable piece of node structure.


So, thats a quick summary of how everything might work in Synapse 2, its obviously not doing much right now, but very soon the Document work will come down to the development branch, and the work on the document editors can start.

Saturday, 24 September 2011

Introduction

This is a development blog for vexx, a project which aims to make designing and creating 2d and 3d manipulation applications easier to produce. We released synapse in early 2010 a package for manipulating image and video streams. Since then we have been working on making synapse better with more animation and curve controls, less dependance on OpenGL and much more. We are also working on other projects, which support synapse internally. More news and dev info as I go.