https://www.google.com/logos/2016/halloween16/r4/halloween16.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::cell::UnsafeCell; | |
use std::sync::atomic::{AtomicBool, Ordering}; | |
const LOCKED: bool = true; | |
const UNLOCKED: bool = false; | |
pub struct Mutex<T> { | |
locked: AtomicBool, | |
v: UnsafeCell<T>, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error whilst running `./x.py test --keep-stage 1 library/alloc/` | |
```rust | |
Updating only changed submodules | |
Submodules updated in 0.01 seconds | |
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) | |
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu) | |
Testing alloc stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) | |
running 265 tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(const_trait_impl, const_fn_trait_bound)] | |
fn main() { | |
println!("Howdy partner?"); | |
let mut x = bar::<i32>; | |
println!("{}", std::mem::size_of_val(&x)); | |
baz(bar::<u32>); | |
baz(bar::<i32>); | |
//quox(bar::<u32>); | |
make_fn()(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
source "https://rubygems.org" | |
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | |
gem "faraday" | |
gem "json" | |
group :test do |
- Memory safe. I like to think of it as being given a dull-rusty blade rather than a sharp finely crafted japanese katana/wakizashi. Now go run about and see which cuts you faster!
- Support for Futures (aka Promises in JS parlance).
- Threadsafe concurrency features:
Arc
vs.Mutex<T>
etc. - Generics and Zero-cost abstractions
- Runs on anything with a CPU. Even Android.
- Supports full WASM (WebAssembly). Here's a demo.
- Fabulous tooling via Cargo.
- Much more covered by this great talk by Jon Gjengset (@jonhoo) https://www.youtube.com/watch?v=DnT-LUQgc7s
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let delay = time::Duration::from_millis(1); | |
let now = time::Instant::now(); | |
let thread_delay = Arc::new(1); | |
let mut done = false; | |
while !done { | |
let thread_delay = Arc::clone(&thread_delay); | |
let handle = thread::spawn(move || { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
├── Cargo.lock | |
├── Cargo.toml | |
├── conf | |
│ ├── development | |
│ │ └── config.yml | |
│ └── production | |
│ └── config.yml | |
├── src | |
│ ├── errors.rs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[macro_use] | |
use crate::mysql::*; | |
use crate::mysql::prelude::*; | |
use crate::errors::Error; | |
#[derive(Debug)] | |
pub struct ConnectorMysql { | |
} |