File: README.md

package info (click to toggle)
acl2 8.6%2Bdfsg-3
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 1,138,276 kB
  • sloc: lisp: 17,818,294; java: 125,359; python: 28,122; javascript: 23,458; cpp: 18,851; ansic: 11,569; perl: 7,678; xml: 5,591; sh: 3,978; makefile: 3,840; ruby: 2,633; yacc: 1,126; ml: 763; awk: 295; csh: 233; lex: 197; php: 178; tcl: 49; asm: 23; haskell: 17
file content (42 lines) | stat: -rw-r--r-- 1,882 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# simple-tcp-service

## What is this?

This directory contains code that is intended to make it easier to
produce services that expose TCP sockets and use ACL2s.

This directory contains several parts:
- An ASDF system providing a TCP server that allows one to create a
  customized "ACL2s service" that exposes some capabilities over a TCP
  socket using a custom protocol
- An ASDF system providing a library for encoding and decoding Defdata
  values as JSON
- A small Python module for connecting to and interacting with an
  ACL2s service
- A simple example ACL2s service

## Prerequisites
To run the examples, Quicklisp should be installed. If not installed
at `~/quicklisp`, the `QUICKLISP_SETUP` environment variable should be
set to the path to the `quicklisp/setup.lisp` file. If your ACL2 image
starts with Quicklisp loaded, this is not required. (you can check
this by exiting into raw lisp and checking whether `*features*`
contains `:QUICKLISP`)

## How do I use this?

To create a service, one needs to create a request handler for
it. This is a function that takes in the body of a message (decoded as
a UTF-8 string) and produces a string (that will be encoded using
UTF-8 and sent back to the requester).  In most cases, one can simply
use the rest of the files from the `basic-server` example with the
custom request handler (updating `load`s as appropriate).

The Python module supports both starting up a ACL2s service image in a
subprocess and connecting to an existing service (given its TCP
port). This means that the services can be running on different
computers and interacted with over a network if desired, as long as
the appropriate network configuration is performed to e.g. forward
ports if needed. One could also create several services in
subprocesses to create a worker pool and use something like Flask to
integrate the service with a REST API.