Borg Examples

Pico Examples

These examples are standard pico programming examples. For a full list of possible natives and their usage, please go to
Recursive.borg - Some standard recursive functions like factorial and fibonacci.
QuickSort.borg - An illustration how to write a simple quicksort in borg.
BubbleSort.borg - An illustration how to write a simple bubblesort in borg.
MetaPico - An illustration how to write a pico evaluator in Pico.
Unify.borg - A unification operator. Takes two expressions and unifies them partially
AvlTree.borg - An implementation of an AVL Tree (also includes the delete operator !). An example how to use this can be found at AvlTreeDemo.borg

Borg Natives Examples

Display.borg - A test for the display operator
CoreTest - The entry to the core test. These files are made to check the correct working of the borg engine. Note: it is impossible to guarentee a correct working evaluator by just making the evaluator evaluate the CoreTest. Nevertheless, mind-bogling stupid bugs will/should be reported by this test.
Objects.borg - Illustrates how to create objects, how to inherit from them and how borg can be used for dynamic inheritance.
ObjectSieve.borg - Illustrates how we can change the behaviour of an object. In this example the behavioyur of the prime-filters is changed after initialisation.
Serialisation.borg - Explains the ser and deser operators. This example also illustrates how sandboxing can be done.
Persistency.borg - A slightly modified Serialisation example. We now use saveexp and loadexp instead of ser and deser. I'd like to change this example to illustrate how a complete agent can be stored and restored
Socketdemo.borg - A demonstration how to use the borg socket layer.

Borg Libraries

PalmWidgets.borg - The widget library for a Palm Pilot. This library is implemented for kborg and will be implemented for pborg. An example of the library can be found on PalmWidgetsTest.borg

Borg Distributed Programming Examples

JumpingFactorial.borg - The callculation of the factorial of 12, while jumping from one machine to another with the agentmove operator. This is an example of very fine grained migration, and reification of the computational state.
The sieve of Erathostenes - Various examples how to bujild a sieve of erathostenes..
SimpleTimer.borg - An illustration how to write a very simple timer.
AdvancedTimer.borg - An illustration how one agent can offer a set of timers to other agents using the sendmessage primitive.
SystemTimer.borg - An illustration how to use the build in system timer
WhiteBoard - An illustration how to write a whiteboard with disconnect -> continue/wait voting.
WebServer - The Webserver stub for borg applications
Scheduler - The scheduler application is a simple web-interface for some persons to schedule their time. This application exists as an ilustration how to build agents for the web. So beware. This is not the most powerful cyberscheduler. not yet documented
MeetingPlanner - MeetingPlanner application with GUI for KDE/Palm (using the Palm widget library). This application is going to be used as a case in different thesissen.

Bborg Jitcompilation and code generation

madd.borg - How to add a new native to a running borgsystem. Madd is special because is shows type overloading.
absorb.borg - How to use c-code and c-variables in a borg system. This example reifies a c structure.
hello.borg - Another kinky example of how to use c-code and c-variables. Actually this one uses C++ functions and qt. It will add the natives to borg needed to create and resize a qt-button. This example only works kbborg.