From 1e7517138a64373e93fb0a4f6792a84388f501a7 Mon Sep 17 00:00:00 2001 From: "Reid D. 'arrdem' McKenzie" Date: Tue, 31 May 2022 19:04:14 -0600 Subject: [PATCH] Shogoth -> Shoggoth --- projects/{shogoth => shoggoth}/BUILD | 4 ++-- projects/{shogoth => shoggoth}/README.md | 2 +- .../src/python/shoggoth}/analyzer/__init__.py | 0 .../src/python/shoggoth}/analyzer/impl.py | 6 +++--- .../src/python/shoggoth}/client/__main__.py | 0 .../src/python/shoggoth/parser/__init__.py | 6 ++++++ .../src/python/shoggoth}/parser/impl.py | 2 +- .../src/python/shoggoth}/reader/__init__.py | 0 .../src/python/shoggoth}/reader/impl.py | 6 +++--- .../src/python/shoggoth}/repl/__main__.py | 8 ++++---- .../src/python/shoggoth}/server/__main__.py | 0 .../src/python/shoggoth}/server/impl.py | 0 .../src/python/shoggoth}/types/__init__.py | 2 +- .../src/python/shoggoth}/types/function.py | 0 .../src/python/shoggoth}/types/keyword.py | 0 .../src/python/shoggoth}/types/symbol.py | 0 .../src/python/shoggoth}/vm/NOTES.md | 0 .../src/python/shoggoth}/vm/__init__.py | 0 .../src/python/shoggoth}/vm/bootstrap.py | 16 ++++++++-------- .../src/python/shoggoth}/vm/impl.py | 4 ++-- .../src/python/shoggoth}/vm/isa.py | 2 +- .../test/python/shogoth/test_parser.py | 2 +- .../test/python/shogoth/vm/fixtures.py | 2 +- .../test/python/shogoth/vm/test_bootstrap.py | 2 +- .../test/python/shogoth/vm/test_interpreter.py | 2 +- .../src/python/shogoth/parser/__init__.py | 6 ------ 26 files changed, 36 insertions(+), 36 deletions(-) rename projects/{shogoth => shoggoth}/BUILD (72%) rename projects/{shogoth => shoggoth}/README.md (98%) rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/analyzer/__init__.py (100%) rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/analyzer/impl.py (96%) rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/client/__main__.py (100%) create mode 100644 projects/shoggoth/src/python/shoggoth/parser/__init__.py rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/parser/impl.py (92%) rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/reader/__init__.py (100%) rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/reader/impl.py (96%) rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/repl/__main__.py (85%) rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/server/__main__.py (100%) rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/server/impl.py (100%) rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/types/__init__.py (95%) rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/types/function.py (100%) rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/types/keyword.py (100%) rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/types/symbol.py (100%) rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/vm/NOTES.md (100%) rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/vm/__init__.py (100%) rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/vm/bootstrap.py (82%) rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/vm/impl.py (97%) rename projects/{shogoth/src/python/shogoth => shoggoth/src/python/shoggoth}/vm/isa.py (99%) rename projects/{shogoth => shoggoth}/test/python/shogoth/test_parser.py (93%) rename projects/{shogoth => shoggoth}/test/python/shogoth/vm/fixtures.py (79%) rename projects/{shogoth => shoggoth}/test/python/shogoth/vm/test_bootstrap.py (98%) rename projects/{shogoth => shoggoth}/test/python/shogoth/vm/test_interpreter.py (98%) delete mode 100644 projects/shogoth/src/python/shogoth/parser/__init__.py diff --git a/projects/shogoth/BUILD b/projects/shoggoth/BUILD similarity index 72% rename from projects/shogoth/BUILD rename to projects/shoggoth/BUILD index 5c3407f..0ec38de 100644 --- a/projects/shogoth/BUILD +++ b/projects/shoggoth/BUILD @@ -1,6 +1,6 @@ py_project( - name = "shogoth", - main = "src/python/shogoth/repl/__main__.py", + name = "shoggoth", + main = "src/python/forerunner/repl/__main__.py", main_deps = [ py_requirement("prompt_toolkit"), py_requirement("yaspin"), diff --git a/projects/shogoth/README.md b/projects/shoggoth/README.md similarity index 98% rename from projects/shogoth/README.md rename to projects/shoggoth/README.md index 023566c..5ee126a 100644 --- a/projects/shogoth/README.md +++ b/projects/shoggoth/README.md @@ -1,4 +1,4 @@ -# Shogot'im +# Shoggot'im > "The shoggot'im, they're called: servitors. There are several kinds of advanced robotic systems made out of molecular components: they can change shape, restructure material at the atomic level -- act like corrosive acid, or secrete diamonds. Some of them are like a tenuous mist -- what Doctor Drexler at MIT calls a utility fog -- while others are more like an oily globule. Apparently they may be able to manufacture more of themselves, but they're not really alive in any meaning of the term we're familiar with. They're programmable, like robots, using a command language deduced from recovered records of the forerunners who left them here. The Molotov Raid of 1930 brought back a large consignment of them; all we have to go on are the scraps they missed, and reports by the Antarctic Survey. Professor Liebkunst's files in particular are most frustrating --'' > diff --git a/projects/shogoth/src/python/shogoth/analyzer/__init__.py b/projects/shoggoth/src/python/shoggoth/analyzer/__init__.py similarity index 100% rename from projects/shogoth/src/python/shogoth/analyzer/__init__.py rename to projects/shoggoth/src/python/shoggoth/analyzer/__init__.py diff --git a/projects/shogoth/src/python/shogoth/analyzer/impl.py b/projects/shoggoth/src/python/shoggoth/analyzer/impl.py similarity index 96% rename from projects/shogoth/src/python/shogoth/analyzer/impl.py rename to projects/shoggoth/src/python/shoggoth/analyzer/impl.py index bad5294..b9f777c 100644 --- a/projects/shogoth/src/python/shogoth/analyzer/impl.py +++ b/projects/shoggoth/src/python/shoggoth/analyzer/impl.py @@ -6,7 +6,7 @@ from abc import ABC from dataclasses import dataclass import typing as t -from shogoth.types import ( +from shoggoth.types import ( Keyword, List, Symbol, @@ -84,7 +84,7 @@ class FnExpr(Expr): body: Expr -BOOTSTRAP = "lang.shogoth.v0.bootstrap" +BOOTSTRAP = "lang.shoggoth.v0.bootstrap" SPECIALS = Namespace(Symbol(BOOTSTRAP), { Symbol("if*"): None, Symbol("let*"): None, @@ -92,7 +92,7 @@ SPECIALS = Namespace(Symbol(BOOTSTRAP), { }) -GLOBALS = Namespace(Symbol("lang.shogoth.v0.core"), { +GLOBALS = Namespace(Symbol("lang.shoggoth.v0.core"), { }) diff --git a/projects/shogoth/src/python/shogoth/client/__main__.py b/projects/shoggoth/src/python/shoggoth/client/__main__.py similarity index 100% rename from projects/shogoth/src/python/shogoth/client/__main__.py rename to projects/shoggoth/src/python/shoggoth/client/__main__.py diff --git a/projects/shoggoth/src/python/shoggoth/parser/__init__.py b/projects/shoggoth/src/python/shoggoth/parser/__init__.py new file mode 100644 index 0000000..6edc5f0 --- /dev/null +++ b/projects/shoggoth/src/python/shoggoth/parser/__init__.py @@ -0,0 +1,6 @@ +"""Published interface to the shoggoth parser.""" + +from .impl import parse + + +__all__ = ["parse"] diff --git a/projects/shogoth/src/python/shogoth/parser/impl.py b/projects/shoggoth/src/python/shoggoth/parser/impl.py similarity index 92% rename from projects/shogoth/src/python/shogoth/parser/impl.py rename to projects/shoggoth/src/python/shoggoth/parser/impl.py index a1d60c0..1c5db2c 100644 --- a/projects/shogoth/src/python/shogoth/parser/impl.py +++ b/projects/shoggoth/src/python/shoggoth/parser/impl.py @@ -60,6 +60,6 @@ COMMENT: /;.*?\n/ def parse(input: str) -> Any: - '''Parse a string using the shogoth (lisp) gramar, returning an unmodified tree.''' + '''Parse a string using the shoggoth (lisp) gramar, returning an unmodified tree.''' return PARSER.parse(input) diff --git a/projects/shogoth/src/python/shogoth/reader/__init__.py b/projects/shoggoth/src/python/shoggoth/reader/__init__.py similarity index 100% rename from projects/shogoth/src/python/shogoth/reader/__init__.py rename to projects/shoggoth/src/python/shoggoth/reader/__init__.py diff --git a/projects/shogoth/src/python/shogoth/reader/impl.py b/projects/shoggoth/src/python/shoggoth/reader/impl.py similarity index 96% rename from projects/shogoth/src/python/shogoth/reader/impl.py rename to projects/shoggoth/src/python/shoggoth/reader/impl.py index 9c428f4..52b283a 100644 --- a/projects/shogoth/src/python/shogoth/reader/impl.py +++ b/projects/shoggoth/src/python/shoggoth/reader/impl.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -"""The shogoth reader.""" +"""The shoggoth reader.""" import sys @@ -11,8 +11,8 @@ import re from typing import Any from lark import Token, Tree -from shogoth.parser import parse -from shogoth.types import ( +from shoggoth.parser import parse +from shoggoth.types import ( Keyword, List, Symbol, diff --git a/projects/shogoth/src/python/shogoth/repl/__main__.py b/projects/shoggoth/src/python/shoggoth/repl/__main__.py similarity index 85% rename from projects/shogoth/src/python/shogoth/repl/__main__.py rename to projects/shoggoth/src/python/shoggoth/repl/__main__.py index 8813229..d7ded43 100644 --- a/projects/shogoth/src/python/shogoth/repl/__main__.py +++ b/projects/shoggoth/src/python/shoggoth/repl/__main__.py @@ -3,14 +3,14 @@ from prompt_toolkit import PromptSession from prompt_toolkit.history import FileHistory from prompt_toolkit.styles import Style -from shogoth.analyzer import ( +from shoggoth.analyzer import ( Analyzer, GLOBALS, Namespace, SPECIALS, ) -from shogoth.reader import Reader -from shogoth.types import Symbol +from shoggoth.reader import Reader +from shoggoth.types import Symbol from yaspin import Spinner, yaspin @@ -31,7 +31,7 @@ def main(): analyzer = Analyzer(SPECIALS, GLOBALS) ns = Namespace(Symbol("user"), {}) - session = PromptSession(history=FileHistory(".shogoth.history")) + session = PromptSession(history=FileHistory(".shoggoth.history")) while True: try: diff --git a/projects/shogoth/src/python/shogoth/server/__main__.py b/projects/shoggoth/src/python/shoggoth/server/__main__.py similarity index 100% rename from projects/shogoth/src/python/shogoth/server/__main__.py rename to projects/shoggoth/src/python/shoggoth/server/__main__.py diff --git a/projects/shogoth/src/python/shogoth/server/impl.py b/projects/shoggoth/src/python/shoggoth/server/impl.py similarity index 100% rename from projects/shogoth/src/python/shogoth/server/impl.py rename to projects/shoggoth/src/python/shoggoth/server/impl.py diff --git a/projects/shogoth/src/python/shogoth/types/__init__.py b/projects/shoggoth/src/python/shoggoth/types/__init__.py similarity index 95% rename from projects/shogoth/src/python/shogoth/types/__init__.py rename to projects/shoggoth/src/python/shoggoth/types/__init__.py index 5536f44..7f40a9a 100644 --- a/projects/shogoth/src/python/shogoth/types/__init__.py +++ b/projects/shoggoth/src/python/shoggoth/types/__init__.py @@ -1,4 +1,4 @@ -"""The public interface for shogoth's baked-in types.""" +"""The public interface for shoggoth's baked-in types.""" import typing as t diff --git a/projects/shogoth/src/python/shogoth/types/function.py b/projects/shoggoth/src/python/shoggoth/types/function.py similarity index 100% rename from projects/shogoth/src/python/shogoth/types/function.py rename to projects/shoggoth/src/python/shoggoth/types/function.py diff --git a/projects/shogoth/src/python/shogoth/types/keyword.py b/projects/shoggoth/src/python/shoggoth/types/keyword.py similarity index 100% rename from projects/shogoth/src/python/shogoth/types/keyword.py rename to projects/shoggoth/src/python/shoggoth/types/keyword.py diff --git a/projects/shogoth/src/python/shogoth/types/symbol.py b/projects/shoggoth/src/python/shoggoth/types/symbol.py similarity index 100% rename from projects/shogoth/src/python/shogoth/types/symbol.py rename to projects/shoggoth/src/python/shoggoth/types/symbol.py diff --git a/projects/shogoth/src/python/shogoth/vm/NOTES.md b/projects/shoggoth/src/python/shoggoth/vm/NOTES.md similarity index 100% rename from projects/shogoth/src/python/shogoth/vm/NOTES.md rename to projects/shoggoth/src/python/shoggoth/vm/NOTES.md diff --git a/projects/shogoth/src/python/shogoth/vm/__init__.py b/projects/shoggoth/src/python/shoggoth/vm/__init__.py similarity index 100% rename from projects/shogoth/src/python/shogoth/vm/__init__.py rename to projects/shoggoth/src/python/shoggoth/vm/__init__.py diff --git a/projects/shogoth/src/python/shogoth/vm/bootstrap.py b/projects/shoggoth/src/python/shoggoth/vm/bootstrap.py similarity index 82% rename from projects/shogoth/src/python/shogoth/vm/bootstrap.py rename to projects/shoggoth/src/python/shoggoth/vm/bootstrap.py index be535c3..9249971 100644 --- a/projects/shogoth/src/python/shogoth/vm/bootstrap.py +++ b/projects/shoggoth/src/python/shoggoth/vm/bootstrap.py @@ -6,13 +6,13 @@ Hopefully no "real" interpreter ever uses this code, since it's obviously replac from .isa import Module, Opcode -from shogoth.types import * +from shoggoth.types import * BOOTSTRAP = Module() NOT = BOOTSTRAP.define_function( - ";/lang/shogoth/v0/bootstrap/not;bool;bool", + ";/lang/shoggoth/v0/bootstrap/not;bool;bool", [ Opcode.IF(target=3), Opcode.FALSE(), @@ -23,7 +23,7 @@ NOT = BOOTSTRAP.define_function( ) OR = BOOTSTRAP.define_function( - ";/lang/shogoth/v0/bootstrap/or;bool,bool;bool", + ";/lang/shoggoth/v0/bootstrap/or;bool,bool;bool", [ Opcode.IF(target=3), Opcode.TRUE(), @@ -37,7 +37,7 @@ OR = BOOTSTRAP.define_function( ) AND = BOOTSTRAP.define_function( - ";/lang/shogoth/v0/bootstrap/and;bool,bool;bool", + ";/lang/shoggoth/v0/bootstrap/and;bool,bool;bool", [ Opcode.IF(target=3), Opcode.IF(target=3), @@ -50,7 +50,7 @@ AND = BOOTSTRAP.define_function( ) XOR = BOOTSTRAP.define_function( - ";/lang/shogoth/v0/bootstrap/xor;bool,bool;bool", + ";/lang/shoggoth/v0/bootstrap/xor;bool,bool;bool", [ Opcode.DUP(nargs=2), # !A && B @@ -73,16 +73,16 @@ XOR = BOOTSTRAP.define_function( ) TRUE = BOOTSTRAP.define_type( - "/lang/shogoth/v0/true", + "/lang/shoggoth/v0/true", ProductExpr([]), ) FALSE = BOOTSTRAP.define_type( - "/lang/shogoth/v0/false", + "/lang/shoggoth/v0/false", ProductExpr([]), ) BOOL = BOOTSTRAP.define_type( - "/lang/shogoth/v0/bool", + "/lang/shoggoth/v0/bool", SumExpr([TRUE, FALSE]) ) diff --git a/projects/shogoth/src/python/shogoth/vm/impl.py b/projects/shoggoth/src/python/shoggoth/vm/impl.py similarity index 97% rename from projects/shogoth/src/python/shogoth/vm/impl.py rename to projects/shoggoth/src/python/shoggoth/vm/impl.py index b36ee74..eb72a83 100644 --- a/projects/shogoth/src/python/shogoth/vm/impl.py +++ b/projects/shoggoth/src/python/shoggoth/vm/impl.py @@ -2,8 +2,8 @@ """The Shogoth VM implementation. -The whole point of shogoth is that program executions are checkpointable and restartable. This requires that rather than -using a traditional recursive interpreter which is difficult to snapshot, interpretation in shogoth occur within a +The whole point of shoggoth is that program executions are checkpointable and restartable. This requires that rather than +using a traditional recursive interpreter which is difficult to snapshot, interpretation in shoggoth occur within a context (a virtual machine) which DOES have an easily introspected and serialized representation. ## The Shogoth VM Architecture diff --git a/projects/shogoth/src/python/shogoth/vm/isa.py b/projects/shoggoth/src/python/shoggoth/vm/isa.py similarity index 99% rename from projects/shogoth/src/python/shogoth/vm/isa.py rename to projects/shoggoth/src/python/shoggoth/vm/isa.py index c601625..f318fef 100644 --- a/projects/shogoth/src/python/shogoth/vm/isa.py +++ b/projects/shoggoth/src/python/shoggoth/vm/isa.py @@ -3,7 +3,7 @@ from typing import NamedTuple -from shogoth.types import FunctionRef +from shoggoth.types import FunctionRef class Opcode: diff --git a/projects/shogoth/test/python/shogoth/test_parser.py b/projects/shoggoth/test/python/shogoth/test_parser.py similarity index 93% rename from projects/shogoth/test/python/shogoth/test_parser.py rename to projects/shoggoth/test/python/shogoth/test_parser.py index 15c8802..703e832 100644 --- a/projects/shogoth/test/python/shogoth/test_parser.py +++ b/projects/shoggoth/test/python/shogoth/test_parser.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import pytest -from shogoth.parser import parse +from shoggoth.parser import parse @pytest.mark.parametrize("example", [ diff --git a/projects/shogoth/test/python/shogoth/vm/fixtures.py b/projects/shoggoth/test/python/shogoth/vm/fixtures.py similarity index 79% rename from projects/shogoth/test/python/shogoth/vm/fixtures.py rename to projects/shoggoth/test/python/shogoth/vm/fixtures.py index e092db2..d3937d6 100644 --- a/projects/shogoth/test/python/shogoth/vm/fixtures.py +++ b/projects/shoggoth/test/python/shogoth/vm/fixtures.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import pytest -from shogoth.vm import * +from shoggoth.vm import * @pytest.fixture diff --git a/projects/shogoth/test/python/shogoth/vm/test_bootstrap.py b/projects/shoggoth/test/python/shogoth/vm/test_bootstrap.py similarity index 98% rename from projects/shogoth/test/python/shogoth/vm/test_bootstrap.py rename to projects/shoggoth/test/python/shogoth/vm/test_bootstrap.py index 40ba9b1..fb99599 100644 --- a/projects/shogoth/test/python/shogoth/vm/test_bootstrap.py +++ b/projects/shoggoth/test/python/shogoth/vm/test_bootstrap.py @@ -3,7 +3,7 @@ from .fixtures import * # noqa import pytest -from shogoth.vm import * +from shoggoth.vm import * @pytest.mark.parametrize("stack,ret", [ diff --git a/projects/shogoth/test/python/shogoth/vm/test_interpreter.py b/projects/shoggoth/test/python/shogoth/vm/test_interpreter.py similarity index 98% rename from projects/shogoth/test/python/shogoth/vm/test_interpreter.py rename to projects/shoggoth/test/python/shogoth/vm/test_interpreter.py index d9157f6..3f1ee9f 100644 --- a/projects/shogoth/test/python/shogoth/vm/test_interpreter.py +++ b/projects/shoggoth/test/python/shogoth/vm/test_interpreter.py @@ -5,7 +5,7 @@ Tests coverign the VM interpreter from .fixtures import * # noqa import pytest -from shogoth.vm import * +from shoggoth.vm import * def test_true(vm): diff --git a/projects/shogoth/src/python/shogoth/parser/__init__.py b/projects/shogoth/src/python/shogoth/parser/__init__.py deleted file mode 100644 index f3ab289..0000000 --- a/projects/shogoth/src/python/shogoth/parser/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -"""Published interface to the shogoth parser.""" - -from .impl import parse - - -__all__ = ["parse"]