This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vyzo@carbon go-libp2p-kad-dht $ go test -v -run TestConcurrentRequests -timeout 1m | |
=== RUN TestConcurrentRequests | |
panic: test timed out after 1m0s | |
goroutine 179 [running]: | |
testing.startAlarm.func1() | |
/usr/lib64/go/src/testing/testing.go:1145 +0xf9 | |
created by time.goFunc | |
/usr/lib64/go/src/time/sleep.go:170 +0x44 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ go test -v | |
# gx/ipfs/QmQMdVT3PHEhMbdkANAqjpEmyUpVZEEzZyougpCSYqcjre/go-reuseport | |
../../../gx/ipfs/QmQMdVT3PHEhMbdkANAqjpEmyUpVZEEzZyougpCSYqcjre/go-reuseport/impl_unix.go:99:16: cannot use sockaddrnet.NetAddrToSockaddr(dialer.LocalAddr) (type "golang.org/x/sys/unix".Sockaddr) as type "gx/ipfs/QmPXvegq26x982cQjSfbTvSzZXn7GiaMwhhVPHkeTEhrPT/sys/unix".Sockaddr in assignment: | |
"golang.org/x/sys/unix".Sockaddr does not implement "gx/ipfs/QmPXvegq26x982cQjSfbTvSzZXn7GiaMwhhVPHkeTEhrPT/sys/unix".Sockaddr (missing "gx/ipfs/QmPXvegq26x982cQjSfbTvSzZXn7GiaMwhhVPHkeTEhrPT/sys/unix".sockaddr method) | |
../../../gx/ipfs/QmQMdVT3PHEhMbdkANAqjpEmyUpVZEEzZyougpCSYqcjre/go-reuseport/impl_unix.go:100:17: cannot use sockaddrnet.NetAddrToSockaddr(netAddr) (type "golang.org/x/sys/unix".Sockaddr) as type "gx/ipfs/QmPXvegq26x982cQjSfbTvSzZXn7GiaMwhhVPHkeTEhrPT/sys/unix".Sockaddr in assignment: | |
"golang.org/x/sys/unix".Sockaddr does not implement "gx/ipfs/QmPXvegq26x982cQjSfbTvSzZXn7GiaMwhhVPHkeTEhrPT/sys/unix".Sockaddr (missing "gx/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defsyntax (let-hash stx) | |
(syntax-case stx () | |
((macro expr body ...) | |
(with-syntax ((@ref (stx-identifier #'macro '%%ref))) | |
#'(let (hash expr) | |
(let-syntax | |
((var-ref | |
(syntax-rules () | |
((_ id) (@ref id))))) | |
(let-syntax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(with-exception-handler | |
(let (E (current-exception-handler)) | |
(lambda (exn) | |
(continuation-capture | |
(lambda (cont) | |
(dump-stack-trace! cont exn) | |
(E exn))))) | |
(lambda () do-stuff-that-raises)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; The cache is a perfect hash table represented as a vector containing | |
;; cache entries. A cache entry is an inverted arg type id improper list | |
;; terminating to the the method procedure. | |
;; This allows for lock-free allocation-free recursive lookup | |
;; and reasonably fast dispatch | |
(def (generic-cache-lookup cache args) | |
(def (lookup hash rest) | |
(match rest | |
([arg . rest] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat for-syntax.ss | |
(import (phi: -1 :tmp/for-template)) | |
(displayln "for-syntax") | |
$ cat for-template.ss | |
(displayln "for-template") | |
$ cat program.ss | |
(import (phi: +1 :tmp/for-syntax)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(c-declare #<<END-C | |
// these are defined in gambit/lib/mem.c | |
#define ___PSTATE_MEM(var) ___ps->mem.var | |
#define still_objs ___PSTATE_MEM(still_objs_) | |
#define ___STILL_LINK_OFS 0 | |
#define ___STILL_REFCOUNT_OFS 1 | |
#define ___STILL_BODY_OFS 6 | |
#define ___STILL_HAND_OFS ___STILL_BODY_OFS | |
END-C | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gossipsub aka meshsub/1.0.0 | |
basic idea: | |
- regular flood of gossip about messages seen (and perhaps peer exchange) | |
- prune the overlay for message relay to create a random mesh (hence meshsub) | |
router state per topic: | |
- maintain a list of all connected peers in the topic | |
- we flood to floodsub peers | |
- for gossipsub peers: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def (get-caller cont) | |
(let lp ((cont cont)) | |
(and cont | |
(or (##continuation-creator cont) | |
(lp (##continuation-next-frame cont #f)))))) | |
(def (log/caller fmt . args) | |
(continuation-capture | |
(lambda (cont) | |
(let (caller (get-caller cont)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; -*- Gerbil -*- | |
(import :gerbil/gambit/random | |
:std/misc/shuffle | |
(only-in :std/srfi/1 take)) | |
(export (struct-out node) | |
node-degree | |
node-graft! | |
node-prune! | |
make-graph |