러스트 (프로그래밍 언어): 두 판 사이의 차이

내용 삭제됨 내용 추가됨
0.9 릴리즈
0.9 문법 및 라이브러리에 따라 예제 코드 변경
23번째 줄:
2006년 개발자 그레이든 호아레의 개인 프로젝트로 시작되었으며, 2009년 호아레의 고용주인 모질라가 개발에 참여했다.<ref name="proj-faq">{{웹 인용|url=https://github.com/mozilla/rust/wiki/Doc-project-FAQ|제목=Project FAQ|날짜=2010-09-14|확인날짜=2012-01-11|언어=en}}</ref> 2010년 처음으로 일반에 공개되었으며,<ref name="future-tense">{{웹 인용|url=http://www.slideshare.net/BrendanEich/future-tense-7782010|제목=Future Tense|날짜=2011-04-29|확인날짜=2012-02-06|언어=en|인용문=At Mozilla Summit 2010, we launched Rust, a new programming language motivated by safety and concurrency for parallel hardware, the “manycore” future which is upon us.}}</ref> 같은 해 [[Objective Caml]]로 작성된 초기 컴파일러에서 Rust로 쓰여진 컴파일러로 전환되었다.<ref name="rust-in-rust">{{웹 인용|url=http://blog.mozilla.com/graydon/2010/10/02/rust-progress/|제목=Rust Progress|성=Hoare|이름=Graydon|날짜=2010-10-02|확인날짜=2010-10-30|언어=en}}</ref> ''rustc''는 2011년 처음으로 자기 자신을 컴파일하는데 성공했다.
 
2012년 1월 첫 번째 알파 버전인 0.1이 발표되었다.<ref name="rustc-0.1">{{웹 인용|url=http://www.reddit.com/r/programming/comments/opgxd/mozilla_and_the_rust_community_release_rust_01_a/|제목=Mozilla and the Rust community release Rust 0.1 (a strongly-typed systems programming language with a focus on memory safety and concurrency)|저자=catamorphism|날짜=2012-01-20|확인날짜=2012-02-06|언어=en}}</ref> 현재 최신 버전은 2014년 1월에 발표된 0.9이다9 버전이다.
 
모질라의 정책<ref name="moz-manifesto">{{웹 인용|url=http://www.mozilla.org/about/manifesto.ko.html|제목=The Mozilla Manifesto|확인날짜=2013-04-29}}</ref>에 따라, Rust는 전적으로 오픈 소스로 개발되고 있으며, 커뮤니티로부터 피드백을 받고 있다. 모질라 재단과 [[삼성전자]]가 Rust의 개발을 후원하고 있다. Rust의 설계에는 모질라의 렌더링 엔진인 Servo와 rustc 컴파일러를 개발하면서 쌓인 경험들이 반영되어 있다.
 
== 특징 ==
66번째 줄:
// `mut` 키워드는 값이 바뀔 수 있는 변수를 가리킨다.
let mut i = 1,
let mut result = 1;
while i <= n {
result *= i;
82번째 줄:
표시될 수 있다 */
fn main() {
// 변수 message는 변경이 불가능하므로, 여러 개의 태스크에서 동시에 접근해도 안전하다.
// `times` 는 정수형 값에 대해 정의된 멤버 함수로, 코드 조각을 인자로 받는다.
let message = "This is part of a lightweight thread.";
for 10.times {
for num in range(0, 10) {
do spawn {
}println(message);
// `each` 는 한개의 인자를 갖는 코드 조각을 인자로 받는다.
// println! 은 매크로이며, 컴파일 시간에 변수의 형 검사가 이루어진다.
for [1, 2, 3].each |item| {
// C나 C++의 단순한 //코드 치환 매크로와 달리, `fmt!`Rust의 매크로는 컴파일시Scheme과 타입이유사한 검사되는구조적 매크로이다.
println!("Message printed by task println(fmt!("%d{:i}.", *item)num);
}
}
}