Skip to content

Instantly share code, notes, and snippets.

View kubkon's full-sized avatar

Jakub Konka kubkon

View GitHub Profile
@kubkon
kubkon / benchmark_results.txt
Created November 7, 2019 11:28
Bench nalgebra/kubkon/noncommutative
Compiling nalgebra v0.18.2 (/home/kubkon/dev/nalgebra)
warning: lint `incoherent_fundamental_impls` has been removed: `converted into hard error, see https://github.com/rust-lang/rust/issues/46205`
--> src/lib.rs:85:9
|
85 | #![warn(incoherent_fundamental_impls)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(renamed_and_removed_lints)]` on by default
warning: lint `incoherent_fundamental_impls` has been removed: `converted into hard error, see https://github.com/rust-lang/rust/issues/46205`
@kubkon
kubkon / vecorstr.rs
Created April 21, 2020 14:32
VecOrStr implementing IntoIterator<Item = String>
use std::vec::IntoIter;
pub enum VecOrStr {
Vec { inner: Vec<String> },
Str { inner: String },
}
impl VecOrStr {
pub fn from_iter<S: AsRef<str>>(iter: impl IntoIterator<Item = S>) -> Self {
let inner = iter.into_iter().map(|x| x.as_ref().to_owned()).collect();
@kubkon
kubkon / desired.wat
Created June 4, 2020 15:13
Import globals and export func that uses them
(module
(type (;0;) (func (param i32)))
(type (;1;) (func))
(import "env" "frobinate" (func $frobinate (type 0)))
(import "env" "glob" (global (;0;) i32))
(export "foo" (func $foo))
(func $foo (type 1)
global.get 0
call $frobinate
return))
@kubkon
kubkon / main.rs
Last active July 27, 2020 12:56
read_vectored in libstd
use std::fs;
use std::io::{self, IoSliceMut, Read, Write, Seek, SeekFrom};
fn main() -> io::Result<()> {
let mut f = fs::OpenOptions::new()
.read(true)
.write(true)
.create(true)
.truncate(true)
.open("test.txt")?;
@kubkon
kubkon / example.py
Created November 25, 2020 13:23
yapapi - schedule single task at a time
#!/usr/bin/env python3
import asyncio
import json
import marshal
import pathlib
import sys
import yapapi
from yapapi.log import enable_default_logger, log_summary, log_event_repr # noqa
from yapapi.runner import Engine, Task, vm
@kubkon
kubkon / fd_readdir_v0.26
Created May 11, 2021 08:18
fd_readdir - wasmtime v0.26.0
TRACE wasi_common::snapshots::preview_1::wasi_snapshot_preview1 > wiggle abi; module="wasi_snapshot_preview1" function="random_get"
TRACE wasi_common::snapshots::preview_1::wasi_snapshot_preview1 > buf=*guest 0xffed0 buf_len=48
TRACE wasi_common::snapshots::preview_1::wasi_snapshot_preview1 > result=Ok(())
TRACE wasi_common::snapshots::preview_1::wasi_snapshot_preview1 > wiggle abi; module="wasi_snapshot_preview1" function="fd_prestat_get"
TRACE wasi_common::snapshots::preview_1::wasi_snapshot_preview1 > fd=Fd(3)
TRACE wasi_common::snapshots::preview_1::wasi_snapshot_preview1 > result=Ok(Dir(PrestatDir { pr_name_len: 1 }))
TRACE wasi_common::snapshots::preview_1::wasi_snapshot_preview1 > wiggle abi; module="wasi_snapshot_preview1" function="fd_prestat_dir_name"
TRACE wasi_common::snapshots::preview_1::wasi_snapshot_preview1 > fd=Fd(3) path=*guest 0x110000 path_len=1
TRACE wasi_common::snapshots::preview_1::wasi_snapshot_preview1 > result=Ok(())
TRACE wasi_common::snapshots::preview_1::wasi_sna
@kubkon
kubkon / fd_readdir_v0.22.1
Last active May 11, 2021 08:19
fd_readdir in wasmtime v0.22.1
DEBUG wasi_common::ctx > WasiCtx inserting entry pending=PendingEntry::Thunk(0x7ffc451ce240)
DEBUG wasi_common::sys::unix > Host fd 0 is a char device
DEBUG wasi_common::ctx > WasiCtx inserted fd=Fd(0)
DEBUG wasi_common::ctx > WasiCtx inserting entry pending=PendingEntry::Thunk(0x7ffc451ce240)
DEBUG wasi_common::sys::unix > Host fd 1 is a file
DEBUG wasi_common::ctx > WasiCtx inserted fd=Fd(1)
DEBUG wasi_common::ctx > WasiCtx inserting entry pending=PendingEntry::Thunk(0x7ffc451ce240)
DEBUG wasi_common::sys::unix > Host fd 2 is a file
DEBUG wasi_common::ctx > WasiCtx inserted fd=Fd(2)
DEBUG wasi_common::ctx > WasiCtx inserted fd=Fd(3)
fs.test.test "std-i386-linux-none-Debug-bare-multi fs.copyFile"... FAIL (Unseekable)
/home/kubkon/dev/zig/lib/std/fs.zig:1439:25: 0x97dc6d in fs.Dir.deleteFileZ (test)
else => |e| return e,
^
/home/kubkon/dev/zig/lib/std/fs.zig:1418:13: 0x74bfac in fs.Dir.deleteFile (test)
return self.deleteFileZ(&sub_path_c);
^
/home/kubkon/dev/zig/lib/std/os.zig:1902:19: 0xa1cd87 in os.unlinkatZ (test)
EISDIR => return error.IsDir,
^
❯ cat config.h
/*
* Copyright (c) 2016 Andrew Kelley
*
* This file is part of zig, which is MIT licensed.
* See http://opensource.org/licenses/MIT
*/
#ifndef ZIG_CONFIG_H
#define ZIG_CONFIG_H
❯ cat config.h
/*
* Copyright (c) 2016 Andrew Kelley
*
* This file is part of zig, which is MIT licensed.
* See http://opensource.org/licenses/MIT
*/
#ifndef ZIG_CONFIG_H
#define ZIG_CONFIG_H