• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

A categorical programming language


Commit MetaInfo

修订版612dde46f06284a994c7978ed3b324d95db46277 (tree)
时间2022-08-22 06:50:00
作者Corbin <cds@corb...>
CommiterCorbin

Log Message

Start work on a new sort of spellserver.

更改概述

差异

--- /dev/null
+++ b/honey.py
@@ -0,0 +1,28 @@
1+import json
2+import os
3+
4+from flask import Flask, jsonify, url_for
5+
6+app = Flask(__name__)
7+
8+hive = json.load(open(os.environ["HONEY_HIVE"]))
9+symbols = hive["symbols"]
10+heap = hive["heap"]
11+
12+@app.route("/dippers")
13+def dippers():
14+ return jsonify({name: url_for("dip", name=name) for name in symbols})
15+
16+def resolve(i):
17+ rv = heap[i]
18+ if isinstance(rv, int):
19+ return resolve(rv)
20+ elif isinstance(rv, list):
21+ return [rv[0]] + [resolve(x) for x in rv[1:]]
22+ else:
23+ return rv
24+
25+@app.route("/dip/<path:name>")
26+def dip(name):
27+ index, trail = symbols[name]
28+ return jsonify({"expr": resolve(index), "trail": trail})
--- a/shell.nix
+++ b/shell.nix
@@ -28,6 +28,8 @@ in pkgs.stdenv.mkDerivation {
2828 # ocamlPackages.sexp
2929 # working with JSON
3030 jq
31+ # honey
32+ python3Packages.flask
3133 # benchmarking
3234 busybox feedgnuplot linuxPackages.perf
3335 # publishing