diff --git a/TODO.md b/TODO.md index 0bc41434..94eb40cd 100644 --- a/TODO.md +++ b/TODO.md @@ -1,5 +1,3 @@ -`cap` as a builtin - # articles [docs] 反应网编程 -- 加入到 演算场 的连接 @@ -8,12 +6,6 @@ [docs] 反应网编程 -- 完成 `DiffList` 的讲解 [docs] 反应网编程 -- 翻译为 programming-with-interaction-nets -# edge - -edge as entity - -port should be connected to edge instead of port - # propaganda post on v2ex diff --git a/docs/diary/2023-08-27-port-should-connect-to-wire-instead-of-port.md b/docs/diary/2023-08-27-port-should-connect-to-edge-instead-of-port.md similarity index 63% rename from docs/diary/2023-08-27-port-should-connect-to-wire-instead-of-port.md rename to docs/diary/2023-08-27-port-should-connect-to-edge-instead-of-port.md index 27af643f..782629b1 100644 --- a/docs/diary/2023-08-27-port-should-connect-to-wire-instead-of-port.md +++ b/docs/diary/2023-08-27-port-should-connect-to-edge-instead-of-port.md @@ -1,15 +1,15 @@ --- -title: Port should connect to wire instead of port +title: Port should connect to edge instead of port author: Xie Yuheng date: 2023-08-27 --- In a shared-memory multithread implementation, -port must connect to wire instead of port, +port must connect to edge instead of port, so that parallel updates of the net will not interfere with each other. Since JavaScript is singlethread this does not matter, but as a reference implementation -port still should connect to wire instead of port. +port still should connect to edge instead of port. diff --git a/src/lang/net/Net.ts b/src/lang/net/Net.ts index b1ded779..38d2f5c1 100644 --- a/src/lang/net/Net.ts +++ b/src/lang/net/Net.ts @@ -40,6 +40,13 @@ export type PortEntry = { connection?: Connection } +// For a shared-memory multithread implementation. +// - We must define `EdgeEntry`. +// - `Net` must have `edgeEntries: Map`. +// - Port must connect to edge instead of port, +// so that parallel updates of the net will not +// interfere with each other. + export type Connection = { port: Port }