+---------------------+
| ┏ |
| ┏┓┏┓╋┏┓ |
| ┗┛┣┛┛╹┗ |
+---------------------+
an Operating Function
is a purely functional programming environment
virtual machine for constructing
resilient, distributed applications.
notepad-demo.mp4
(Video) A basic web app demonstration leveraging an in-system HTTP server. All state is automatically persisted and computations can be paused and resumed: demo
- Discover what an Operating Function is: opfn.co
- Understand why we care; and why you might, as well: Motivation
- Learn the system: Online Technical Documentation (or
/doc
directory here)
You have two options: build a dev environment using Nix, or clone the repo and install a binary. The binary is supplied for convenience only and still requires the source code in order to function.
- Install dependencies:
- libgmp (GNU Multiple Precision Arithmetic Library)
- liblmdb (Lightning Memory-Mapped Database)
- libz (zlib compression library)
On Ubuntu or Debian-based systems:
sudo apt-get update && sudo apt-get install -y \
libgmp10 \
liblmdb0 \
zlib1g
On MacOS:
brew install gmp lmdb zlib
- Download a prebuilt binary
Your browser may not prompt to download these files, in which case you can use cURL
:
curl -L <URL of your choice here> -o pallas
Make it executable and move it somewhere on your path.
- Run it:
If all went well, you should see this:
$ pallas
Run a Pallas machine
Usage: pallas COMMAND
Pallas
Available options:
-h,--help Show this help text
Available commands:
sire Run a standalone Sire repl.
save Load a sire file and save a seed.
show Print a seed file.
repl Interact with a seed file.
start Resume an idle machine.
boot Boot a machine.
Using Nix is the most straightforward way to install Pallas at this time. If your system doesn't support Nix or if you need further instruction (including instructions for Docker), refer to the documentation
- Clone this repo. Navigate to the root of it.
git clone [email protected]:operating-function/pallas.git
cd pallas
- Get into a Nix shell
nix develop
- Build pallas
This will take some time. Perhaps upwards of 15 minutes, depending on your system.
stack build
- Confirm everything is working:
$ stack run pallas
Run a Pallas machine
Usage: pallas COMMAND
Pallas
Available options:
-h,--help Show this help text
Available commands:
sire Run a standalone Sire repl.
save Load a sire file and save a seed.
show Print a seed file.
repl Interact with a seed file.
start Resume an idle machine.
boot Boot a machine.
Navigate to the root of this repository and run the commands below to see a simple demonstration of running a Pallas machine.
(The following demo uses /tmp
as the location on the host filesystem
to create a directory named counter
to hold the event log of the machine.
Feel free to use a different directory if you'd like.)
pallas boot /tmp/counter sire/demo_count_up.sire
pallas start /tmp/counter
Take note of the final counter value and then Ctrl-C
to kill the machine.
++ [%trk {2020-09-21T10:15:00.729241178Z}]
++ [{counter is at}=7]
Now run pallas start /tmp/counter
again. The counter picks up where it
left off. You'll notice that there is no explicit saving or
writing to disk or a database. You get persistence for free by writing
application code.
(For more on how Pallas machines work, see the documentation).
At this stage in Pallas development, these are the types of contributions that are most appropriate:
- Bugs in the existing examples
- New examples
- Documentation improvements
- Technical questions or requests for clarification
That said, we encourage you to dive even deeper and submit PRs beyond these suggestions.