LLVM 링크 정리
Posted: November 11, 2015 Filed under: Code, Tokamak Project | Tags: llvm Leave a commentDocumentation Links
- Kaleidoscope in Rust
- llvm-rs github (forked)
- llvm-rs Documentation
- llvm-sys Documentation
- Rustc LLVM source
- LLVM C API Doxygen
- Instruction Builders in LLVM C API
- IRBuilder.h in LLVM C++
- IRBuilder API in LLVM C++
- LLVM Programmer’s Manual
- Mapping High-Level Constructs to LLVM IR
Presentation Materials
Sample Codes
- https://github.com/imasahiro/llvm-sample
- codegen module of Impala
- Kaleidoscope in C API
- llvm-clang-samples
Tools
A skeleton code for Iterator in Rust
Posted: October 13, 2015 Filed under: Code | Tags: iterator, rust Leave a commentFor record, I wrote down the same code.
Consuming Iterator
This file contains 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
pub struct TaskSet; | |
pub struct TaskSetIterator { | |
… | |
} | |
impl Iterator for TaskSetIterator { | |
type Item = Task; | |
fn next(&mut self) -> Option<Task> { | |
…. | |
} | |
} | |
pub struct Task; | |
impl IntoIterator for TaskSet { | |
type Item = Task; | |
type IntoIter = TaskSetIterator; | |
fn into_iter(self) -> Self::IntoIter { | |
TaskSetIterator { ... } | |
} | |
} |
Iterator that does not consume items
This file contains 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
pub struct TaskSetRefIterator<'a> | |
{ | |
…. | |
} | |
impl<'a> Iterator for TaskSetRefIterator<'a> { | |
type Item = &'a Task; | |
fn next(&mut self) -> Option<&'a Task> { | |
None | |
} | |
} | |
impl<'a> IntoIterator for &'a TaskSet { | |
type Item = &'a Task; | |
type IntoIter = TaskSetRefIterator<'a>; | |
fn into_iter(self) -> Self::IntoIter { | |
TaskSetRefIterator { ... } | |
} | |
} |
Awesome documentation links for Rust
Posted: October 11, 2015 Filed under: Code, FOSS | Tags: rust Leave a commentI wrote down the useful links that I have learned. I’ll continue to update it.
General
- The Rust Programming Language
- Rust for C++ programmers
- The Advanced Rust Programming Language
- Rust for Rubyists
Abstraction
Ownership
- Lifetime in Rust Book
- Understanding Pointers, Ownership, and Lifetimes in Rust
- http://alvalea.gitbooks.io/rust-for-cpp/content/lifetimes.html
- Understanding Lifetime in Rust – Part I
- Understanding Lifetime in Rust – Part II
Object Safety
FFI
- Foreign Function Interface – Rust Book
- C types in Rust
- Rust FFI C string handling
- How do I get a *mut c_char from a Str?
- Rust Once, Run Everywhere
- FFI in Rust – writing bindings for libcpuid
- 24 days of Rust – calling Rust from other languages
- A Pythonist getting Rusty these days… Part 1, Part 2
- Exposing Rust struct to Python
Iterator
- Effectively Using Iterators In Rust
- A Journey into Iterators
- How can I zip more than two iterators?
- Correct way to return an Iterator?
- Itertools (very useful iterator helper utility)
Pattern Matching
Error handling
biild.rs
Examples
Idiomatic Usages of Rust
- Virtual Structs Part 1: Where Rust’s Enum Shines
- Modeling Graphs in Rust Using Vector Indices
- Rust Design Patterns
API Design
- String vs &str in Rust functions
- Creating a Rust function that accepts String or &str
- Creating a Rust function that returns a &str or String
- Learning Rust With Entirely Too Many Linked Lists
- Rust’s Built-in Traits, the When, How & Why
Ownership
Network and I/O
Macro
MIO
- API Documentation
- mio book
- Getting Acquainted with MIO
- mio source code
- Creating A Multi-echo Server using Rust and mio
- Accumulating echo server using Rust’s mio
- My Basic Understanding of mio and Asynchronous IO
Projects Worth Watching
- Awesome Rust
- Rust in Detail
- Asynchronous IO in Rust
- Building an iOS App in Rust, Part 1: Getting Started with Rust
- Creating A Multi-echo Server using Rust and mio
- Index 1,600,000,000 Keys with Automata and Rust
Papers
Profiling
- Blog: Profiling Rust applications (comments)
- Rust Performance: A story featuring perf and flamegraph on Linux
Updates
- Oct 15, 2015 – Added The Little Book of Rust Macros.
- Nov 3. 2015 – Add ‘Rust Design Pattern’ and ‘Exposing Rust struct to Python’