Rust (bahasa pemrograman): Perbedaan antara revisi
v1.55.0 Tag: Suntingan visualeditor-wikitext |
v1.56.0 Tag: Suntingan visualeditor-wikitext |
||
Baris 13: | Baris 13: | ||
| year = {{release date and age|2010}} |
| year = {{release date and age|2010}} |
||
| programming_language = Rust |
| programming_language = Rust |
||
| latest_release_version = 1. |
| latest_release_version = 1.56.0<ref>{{cite web|title=Announcing Rust 1.56.0 and Rust 2021|url=https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html|website=blog.rust-lang.org|date=2021-10-21|accessdate=2021-11-01}}</ref> |
||
| latest_release_date = {{release date and age|2021| |
| latest_release_date = {{release date and age|2021|10|21}} |
||
| influenced_by = [[Alef (programming language)|Alef]],<ref name="referenceinfluences">{{cite web|title=The Rust Reference: Appendix: Influences|url=https://doc.rust-lang.org/reference/influences.html|accessdate=July 14, 2017 |quote=Rust is not a particularly original language, with design elements coming from a wide range of sources. Some of these are listed below (including elements that have since been removed): SML, OCaml [...] C++ [...] ML Kit, Cyclone [...] Haskell [...] Newsqueak, Alef, Limbo [...] Erlang [...] Swift [...] Scheme [...] C# [...] Ruby [...] NIL, Hermes}}</ref> [[C Sharp|C#]],<ref name="referenceinfluences" /> [[C++]],<ref name="referenceinfluences" /> [[Cyclone (programming language)|Cyclone]],<ref name="referenceinfluences" /><ref name="rustwiki-noteresearch-typesystem">{{cite web|url=https://github.com/rust-lang/rust-wiki-backup/blob/master/Note-research.md#type-system|title=Note Research: Type System | date = 2015-02-01 | accessdate = 2015-03-25 | quote = Papers that have had more or less influence on Rust, or which one might want to consult for inspiration or to understand Rust's background. [...] ''Region based memory management in Cyclone'' [...] ''Safe memory management in Cyclone''}}</ref> [[Erlang (programming language)|Erlang]],<ref name="referenceinfluences" /> [[Haskell (bahasa pemrograman)|Haskell]],<ref name="referenceinfluences" /> [[Hermes (programming language)|Hermes]],<ref name="referenceinfluences" /> [[Limbo (programming language)|Limbo]],<ref name="referenceinfluences" /> [[Newsqueak]],<ref name="referenceinfluences" /> [[NIL (programming language)|NIL]],<ref name="referenceinfluences" /> [[Ocaml|OCaml]],<ref name="referenceinfluences" /> [[Ruby (bahasa pemrograman)|Ruby]],<ref name="referenceinfluences" /> [[Scheme (programming language)|Scheme]],<ref name="referenceinfluences" /> [[Standard ML]],<ref name="referenceinfluences" /> [[Swift (bahasa pemrograman)|Swift]]<ref name="referenceinfluences" /><ref name="rust-if-let">{{cite web|title=RFC for 'if let' expression|url=https://github.com/rust-lang/rfcs/pull/160|accessdate=December 4, 2014 }}</ref> |
| influenced_by = [[Alef (programming language)|Alef]],<ref name="referenceinfluences">{{cite web|title=The Rust Reference: Appendix: Influences|url=https://doc.rust-lang.org/reference/influences.html|accessdate=July 14, 2017 |quote=Rust is not a particularly original language, with design elements coming from a wide range of sources. Some of these are listed below (including elements that have since been removed): SML, OCaml [...] C++ [...] ML Kit, Cyclone [...] Haskell [...] Newsqueak, Alef, Limbo [...] Erlang [...] Swift [...] Scheme [...] C# [...] Ruby [...] NIL, Hermes}}</ref> [[C Sharp|C#]],<ref name="referenceinfluences" /> [[C++]],<ref name="referenceinfluences" /> [[Cyclone (programming language)|Cyclone]],<ref name="referenceinfluences" /><ref name="rustwiki-noteresearch-typesystem">{{cite web|url=https://github.com/rust-lang/rust-wiki-backup/blob/master/Note-research.md#type-system|title=Note Research: Type System | date = 2015-02-01 | accessdate = 2015-03-25 | quote = Papers that have had more or less influence on Rust, or which one might want to consult for inspiration or to understand Rust's background. [...] ''Region based memory management in Cyclone'' [...] ''Safe memory management in Cyclone''}}</ref> [[Erlang (programming language)|Erlang]],<ref name="referenceinfluences" /> [[Haskell (bahasa pemrograman)|Haskell]],<ref name="referenceinfluences" /> [[Hermes (programming language)|Hermes]],<ref name="referenceinfluences" /> [[Limbo (programming language)|Limbo]],<ref name="referenceinfluences" /> [[Newsqueak]],<ref name="referenceinfluences" /> [[NIL (programming language)|NIL]],<ref name="referenceinfluences" /> [[Ocaml|OCaml]],<ref name="referenceinfluences" /> [[Ruby (bahasa pemrograman)|Ruby]],<ref name="referenceinfluences" /> [[Scheme (programming language)|Scheme]],<ref name="referenceinfluences" /> [[Standard ML]],<ref name="referenceinfluences" /> [[Swift (bahasa pemrograman)|Swift]]<ref name="referenceinfluences" /><ref name="rust-if-let">{{cite web|title=RFC for 'if let' expression|url=https://github.com/rust-lang/rfcs/pull/160|accessdate=December 4, 2014 }}</ref> |
||
| operating_system = [[Linux]], [[macOS]], [[Microsoft Windows|Windows]], [[FreeBSD]], [[Android (operating system)|Android]], [[iOS]] (sebagian)<ref>{{cite web |url=https://github.com/rust-lang/rust/wiki/Doc-building-for-ios |title=Rust on iOS |website=[[GitHub]] |deadurl=yes |archiveurl=https://web.archive.org/web/20140723023232/https://github.com/rust-lang/rust/wiki/Doc-building-for-ios |date=2015-01-09 |archivedate=2014-07-23 |accessdate=2017-06-22 }}</ref> |
| operating_system = [[Linux]], [[macOS]], [[Microsoft Windows|Windows]], [[FreeBSD]], [[Android (operating system)|Android]], [[iOS]] (sebagian)<ref>{{cite web |url=https://github.com/rust-lang/rust/wiki/Doc-building-for-ios |title=Rust on iOS |website=[[GitHub]] |deadurl=yes |archiveurl=https://web.archive.org/web/20140723023232/https://github.com/rust-lang/rust/wiki/Doc-building-for-ios |date=2015-01-09 |archivedate=2014-07-23 |accessdate=2017-06-22 }}</ref> |
Revisi per 1 November 2021 11.00
Rust | |
---|---|
Paradigma | Bahasa pemrograman berparadigma jamak, Terkompilasi, Konkuren, Fungsional, Imperatif, Terstruktur, dan Generik |
Dirancang oleh | awalnya oleh Graydon Hoare, kemudian oleh para pengembang proyek Rust. |
Pengembang | Rust Project Developers |
Rilis perdana | 2010 |
Rilis stabil | 1.56.0[1]
/ 21 Oktober 2021 |
Tipe sistem | penulisan yang Statis, Kuat, Terinferensi, Nominal, dan Linear. |
Implementasi dari | Rust |
Sistem operasi | Linux, macOS, Windows, FreeBSD, Android, iOS (sebagian)[2] |
Lisensi | Lisensi Apache 2.0 atau MIT[3] |
Ekstensi nama berkas | .rs, .rlib |
Situs web | www |
Repositori | www |
Terpengaruh oleh | |
Alef,[4] C#,[4] C++,[4] Cyclone,[4][5] Erlang,[4] Haskell,[4] Hermes,[4] Limbo,[4] Newsqueak,[4] NIL,[4] OCaml,[4] Ruby,[4] Scheme,[4] Standard ML,[4] Swift[4][6] | |
Mempengaruhi | |
Crystal, Elm,[7] Idris[8] | |
Sunting kotak info • L • B |
Rust adalah sebuah bahasa pemrograman sistem[9] yang pengembangannya didukung oleh penelitian dari Mozilla.[10] Bahasa ini dirancang agar menjadi pemrograman yang "aman, konkuren (bekerja bersamaan) dan praktis".[11] Bahasa ini mendukung paradigma pemrograman fungsional dan prosedural-imperatif. Sintaksis bahasa Rust serupa dengan bahasa C++ namun dirancang dengan keamanan memori yang lebih baik sembari tetap menjaga performa kerja.
Bahasa Rust ini tergolong pada peranti lunak sumber terbuka. Desainnya merupakan perbaikan bedasarkan pengalaman-pengalaman yang dialami ketika mengembangkan Servo, sebuah perangkat layout untuk peramban web dan kompilator Rust.[12]
Kebanyakan commit kode program yang masuk pada proyek Rust saat ini berasal dari kontribusi anggota komunitas.[13] Bahasa Rust mendapatkan posisi pertama dengan predikat sebagai "Bahasa pemrograman paling disukai" pada survei pengembang di Stack Oveflow tahun 2016 dan 2017.[14][15]
Contoh kode
Hello World
Berikut ini adalah contoh baris kode sederhana untuk menampilkan Hello World
fn main() {
println!("Hello World");
}
Fungsi Faktorial
Rekursif
fn factorial(i: u64) -> u64 {
match i {
0 => 1,
n => n * factorial(n-1)
}
}
Iteratif
fn factorial(i: u64) -> u64 {
let mut acc = 1;
for num in 2..=i {
acc *= num;
}
acc
}
Lihat pula
- Redox (sistem operasi), Sistem Operasi menggunakan bahasa Rust,
- Rocket (web framework), kerangka kerja pembangun aplikasi web menggunakan bahasa Rust.
- Quantum (Mozilla), proyek yang dikembangkan oleh Mozilla untuk menggantikan Gecko sebagai mesin utama peramban Firefox.
Rujukan
- ^ "Announcing Rust 1.56.0 and Rust 2021". blog.rust-lang.org. 2021-10-21. Diakses tanggal 2021-11-01.
- ^ "Rust on iOS". GitHub. 2015-01-09. Diarsipkan dari versi asli tanggal 2014-07-23. Diakses tanggal 2017-06-22.
- ^ "Copyright". Rust compiler source repository. Diakses tanggal 2015-11-09.
- ^ a b c d e f g h i j k l m n o "The Rust Reference: Appendix: Influences". Diakses tanggal July 14, 2017.
Rust is not a particularly original language, with design elements coming from a wide range of sources. Some of these are listed below (including elements that have since been removed): SML, OCaml [...] C++ [...] ML Kit, Cyclone [...] Haskell [...] Newsqueak, Alef, Limbo [...] Erlang [...] Swift [...] Scheme [...] C# [...] Ruby [...] NIL, Hermes
- ^ "Note Research: Type System". 2015-02-01. Diakses tanggal 2015-03-25.
Papers that have had more or less influence on Rust, or which one might want to consult for inspiration or to understand Rust's background. [...] Region based memory management in Cyclone [...] Safe memory management in Cyclone
- ^ "RFC for 'if let' expression". Diakses tanggal December 4, 2014.
- ^ "Command Optimizations?". 2014-06-26. Diakses tanggal 2014-12-10.
I just added the outline of a Result library that lets you use richer error messages. It's like Either except the names are more helpful. The names are inspired by Rust's Result library.
- ^ "Uniqueness Types". 2014-08-22. Diarsipkan dari versi asli tanggal December 25, 2014. Diakses tanggal 2014-10-27.
They are inspired by linear types, Uniqueness Types in the Clean programming language, and ownership types and borrowed pointers in the Rust programming language.
- ^ "Rust is a systems programming language". Rust-lang.org. Diakses tanggal 2017-07-17.
- ^ Noel (2010-07-08). "The Rust Language". Lambda the Ultimate. Diakses tanggal 2010-10-30.
- ^ "FAQ - The Rust Project". Rust-lang.org. Diarsipkan dari versi asli tanggal 2016-02-23. Diakses tanggal 2 March 2016.
- ^ Peter Bright (2013-04-03). "Samsung teams up with Mozilla to build browser engine for multicore machines". Arstechnica.com. Diakses tanggal 2013-04-04.
- ^ "Contributors to rust-lang/rust · GitHub". Github.com. Diakses tanggal 2016-11-03.
- ^ "Stack Overflow Developer Survey 2016 Results". Stack Overflow. Diakses tanggal 2017-03-22.
- ^ "Stack Overflow Developer Survey 2017". Stack Overflow. Diakses tanggal 2017-03-22.
Pranala luar
- Situs web resmi
- Dokumentasi Rust
- Rust by Example – Contoh program kecil di Rust
- Blog Rust
- Belajar Rust
- Forum Rust
- Portal komunitas Rust
- Milis Rust-dev
- Komunitas Rust di Reddit
- Komunitas Rust di Discord
- Repositori Rust di GitHub
- Repositori rust-rosetta di GitHub – Implementasi dari algoritme-algoritme umum dan penyelesaiannya
- Rust diperbandingkan dengan bahasa-bahasa pemrograman lain – Perbandingan interaktif