These are chat archives for rust-lang/rust

May 2016
Wang Shidong
May 31 2016 06:17
I starting to learn rust, and I create new repo named LearnRustTheHardWay, here is a link,, and will you follow me?
Sergey Noskov
May 31 2016 06:34
A description or a plan could be great
Remi Rampin
May 31 2016 14:03
@wsdjeg: Can't you ask here when you run into specific problem rather than expect us to check in periodically to see if you did anything, and if that's something you need help with?
That does seem easier to me ;)
Wang Shidong
May 31 2016 15:45
@remram44 sorry for that. I just starting to learn rust, and I want to take notes via github.
Ruben Tytgat
May 31 2016 21:03
potential new rust user here... is it possible in rust to write a library that exports standard C symbols and can be linked to from other languages?
Peter Atashian
May 31 2016 21:09
@angryzor yes
Ruben Tytgat
May 31 2016 21:10
great! I'll start reading the introduction then!
You'll want your crate type to be either staticlib or cdylib. cdylib is kinda new though, so cargo doesn't support it yet, and you need the latest nightly to use it in rustc.
Ruben Tytgat
May 31 2016 21:12
i see
i don't mind static builds that much though
i assume you do need to compile the rust runtime in then
Peter Atashian
May 31 2016 21:14
Rust has very little of a runtime anyway. But when you create a staticlib or cdylib all of the needed Rust bits will be statically linked in.
Sean Perry
May 31 2016 21:22
it is very similar to making C++ code able to be called by C. No mangling, simple runtime, etc.
I stuffed C++ into EFI once. Good times....
Ruben Tytgat
May 31 2016 21:49
alright, sounds good
Ruben Tytgat
May 31 2016 22:36
on the concept of lifetimes, I'm slightly confused
as far as i understand it's basically 'object lifetime as a type'?
struct Foo<'a> {
    x: &'a i32,
would this signify that x always lives as long as Foo? or does it only have effect on x itself
Ruben Tytgat
May 31 2016 22:42
no wait, i think i got it
i have the impression that it's the latter, which makes more sense considering the type parameter-like syntax
the introduction implies the former though