@@ -12,15 +12,15 @@ prints the text `Hello, world!` to the screen, so we’ll do the same here!
1212> team has been focusing on enabling great IDE support via ` rust-analyzer ` . See
1313> [ Appendix D] [ devtools ] <!-- ignore --> for more details.
1414
15- ### Creating a Project Directory
15+ ### Membuat Direktori Proyek
1616
1717You’ll start by making a directory to store your Rust code. It doesn’t matter
1818to Rust where your code lives, but for the exercises and projects in this book,
19- we suggest making a * projects * directory in your home directory and keeping all
19+ we suggest making a _ projects _ directory in your home directory and keeping all
2020your projects there.
2121
22- Open a terminal and enter the following commands to make a * projects * directory
23- and a directory for the “Hello, world!” project within the * projects * directory.
22+ Open a terminal and enter the following commands to make a _ projects _ directory
23+ and a directory for the “Hello, world!” project within the _ projects _ directory.
2424
2525For Linux, macOS, and PowerShell on Windows, enter this:
2626
@@ -40,14 +40,14 @@ For Windows CMD, enter this:
4040> cd hello_world
4141```
4242
43- ### Writing and Running a Rust Program
43+ ### Menulis dan Menjalankan Program Rust
4444
45- Next, make a new source file and call it * main.rs * . Rust files always end with
46- the * .rs * extension. If you’re using more than one word in your filename, the
45+ Next, make a new source file and call it _ main.rs _ . Rust files always end with
46+ the _ .rs _ extension. If you’re using more than one word in your filename, the
4747convention is to use an underscore to separate them. For example, use
48- * hello_world.rs * rather than * helloworld.rs * .
48+ _ hello_world.rs _ rather than _ helloworld.rs _ .
4949
50- Now open the * main.rs * file you just created and enter the code in Listing 1-1.
50+ Now open the _ main.rs _ file you just created and enter the code in Listing 1-1.
5151
5252<span class =" filename " >Filename: main.rs</span >
5353
@@ -60,7 +60,7 @@ fn main() {
6060<span class =" caption " >Listing 1-1: A program that prints ` Hello, world! ` </span >
6161
6262Save the file and go back to your terminal window in the
63- * ~ /projects/hello_world * directory. On Linux or macOS, enter the following
63+ _ ~ /projects/hello_world _ directory. On Linux or macOS, enter the following
6464commands to compile and run the file:
6565
6666``` console
@@ -85,7 +85,7 @@ section for ways to get help.
8585If ` Hello, world! ` did print, congratulations! You’ve officially written a Rust
8686program. That makes you a Rust programmer—welcome!
8787
88- ### Anatomy of a Rust Program
88+ ### Anatomi dari Program Rust
8989
9090Let’s review this “Hello, world!” program in detail. Here’s the first piece of
9191the puzzle:
@@ -136,7 +136,7 @@ Fourth, we end the line with a semicolon (`;`), which indicates that this
136136expression is over and the next one is ready to begin. Most lines of Rust code
137137end with a semicolon.
138138
139- ### Compiling and Running Are Separate Steps
139+ ### Mengkompilasi dan Menjalankan Adalah Langkah yang Berbeda
140140
141141You’ve just run a newly created program, so let’s examine each step in the
142142process.
@@ -171,24 +171,24 @@ main.pdb
171171main.rs
172172```
173173
174- This shows the source code file with the * .rs * extension, the executable file
175- (* main.exe * on Windows, but * main * on all other platforms), and, when using
176- Windows, a file containing debugging information with the * .pdb * extension.
177- From here, you run the * main * or * main.exe * file, like this:
174+ This shows the source code file with the _ .rs _ extension, the executable file
175+ (_ main.exe _ on Windows, but _ main _ on all other platforms), and, when using
176+ Windows, a file containing debugging information with the _ .pdb _ extension.
177+ From here, you run the _ main _ or _ main.exe _ file, like this:
178178
179179``` console
180180$ ./main # or .\main.exe on Windows
181181```
182182
183- If your * main.rs * is your “Hello, world!” program, this line prints `Hello,
183+ If your _ main.rs _ is your “Hello, world!” program, this line prints `Hello,
184184world!` to your terminal.
185185
186186If you’re more familiar with a dynamic language, such as Ruby, Python, or
187187JavaScript, you might not be used to compiling and running a program as
188- separate steps. Rust is an * ahead -of-time compiled * language, meaning you can
188+ separate steps. Rust is an _ ahead -of-time compiled _ language, meaning you can
189189compile a program and give the executable to someone else, and they can run it
190- even without having Rust installed. If you give someone a * .rb * , * .py * , or
191- * .js * file, they need to have a Ruby, Python, or JavaScript implementation
190+ even without having Rust installed. If you give someone a _ .rb _ , _ .py _ , or
191+ _ .js _ file, they need to have a Ruby, Python, or JavaScript implementation
192192installed (respectively). But in those languages, you only need one command to
193193compile and run your program. Everything is a trade-off in language design.
194194
0 commit comments