Skip to content

Commit 8c1b7a7

Browse files
danilhendrasrmashanz
authored andcommitted
translate chapter 1.2 titles
1 parent 47162ab commit 8c1b7a7

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/ch01-02-hello-world.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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

1717
You’ll start by making a directory to store your Rust code. It doesn’t matter
1818
to 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
2020
your 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

2525
For 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
4747
convention 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

6262
Save 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
6464
commands to compile and run the file:
6565

6666
```console
@@ -85,7 +85,7 @@ section for ways to get help.
8585
If `Hello, world!` did print, congratulations! You’ve officially written a Rust
8686
program. That makes you a Rust programmer—welcome!
8787

88-
### Anatomy of a Rust Program
88+
### Anatomi dari Program Rust
8989

9090
Let’s review this “Hello, world!” program in detail. Here’s the first piece of
9191
the puzzle:
@@ -136,7 +136,7 @@ Fourth, we end the line with a semicolon (`;`), which indicates that this
136136
expression is over and the next one is ready to begin. Most lines of Rust code
137137
end with a semicolon.
138138

139-
### Compiling and Running Are Separate Steps
139+
### Mengkompilasi dan Menjalankan Adalah Langkah yang Berbeda
140140

141141
You’ve just run a newly created program, so let’s examine each step in the
142142
process.
@@ -171,24 +171,24 @@ main.pdb
171171
main.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,
184184
world!` to your terminal.
185185

186186
If you’re more familiar with a dynamic language, such as Ruby, Python, or
187187
JavaScript, 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
189189
compile 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
192192
installed (respectively). But in those languages, you only need one command to
193193
compile and run your program. Everything is a trade-off in language design.
194194

0 commit comments

Comments
 (0)