diff --git a/README.md b/README.md index 7b9115c5fa3..00aa55d349b 100644 --- a/README.md +++ b/README.md @@ -372,7 +372,7 @@ charlie.go("charlie", server); ## Syntax -See [here](design/Syntax.md). +See [here](design/Syntax.html). ## Semantics @@ -382,4 +382,4 @@ TODO... ## Implementation -See [here](design/Implementation.md) +See [here](design/Implementation.html) diff --git a/stdlib/Makefile b/stdlib/Makefile index fbbd55b953b..d34611c7efb 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -2,16 +2,9 @@ ASC=../src/asc OUTDIR=_out DOCDIR=doc MDofAS=./markdown-of-actorscript.py +MDofMD=./markdown-of-markdown.py PANDOC=pandoc -## VT100 stuff -#HRULE="\x1b[2;34m----------------------------------------------------------------\x1b[0m" -#MODULE_NAME="\x1b[1;32mModule:\x1b[1;34m" -#BEGIN="\x1b[0;1mBegin...\x1b[0m" -#DONE="\x1b[1mDone.\n"$(HRULE) -#MODULE_NAME_COLOR="\x1b[0;1;34m" -#NO_COLOR="\x1b[0m" - # Add new module targets here: MODULES=\ Hash \ @@ -100,7 +93,7 @@ $(DOCDIR): $(DOCDIR)/README.md: README.md | $(DOCDIR) @echo "" > $@ @echo "" >> $@ - @cat $< >> $@ + $(MDofMD) $< >> $@ $(DOCDIR)/examples/produce-exchange/: README.md @mkdir -p $@ @@ -108,61 +101,34 @@ $(DOCDIR)/examples/produce-exchange/: README.md $(DOCDIR)/examples/produce-exchange/README.md: examples/produce-exchange/README.md | $(DOCDIR)/examples/produce-exchange/ @echo "" > $@ @echo "" >> $@ - @cat $< >> $@ + $(MDofMD) $< >> $@ $(OUTDIR)/Hash.out: prelude.as hash.as | $(OUTDIR) -# @echo $(MODULE_NAME) $(basename $(notdir $@)) -# @echo $(BEGIN) $(ASC) -r $(filter-out $(OUTDIR), $^) > $@ -# @echo $(DONE) $(OUTDIR)/List.out: prelude.as list.as | $(OUTDIR) -# @echo $(MODULE_NAME) $(basename $(notdir $@)) -# @echo $(BEGIN) $(ASC) -r $(filter-out $(OUTDIR), $^) > $@ -# @echo $(DONE) $(OUTDIR)/ListTest.out: prelude.as list.as listTest.as | $(OUTDIR) -# @echo $(MODULE_NAME) $(basename $(notdir $@)) -# @echo $(BEGIN) $(ASC) -r $(filter-out $(OUTDIR), $^) > $@ -# @echo $(DONE) $(OUTDIR)/AssocList.out: prelude.as list.as assocList.as | $(OUTDIR) -# @echo $(MODULE_NAME) $(basename $(notdir $@)) -# @echo $(BEGIN) $(ASC) -r $(filter-out $(OUTDIR), $^) > $@ -# @echo $(DONE) $(OUTDIR)/Trie.out: prelude.as hash.as list.as assocList.as trie.as | $(OUTDIR) -# @echo $(MODULE_NAME) $(basename $(notdir $@)) -# @echo $(BEGIN) $(ASC) -r $(filter-out $(OUTDIR), $^) > $@ -# @echo $(DONE) $(OUTDIR)/DocTable.out: prelude.as hash.as list.as assocList.as trie.as docTable.as | $(OUTDIR) -# @echo $(MODULE_NAME) $(basename $(notdir $@)) -# @echo $(BEGIN) $(ASC) -r $(filter-out $(OUTDIR), $^) > $@ -# @echo $(DONE) $(OUTDIR)/Set.out: prelude.as hash.as list.as assocList.as trie.as set.as | $(OUTDIR) -# @echo $(MODULE_NAME) $(basename $(notdir $@)) -# @echo $(BEGIN) $(ASC) -r $(filter-out $(OUTDIR), $^) > $@ -# @echo $(DONE) $(OUTDIR)/SetDb.out: prelude.as hash.as list.as assocList.as trie.as set.as setDb.as | $(OUTDIR) -# @echo $(MODULE_NAME) $(basename $(notdir $@)) -# @echo $(BEGIN) $(ASC) -r $(filter-out $(OUTDIR), $^) > $@ -# @echo $(DONE) $(OUTDIR)/SetDbTest.out: prelude.as hash.as list.as assocList.as trie.as set.as setDb.as setDbTest.as | $(OUTDIR) -# @echo $(MODULE_NAME) $(basename $(notdir $@)) -# @echo $(BEGIN) $(ASC) -r $(filter-out $(OUTDIR), $^) > $@ -# @echo $(DONE) PRODUCE_EXCHANGE_SRC=\ prelude.as hash.as list.as assocList.as trie.as docTable.as \ @@ -173,44 +139,16 @@ PRODUCE_EXCHANGE_SRC=\ $(OUTDIR)/ProduceExchange.out: $(PRODUCE_EXCHANGE_SRC) \ examples/produce-exchange/test/simpleSetupAndQuery.as | $(OUTDIR) -# @echo $(MODULE_NAME) $(basename $(notdir $@)) -# @echo $(BEGIN) $(ASC) -r $(filter-out $(OUTDIR), $^) > $@ -# @echo $(DONE) $(OUTDIR)/ProduceExchange.wasm: $(PRODUCE_EXCHANGE_SRC) | $(OUTDIR) $(ASC) -c --dfinity -o $@ $(filter-out $(OUTDIR), $^) $(DOCDIR)/%.md: %.as $(MDofAS) | $(DOCDIR) - @echo "" > $@ + @echo "" > $@ @echo "" >> $@ @echo "" >> $@ $(MDofAS) $< >> $@ $(DOCDIR)/%.html: $(DOCDIR)/%.md $(PANDOC) -f gfm $^ > $@ - - -######################################################################################### -# TODO(Matthew): Figure out why this "compressed" version of the rules doesn't work. - -# $(OUTDIR)/List.out: $(OUTDIR) list.as ; @$(doModule) - -# $(OUTDIR)/ListTest.out: $(OUTDIR) list.as listTest.as ; @$(doModule) - -# $(OUTDIR)/Trie.out: $(OUTDIR) list.as trie.as ; @$(doModule) - -# $(OUTDIR)/Set.out: $(OUTDIR) list.as trie.as set.as ; @$(doModule) - -# $(OUTDIR)/SetDb.out: $(OUTDIR) list.as trie.as set.as setDb.as ; @$(doModule) - -# $(OUTDIR)/SetDbTest.out: $(OUTDIR) list.as trie.as set.as setDb.as setDbTest.as ; @$(doModule) - -# $(OUTDIR)/ProduceExchange.out: $(OUTDIR) list.as trie.as produceExchange.as ; @$(doModule) - -# define doModule = -# @echo $(MODULE_NAME) $(basename $(notdir $@)) -# @echo $(BEGIN) -# $(ASC) -r $(filter-out $(OUTDIR), $^) > $@ -# @echo $(DONE) -# endef diff --git a/stdlib/README.md b/stdlib/README.md index e1be41034ad..2e81fabd39d 100644 --- a/stdlib/README.md +++ b/stdlib/README.md @@ -17,7 +17,7 @@ of the [produce exchange example](https://github.com/dfinity-lab/actorscript/tre See also, the [library modules by priority](#library-modules-by-priority). -[`DocTable`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/docTable.md) +[`DocTable`]($DOCURL/docTable.html) ---------- A _document table_ abstracts over a **mutable collection of _documents_**, @@ -36,17 +36,17 @@ See also [`Trie`](#trie) and [`AssocList`](#assoclist). -[`Trie`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/trie.md) +[`Trie`]($DOCURL/trie.html) ---------- Represent a finite map with a _canonical binary tree_, based on hashing each key. -[`AssocList`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/assocList.md) +[`AssocList`]($DOCURL/assocList.html) ------------ Represent a finite map with an _association list_ a list of key-value pairs. -[`List`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/list.md) +[`List`]($DOCURL/list.html) ----------- Linked lists. diff --git a/stdlib/docTable.as b/stdlib/docTable.as index a8234c01f98..d66eb189f27 100644 --- a/stdlib/docTable.as +++ b/stdlib/docTable.as @@ -24,7 +24,7 @@ type information. /** Representation ================ - A table is a finite map (currently a [Trie](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/trie.md)) mapping ids to documents. + A table is a finite map (currently a [Trie]($DOCURL/trie.html)) mapping ids to documents. See also: [private state](#private-state). @@ -100,7 +100,7 @@ class DocTable( `empty` --------- - See also [`Table.empty`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/trie.md#empty) + See also [`Table.empty`]($DOCURL/trie.md#empty) */ @@ -112,7 +112,7 @@ class DocTable( `getTable` --------- - See also [`Table.copy`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/trie.md#copy) + See also [`Table.copy`]($DOCURL/trie.md#copy) */ @@ -124,7 +124,7 @@ class DocTable( `addDoc` --------- - See also [`Table.insertFresh`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/trie.md#insertfresh) + See also [`Table.insertFresh`]($DOCURL/trie.md#insertfresh) */ @@ -141,7 +141,7 @@ class DocTable( `updateDoc` --------- - See also [`Table.replace`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/trie.md#insertfresh) + See also [`Table.replace`]($DOCURL/trie.md#insertfresh) */ @@ -196,7 +196,7 @@ class DocTable( `addInfo` --------- - See also [`Table.insertFresh`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/trie.md#insertfresh) + See also [`Table.insertFresh`]($DOCURL/trie.md#insertfresh) */ addInfo(info:Id -> Info) : ?(Id, Doc) { @@ -214,7 +214,7 @@ class DocTable( `rem` --------- - See also [`Table.removeThen`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/trie.md#removeThen) + See also [`Table.removeThen`]($DOCURL/trie.md#removeThen) */ @@ -256,7 +256,7 @@ class DocTable( `getDoc` --------- - See also [`Table.find`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/trie.md#find) + See also [`Table.find`]($DOCURL/trie.md#find) */ @@ -280,7 +280,7 @@ class DocTable( `count` --------- - See also [`Table.count`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/trie.md#count) + See also [`Table.count`]($DOCURL/trie.md#count) */ count() : Nat { @@ -291,7 +291,7 @@ class DocTable( `allDoc` --------- - See also [`Table.toArray`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/trie.md#toarray) + See also [`Table.toArray`]($DOCURL/trie.md#toarray) */ allDoc() : [Doc] { @@ -303,7 +303,7 @@ class DocTable( `allInfo` --------- - See also [`Table.toArray`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/trie.md#toarray) + See also [`Table.toArray`]($DOCURL/trie.md#toarray) */ allInfo() : [Info] { diff --git a/stdlib/examples/produce-exchange/README.md b/stdlib/examples/produce-exchange/README.md index 281ed517b5b..ac1e5882ba8 100644 --- a/stdlib/examples/produce-exchange/README.md +++ b/stdlib/examples/produce-exchange/README.md @@ -40,24 +40,24 @@ The documentation of this design now evolves in two places: -------------------------------------------------------------- -Produce Exchange Standards Specification (PESS) +Produce Exchange Standards Specification ================================================== The Produce Exchange is a DFINITY canister whose implementation defines a set of _standards_ whose **formal specification** we refer to collectively as -the _"Produce Exchange Standards Specification"_, or _"PESS"_ for short. +the _"Produce Exchange Standards Specification"_. Organizational overview ---------------------------- -We break the PESS definition into several files, described below in detail as +We break the standards definition into several files, described below in detail as [**server components**](#server-components). **Server message formats** As ActorScript-based documentation, the embedded source code for these -components makes the PESS definition into a **formal definition**, to +components makes the standards definition into a **formal definition**, to the same degree that ActorScript has a formal semantics of its own, in terms of DFINITY's semantics, etc: @@ -68,10 +68,10 @@ terms of DFINITY's semantics, etc: **Server message behavior** The _behavior_ of this server defines the _semantic_ aspects of the -PESS standard. +standards definition. The _implementation details_ of this behavior are not included in the -PESS standard. We include a prototype specification of this behavior, +standards definition. We include a prototype specification of this behavior, which is subject to change: - The [server model types](#server-model-types) define the internal data model used by the server to support its behavior. @@ -124,7 +124,7 @@ following definitional pieces, listed below. Basic types used in messages, and published/stored internally in the server actor's state. -See [`serverTypes.md`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverTypes.md) for authoritative documentation. +See [`serverTypes.md`]($DOCURL/examples/produce-exchange/serverTypes.html) for authoritative documentation. See [`serverTypes.as`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/stdlib/examples/produce-exchange/serverTypes.as) for the source code. @@ -133,7 +133,7 @@ See [`serverTypes.as`](https://github.com/dfinity-lab/actorscript/blob/stdlib-ex Defined by the server actor's public signature, which specifies the messages and message formats for each participant. -See [`serverActor.md`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md) for authoritative documentation. +See [`serverActor.md`]($DOCURL/examples/produce-exchange/serverActor.html) for authoritative documentation. See [`serverActor.as`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/stdlib/examples/produce-exchange/serverActor.as) for the source code. @@ -143,7 +143,7 @@ See [`serverActor.as`](https://github.com/dfinity-lab/actorscript/blob/stdlib-ex This component defines structures that the next component uses to implement the server actor; neither component is exposed by the actor's public-facing interface. -See [`serverModelTypes.md`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverModelTypes.md) for authoritative documentation. +See [`serverModelTypes.md`]($DOCURL/examples/produce-exchange/serverModelTypes.html) for authoritative documentation. See [`serverModelTypes.as`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/stdlib/examples/produce-exchange/serverModelTypes.as) for the source code. @@ -153,8 +153,8 @@ See [`serverModelTypes.as`](https://github.com/dfinity-lab/actorscript/blob/stdl See [the standard library](https://github.com/dfinity-lab/actorscript/tree/stdlib-examples/stdlib/#produce-exchange) for collection abstractions, including - the [`DocTable` class](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/docTable.md) -and the [`Trie` type](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/trie.md). + the [`DocTable` class]($DOCURL/docTable.html) +and the [`Trie` type]($DOCURL/trie.html). **Server model implementation** -------------------------------- @@ -164,14 +164,14 @@ The model implementation formally defines the _behavioral by implementing the server's interface in terms of the [_server model types_](#server-model-types). -See [`serverModel.md`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverModel.md) for authoritative documentation. +See [`serverModel.md`]($DOCURL/examples/produce-exchange/serverModel.html) for authoritative documentation. See [`serverModel.as`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/stdlib/examples/produce-exchange/serverModel.as) for the source code. -Note that while we define the **behavior for the PESS**, the +Note that while we define the **behavior for the server**, the _implementation details of this component and [server model -types](#server-model-types) themselves are not in PESS, and are -subject to change independently of PESS. +types](#server-model-types) themselves are not in definition, and are +subject to change independently of this definition. **Aside:** This model implementation is highly formulaic. In the future, we could likely _derive_ such implementations (auto-generate @@ -200,7 +200,7 @@ We decompose the **test suite** for the Produce Exchange into the following mile To do -See below for [more thoughts about performance testing](https://github.com/dfinity-lab/actorscript/tree/stdlib-examples/design/stdlib/examples/produce-exchange#performance-considerations). +See below for [more thoughts about performance testing]($DOCURL/stdlib/examples/produce-exchange#performance-considerations). @@ -225,10 +225,10 @@ ALL USERS > **Sign up** User can add their name and role and receive a unique ID -See these, provided by the [**registrar** role](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#pess-registrar-based-ingress-messages): -- [**`registrarAddProducer`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#registraraddproducer) -- [**`registrarAddTransporter`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#registraraddtransporter) -- [**`registrarAddRetailer`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#registraraddretailer) +See these, provided by the [**registrar** role]($DOCURL/examples/produce-exchange/serverActor.md#registrar-based-ingress-messages): +- [**`registrarAddProducer`**]($DOCURL/examples/produce-exchange/serverActor.md#registraraddproducer) +- [**`registrarAddTransporter`**]($DOCURL/examples/produce-exchange/serverActor.md#registraraddtransporter) +- [**`registrarAddRetailer`**]($DOCURL/examples/produce-exchange/serverActor.md#registraraddretailer) > **Log in** A user can identify themselves from a dropdown and "log in" @@ -242,63 +242,63 @@ PRODUCER ------------- > **Add/update inventory** Producer updates the goods, prices in the inventory available on the exchange -See [**`produerAddInventory`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#produceraddinventory) -and [**`produerRemInventory`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#producerreminventory) +See [**`produerAddInventory`**]($DOCURL/examples/produce-exchange/serverActor.md#produceraddinventory) +and [**`produerRemInventory`**]($DOCURL/examples/produce-exchange/serverActor.md#producerreminventory) > **View inventory** Producer can see their inventory -See [**`producerAllInventoryInfo`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#producerallinventoryinfo) +See [**`producerAllInventoryInfo`**]($DOCURL/examples/produce-exchange/serverActor.md#producerallinventoryinfo) > **View past sales orders** Producer can see sales orders they fulfilled in the past Note: We call them "reservations". -See [**`producerReservations`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#producerreservations) +See [**`producerReservations`**]($DOCURL/examples/produce-exchange/serverActor.md#producerreservations) > **View "market price"** Producer can see the last sales price for any good within any geographic area -See [**`produceMarketInfo`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#producemarketinfo) +See [**`produceMarketInfo`**]($DOCURL/examples/produce-exchange/serverActor.md#producemarketinfo) TRANSPORTER --------------------- > **Add/update routes** Transporter updates the routes available on the exchange. Transporter can see their routes. Each route is composed of an origin zone, destination zone, pickup date, delivery date, cost. -See [**`transporterAddRoute`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#transporteraddroute) -and [**`transporterRemRoute`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#transporterremroute) +See [**`transporterAddRoute`**]($DOCURL/examples/produce-exchange/serverActor.md#transporteraddroute) +and [**`transporterRemRoute`**]($DOCURL/examples/produce-exchange/serverActor.md#transporterremroute) > **View routes** Transporter can see their routes. Each route is composed of an origin zone, destination zone, pickup date, delivery date, cost. -See [**`transporterAllRouteInfo`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#transporterallrouteinfo) +See [**`transporterAllRouteInfo`**]($DOCURL/examples/produce-exchange/serverActor.md#transporterallrouteinfo) > **View past sales orders** Transporter can see routes which were utilized in the past Note: We call them "reservations". -See [**`transporterAllReservationInfo`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#transporterallreservationinfo) +See [**`transporterAllReservationInfo`**]($DOCURL/examples/produce-exchange/serverActor.md#transporterallreservationinfo) RETAILER ------------------- > **Query inventory** Retailer can query a good with a delivery date. The Exchange will return a list of goods (and prices) that can be delivered to that retailer's geography within that date. -See [**`retailerQueryDates`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#retailerquerydates) +See [**`retailerQueryDates`**]($DOCURL/examples/produce-exchange/serverActor.md#retailerquerydates) and -[**`retailerQueryAll`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#retailerqueryall) +[**`retailerQueryAll`**]($DOCURL/examples/produce-exchange/serverActor.md#retailerqueryall) > **Place a sales order** Retailer can place order for one or more of options presented by any query. Note: We call them "reservations". -See [**`retailerReserve`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#retailerreserve) +See [**`retailerReserve`**]($DOCURL/examples/produce-exchange/serverActor.md#retailerreserve) and -[**`retailerReserveCheapest`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#retailerreservecheapest) +[**`retailerReserveCheapest`**]($DOCURL/examples/produce-exchange/serverActor.md#retailerreservecheapest) > **View past sales orders** Retailer can see sales orders they placed in the past Note: We call them "reservations". -See [**`retailerReservations`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#retailerreservations) +See [**`retailerReservations`**]($DOCURL/examples/produce-exchange/serverActor.md#retailerreservations) @@ -307,27 +307,27 @@ EXCHANGE DAPP DEVELOPER > **View GMV** Developer can see aggregate sum of how many sales have been processed -See [**`devViewGMV`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#devviewgmv). +See [**`devViewGMV`**]($DOCURL/examples/produce-exchange/serverActor.md#devviewgmv). > **View queries** Developer can see how many aggregate queries have been made by all retailers -See [**`devViewQueries`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#devviewqueries). +See [**`devViewQueries`**]($DOCURL/examples/produce-exchange/serverActor.md#devviewqueries). > **View sales orders** Developer can see how many aggregate sales orders have been made by all retailers -See [**`devViewReservations`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#devviewreservations). +See [**`devViewReservations`**]($DOCURL/examples/produce-exchange/serverActor.md#devviewreservations). > **View producers** Developer can see how many producers in the system and how many goods each has -See [**`devViewProducers`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#devviewproducers). +See [**`devViewProducers`**]($DOCURL/examples/produce-exchange/serverActor.md#devviewproducers). > **View transporters** Developer can see how many producers in the system and how many goods each has -See [**`devViewTransporters`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#devviewtransporters). +See [**`devViewTransporters`**]($DOCURL/examples/produce-exchange/serverActor.md#devviewtransporters). > ****View retailers** Developer can see how many retailers in the system and how many queries and how many sales orders -See [**`devViewRetailers`**](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md#devviewretailers). +See [**`devViewRetailers`**]($DOCURL/examples/produce-exchange/serverActor.md#devviewretailers). @@ -542,13 +542,13 @@ We have the following questions: Canister upgrades ==================== -The PESS evolves according to the "central authority" (cf PE spec +The standards evolve according to the "central authority" (cf PE spec document), who we identify as the github repo and open source developer community that surrounds this implementation. -Updating the types in the PESS requires changing the file `serverTypes.as` +Updating the types in the standards requires changing the file `serverTypes.as` mentioned above, and performing a canister upgrade on the running -system. Similarly, to evolve the behavioral definition of PESS, the +system. Similarly, to evolve the behavioral definition of standards, the implementation of this actor will change (in `serverActor.as` and `serverModel.as`), and will also require a canister upgrade. diff --git a/stdlib/examples/produce-exchange/serverActor.as b/stdlib/examples/produce-exchange/serverActor.as index d36688ffe9d..7d765351985 100644 --- a/stdlib/examples/produce-exchange/serverActor.as +++ b/stdlib/examples/produce-exchange/serverActor.as @@ -1,13 +1,13 @@ /** - [PESS Background](https://github.com/dfinity-lab/actorscript/tree/stdlib-examples/design/stdlib/examples/produce-exchange#Produce-Exchange-Standards-Specification-PESS) + [Background]($DOCURL/stdlib/examples/produce-exchange#Produce-Exchange-Standards-Specification) -------------------- */ actor server = { /** - PESS: Server Actor + Server Actor ======================================= The `Server` actor defines an interface for messages sent @@ -15,11 +15,11 @@ actor server = { See also: - - [client-server types](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverTypes.md#server-types). - - the **[server `Model` class](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverModel.md)**. + - [client-server types]($DOCURL/examples/produce-exchange/serverTypes.md#server-types). + - the **[server `Model` class]($DOCURL/examples/produce-exchange/serverModel.html)**. - PESS: Registrar-based ingress messages + Registrar-based ingress messages ================================================ The registrar provides functions to add and to remove entities from @@ -236,7 +236,7 @@ actor server = { `getRegionInfo` --------------------- - See also: [server type `RegionInfo`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverTypes.md#regioninfo). + See also: [server type `RegionInfo`]($DOCURL/examples/produce-exchange/serverTypes.md#regioninfo). */ @@ -251,7 +251,7 @@ actor server = { `allRegionInfo` --------------------- - See also: [server type `RegionInfo`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverTypes.md#regioninfo). + See also: [server type `RegionInfo`]($DOCURL/examples/produce-exchange/serverTypes.md#regioninfo). */ @@ -517,7 +517,7 @@ actor server = { /** - PESS: `Producer`-based ingress messages: + `Producer`-based ingress messages: ========================================== */ @@ -525,7 +525,7 @@ actor server = { `producerAddInventory` ------------------------------------------ - See also [Model.producerAddInventory](https://github.com/dfinity-lab/actorscript/tree/stdlib-examples/design/stdlib/examples/produce-exchange/serverModel.md#produceraddinventory) + See also [Model.producerAddInventory]($DOCURL/stdlib/examples/produce-exchange/serverModel.md#produceraddinventory) */ producerAddInventory( id: ProducerId, @@ -621,7 +621,7 @@ actor server = { /** - PESS: `Transporter`-based ingress messages: + `Transporter`-based ingress messages: =========================================== */ @@ -669,7 +669,7 @@ actor server = { }; /** - PESS: `Retailer`-based ingress messages: + `Retailer`-based ingress messages: ====================================== `retailerQueryAll` @@ -715,31 +715,6 @@ actor server = { retailerReserve(id, inventory, route) }; - /** - `retailerReserveCheapest` - --------------------------- - - Like `retailerReserve`, but chooses cheapest choice among all - feasible produce inventory items and routes, given a grade, - quant, and delivery window. - - ?? This may be an example of what Mack described to me as - wanting, and being important -- a "conditional update"? - - */ - retailerReserveCheapest( - id:RetailerId, - produce:ProduceId, - grade:Grade, - quant:Quantity, - begin:Date, - end:Date - ) : async ?(ReservedInventoryId, ReservedRouteId) - { - getModel(). - retailerReserveCheapest(id, produce, grade, quant, begin, end) - }; - /** `retailerReservations` --------------------------- @@ -759,7 +734,7 @@ actor server = { /** - PESS: Developer-based ingress messages: + Developer-based ingress messages: ======================================================== The following messages may originate from developers @@ -802,8 +777,7 @@ been processed */ devViewGMV() : async ?Nat { - // xxx - null + nyi() }; /** @@ -911,27 +885,9 @@ been processed }; /** - End of PESS interface definition + End of interface definition ----------------------------------- - With the following closing brace, the interface of the PESS `Server` is thusly defined. + With the following closing brace, the interface of the `Server` is thusly defined. */ }; // end: actor class `Server` -///////////////////////////////////////////////////////////////////////////// - -/** - To do: PESS definition - ================================================ - - More registrar ingress messages: - -------------------------------- - - - Get a list of all ids for each entity class in the registry: - ids of all truck types, all regions, all produce, all transporters, all producers, all retailers. - - - For each id kind, provide a server message to get back the other registry info - that the registrar stores in association with it (short_name, description, etc.). - - - not now, but eventually, may need a cursor-message sub-system for going through extremely long lists of ids. - - */ diff --git a/stdlib/examples/produce-exchange/serverModel.as b/stdlib/examples/produce-exchange/serverModel.as index 2e86bda2381..fed2b747720 100644 --- a/stdlib/examples/produce-exchange/serverModel.as +++ b/stdlib/examples/produce-exchange/serverModel.as @@ -1,21 +1,21 @@ /** -[PESS Background](https://github.com/dfinity-lab/actorscript/tree/stdlib-examples/design/stdlib/examples/produce-exchange#Produce-Exchange-Standards-Specification-PESS) +[Background]($DOCURL/stdlib/examples/produce-exchange#Produce-Exchange-Standards-Specification) -------------------- Server Model =============================== -**[`Server` actor class](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverActor.md)** +**[`Server` actor class]($DOCURL/examples/produce-exchange/serverActor.html)** defines an interface for messages sent by all participants, and the responses received in return. -Here, we depart from defining PESS data types and messages, and +Here, we depart from defining messages and their data types, and instead turn our attention to the _internal representation_ of the server actor's state, defined by the **[server model -types](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/examples/produce-exchange/serverModelTypes.md)**, +types]($DOCURL/examples/produce-exchange/serverModelTypes.html)**, and the _outer behavior_ of this `Server` actor. The latter behavior -is part of the PESS definition, and the internal type definitions that it +is part of the standards definition, and the internal type definitions that it uses are is not. */ @@ -77,10 +77,10 @@ Representation We use several public-facing **tables**, implemented as document tables. -CRUD operations via [document tables](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/docTable.md) +CRUD operations via [document tables]($DOCURL/docTable.html) ---------------------------------------------------- -This server model provides [document table](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/docTable.md) objects to hold the +This server model provides [document table]($DOCURL/docTable.html) objects to hold the following kinds of entities in the exchange: - **Static resource information:** truck types, produce types and region information. @@ -572,7 +572,7 @@ than the MVP goals, however. /** - PESS Behavior: message-response specifications + Message-response specifications ====================================================== As explained in the `README.md` file, this actor also gives a @@ -580,7 +580,7 @@ than the MVP goals, however. implementation of this behavior (and wrapped trivially by `Server`). The functional behavior of this interface, but not implementation - details, are part of the formal PESS. + details, are part of the formal spec. */ @@ -1079,9 +1079,9 @@ than the MVP goals, however. - [`makeReservationInfo`](#makereservationinfo): Summarizes the reserved route and inventory documents. For `Trie`-based DB operations: - - [`Trie.join`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/trie.md#join): For the inner join on common `RegionId`s of routes and inventory. - - [`Trie.prod`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/trie.md#prod): For the catesian product of routes and inventory. - - [`Trie.mergeDisjoint2D`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/trie.md#mergeDisjoint2D): To flatten 2D mappings into 1D mappings. + - [`Trie.join`]($DOCURL/trie.md#join): For the inner join on common `RegionId`s of routes and inventory. + - [`Trie.prod`]($DOCURL/trie.md#prod): For the catesian product of routes and inventory. + - [`Trie.mergeDisjoint2D`]($DOCURL/trie.md#mergeDisjoint2D): To flatten 2D mappings into 1D mappings. */ retailerQueryAll(id:RetailerId) : ?QueryAllResults { retailerQueryCount += 1; @@ -1187,8 +1187,6 @@ than the MVP goals, however. `retailerAllReservationInfo` --------------------------- - TODO-Cursors (see above). - */ retailerAllReservationInfo(id:RetailerId) : ?[(ReservedInventoryInfo, @@ -1254,29 +1252,5 @@ than the MVP goals, however. nyi() }; - /** - `retailerReserveCheapest` - --------------------------- - - Like `retailerReserve`, but chooses cheapest choice among all - feasible produce inventory items and routes, given a grade, - quant, and delivery window. - - ?? This may be an example of what Mack described to me as - wanting, and being important -- a "conditional update"? - - */ - retailerReserveCheapest( - id:RetailerId, - produce:ProduceId, - grade:Grade, - quant:Quantity, - begin:Date, - end:Date - ) : ?(ReservedInventoryId, ReservedRouteId) - { - nyi() - }; - }; diff --git a/stdlib/examples/produce-exchange/serverModelTypes.as b/stdlib/examples/produce-exchange/serverModelTypes.as index f8d05e39098..fd0e3326d15 100644 --- a/stdlib/examples/produce-exchange/serverModelTypes.as +++ b/stdlib/examples/produce-exchange/serverModelTypes.as @@ -1,6 +1,6 @@ /** -[PESS Background](https://github.com/dfinity-lab/actorscript/tree/stdlib-examples/design/stdlib/examples/produce-exchange#Produce-Exchange-Standards-Specification-PESS) +[Background]($DOCURL/stdlib/examples/produce-exchange#Produce-Exchange-Standards-Specification) -------------------- Server Model Types @@ -28,7 +28,7 @@ Representation ------------ See also: modules for [`Trie`]() - and [`DocTable`](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/docTable.md). + and [`DocTable`]($DOCURL/docTable.html). */ @@ -38,7 +38,7 @@ let Map = Trie; /** -[Document tables](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/docTable.md) +[Document tables]($DOCURL/docTable.html) -------------------------- Document tables abstract over the various finite map operations we @@ -53,7 +53,7 @@ Nested document structures ----------------------------- Below, we define top-level **document structures** for representing each `Producer`, -`Retailer` and `Transporter`'s officially published state within the PESS. +`Retailer` and `Transporter`'s officially published state within the exchange. Formally, these types define the types of forests (a set of trees with many roots) that constitute our internal data model. @@ -63,7 +63,7 @@ For each kind of structure below, we assume a type of unique Id. We associate document information, such as textual names and descriptions, where appropriate. -We include other fields from the PESS, such as "units", "grades", +We include other fields such as "units", "grades", "dates" and time intervals (start/end dates), each where appropriate. Query implementation diff --git a/stdlib/examples/produce-exchange/serverTypes.as b/stdlib/examples/produce-exchange/serverTypes.as index 19a07c15dff..763bb161fbf 100644 --- a/stdlib/examples/produce-exchange/serverTypes.as +++ b/stdlib/examples/produce-exchange/serverTypes.as @@ -1,13 +1,13 @@ /** -[PESS Background](https://github.com/dfinity-lab/actorscript/tree/stdlib-examples/design/stdlib/examples/produce-exchange#Produce-Exchange-Standards-Specification-PESS) +[Background]($DOCURL/examples/produce-exchange#Produce-Exchange-Standards-Specification) -------------------- Server Types ================== This file defines structures that appear the server actor's messaging -interface. They are part of the formal PESS definition. +interface. They are part of the formal standards definition. */ @@ -15,7 +15,7 @@ interface. They are part of the formal PESS definition. /** Basic types --------------------- -These types standardize representations for many common PESS notions +These types standardize representations for many common notions */ @@ -288,9 +288,9 @@ type ProduceExchangeCounts = shared { /** // -// PESS: Query parameters and results +// Query parameters and results // ---------------------------------- -// Externally, these types define the input and output structures for PESS queries. +// Externally, these types define the input and output structures for queries. // Internally, producing instances of the result structures will require // performing joins based on internal tables, and the information from the input structures. diff --git a/stdlib/markdown-of-actorscript.py b/stdlib/markdown-of-actorscript.py index 28f104d79bf..f3a91e1eee6 100755 --- a/stdlib/markdown-of-actorscript.py +++ b/stdlib/markdown-of-actorscript.py @@ -43,6 +43,18 @@ ## - KISS: Dont mix mode switches on a single line. ## + +## Stable links +## ----------- +## https://hydra.oregon.dfinity.build//job/dfinity-ci-build/actorscript.pr-234/stdlib-reference/latest/download/1/doc/ +## +## (PR 234 is the current PR for the standard library and produce exchange) +## + +DOCURL="https://hydra.oregon.dfinity.build//job/dfinity-ci-build/actorscript.pr-234/stdlib-reference/latest/download/1/doc/" + +############################################################################################################# + import sys import re @@ -85,6 +97,7 @@ def switchModeTo(toMode, toModeOpen, toModeClose): modeLines.pop() print "" for l in modeLines: + l = l.replace("$DOCURL", DOCURL); print(l.rstrip()) print modeClose # The source file explicitly omitted this diff --git a/stdlib/markdown-of-markdown.py b/stdlib/markdown-of-markdown.py new file mode 100755 index 00000000000..14c719d9b7d --- /dev/null +++ b/stdlib/markdown-of-markdown.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +## Stable links +## ----------- +## https://hydra.oregon.dfinity.build//job/dfinity-ci-build/actorscript.pr-234/stdlib-reference/latest/download/1/doc/ +## +## (PR 234 is the current PR for the standard library and produce exchange) +## + +DOCURL="https://hydra.oregon.dfinity.build//job/dfinity-ci-build/actorscript.pr-234/stdlib-reference/latest/download/1/doc/" + +############################################################################################################# + +import sys +import re + +with open(sys.argv[1], "r") as ins: + for line in ins: + line = line.replace("$DOCURL", DOCURL); + print line.rstrip() diff --git a/stdlib/trie.as b/stdlib/trie.as index 4431935157c..63e3461f205 100644 --- a/stdlib/trie.as +++ b/stdlib/trie.as @@ -95,7 +95,7 @@ type Trie = ?Node; ----------------- Notice above that the `Leaf` case uses a list of key-value pairs. - See [this document](https://github.com/dfinity-lab/actorscript/blob/stdlib-examples/design/stdlib/assocList.md) for more details. + See [this document]($DOCURL/assocList.html) for more details. */ /**