I hereby claim:
- I am mcpherrinm on github.
- I am mcpherrinm (https://keybase.io/mcpherrinm) on keybase.
- I have a public key whose fingerprint is 9CB0 EADC 9F72 685C 0657 401B 30CF 8EFF 1324 4DAC
To claim this, I am signing this object:
trait Bitbuf { | |
fn read_bytes(&self, start: uint, len: uint) -> u64; | |
fn write_bytes(&mut self, start: uint, len: uint, data: u64); | |
} | |
// An implementation on a bare buffer | |
//impl<'a> Bitbuf for &'a [u8] { | |
impl Bitbuf for ~[u8] { | |
fn read_bytes(&self, start: uint, len: uint) -> u64 { | |
let mut data = 0; |
05:52 PM -!- brson [brson@moz-BBE3ABD.mv.mozilla.com] has joined #rust | |
05:52 PM -!- mode/#rust [+ao brson brson] by ChanServ | |
05:52 PM < mcpherrin> there's a bit of info on https://github.com/mozilla/rust/pull/11151 I guess | |
05:53 PM <@huon> https://github.com/sfackler/syntax-ext-talk/blob/gh-pages/simple-ext/lib.rs | |
05:53 PM <@huon> https://github.com/sfackler/rust-phf/ | |
05:53 PM < sfackler> mcpherrin: libfourcc in the rust repo, or https://github.com/sfackler/rust-phf or https://github.com/sfackler/syntax-ext-talk/blob/gh-pages/simple-ext/lib.rs | |
The paper: | |
http://www.mpi-sws.org/~turon/re-deriv.pdf |
#!/bin/sh | |
while true; do | |
echo -n " > " | |
read line | |
TMP=`mktemp` | |
rustc - -o $TMP <<EOF | |
#[feature(globs, macro_rules, struct_variant)]; | |
extern mod extra; | |
fn main() { |
#![no_std] | |
extern "rust-intrinsic" { fn abort() -> !; } | |
#[no_mangle] | |
pub extern "C" fn rust_stack_exhausted() { | |
unsafe { abort() } | |
} | |
#[start] | |
fn start(_:int, _:**u8)->int{ 0 } |
_ ______ _ ______ _______ _ | |
/ \ | ___ \ | | / ____//__ __| / \ | |
/ _ \ | |___) )| |( (___ | | / _ \ | |
/ /_\ \ | |\ _/ | | \____ \ | | / /_\ \ | |
/ ___/\ \ | | \ \ | | ____) ) | | / ___/\ \ | |
/_/ \_\|_| \_\ |_| /_____/ |_|/_/ \_\ |
mm@cereal:~/dytest$ rustc -C prefer-dynamic --crate-type=dylib fooz.rs | |
mm@cereal:~/dytest$ cat fooz.rs | |
#[no_mangle] | |
pub extern "C" fn foo(x: int) { | |
println!("Cowabunga, {}", x); | |
} | |
mm@cereal:~/dytest$ cat test.py | |
import ctypes | |
fooz = ctypes.CDLL("/home/mm/dytest/libfooz-afaf02c9-0.0.so") |
fn main() { println!("Hello, World!") } |
main: declare.o main.o | |
declare.o: declare.cc | |
main.o: main.cc |
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object: