Skip to content

Instantly share code, notes, and snippets.

@copy
copy / v86.md
Created December 17, 2022 18:25

Here's an overview of v86 workings. For details, check the source.

The major limitations of WebAssembly are:

  • structured control flow (you can't generate arbitrary jumps)
  • no control over registers (you can't keep x86 registers in wasm locals across functions)
  • no mmap (paging needs to be fully emulated)
  • no patching
  • module generation is fairly slow, but at least it's asynchronous, so other things can keep running
  • there is some memory overhead per module, so you can't generate more than a few thousand
open Astring
let request_uri =
try Unix.unsafe_getenv "REQUEST_URI"
with Not_found -> ""
let request_method =
match Unix.unsafe_getenv "REQUEST_METHOD" with
| exception Not_found -> `Get
| "GET" -> `Get
#!/usr/bin/env bash
set -ve
if [ $(id -u) != "0" ]
then
echo "Please run as root"
exit 1
fi
OUTFILE=/tmp/debian-full.img
#
# Automatically generated file; DO NOT EDIT.
# SeaBIOS Configuration
#
#
# General Features
#
# CONFIG_COREBOOT is not set
CONFIG_QEMU=y
diff --git a/src/tcpip_checksum/tcpip_checksum.ml b/src/tcpip_checksum/tcpip_checksum.ml
index 2b7abc87..5035ccaa 100644
--- a/src/tcpip_checksum/tcpip_checksum.ml
+++ b/src/tcpip_checksum/tcpip_checksum.ml
@@ -15,6 +15,30 @@
*)
(** One's complement checksum, RFC1071 *)
-external ones_complement: Cstruct.t -> int = "caml_tcpip_ones_complement_checksum"
+(* external ones_complement: Cstruct.t -> int = "caml_tcpip_ones_complement_checksum" *)
*** Run benchmarks for path "list.nth.100"
Throughputs for "List.nth", "Map.find", "RAL.get", "funvec.get", "batvec.get", "clarity_vec.get" each running 3 times for at least 2 CPU seconds:
List.nth: 2.10 WALL ( 2.10 usr + 0.00 sys = 2.10 CPU) @ 229382.33/s (n=482091)
2.10 WALL ( 2.10 usr + 0.00 sys = 2.10 CPU) @ 229541.89/s (n=482091)
2.11 WALL ( 2.10 usr + 0.00 sys = 2.10 CPU) @ 229257.21/s (n=482091)
Map.find: 2.15 WALL ( 2.13 usr + 0.00 sys = 2.13 CPU) @ 232865.07/s (n=496269)
2.13 WALL ( 2.13 usr + 0.00 sys = 2.13 CPU) @ 233399.52/s (n=496269)
2.11 WALL ( 2.10 usr + 0.00 sys = 2.10 CPU) @ 235763.63/s (n=496269)
RAL.get: 2.09 WALL ( 2.09 usr + 0.00 sys = 2.09 CPU) @ 1262272.53/s (n=2642666)
(* The Computer Language Benchmarks Game
* https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
*
* contributed by Troestler Christophe
* modified by Mauricio Fernandez
*)
module C(S : sig
val k : int
val dna : bytes
(*
* The Computer Language Benchmarks Game
* https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
*
* regex-dna program contributed by Paolo Ribeca, August 2011
*
* The regexp machinery comes from a previous OCaml version by
* Christophe TROESTLER and Mauricio Fernandez
*
* converted from regex-dna program
#N Sir Robin
#O Adam P. Goucher, Tom Rokicki; 2018
#C The first elementary knightship to be found in Conway's Game of Life.
#C http://conwaylife.com/wiki/Sir_Robin
x = 31, y = 79, rule = B3/S23
4b2o$4bo2bo$4bo3bo$6b3o$2b2o6b4o$2bob2o4b4o$bo4bo6b3o$2b4o4b2o3bo$o9b
2o$bo3bo$6b3o2b2o2bo$2b2o7bo4bo$13bob2o$10b2o6bo$11b2ob3obo$10b2o3bo2b
o$10bobo2b2o$10bo2bobobo$10b3o6bo$11bobobo3bo$14b2obobo$11bo6b3o2$11bo
9bo$11bo3bo6bo$12bo5b5o$12b3o$16b2o$13b3o2bo$11bob3obo$10bo3bo2bo$11bo
4b2ob3o$13b4obo4b2o$13bob4o4b2o$19bo$20bo2b2o$20b2o$21b5o$25b2o$19b3o
from .base import Base
import deoplete.util
import re
import time
class Source(Base):
def __init__(self, vim):
Base.__init__(self, vim)
self.name = 'test'