Code Samples in This Training

์ด ๊ต์œก์„ ์œ„ํ•ด ์šฐ๋ฆฌ๋Š” ๋‹น์‹ ์˜ ๋ธŒ๋ผ์šฐ์ €์—์„œ ์‹คํ–‰๋  ์ˆ˜ ์žˆ๋Š” ์˜ˆ์ œ๋ฅผ ์ œ๊ณตํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ์„ค์น˜๊ฐ€ ํ›จ์”ฌ ์‰ฌ์›Œ์ง€๊ณ  ๋ชจ๋“  ์‚ฌ์šฉ์ž๊ฐ€ ์ผ๊ด€๋œ ํ™˜๊ฒฝ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ๋ฉ๋‹ˆ๋‹ค.

For this training, we will mostly explore the Rust language through examples which can be executed through your browser. This makes the setup much easier and ensures a consistent experience for everyone.

์นด๊ณ (cargo)๋ฅผ ์„ค์น˜ํ•˜๋Š” ๊ฒƒ์€ ์—ฌ์ „ํžˆ ์ข‹์Šต๋‹ˆ๋‹ค. ์ด ๊ฒƒ์€ ๋‹น์‹ ์˜ ์—ฐ์Šต์„ ๋” ์‰ฝ๊ฒŒ ๋งŒ๋“ค์–ด ์ค๋‹ˆ๋‹ค. ๋งˆ์ง€๋ง‰ ๋‚  ๊ฐ•์˜์—์„œ ๋‹น์‹ ์ด Cargo๋ฅผ ํ•„์š”๋กœ ํ•˜๋Š” ์˜์กด์„ฑ์„ ๊ฐ€์ง€๊ณ  ์ž‘์—…ํ•˜๋Š” ๊ฒฝํ—˜์„ ํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค.

Installing Cargo is still encouraged: it will make it easier for you to do the exercises. On the last day, we will do a larger exercise which shows you how to work with dependencies and for that you need Cargo.

์ด ๊ณผ์ •์˜ ์ฝ”๋“œ ๋ธ”๋ก๋“ค์€ ์ „๋ถ€ ๋Œ€ํ™”ํ˜•์œผ๋กœ ๊ตฌ์„ฑ๋˜ ์žˆ์Šต๋‹ˆ๋‹ค.

The code blocks in this course are fully interactive:

fn main() {
    println!("Edit me!");
}

์ฝ”๋“œ ๋ธ”๋ก์— ํฌ์ปค์Šค๋ฅผ ๋‘๊ณ  Ctrl-Enter๋ฅผ ๋ˆŒ๋Ÿฌ ์‹คํ–‰ํ•ด ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

You can use Ctrl-Enter to execute the code when focus is in the text box.

๊ฐ•์˜ ์ฐธ์กฐ ๋…ธํŠธ

๊ฐ•์˜์—์„œ ๋Œ€๋ถ€๋ถ„์˜ ์ฝ”๋“œ ์ƒ˜ํ”Œ์€ ์œ„์™€ ๊ฐ™์ด ์ˆ˜์ •ํ• ์ˆ˜ ์žˆ์ง€๋งŒ ์ผ๋ถ€ ์ฝ”๋“œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ด์œ ๋กœ ์ˆ˜์ •ํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค:

  • ์œ ๋‹› ํ…Œ์ŠคํŠธ๋Š” ๋‚ด์žฅ ํ”Œ๋ ˆ์ด๊ทธ๋ผ์šด๋“œ์—์„œ ์‹คํ–‰์ด ์•ˆ๋ฉ๋‹ˆ๋‹ค. ์™ธ๋ถ€ ํ”Œ๋ ˆ์ด๊ทธ๋ผ์šด๋“œ ์‚ฌ์ดํŠธ์— ๋ถ™์—ฌ๋„ฃ์–ด ํ…Œ์ŠคํŠธ๋ฅผ ์‹คํ–‰ํ•˜์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.
  • ํŽ˜์ด์ง€์—์„œ ์ด๋™ํ•˜๋ฉด ๋‚ด์žฅ๋œ ํ”Œ๋ ˆ์ด๊ทธ๋ผ์šด๋“œ๋Š” state๋ฅผ ์žƒ์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ๋กœ์ปฌ ํ™˜๊ฒฝ์ด๋‚˜ ์™ธ๋ถ€ ํ”Œ๋ ˆ์ด๊ทธ๋ผ์šด๋“œ ์‚ฌ์ดํŠธ์—์„œ ์—ฐ์Šต๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

Most code samples are editable like shown above. A few code samples are not editable for various reasons:

  • The embedded playgrounds cannot execute unit tests. Copy-paste the code and open it in the real Playground to demonstrate unit tests.

  • The embedded playgrounds lose their state the moment you navigate away from the page! This is the reason that the students should solve the exercises using a local Rust installation or via the Playground.


์—ญ์ฃผ:

  • ์ €๋Ÿฐ ๋ธ”๋ก๋“ค์€ ๊ณผ์ • ์‚ฌ์ดํŠธ์—์„œ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค.
  • ์†Œ์Šค๋‹จ(md)์—์„  ์‹คํ–‰์•ˆ๋ฉ๋‹ˆ๋‹ค(..)