Skip to content

Instantly share code, notes, and snippets.

View olsonjeffery's full-sized avatar
💭
:3

Jeff Olson olsonjeffery

💭
:3
View GitHub Profile
@olsonjeffery
olsonjeffery / gdb
Created August 7, 2013 03:54
error..
running 1 test
[New Thread 0x7ffff5225700 (LWP 20307)]
[New Thread 0x7ffff460a700 (LWP 20308)]
[New Thread 0x7fffef3fd700 (LWP 20309)]
[New Thread 0x7fffee7e2700 (LWP 20310)]
STREAM FUTURE FROM CONNECT: {state: Pending()}
BEFORE RESOLVING ret_future: {state: Pending()}
AFTER RESOLVING ret_future: Err({kind: ConnectionRefused, desc: "connection refused", detail: None})
failed to async connect: {kind: ConnectionRefused, desc: "connection refused", detail: None}
AFTER COND RAISE
@olsonjeffery
olsonjeffery / git log
Created August 8, 2013 18:19
make install
jeff@mbp:~/src/rust/build$ VERBOSE=1 make install
cfg: build triple x86_64-unknown-linux-gnu
cfg: host triples x86_64-unknown-linux-gnu
cfg: target triples x86_64-unknown-linux-gnu
cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE)
cfg: enabling more debugging (CFG_ENABLE_DEBUG)
cfg: host for x86_64-unknown-linux-gnu is x86_64
cfg: os for x86_64-unknown-linux-gnu is unknown-linux-gnu
cfg: disabling C++ optimization (CFG_DISABLE_OPTIMIZE_CXX)
to_str().to_c_str().with_ref(...)
@olsonjeffery
olsonjeffery / sketch.rs
Last active December 21, 2015 17:59
my pitch for FileInfo
pub trait FileInfo<'self> {
// stat/info-related methods
fn stat(&self) -> FileStat;
fn path(&self) -> Path;
fn exists(&self) -> bool;
// note that all of these involve opening/creating filestreams and they
// consume the FileInfo in the process
fn open(self, mode: FileMode, access: FileAccess) -> FileStream'
fn create(self); // implies a certain overload of open() above
@olsonjeffery
olsonjeffery / sleepyport.rs
Last active December 22, 2015 17:19
time for bed, old man!
use std::rt::comm;
use std::rt::io::timer::Timer;
use std::cell::Cell;
trait SleepyPort<T: Send> {
fn recv_timeout(self, msecs: u64) -> Option<T>;
}
impl<T: Send> SleepyPort<T> for comm::PortOne<T> {
fn recv_timeout(self, msecs: u64) -> Option<T> {
fn rmdir(&self) {
let p = self.get_path().to_str();
match suppressed_stat(|| self.stat()) {
Some(s) => {
match s.is_dir {
true => rmdir(self.get_path()),
false => {
let ioerr = IoError {
kind: MismatchedFileTypeForOperation,
desc: fmt!("%s is not a directory", p),
@olsonjeffery
olsonjeffery / bleh.rs
Created September 23, 2013 18:46
hm.
trait Foo { fn bar(&self) -> bool; }
struct A;
impl Foo for A { fn bar(&self) -> bool { true } }
struct B;
impl Foo for B { fn bar(&self) -> bool { false } }
let a = A; let b = B; let v = ~[&a as &Foo, &b as &Foo];
@olsonjeffery
olsonjeffery / down-the-rabbit-hole.md
Last active December 24, 2015 07:59
RFC: Well-defined boundaries between bare-metal rust and "the runtime"

Executive summary

  • Radical re-org of the std lib layout. Tease out stuff that lives in librustc that should be in the std lib (all small-r-runtime functionality to include TLS, malloc, fail!(), etc etc etc .. i don't have a great grasp on what all this includes)
  • Global re-evaluation of patterns/practices used in libstd and better understanding of rules/implications of coupling any given language/library feature to any given aspect/level of the holistic concept of "the runtime"
  • getting libuv-coupling out of libstd is the ultimate goal.. but a lot of other stuff shakes out as well, when taken to its logical conclusion
  • Add a nort {} block annotation, akin to unsafe {}, where the compiler can guarantee that some arbitrary set of "small-to-big-R runtime" functionality is not used. What this arbitrary set is: Not sure.

How things are, today

  • libuv is a submodule of mozilla/rust, built and statically linked into librt
drwxr-xr-x 3 daemon daemon 36864 Oct 31 04:37 files
src/client/hf/ux/mod.rs:20:19: 20:20 error: cannot infer an appropriate lifetime for automatic coercion due to conflicting requirements
src/client/hf/ux/mod.rs:20 world: w,
^
src/client/hf/ux/mod.rs:18:69: 23:5 note: first, the lifetime cannot outlive the lifetime &'a as defined on the block at 18:69...
src/client/hf/ux/mod.rs:18 pub fn new<'a>(w: &'a mut World, d: &'a GameDisplay) -> ZoneView {
src/client/hf/ux/mod.rs:19 ZoneView {
src/client/hf/ux/mod.rs:20 world: w,
src/client/hf/ux/mod.rs:21 display: d
src/client/hf/ux/mod.rs:22 }
src/client/hf/ux/mod.rs:23 }