Skip to content

Instantly share code, notes, and snippets.

Avatar

κeen KeenS

View GitHub Profile
View fizzbuzz_semigroup.rs
//! rust port of this
//! https://twitter.com/gakuzzzz/status/1314499876969881602
//! requires nightly
// just for ease
#![feature(bool_to_option)]
// mandatory
#![feature(type_alias_impl_trait)]
// code
View COPYING
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
View Cargo.toml
[package]
name = "so-actix-web-reqwest"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
actix-web = "2.0"
reqwest = "0.10"
@KeenS
KeenS / qsort.smi
Last active Jan 3, 2020
An example of SML#'s MassiveThreads support
View qsort.smi
_require "basis.smi"
_require "thread.smi"
@KeenS
KeenS / memo.txt
Last active Dec 21, 2019
Rustの並列コンパイラを試してみた See also https://qiita.com/qnighy/items/b0aa66749ad7a31ecbf9
View memo.txt
手元のコード(4万行くらい)をThreadripper 1950x(16コア32スレッド)でビルドしてみた
# 並列化してないやつ
cargo +nightly-2019-12-17 build 882.25s user 49.92s system 468% cpu 3:19.16 total
cargo +nightly-2019-12-17 build --release 2988.11s user 52.70s system 1149% cpu 4:24.54 total
cargo +nightly-2019-12-17 check 199.58s user 14.22s system 413% cpu 51.731 total
# 並列化したやつ
cargo +nightly-2019-12-18 build 1061.89s user 75.08s system 618% cpu 3:03.70 total
cargo +nightly-2019-12-18 build --release 3135.03s user 74.32s system 1247% cpu 4:17.21 total
View Hamt.sml
functor Hamt(X:
sig
eqtype k
val hash: k -> Int32.int
end
): sig
type 'v t
exception HashConflict
val empty: 'v t
View struct_index.rs
use std::ops::{Index, IndexMut};
pub struct User {
id: u64,
name: String,
}
impl User {
pub fn new(id_var: u64, name_var: String) -> Self {
User {
View main.saty
@require: stdjareport
@import: stage0
let-inline \show-int n = embed-string (arabic n)
in
document (|
title = {サンプル文書};
author = {組 版太郎};
|) '<
View cps
[| x |] = λk.k x ・・・val
[| λx.t |] = λk.k (λx.[|t|]) ・・・lam
[| π t |] = λk.[|t|] (λa.k (π a)) ・・・app1
[| t1 t2 |] = λk.[|t1|] (λf.[|t2|] (λa.f a k)) ・・・app2
[| Sx.t |] = λk.[x↦λa.λk'.k' (k a)]([|t|] (λv.v))・・・shift
[| <t> |] = λk.k ([|t|] (λv.v)) ・・・reset
変換対象: <add10 (Sx.x (x 100))>
View tayupinco.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.