C4 linearization algorithm and helpers #1467
No reviewers
Labels
No labels
UX
active development
backlog
blocker
bootstrap
bounty
bug
dependencies
discussion
documentation
duplicate
enhancement
flaky test
help wanted
invalid
javascript
question
release
tendentious
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mighty-gerbils/gerbil!1467
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "v0.19-c4"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The C4 linearization algorithm, updated:
C3 linearization (which we were already using)
support for "suffix" vs "infix" specifications (i.e. struct vs classes, which we had of late)
Better O(dn) instead of O(d²n²) asymptotic performance
Support for the local order being an arbitrary partial order, not necessarily total.
Helpers:
move the old v0.18 std/misc/hash to std/hash/misc (instead of std/hash) and std/hash-tables becomes std/hash/types
implement a new with-id, in between the old with-id (of std/sugar) and the new with-identifiers
(Reopening #1466, cleanly I hope.)
some fishy bug looking things
@ -12,6 +12,7 @@ package: gerbil"core/match""core/more-sugar""core/contract""core/more-syntax-sugar"no, this is the wrong phase.
can't import this here.
@ -72,2 +72,3 @@struct: falseeq: free-identifier=?))eq: free-identifier=?get-name: stx-e))that looks like a bug, what exactly does
get-namedo?you can't hash identifiers with their
stx-e, it drops the context.get-name is there purely for the sake of error messages, so that in case of inconsistency in the class definitions, we print just the name of a class, not the potentially circular data structure associated to it.
No algorithmic decision is made based on the name. Equality is on the original value provided, in this case, the identifier itself.
@ -876,2 +877,3 @@(!class-type-struct? (syntax-local-value klass-id)))eq: free-identifier=?))eq: free-identifier=?get-name: stx-e))same here.
@ -3243,2 +3245,3 @@(!class-type-struct? (syntax-local-value/context klass-id)))eq: free-identifier=?))eq: free-identifier=?get-name: stx-e))and here
@ -9,6 +9,27 @@ package: gerbil/core(phi: +1 "runtime" "expander" "sugar"))(export #t)(begin-syntaxseems like you want those in a nested module?
maybe that's why you had to import more-syntax-sugar at runtime.
and import both at runtime and for-syntax here, not in core
I moved those things to more-sugar where I now believe they belong.
that s not a good place either. these things need to not be present at base runtime or else everytime you compile a binary you pull the expander... fail.
@ -48,0 +73,4 @@(stx-map(lambda (clause)(syntax-case clause (quote unquote quasiquote)((fresh-id (quote local-id))untabify
@ -1169,6 +1169,7 @@ package: gerbil/coresystem-version-stringtable->listtable-copytable-new ;; TODO: BOOTSTRAPremove TODO
@ -1821,6 +1822,7 @@ package: gerbil/corehash-keyshash-valueshash-copyhash-new ;; TODO: BOOTSTRAPremove TODO
@ -29,6 +29,7 @@ namespace: #f(delete! key) => :void(for-each (proc : :procedure)) => :void(copy) => @HashTable(new (size-hint :? :fixnum := #f)) => @HashTable ;; TODO: BOOTSTRAPremove TODO
@ -616,6 +627,9 @@ namespace: #f=> HashTable(h.copy))(defhash-method (hash-new h) => HashTable (h.new)) ;; TODO: BOOTSTRAPremove TODO comment
@ -617,2 +628,4 @@(h.copy))(defhash-method (hash-new h) => HashTable (h.new)) ;; TODO: BOOTSTRAP;;(defhash-method (hash-new h) => HashTable (void)) ;; TODO: BOOTSTRAPand this?
@ -0,0 +5,4 @@(export sugar-test)(import"../core/more-syntax-sugar"import this by its canonical path?
@ -6,3 +6,3 @@:std/hash-table:std/hash/types:std/io/interface:std/io/bio/apifix this indent while at it
9c03c8d218to2b97aede812b97aede81to53e2170d85no, these utils are syntax specific.
@ -39,1 +39,3 @@#'(%#set! id expr)))))#'(%#set! id expr))))(def (stx-re-source stx src)no. these do not belong to a runtime module.
almost ready, a couple of erroneous stx-e usages where it should by syntax-e
@ -31,6 +31,7 @@ package: gerbil"core/mop""core/match""core/more-sugar""core/more-syntax-sugar"why is this here? it doesn't import it at runtime.
@ -40,0 +53,4 @@((stx-pair? stx)(stx-re-source (cons (recur (stx-car stx)) (recur (stx-cdr stx))) stx))((stx-vector? stx)(stx-re-source (vector-map recur (stx-e stx)) stx))syntax-e
@ -40,0 +55,4 @@((stx-vector? stx)(stx-re-source (vector-map recur (stx-e stx)) stx))((stx-box? stx)(stx-re-source (box (recur (unbox (stx-e stx)))) stx))sytnax-e
53e2170d85to1a63e22bfe