ddat interop with dat js
cable interop with cabal js
ddat's frontend = dat-thang
cable fe = cable-thang
dillo support based on cel's dillo-dat
bootstrap node
xplatform support

Signed-off-by: divo <418@cryspace.space>
This commit is contained in:
divorce committed 2026-10-19 00:17:02 -04:00
1 parent f0f91540be
commit b735900f2e
323 files changed
+134347 -343

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
;;; The C codec owns framing and protocol bytes. Scheme owns the readable view.
;;; Wire records have named fields, so optional fields can be added without
;;; changing positional call sites or the peer-visible protocol.
(define (dat:wire-message channel type payload)
(if (not (and (integer? channel) (exact? channel) (>= channel 0)))
(error 'out-of-range "wire channel must be a non-negative exact integer" channel))
(if (not (and (integer? type) (exact? type) (>= type 0)))
(error 'out-of-range "wire type must be a non-negative exact integer" type))
(if (not (byte-vector? payload))
(error 'wrong-type-arg "wire payload must be a bytevector" payload))
(list 'dat:wire-message
(cons 'channel channel)
(cons 'type type)
(cons 'payload payload)))
(define (dat:wire-message? value)
(and (dat:record? value 'dat:wire-message)
(integer? (dat:record-ref value 'channel #f))
(integer? (dat:record-ref value 'type #f))
(byte-vector? (dat:record-ref value 'payload #f))))
(define (dat:wire-frame->record bytes)
(dat-wire->sexp bytes))
(define (dat:record->wire-frame record)
(if (not (dat:wire-message? record))
(error 'wrong-type-arg "expected a dat:wire-message record" record)
(dat-sexp->wire record)))
(provide 'dat:wire)