Skip to content

Instantly share code, notes, and snippets.

package postgres:api {
interface connection {
query: func(...) -> ...;
execute: func(...) -> ...;
}
interface connections {
*: connection;
}
interface runtime-connections {
resource connection = resourceify(connection);
;; Each of these 4 modules is independently published. Note that, while there is a non-trivial amount of type-y
;; boilerplate, it is proportional in size to only the *direct* dependencies.
(module $A
(type $Wasi (instance ...))
(import "wasi" (instance (type $Wasi)))
(func (export "a") ...)
)
(module $B
@lukewagner
lukewagner / ArrayBuffer.transfer
Created November 13, 2014 23:38
ArrayBuffer.transfer strawman
Proposal
--------
The proposal is to add a static ArrayBuffer.transfer(oldBuffer [, newByteLength]). This
method returns a new ArrayBuffer whose contents are taken from oldBuffer.[[ArrayBufferData]]
and then either truncated or zero-extended to be newByteLength. This operation leaves
oldBuffer in a detached state. If newByteLength is undefined, oldBuffer.byteLength is
used.
var buf1 = new ArrayBuffer(40);