From 14025d22ce3d66c9d235e57221ec4653e00f972c Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Fri, 26 Nov 2021 20:17:43 +1300 Subject: Switched to .xhtml extension, fixed some minor bugs --- project/templates/grasp.xhtml | 76 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 project/templates/grasp.xhtml (limited to 'project/templates/grasp.xhtml') diff --git a/project/templates/grasp.xhtml b/project/templates/grasp.xhtml new file mode 100644 index 0000000..5afc4b7 --- /dev/null +++ b/project/templates/grasp.xhtml @@ -0,0 +1,76 @@ + +{%- extends "base.xhtml" -%} + + + +{%- block title -%}Grasp Interpreter{%- endblock -%} + + + +{%- block content %} +

Grasp Interpreter

+ +

Git repository: Link

+ +
1/1/2017
+ +

Like Lisp, the esoteric programming language Grasp is a homoiconic language that exclusively uses a single datatype. Except +instead of lists, it uses directed graphs.

+ +

A Grasp program is initialised with instruction pointers to those nodes in the graph that have +a "name" edge to a node with the value "grasp:main". The nodes at each instruction pointer are +evaluated and the pointer then updated by following an available "next" edge. This continues until +all instruction pointers have no more "next" edges to follow.

+ +
+ Hello World in Grasp +
Hello World in Grasp
+
+ +

In the current +specification, the actions that can be performed are:

+ + + +

The execution of a node may be skipped by having "cond" edges pointing to either zero values or +non-numeric values. Also, due to the way instruction pointers update and the way several +instructions are defined, there is a measure of non-determinism that can be introduced depending on +what edges are available.

+ +

The language seemed like an interesting enough idea, but unfortunately nobody had done anything +with it, and there was only a specification. This has now been fixed. The interpreter currently +uses a subset of the DOT graph +description language for the file format, to enable a text format as well as relatively easy +conversion to a graph image.

+ +

The above example is recorded as follows:

+
+ +digraph { + 1 [label="puts"] + 2 [label="grasp:main"] + 3 [label="Hello world!"] + + 1 -> 2 [label="name"] + 1 -> 3 [label="in"] +} + +
+ +

If a format that more readily converts to a comprehensible graph image is found, a parser for it +may be added.

+{% endblock -%} + + -- cgit