Skip to content

Latest commit

 

History

History
22 lines (13 loc) · 428 Bytes

README.rst

File metadata and controls

22 lines (13 loc) · 428 Bytes

A brainfuck interpreter as a PostgreSQL procedural language.

To install:

make install

To use:

CREATE FUNCTION pl_bf_call_handler() RETURNS language_handler AS 'pl_bf.so' LANGUAGE C;

CREATE LANGUAGE brainfuck HANDLER pl_bf_call_handler;

-- Add the low byte of 2 integers:
CREATE FUNCTION bf_add(int, int) RETURNS int AS $$
>>>>[-<<<<+>>>>]
$$ LANGUAGE brainfuck;

SELECT * FROM bf_add(3, 5);  -- 8!