Skip to content

Latest commit

ย 

History

53 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

rust_GUI_Xilem_Training

link





crates.io Downloads docs.rs githubiconfloemstar

  • An experimental Rust native UI framework
    • Xilem is a UI toolkit. It combines ideas from Flutter, SwiftUI, and Elm. Like all of these, it uses lightweight view objects, diffing them to provide minimal updates to a retained UI. Like SwiftUI, it is strongly typed. For more details on Xilem's reactive architecture see Xilem: an architecture for UI in Rust.

    • Rust ์šฉ Data-first UI ๋””์ž์ธ ํˆดํ‚ท์ธ Druid ๋ฅผ ๋งŒ๋“ค์—ˆ๋˜ ์‚ฌ๋žŒ์˜ ์ œ์•ˆ ๊ธ€์ด๋„ค์š”. ๊ฝค ๊ธด๊ธ€์ด๋ผ ๋„์ž…๋ถ€๋งŒ ์˜ฎ๊ฒจ๋ด…๋‹ˆ๋‹ค. ๊ฒฐ๊ณผ๋ฌผ์ด ๋‚˜์™€๋ด์•ผ ์•Œ ๊ฒƒ ๊ฐ™์•„์š”. Raph Levien์€ ์‚ฌ์‹ค Druid๋งŒ์œผ๋กœ ๋งํ•˜๊ธฐ์—๋Š” ๋„ˆ๋ฌด ๋ถ€์กฑํ•œ ์‚ฌ๋žŒ์ธ๋ฐ... (GPL) Ghostscript ๋ฉ”์ธํ…Œ์ด๋„ˆ, Advogato ๋ธ”๋กœ๊ทธ ์ปค๋ฎค๋‹ˆํ‹ฐ, Inconsolata ๊ธ€๊ผด, Xi ํŽธ์ง‘๊ธฐ ๋“ฑ์œผ๋กœ ์˜ˆ์ „๋ถ€ํ„ฐ ์œ ๋ช…ํ•ฉ๋‹ˆ๋‹ค.

1

์ตœ์‹ ๊ธ€ Latest News|๐Ÿ”|


DXC / ICD / GLSL / HLSL / SPIR-V VMA์ฐจ์ด์ |๐Ÿ”|

Term Description
DXC Microsoft's Open Source DirectX Shader Compiler
ICD Installable Client Driver: A Vulkan compatible display driver
GLSL OpenGL Shading Language
HLSL DirectX High-Level Shading Language
SPIR-V Standard Portable Intermediate Representation is a cross-API intermediate language (IL) that natively represents parallel compute and graphics programs
VMA The Vulkan Memory Allocator library provided by AMD.
Vulkan
Instance
The Vulkan API object that stores all per-application states
Vulkan
Layer
A library designed to work as a plug-in for the loader. It usually serves to provide validation and debugging functionality to applications
Vulkan
Loader
A library which implements the Vulkan API entry points and manages layers, extensions, and drivers. It is found in the independent hardware vendor driver installs

GPU๋Š” ์–ด๋–ป๊ฒŒ ์ž‘๋™ํ• ๊นŒ | bRd 3D|๐Ÿ”|

'์ปดํ“จํ„ฐ'์˜ ๊ตฌ์กฐ๋Š” ์–ด๋–ป๊ฒŒ ๋˜์–ด์žˆ์„๊นŒ? CPU์™€ ๋ฉ”๋ชจ๋ฆฌ! [์•ˆ๋ ๊ณผํ•™ - ๋žฉ๋ฏธํŒ… 15ํ™”] | ์•ˆ๋ ๊ณผํ•™ Unrealscience|๐Ÿ”|

CPU๋Š” ์–ด๋–ป๊ฒŒ ์ž‘๋™ํ• ๊นŒ? | bRd 3D|๐Ÿ”|


(240605)Xilem: Let's Build High Performance Rust UI - Raph Levien | Rust Nederland (RustNL)|๐Ÿ”|

Ralph์˜ ๋ฐœํ‘œ์— ํฐ ๋ฐ•์ˆ˜๋ฅผ ๋ณด๋‚ด ์ฃผ์„ธ์š”. ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

  • We're working on this project of building high-performance UI. It's under the Xilin kind of umbrella for the project, but I'm going to talk about, I'm going to give an overview of the pieces of it, but the call to action here is come and get involved in the project. ChatGPT

    • ์šฐ๋ฆฌ๋Š” ๊ณ ์„ฑ๋Šฅ UI๋ฅผ ๊ตฌ์ถ•ํ•˜๋Š” ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ ์ค‘์ž…๋‹ˆ๋‹ค. ์ด ํ”„๋กœ์ ํŠธ๋Š” Xilin์˜ ์ผ์ข…์˜ ํ”„๋กœ์ ํŠธ ์•ˆ์— ์žˆ์ง€๋งŒ, ์ €๋Š” ์—ฌ๊ธฐ์„œ ๊ทธ ๊ตฌ์„ฑ ์š”์†Œ์— ๋Œ€ํ•œ ๊ฐœ์š”๋ฅผ ์ œ๊ณตํ•  ๊ฑฐ์—์š”. ๊ทธ๋Ÿฌ๋‚˜ ์—ฌ๊ธฐ์„œ์˜ ์ฝœ ํˆฌ ์•ก์…˜์€ ์ด ํ”„๋กœ์ ํŠธ์— ์ฐธ์—ฌํ•ด ์ฃผ์„ธ์š”.
  • So first, I want to talk a little bit about the goals of the project. So the real focus of this entire thing is high performance. And that's actually a little bit of an unusual goal. Most of the time, you're more focused on developer experience, and so on and so forth. But we really feel like high performance is the niche. This is why you would use Rust to build UI. ChatGPT

    • ๋จผ์ €, ์ด ํ”„๋กœ์ ํŠธ์˜ ๋ชฉํ‘œ์— ๋Œ€ํ•ด ์กฐ๊ธˆ ์ด์•ผ๊ธฐํ•˜๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค. ์ด ์ „์ฒด ํ”„๋กœ์ ํŠธ์˜ ์ง„์ •ํ•œ ์ดˆ์ ์€ ๊ณ ์„ฑ๋Šฅ์ž…๋‹ˆ๋‹ค. ์‹ค์ œ๋กœ ์ด๊ฒƒ์€ ์กฐ๊ธˆ ์ด์ƒํ•œ ๋ชฉํ‘œ์ž…๋‹ˆ๋‹ค. ๋Œ€๋ถ€๋ถ„์˜ ๊ฒฝ์šฐ์—๋Š” ๊ฐœ๋ฐœ์ž ๊ฒฝํ—˜์— ๋” ์ง‘์ค‘ํ•˜๋Š” ํŽธ์ด์ง€๋งŒ, ์šฐ๋ฆฌ๋Š” ๊ณ ์„ฑ๋Šฅ์ด ์ค‘์š”ํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ์ด๊ฒƒ์ด Rust๋กœ UI๋ฅผ ๊ตฌ์ถ•ํ•˜๋Š” ์ด์œ ์ž…๋‹ˆ๋‹ค.
  • That's driving a lot of the decisions that we're making. We're also focused on a very rich 2D graphics model. We want to have full access to vector graphics with all of the goodies like gradients and also really good font support. I'll talk about that a little bit more. Of course, that's what I do. But we don't want to just have something that's high-performance and rich but very hard to program. We also want to make a really ergonomic, easy-to-use API on top of that. And we want this to work on desktop and mobile. The project is being funded by Google. It's a research project that's being funded by Google Fonts. And the focus of that is Android apps. So we want to do both. We want to demonstrate a really good experience on Android, but I think the community is interested in desktop and other targets as well. ChatGPT

    • ์ด๋Ÿฌํ•œ ๊ฒฐ์ •์— ๋งŽ์€ ์˜ํ–ฅ์„ ๋ฏธ์น˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๋˜ํ•œ ๋งค์šฐ ํ’๋ถ€ํ•œ 2D ๊ทธ๋ž˜ํ”ฝ ๋ชจ๋ธ์—๋„ ์ง‘์ค‘ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๋Š” ๊ทธ๋ž˜๋””์–ธํŠธ์™€ ๊ฐ™์€ ๋ชจ๋“  ๊ธฐ๋Šฅ์„ ๊ฐ–์ถ˜ ๋ฒกํ„ฐ ๊ทธ๋ž˜ํ”ฝ์— ์™„์ „ํ•œ ์•ก์„ธ์Šค๋ฅผ ์›ํ•ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ ์ •๋ง ์ข‹์€ ๊ธ€๊ผด ์ง€์›๋„ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์ข€ ๋” ์ž์„ธํžˆ ์ด์•ผ๊ธฐํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๋ฌผ๋ก , ๊ทธ๊ฒŒ ์ œ๊ฐ€ ํ•˜๋Š” ์ผ์ด์ฃ . ํ•˜์ง€๋งŒ ์šฐ๋ฆฌ๋Š” ๊ณ ์„ฑ๋Šฅ๊ณผ ํ’๋ถ€ํ•จ๋งŒ ๊ฐ€์ง€๊ณ  ์žˆ์–ด์„œ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์ด ๋งค์šฐ ์–ด๋ ต๋‹ค๋ฉด ์•ˆ ๋˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๋˜ํ•œ, ๊ทธ ์œ„์— ์ •๋ง ํŽธ์•ˆํ•˜๊ณ  ์‚ฌ์šฉํ•˜๊ธฐ ์‰ฌ์šด API๋ฅผ ๋งŒ๋“ค๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ด๊ฒƒ์„ ๋ฐ์Šคํฌํ†ฑ๊ณผ ๋ชจ๋ฐ”์ผ์—์„œ ์ž‘๋™ํ•˜๋„๋ก ํ•˜๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค. ์ด ํ”„๋กœ์ ํŠธ๋Š” Google์—์„œ ์ž๊ธˆ์„ ์ง€์›ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Š” Google Fonts์—์„œ ์ž๊ธˆ์„ ์ง€์›ํ•˜๋Š” ์—ฐ๊ตฌ ํ”„๋กœ์ ํŠธ์ž…๋‹ˆ๋‹ค. ์ด ํ”„๋กœ์ ํŠธ์˜ ์ดˆ์ ์€ Android ์•ฑ์ž…๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ์šฐ๋ฆฌ๋Š” ๋‘˜ ๋‹ค ํ•˜๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. Android์—์„œ ์ข‹์€ ๊ฒฝํ—˜์„ ๋ณด์—ฌ์ฃผ๊ณ  ์‹ถ์ง€๋งŒ, ์ปค๋ฎค๋‹ˆํ‹ฐ๋Š” ๋ฐ์Šคํฌํ†ฑ๊ณผ ๋‹ค๋ฅธ ํƒ€๊ฒŸ์—๋„ ๊ด€์‹ฌ์ด ์žˆ์Šต๋‹ˆ๋‹ค.
  • This is a research project. The goals of this, we're not offering this as a product, you know, something that's fully ready to use out of the box. Maybe it will evolve into that over time, but the goals for right now are to discover, like, what is the best way to build UI in Rust and, you know, to what extent are we able to realize these goals of being extremely high performance and fully featured as a user interface. ChatGPT

    • ์ด๊ฒƒ์€ ์—ฐ๊ตฌ ํ”„๋กœ์ ํŠธ์ž…๋‹ˆ๋‹ค. ์ด ํ”„๋กœ์ ํŠธ์˜ ๋ชฉํ‘œ๋Š” ์ œํ’ˆ์œผ๋กœ ์ œ๊ณต๋˜๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ, ์ƒ์ž์—์„œ ๊บผ๋‚ด์„œ ์ฆ‰์‹œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์ด ์•„๋‹™๋‹ˆ๋‹ค. ์‹œ๊ฐ„์ด ์ง€๋‚˜๋ฉด ์ด๊ฒƒ์ด ๊ทธ๋ ‡๊ฒŒ ์ง„ํ™”๋  ์ˆ˜๋„ ์žˆ์ง€๋งŒ, ํ˜„์žฌ์˜ ๋ชฉํ‘œ๋Š” Rust๋กœ UI๋ฅผ ๊ตฌ์ถ•ํ•˜๋Š” ๊ฐ€์žฅ ์ข‹์€ ๋ฐฉ๋ฒ•์„ ๋ฐœ๊ฒฌํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์šฐ๋ฆฌ๊ฐ€ ์–ผ๋งˆ๋‚˜ ๊ณ ์„ฑ๋Šฅ์ด๊ณ  ๊ธฐ๋Šฅ์ด ํ’๋ถ€ํ•œ ์‚ฌ์šฉ์ž ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์‹คํ˜„ํ•  ์ˆ˜ ์žˆ๋Š”์ง€์— ๋Œ€ํ•œ ๋ฒ”์œ„์ž…๋‹ˆ๋‹ค.
  • We want to work with the community. This is maybe a little bit of a newer focus of the project, that we've been maybe a little bit siloed, maybe doing some of our own things. But as I go through the slides, you'll see that there are a number of decisions that we've made about how do we cooperate with the Rust ecosystem instead of just doing our own thing. ChatGPT

    • ์šฐ๋ฆฌ๋Š” ์ปค๋ฎค๋‹ˆํ‹ฐ์™€ ํ•จ๊ป˜ ์ผํ•˜๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ํ”„๋กœ์ ํŠธ์˜ ์กฐ๊ธˆ ์ƒˆ๋กœ์šด ์ดˆ์ ์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๋Š” ์กฐ๊ธˆ ๊ฒฉ๋ฆฌ๋˜์–ด ์žˆ์—ˆ๊ฑฐ๋‚˜ ์ž์ฒด์ ์ธ ์ผ์„ ํ•˜๊ณ  ์žˆ์„ ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์ €๋Š” ์Šฌ๋ผ์ด๋“œ๋ฅผ ํ†ตํ•ด ์ง„ํ–‰ํ•˜๋ฉด์„œ ์šฐ๋ฆฌ๊ฐ€ ์–ด๋–ค ๊ฒฐ์ •์„ ๋‚ด๋ ธ๋Š”์ง€ ๋ณผ ์ˆ˜ ์žˆ์„ ๊ฒƒ์ž…๋‹ˆ๋‹ค. Rust ์ƒํƒœ๊ณ„์™€์˜ ํ˜‘๋ ฅ์— ๋Œ€ํ•ด ์–ด๋–ป๊ฒŒ ํ•  ๊ฒƒ์ธ์ง€์— ๋Œ€ํ•œ ๊ฒƒ์ด์ฃ .
  • This is kind of a picture of what the problems that you need to solve in UI, and I want to point people to Nico. Nico Burns did a talk on Monday, and there's also a white paper that's coming out soon, and that work is giving a much more complete picture of what you're seeing on the screen here. But we are seeing the problem in layers. So there's a top layer, which is reactivity, and this could be provided, like each of these layers, each of these boxes could be provided by a number of different crates. So this reactivity could be provided by Dioxys or Leptos, and then I'll be talking a lot more about what we're doing with this. And then there's a middle layer, which is solving a lot of the guts of what's involved in UI, of having a full collection of widgets and having gestures and layout and your text editing. There's a lot of problems that need to be solved at that layer. And then there's also a really important layer at the bottom of infrastructure. How do you connect to the platform, and how do you do the basic functions of drawing, text rendering, getting to your GPU, and accessibility? I'll be talking a lot more about that. ChatGPT

    • ์ด๊ฒƒ์€ UI์—์„œ ํ•ด๊ฒฐํ•ด์•ผ ํ•  ๋ฌธ์ œ๋“ค์˜ ๊ทธ๋ฆผ์ด๋ฉฐ, Nico์—๊ฒŒ ์ฃผ๋ชฉํ•˜๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค. Nico Burns๊ฐ€ ์›”์š”์ผ์— ๋ฐœํ‘œ๋ฅผ ํ–ˆ๊ณ , ๊ณง ๋‚˜์˜ฌ ํ™”์ดํŠธ ํŽ˜์ดํผ๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ ์ž‘์—…์€ ์—ฌ๊ธฐ ํ™”๋ฉด์—์„œ ๋ณด์ด๋Š” ๊ฒƒ์˜ ํ›จ์”ฌ ์™„์ „ํ•œ ๊ทธ๋ฆผ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ์šฐ๋ฆฌ๋Š” ๋ฌธ์ œ๋ฅผ ์ธต๋ณ„๋กœ ๋ณด๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๋งจ ์œ„์ธต์€ ๋ฐ˜์‘์„ฑ์ž…๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ๊ฐ๊ฐ์˜ ์ธต, ๊ฐ๊ฐ์˜ ์ƒ์ž๋“ค์ด ์—ฌ๋Ÿฌ ๋‹ค๋ฅธ ํฌ๋ ˆ์ดํŠธ๋กœ ์ œ๊ณต๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ๋ฐ˜์‘์„ฑ์€ Dioxys๋‚˜ Leptos์— ์˜ํ•ด ์ œ๊ณต๋  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์ €๋Š” ์ด์— ๋Œ€ํ•ด ๋” ์ž์„ธํžˆ ์ด์•ผ๊ธฐํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ค‘๊ฐ„์ธต์—๋Š” UI์˜ ๋‚ด์šฉ์„ ํ•ด๊ฒฐํ•˜๋Š” ๋งŽ์€ ๋‚ด๋ถ€ ๊ตฌ์กฐ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์œ„์ ฏ์˜ ์ „์ฒด ์ปฌ๋ ‰์…˜๊ณผ ์ œ์Šค์ฒ˜ ๋ฐ ๋ ˆ์ด์•„์›ƒ ๋ฐ ํ…์ŠคํŠธ ํŽธ์ง‘์„ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ๊ฒƒ๊ณผ ๊ด€๋ จ๋œ ๋งŽ์€ ๋ฌธ์ œ๋“ค์ด ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๋งค์šฐ ์ค‘์š”ํ•œ ํ•˜๋‹จ์˜ ์ธํ”„๋ผ ๋ ˆ์ด์–ด๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ํ”Œ๋žซํผ์— ์—ฐ๊ฒฐํ•˜๋Š” ๋ฐฉ๋ฒ•๊ณผ ๊ทธ๋ž˜ํ”ฝ ์ฒ˜๋ฆฌ ์žฅ์น˜์— ๋„๋‹ฌํ•˜๋Š” ๋ฐฉ๋ฒ•, ๊ทธ๋ฆฌ๊ณ  ์ ‘๊ทผ์„ฑ์€ ์–ด๋–ป๊ฒŒ ํ•˜๋Š”์ง€์— ๋Œ€ํ•ด ๋” ๋งŽ์€ ์ด์•ผ๊ธฐ๋ฅผ ๋‚˜๋ˆŒ ๊ฒƒ์ž…๋‹ˆ๋‹ค.
  • So this is kind of our instantiation of this layered architecture. And so at the top level, we have the Xilin Reactive Architecture. In the middle layer, we have Masonry, which is our widget set, which does not depend on Xilin. So you could imagine using Masonry with Deoxys or Leptos. And then we're using Taffy for layout. And at the bottom, we have a mixture of things that are Rust ecosystem, like WinIT. We made a decision. We switched over in January from our own platform integration to using WinIT. And then a lot of the other things are things that we're building, that obviously we're building for use in Xilin, but we're also hoping can be used by other projects in the Rust ecosystem. ChatGPT

  • ์ด๊ฒƒ์€ ์ €ํฌ๊ฐ€ ์ธต๋ณ„ ์•„ํ‚คํ…์ฒ˜๋ฅผ ๊ตฌํ˜„ํ•œ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๋งจ ์œ„์ธต์—๋Š” Xilin ๋ฐ˜์‘ํ˜• ์•„ํ‚คํ…์ฒ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์ค‘๊ฐ„์ธต์—๋Š” Xilin์— ์˜์กดํ•˜์ง€ ์•Š๋Š” ์œ„์ ฏ ์„ธํŠธ์ธ Masonry๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ Masonry๋ฅผ Deoxys๋‚˜ Leptos์™€ ํ•จ๊ป˜ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค๊ณ  ์ƒ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๋ ˆ์ด์•„์›ƒ์—๋Š” Taffy๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๋งจ ์•„๋ž˜์ธต์—๋Š” WinIT๊ณผ ๊ฐ™์€ Rust ์ƒํƒœ๊ณ„์˜ ํ˜ผํ•ฉ๋ฌผ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๋Š” 1์›”์— ์šฐ๋ฆฌ ์ž์ฒด์˜ ํ”Œ๋žซํผ ํ†ตํ•ฉ์—์„œ WinIT์„ ์‚ฌ์šฉํ•˜๋„๋ก ์ „ํ™˜ํ•˜๋Š” ๊ฒฐ์ •์„ ๋‚ด๋ ธ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๋‹ค๋ฅธ ๋งŽ์€ ๊ฒƒ๋“ค์€ ์šฐ๋ฆฌ๊ฐ€ ๊ตฌ์ถ• ์ค‘์ธ ๊ฒƒ๋“ค์ž…๋‹ˆ๋‹ค. ๋ถ„๋ช…ํžˆ Xilin์—์„œ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด ๊ตฌ์ถ• ์ค‘์ด์ง€๋งŒ, Rust ์ƒํƒœ๊ณ„์˜ ๋‹ค๋ฅธ ํ”„๋กœ์ ํŠธ์—์„œ๋„ ์‚ฌ์šฉ๋  ์ˆ˜ ์žˆ๊ธฐ๋ฅผ ํฌ๋งํ•ฉ๋‹ˆ๋‹ค.

  • Again, Xylem is generic. There's a Xylem core, which is generic over the element tree that it's driving, so we can drive masonry widget set and also give a demo of using the Xylem core to drive DOM and create experience that can run in the browser. ChatGPT

    • ๋‹ค์‹œ ๋งํ•ด, Xilem์€ ๋ฒ”์šฉ์ ์ž…๋‹ˆ๋‹ค. Xilem ์ฝ”์–ด๋Š” ๊ทธ๊ฒƒ์ด ๊ตฌ๋™ํ•˜๋Š” ์š”์†Œ ํŠธ๋ฆฌ์— ๋Œ€ํ•ด ๋ฒ”์šฉ์ ์ž…๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ์šฐ๋ฆฌ๋Š” Masonry ์œ„์ ฏ ์„ธํŠธ๋ฅผ ๊ตฌ๋™ํ•  ์ˆ˜ ์žˆ๊ณ , ๋˜ํ•œ ๋ธŒ๋ผ์šฐ์ €์—์„œ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒฝํ—˜์„ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด Xilem ์ฝ”์–ด๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ DOM์„ ๊ตฌ๋™ํ•˜๋Š” ๋ฐ๋ชจ๋ฅผ ์ œ๊ณตํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • So the Xilin architecture, the Xilin Reactive architecture, gives you very simple code. Like this is your classic counter example, and this is really all of the code that there is. This is the actual code that I'm going to run. So it's a pretty simple code to get this functionality. And if I run this, ChatGPT

    • Xilin ์•„ํ‚คํ…์ฒ˜, Xilin ๋ฐ˜์‘ํ˜• ์•„ํ‚คํ…์ฒ˜๋Š” ๋งค์šฐ ๊ฐ„๋‹จํ•œ ์ฝ”๋“œ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ์ „ํ˜•์ ์ธ ์นด์šดํ„ฐ ์˜ˆ์ œ์ด๋ฉฐ, ์‹ค์ œ๋กœ ๋ชจ๋“  ์ฝ”๋“œ๊ฐ€ ์—ฌ๊ธฐ์— ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์ด ์‹คํ–‰ํ•  ์‹ค์ œ ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค. ์ด ๊ธฐ๋Šฅ์„ ์–ป์œผ๋ ค๋ฉด ๋งค์šฐ ๊ฐ„๋‹จํ•œ ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค. ์‹คํ–‰ํ•˜๋ฉด,
  • Pray to the demo gods, we have a usable example. Very simple. And I'll tempt the demo gods a little bit more and do a little bit of live coding. Let's add a checkbox to this. Also add a checkbox and test my live typing skills. And we'll call it is zero. And we'll be checked if count is actually equal to zero. And then on the action, we've got the app state, which in this case is just a count. And we've got a Boolean for whether it's checked. And we'll just set the count to zero or one based on sort of the opposite of the checked state. And we'll coerce that to 32. And this should give an error because checkbox, I'll just add it. ChatGPT

    • ์‹ ์˜ ์ด๋ฆ„์œผ๋กœ ๋ฐ๋ชจ๋ฅผ ๊ธฐ๋„ํ•ด๋ด…๋‹ˆ๋‹ค. ์šฐ๋ฆฌ์—๊ฒŒ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์˜ˆ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ๋งค์šฐ ๊ฐ„๋‹จํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์กฐ๊ธˆ ๋” ๋ฐ๋ชจ๋ฅผ ์œ ํ˜นํ•˜๊ณ  ์‹ค์‹œ๊ฐ„ ์ฝ”๋”ฉ๋„ ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์— ์ฒดํฌ๋ฐ•์Šค๋ฅผ ์ถ”๊ฐ€ํ•ด ๋ด…์‹œ๋‹ค. ํƒ€์ดํ•‘ ์‹ค๋ ฅ์„ ํ…Œ์ŠคํŠธํ•˜๊ณ  ์ฒดํฌ๋ฐ•์Šค๋ฅผ ์ถ”๊ฐ€ํ•ด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ์ด๋ฅผ 'is zero'๋ผ๊ณ  ๋ถ€๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  count๊ฐ€ ์‹ค์ œ๋กœ 0๊ณผ ๊ฐ™์€ ๊ฒฝ์šฐ์—๋งŒ ์ฒดํฌ๋˜๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์•ก์…˜์—๋Š” ์ด ๊ฒฝ์šฐ ์•ฑ ์ƒํƒœ๊ฐ€ ์žˆ์œผ๋ฉฐ, ์ด๋Š” ๋‹จ์ˆœํžˆ ์นด์šดํŠธ์ž…๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ฒดํฌ ์—ฌ๋ถ€์— ๋Œ€ํ•œ ๋ถˆ๋ฆฌ์–ธ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ฒดํฌ๋œ ์ƒํƒœ์˜ ๋ฐ˜๋Œ€์— ๋”ฐ๋ผ ์นด์šดํŠธ๋ฅผ 0 ๋˜๋Š” 1๋กœ ์„ค์ •ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ด๋ฅผ 32๋กœ ๊ฐ•์ œ ๋ณ€ํ™˜ํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ checkbox๊ฐ€ ์—†๊ธฐ ๋•Œ๋ฌธ์— ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ„๋‹จํžˆ ์ถ”๊ฐ€ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
  • And this is a Mac M1, so this is going to be a lot slower than what you saw yesterday morning, but it's pretty fast still. And now we've got a checkbox there, and we can use that. You know, it's reactive, so if you change the count here, reset it, it's changing the checkbox state because that's all kind of computed in the app logic. It's here. ChatGPT

    • ์ด๊ฑด ๋งฅ M1์ด๋ผ์„œ ์–ด์ œ ์•„์นจ์— ๋ณด์•˜๋˜ ๊ฒƒ๋ณด๋‹ค ํ›จ์”ฌ ๋А๋ฆด ๊ฑฐ์˜ˆ์š”. ๊ทธ๋Ÿฌ๋‚˜ ์—ฌ์ „ํžˆ ๊ฝค ๋น ๋ฆ…๋‹ˆ๋‹ค. ์ด์ œ ์ฒดํฌ๋ฐ•์Šค๊ฐ€ ์žˆ๊ณ , ์ด๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฐ˜์‘ํ˜•์ด๊ธฐ ๋•Œ๋ฌธ์— ์—ฌ๊ธฐ์„œ ์นด์šดํŠธ๋ฅผ ๋ณ€๊ฒฝํ•˜๋ฉด ์ฒดํฌ๋ฐ•์Šค ์ƒํƒœ๋„ ๋ณ€๊ฒฝ๋˜๋ฉฐ, ์ด๋Š” ๋ชจ๋‘ ์•ฑ ๋กœ์ง์—์„œ ๊ณ„์‚ฐ๋ฉ๋‹ˆ๋‹ค. ์—ฌ๊ธฐ ์žˆ์Šต๋‹ˆ๋‹ค.
  • All right, back to the slides. So yeah, there's a few things that are a little bit different than a lot of the reactive layers that you see are derived from the JavaScript world, which is typically very dynamically type. And I think Xylem is a lot more inspired by Swift UI than it is by JavaScript frameworks. So everything that you're seeing, all of these views that are created are statically type. And that also means that the process of reconciliation, of dissing, this is all working statically typed data. So it's going to be a lot more efficient than doing something that's dynamically type. You'll also notice looking at that code that there are no macros in there, that these are actually fairly simple Rust value data types. Like, you know, when there's a string, well, there's no label in here. I'm not going to add a label, life-coded, but it's really just a string. And then that string is a view that creates the underlying label widget, but the programmer doesn't really have to worry about that. ChatGPT

    • ์ข‹์•„์š”, ๋‹ค์‹œ ์Šฌ๋ผ์ด๋“œ๋กœ ๋Œ์•„๊ฐ€ ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ๋งŽ์€ ๋ฐ˜์‘ํ˜• ๋ ˆ์ด์–ด๋“ค์ด ์ผ๋ฐ˜์ ์œผ๋กœ JavaScript ์„ธ๊ณ„์—์„œ ์œ ๋ž˜๋˜์—ˆ๋Š”๋ฐ, ์ด๋Š” ๋ณดํ†ต ๋งค์šฐ ๋™์ ์œผ๋กœ ํƒ€์ž…๋ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  Xilem์€ JavaScript ํ”„๋ ˆ์ž„์›Œํฌ๋ณด๋‹ค๋Š” Swift UI์—์„œ ๋งŽ์€ ์˜๊ฐ์„ ๋ฐ›์•˜๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ๋ณด๊ณ  ๊ณ„์‹  ๋ชจ๋“  ๋ทฐ๋“ค์€ ์ •์ ์œผ๋กœ ํƒ€์ž…๋ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ด๋Š” ๋ชจ๋“  ์žฌ์กฐ์ • ๋ฐ ํ•ด๊ฒฐ ๊ณผ์ •์ด ์ •์ ์œผ๋กœ ํƒ€์ž…๋œ ๋ฐ์ดํ„ฐ์—์„œ ์ž‘๋™ํ•˜๊ธฐ ๋•Œ๋ฌธ์—, ๋™์ ์œผ๋กœ ํƒ€์ž…๋œ ๊ฒƒ์„ ์ˆ˜ํ–‰ํ•˜๋Š” ๊ฒƒ๋ณด๋‹ค ํ›จ์”ฌ ํšจ์œจ์ ์ผ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๊ทธ ์ฝ”๋“œ๋ฅผ ๋ณด๋ฉด ๊ฑฐ๊ธฐ์— ๋งคํฌ๋กœ๊ฐ€ ์—†๋‹ค๋Š” ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ๋“ค์€ ์‹ค์ œ๋กœ ์ƒ๋‹นํžˆ ๊ฐ„๋‹จํ•œ Rust ๊ฐ’ ๋ฐ์ดํ„ฐ ์œ ํ˜•์ž…๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ๋ฌธ์ž์—ด์ด ์žˆ๋Š” ๊ฒฝ์šฐ, ์—ฌ๊ธฐ์—๋Š” ๋ ˆ์ด๋ธ”์ด ์—†์Šต๋‹ˆ๋‹ค. ๋ ˆ์ด๋ธ”์„ ์ถ”๊ฐ€ํ•˜์ง€ ์•Š๊ฒ ์Šต๋‹ˆ๋‹ค. ๋ผ์ด๋ธŒ ์ฝ”๋”ฉํ•˜๋Š” ๊ฒƒ์€ ์•„๋‹ˆ์ง€๋งŒ, ์ด๊ฒƒ์€ ์ •๋ง๋กœ ๊ทธ๋ƒฅ ๋ฌธ์ž์—ด์ž…๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๊ทธ ๋ฌธ์ž์—ด์€ ๊ธฐ๋ณธ ๋ ˆ์ด๋ธ” ์œ„์ ฏ์„ ์ƒ์„ฑํ•˜๋Š” ๋ทฐ์ด์ง€๋งŒ, ํ”„๋กœ๊ทธ๋ž˜๋จธ๋Š” ์‹ค์ œ๋กœ ๊ทธ๊ฒƒ์— ๋Œ€ํ•ด ๊ฑฑ์ •ํ•  ํ•„์š”๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.
  • So as I mentioned, there's a generic Xilin core. In this case, we're generating a masonry view, which is our native widget type. But you could also generate other things like web, and I'll show an example of that. ChatGPT

    • ์ œ๊ฐ€ ์–ธ๊ธ‰ํ–ˆ๋“ฏ์ด, ๋ฒ”์šฉ Xilem ์ฝ”์–ด๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ๊ฒฝ์šฐ์—๋Š” Masonry ๋ทฐ๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Š” ์šฐ๋ฆฌ์˜ ๋„ค์ดํ‹ฐ๋ธŒ ์œ„์ ฏ ์œ ํ˜•์ž…๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์›น๊ณผ ๊ฐ™์€ ๋‹ค๋ฅธ ๊ฒƒ๋“ค๋„ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๊ฒƒ์˜ ์˜ˆ๋ฅผ ๋ณด์—ฌ๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค.
  • XIALM is based at the core of XIALM. Drawing is really essential to any GUI toolkit, and that's also where you tend to spend most of the CPU time, most of the performance. It's just how fast can you get this thing drawn onto the screen. And so that's a lot of what I've been doing over the past few years, really, is building a fast 2D rendering engine that does as much of the work as possible on the GPU. You want to do as little as possible on the CPU. You want to offload all of that work to the GPU. So it is implementing the full standard 2D imaging model. So we have vector paths with fills and strokes, gradients, images, clips, blends, and text. Let's go to the demo. ChatGPT

    • XIALM์€ XIALM์˜ ํ•ต์‹ฌ์— ๊ธฐ๋ฐ˜ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ธฐ๋Š” ๋ชจ๋“  GUI ํˆดํ‚ท์— ๋งค์šฐ ์ค‘์š”ํ•˜๋ฉฐ, ๋Œ€๋ถ€๋ถ„์˜ CPU ์‹œ๊ฐ„, ๋Œ€๋ถ€๋ถ„์˜ ์„ฑ๋Šฅ์„ ์‚ฌ์šฉํ•˜๋Š” ๊ณณ์ž…๋‹ˆ๋‹ค. ํ™”๋ฉด์— ์ด๊ฒƒ์„ ์–ผ๋งˆ๋‚˜ ๋นจ๋ฆฌ ๊ทธ๋ฆด ์ˆ˜ ์žˆ๋Š”๊ฐ€๊ฐ€ ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ์ง€๋‚œ ๋ช‡ ๋…„ ๋™์•ˆ ์ €๋Š” ๊ฐ€๋Šฅํ•œ ํ•œ ๋งŽ์€ ์ž‘์—…์„ GPU์—์„œ ์ˆ˜ํ–‰ํ•˜๋Š” ๋น ๋ฅธ 2D ๋ Œ๋”๋ง ์—”์ง„์„ ๊ตฌ์ถ•ํ•˜๋Š” ๋ฐ ์ฃผ๋ ฅํ•ด ์™”์Šต๋‹ˆ๋‹ค. CPU์—์„œ ์ตœ์†Œํ•œ์˜ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๊ณ  ๊ฐ€๋Šฅํ•œ ๋งŽ์€ ์ž‘์—…์„ GPU๋กœ ์˜คํ”„๋กœ๋“œํ•˜๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ํ‘œ์ค€ 2D ์ด๋ฏธ์ง• ๋ชจ๋ธ์„ ์™„์ „ํžˆ ๊ตฌํ˜„ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์šฐ๋ฆฌ๋Š” ๋ฒกํ„ฐ ๊ฒฝ๋กœ์™€ ์ฑ„์šฐ๊ธฐ ๋ฐ ์ŠคํŠธ๋กœํฌ, ๊ทธ๋ž˜๋””์–ธํŠธ, ์ด๋ฏธ์ง€, ํด๋ฆฝ, ๋ธ”๋ Œ๋“œ ๋ฐ ํ…์ŠคํŠธ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฐ๋ชจ๋กœ ์ด๋™ํ•ด ๋ณด์ฃ .
  • Um, let's see if we can... ChatGPT

    • ์ œ๊ฐ€ ๋„์™€๋“œ๋ฆด ์ˆ˜ ์žˆ๋Š” ๊ฒŒ ์žˆ๋‚˜์š”? ๋ฌด์—‡์„ ํ•˜๊ณ  ์‹ถ์œผ์„ธ์š”?
  • So, I'm just going to run through kind of our standard test scene so you always have the... ChatGPT

    • ๊ทธ๋Ÿฌ๋‹ˆ๊นŒ, ์ œ๊ฐ€ ํ‘œ์ค€ ํ…Œ์ŠคํŠธ ์žฅ๋ฉด์„ ์‹คํ–‰ํ•ด๋ณผ๊ฒŒ์š”. ๊ทธ๋ž˜์„œ ํ•ญ์ƒ...
  • You need to have that. Some of these things, like we have a lot of things in there for stroking, because just in the past few months we've moved from the stroke expansion being computed on the CPU to entirely being computed on the GPU. And actually there's a paper that I just submitted to a conference, so you can see the preprint. There's a lot of math that goes into computing the stuff on the GPU. ChatGPT

    • ๊ทธ๊ฑธ ๊ฐ–๊ณ  ์žˆ์–ด์•ผ ํ•ด์š”. ์ตœ๊ทผ ๋ช‡ ๋‹ฌ ๋™์•ˆ ์ŠคํŠธ๋กœํฌ ํ™•์žฅ์ด CPU์—์„œ ๊ณ„์‚ฐ๋˜๋Š” ๊ฒƒ์—์„œ ์™„์ „ํžˆ GPU์—์„œ ๊ณ„์‚ฐ๋˜๋„๋ก ์ด๋™ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— ๊ทธ ์ค‘ ์ผ๋ถ€๋Š” CPU์—์„œ ๊ณ„์‚ฐ๋˜๋Š” ๊ฒƒ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์‚ฌ์‹ค, ์ œ๊ฐ€ ๋ฐฉ๊ธˆ ํ•™ํšŒ์— ์ œ์ถœํ•œ ๋…ผ๋ฌธ์ด ์žˆ์œผ๋‹ˆ๊นŒ ํ”„๋ฆฌํ”„๋ฆฐํŠธ๋ฅผ ๋ณผ ์ˆ˜ ์žˆ์–ด์š”. GPU์—์„œ ์ด๋Ÿฐ ๊ฒƒ๋“ค์„ ๊ณ„์‚ฐํ•˜๋Š” ๋ฐ๋Š” ๋งŽ์€ ์ˆ˜ํ•™์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
  • Mention the turn async off. Things go a lot faster. Here's a fun test scene that has, you know, a little bit, this is actually not a lot of strokes. We have test scenes in here as, you know, tens of thousands of strokes. And so this one is showing a bunch of things. It's showing the animation and an image in there. And one of the things that we're also showing here is that our text and font handling is able to do variable fonts. And one of the goals, one of the things that's kind of driving this is to be able to do richer things like animate those variable font parameters. So you can go from light to bold, and you can animate the widths completely dynamically. And that's a, to get really high performance, this would be a major challenge with existing TD graphics libraries. So this is just kind of going through, this is our engineering test scene. So here you can see all the different blend modes. There's more coming up that are sort of stress tests for how many line segments that you can have and still get decent performance. Yeah, this is another one. This is the motion mark example. And let's see with the stats that you can ramp up to, I think it goes up to like 70,000 and still running it over 120 frames a second. So the performance, moving all of this from the CPU to the GPU just unlocks hugely increased performance. I'll show you another example that really shows off their performance. This is one of our standards test scenes. It's a map of Paris. It has ChatGPT

    • Async๋ฅผ ๋„๋ฉด ์„ฑ๋Šฅ์ด ํ›จ์”ฌ ๋นจ๋ผ์ง‘๋‹ˆ๋‹ค. ์—ฌ๊ธฐ ์žฌ๋ฏธ์žˆ๋Š” ํ…Œ์ŠคํŠธ ์žฅ๋ฉด์ด ์žˆ์–ด์š”. ์ด๊ฒƒ์€ ์‹ค์ œ๋กœ ๋งŽ์€ ์ˆ˜์˜ ์ŠคํŠธ๋กœํฌ๊ฐ€ ์•„๋‹ˆ์—์š”. ์—ฌ๊ธฐ์—๋Š” ์ˆ˜์ฒœ ๊ฐœ์˜ ์ŠคํŠธ๋กœํฌ๊ฐ€ ์žˆ๋Š” ํ…Œ์ŠคํŠธ ์žฅ๋ฉด๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ์ด๊ฒƒ์€ ์—ฌ๋Ÿฌ ๊ฐ€์ง€๋ฅผ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค. ์• ๋‹ˆ๋ฉ”์ด์…˜๊ณผ ์ด๋ฏธ์ง€๋ฅผ ๋ณด์—ฌ์ฃผ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ ์šฐ๋ฆฌ๊ฐ€ ๋ณด์—ฌ์ฃผ๊ณ  ์žˆ๋Š” ๋‹ค๋ฅธ ๊ฒƒ ์ค‘ ํ•˜๋‚˜๋Š” ํ…์ŠคํŠธ์™€ ๊ธ€๊ผด ์ฒ˜๋ฆฌ๊ฐ€ ๋ณ€์ˆ˜ ๊ธ€๊ผด์„ ๋‹ค๋ฃฐ ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ด๊ฒƒ์„ ํ†ตํ•ด ๋ณ€์ˆ˜ ๊ธ€๊ผด ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ์• ๋‹ˆ๋ฉ”์ด์…˜ํ™”ํ•  ์ˆ˜ ์žˆ๋Š” ๋“ฑ ๋ณด๋‹ค ํ’๋ถ€ํ•œ ๊ธฐ๋Šฅ์„ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์ด ๋ชฉํ‘œ ์ค‘ ํ•˜๋‚˜์ž…๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ๊ธ€๊ผด ๋‘๊ป˜๋ฅผ ๊ฐ€๋ณ๊ฒŒ ๋ฐ”๊พธ๊ฑฐ๋‚˜ ์ง„ํ•˜๊ฒŒ ๋ฐ”๊พธ๊ณ , ๋„ˆ๋น„๋ฅผ ์™„์ „ํžˆ ๋™์ ์œผ๋กœ ์• ๋‹ˆ๋ฉ”์ด์…˜ํ™”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ธฐ์กด์˜ 2D ๊ทธ๋ž˜ํ”ฝ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋กœ๋Š” ์ด๋ฅผ ๊ตฌํ˜„ํ•˜๋Š” ๊ฒƒ์ด ๋งค์šฐ ์–ด๋ ค์šด ๊ณผ์ œ์ผ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์—ฌ๊ธฐ ์—”์ง€๋‹ˆ์–ด๋ง ํ…Œ์ŠคํŠธ ์žฅ๋ฉด์ด ์žˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์–‘ํ•œ ๋ธ”๋ Œ๋“œ ๋ชจ๋“œ๋ฅผ ๋ชจ๋‘ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ข€ ๋” ๋‚˜์˜ค๋Š” ๊ฒƒ๋“ค์€ ์„ฑ๋Šฅ์„ ์–ผ๋งˆ๋‚˜ ํ–ฅ์ƒ์‹œํ‚ฌ ์ˆ˜ ์žˆ๋Š”์ง€์— ๋Œ€ํ•œ ์ŠคํŠธ๋ ˆ์Šค ํ…Œ์ŠคํŠธ์ž…๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ๋˜ ๋‹ค๋ฅธ ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ๋ชจ์…˜ ๋งˆํฌ ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ํ†ต๊ณ„๋ฅผ ๋ณด๋ฉด, 70,000๊นŒ์ง€ ์˜ฌ๋ผ๊ฐ€๊ณ ๋„ ์—ฌ์ „ํžˆ ์ดˆ๋‹น 120ํ”„๋ ˆ์ž„์œผ๋กœ ์‹คํ–‰๋ฉ๋‹ˆ๋‹ค. ๋ชจ๋“  ๊ฒƒ์„ CPU์—์„œ GPU๋กœ ์˜ฎ๊ธฐ๋ฉด ์„ฑ๋Šฅ์ด ํฌ๊ฒŒ ํ–ฅ์ƒ๋ฉ๋‹ˆ๋‹ค. ๋‹ค๋ฅธ ์˜ˆ๋ฅผ ๋ณด์—ฌ๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ์šฐ๋ฆฌ์˜ ํ‘œ์ค€ ํ…Œ์ŠคํŠธ ์žฅ๋ฉด ์ค‘ ํ•˜๋‚˜์ž…๋‹ˆ๋‹ค. ํŒŒ๋ฆฌ ์ง€๋„์ž…๋‹ˆ๋‹ค.
  • A million path segments in the image. You can zoom in, you can see there's a lot of detail there. And, you know, when we're async off, you get hundreds of frames per second. And again, with standard rendering thing, it's challenging even to get 60 frames a second out of this particular test scene. So that's really a lot of what the Xylem project is about, is how do you exploit, if you have all that power, if you have all that graphical power, how do you exploit that from a REST UI? So there's a lot more to be said, including the multi-threaded encoding. Like, if you're rendering a scene of that richness and complexity, and you're only able to get that data to the GPU from a single thread, that can easily be the bottleneck. So one of the goals of this project is, have the different parts of the UI running in different threads, and have it assemble all these scene fragments together. So there's a lot of technical detail. I actually have a talk that I was gonna put a link, I forgot to do that. I did a talk at REST Lab last November, and I go into a lot more detail about the Velo engine. So if you're interested, go check out that talk. ChatGPT

    • ์ด๋ฏธ์ง€์—๋Š” ๋ฐฑ๋งŒ ๊ฐœ์˜ ๊ฒฝ๋กœ ์„ธ๊ทธ๋จผํŠธ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ํ™•๋Œ€ํ•ด์„œ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋งŽ์€ ๋””ํ…Œ์ผ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  async๋ฅผ ๋„๋ฉด ์ดˆ๋‹น ์ˆ˜๋ฐฑ ํ”„๋ ˆ์ž„์„ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ํ‘œ์ค€ ๋ Œ๋”๋ง์—์„œ๋Š” ์ด ํŠน์ • ํ…Œ์ŠคํŠธ ์žฅ๋ฉด์—์„œ 60ํ”„๋ ˆ์ž„์„ ์–ป๋Š” ๊ฒƒ๋„ ์–ด๋ ค์šธ ์ •๋„์ž…๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ Xilem ํ”„๋กœ์ ํŠธ์˜ ์ฃผ๋œ ๋ชฉ์  ์ค‘ ํ•˜๋‚˜๋Š” ๋งŒ์•ฝ ๊ทธ๋งŒํ•œ ํŒŒ์›Œ๊ฐ€ ์žˆ๋‹ค๋ฉด, ๊ทธ๋งŒํ•œ ๊ทธ๋ž˜ํ”ฝ ํŒŒ์›Œ๊ฐ€ ์žˆ๋‹ค๋ฉด, ์ด๊ฒƒ์„ ์–ด๋–ป๊ฒŒ ํ™œ์šฉํ•  ๊ฒƒ์ธ๊ฐ€์— ๋Œ€ํ•œ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๋‹ค์–‘ํ•œ ๊ธฐ์ˆ ์  ์„ธ๋ถ€ ์‚ฌํ•ญ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์‹ค์ œ๋กœ ์ €๋Š” ์ž‘๋…„ 11์›”์— REST Lab์—์„œ ๋ฐœํ‘œํ•œ ๊ฒƒ์ด ์žˆ๋Š”๋ฐ, ๊ทธ๋•Œ Velo ์—”์ง„์— ๋Œ€ํ•ด ๋” ๋งŽ์€ ์„ธ๋ถ€ ์ •๋ณด๋ฅผ ๋‹ค๋ฃจ์—ˆ์Šต๋‹ˆ๋‹ค. ๋งŒ์•ฝ ๊ด€์‹ฌ์ด ์žˆ๋‹ค๋ฉด, ๊ทธ ๋ฐœํ‘œ๋ฅผ ํ™•์ธํ•ด ๋ณด์„ธ์š”.
  • So the way that we use Velo in Xilin is also interesting because this is a different API. This is not having a Canvas context that has an in-mute reference to it, which would restrict you to a single thread. So we have a model in which the widget in Xilin retains a scene fragment. So the scene fragment is kind of, you can think of a scene fragment as like a snippet of binary SVG. So if you're painting, you don't have to repaint the whole widget every time. Then you can retain that scene fragment and only re-encode the subtree when it's changed. And so you can do things like change the transform. So if you're doing scrolling, you don't have to be re-encoding all the content of what's inside that clip window. You can just reuse that and then have the GPU do all the work of re-rendering it. So it's all about making the CPU do as little as possible and making the GPU do the work where it can be actually about 10 times as efficient in terms of how much you can get per second or how much throughput you can get per watch. ChatGPT

    • Xilem์—์„œ Velo๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ์‹๋„ ํฅ๋ฏธ๋กญ์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ๋‹ค๋ฅธ API์ž…๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ Canvas ์ปจํ…์ŠคํŠธ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์ง€๋งŒ ํ•ด๋‹น ์ปจํ…์ŠคํŠธ์— ๋Œ€ํ•œ ๋‚ด๋ถ€ ์ฐธ์กฐ๊ฐ€ ์žˆ๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๊ธฐ ๋•Œ๋ฌธ์—, ์ด๊ฒƒ์€ ๋‹จ์ผ ์Šค๋ ˆ๋“œ๋กœ ์ œํ•œ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. Xilem์—์„œ๋Š” ์œ„์ ฏ์ด ์žฅ๋ฉด ์กฐ๊ฐ์„ ๋ณด์œ ํ•˜๋„๋ก ๋ชจ๋ธ์„ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์žฅ๋ฉด ์กฐ๊ฐ์„ ์ดํ•ดํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ๋ฐ”์ด๋„ˆ๋ฆฌ SVG์˜ ์ผ๋ถ€ ์กฐ๊ฐ์œผ๋กœ ์ƒ๊ฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ๊ทธ๋ฆผ์„ ๊ทธ๋ฆด ๋•Œ๋งˆ๋‹ค ์ „์ฒด ์œ„์ ฏ์„ ๋‹ค์‹œ ๊ทธ๋ฆฌ์ง€ ์•Š์•„๋„ ๋ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ ๋‹ค์Œ ๊ทธ ์žฅ๋ฉด ์กฐ๊ฐ์„ ๋ณด์กดํ•˜๊ณ  ํ•˜์œ„ ํŠธ๋ฆฌ๊ฐ€ ๋ณ€๊ฒฝ๋  ๋•Œ๋งŒ ์žฌ์ธ์ฝ”๋”ฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ๋ณ€ํ˜•์„ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์Šคํฌ๋กค๋ง์„ ํ•  ๋•Œ ์Šคํฌ๋กค ์ฐฝ ์•ˆ์— ์žˆ๋Š” ๋‚ด์šฉ์˜ ๋ชจ๋“  ๋‚ด์šฉ์„ ๋‹ค์‹œ ์ธ์ฝ”๋”ฉํ•  ํ•„์š”๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น ๋‚ด์šฉ์„ ์žฌ์‚ฌ์šฉํ•˜๊ณ  GPU์—๊ฒŒ ๋ชจ๋“  ๋ Œ๋”๋ง ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๋„๋ก ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. CPU๊ฐ€ ์ตœ์†Œํ•œ์˜ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๊ณ  GPU๊ฐ€ ์ž‘์—…์„ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ๊ณณ์—์„œ ์‹ค์ œ๋กœ๋Š” ์ดˆ๋‹น ์–ผ๋งˆ๋‚˜ ๋งŽ์€ ์–‘์„ ์–ป์„ ์ˆ˜ ์žˆ๋Š”์ง€ ๋˜๋Š” ์‹œ๊ฐ„๋‹น ์–ผ๋งˆ๋‚˜ ๋งŽ์€ ์ฒ˜๋ฆฌ๋Ÿ‰์„ ์–ป์„ ์ˆ˜ ์žˆ๋Š”์ง€ ์•ฝ 10๋ฐฐ ํšจ์œจ์ ์ž…๋‹ˆ๋‹ค.
  • Another one of the layers, or another one of the bricks in that image, text is obviously really central to any GUI. And so we have this new crate. And all these crates, by the way, that you saw, the pictures that you see here in bold, most of these just got released in the last two or three weeks. Some of them, I think the Xylem crate actually got released at midnight, so yesterday or today. Alon, in preparation for this talk, of course, we've been working on it for a very long time, but Parley is another one that got released, I think maybe two or three weeks ago. And it's an advanced text layout engine. And so it does the basics of text layout. So it does paragraph layout with line breaking. It has the ability to set attributes. You can do bold and italic and all that fun stuff. But it goes, and of course, it's designed for performance, really really metal performance. But we're also trying to do some richer things. So it supports variable fonts. And one of our goals, we don't have it, what you saw in the demo was not using Parley, I don't think. But we want to support variable fonts. We want to support the animation of variable font access and do richer interactions in the UI. Parley itself, of course, works well with Bellow, but it is not tied to a specific 2D rendering image. So this is one of these blocks that you can mix and match however you like. There's some details here. It's depending, there's two crates that are kind of below Parley. One is called Fontique, and Fontique accesses the system fonts and enumerates them and figures out which font is needed to render which script. And there's also a crate called Screefa, which does the low level font loading. So this is really the Rust alternative to FreeType. I think one of the most exciting things about Screefa is that there's work in progress to get this integrated into Chrome. So that's actually in a Chrome Canary build, I believe under a flag. But the goal is to make that really production quality to support all of the font loading that kind of low level font needs that Chrome has, which is a pretty big requirement. ChatGPT

    • ํ…์ŠคํŠธ๋Š” GUI์—์„œ ์•„์ฃผ ์ค‘์š”ํ•œ ์š”์†Œ์ž…๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ์šฐ๋ฆฌ๋Š” ์ด ์ƒˆ๋กœ์šด ํฌ๋ ˆ์ดํŠธ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ ๋ณด์ด๋Š” ๊ทธ๋ฆผ๋“ค์€ ๋Œ€๋ถ€๋ถ„์ด ์ง€๋‚œ ๋‘ ~ ์„ธ ์ฃผ ๋™์•ˆ ์ถœ์‹œ๋œ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ผ๋ถ€๋Š” ์‹ค์ œ๋กœ ์ง€๋‚œ ๋ฐค ์ž์ •์— ์ถœ์‹œ๋œ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์ด ํ† ํฌ๋ฅผ ์ค€๋น„ํ•˜๋Š” ๋™์•ˆ ์•„๋ก ์€ ๋ฌผ๋ก  ์˜ค๋žœ ์‹œ๊ฐ„๋™์•ˆ ์ž‘์—…ํ•ด ์™”์ง€๋งŒ, Parley๋„ ์ด๋ฒˆ์— ์ถœ์‹œ๋œ ๊ฒƒ ์ค‘ ํ•˜๋‚˜์ž…๋‹ˆ๋‹ค. ๊ณ ๊ธ‰ ํ…์ŠคํŠธ ๋ ˆ์ด์•„์›ƒ ์—”์ง„์ž…๋‹ˆ๋‹ค. ๊ธฐ๋ณธ์ ์ธ ํ…์ŠคํŠธ ๋ ˆ์ด์•„์›ƒ์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. ๋ฌธ๋‹จ ๋ ˆ์ด์•„์›ƒ๊ณผ ์ค„ ๋ฐ”๊ฟˆ์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. ์†์„ฑ์„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ณผ๋“œ์ฒด์™€ ์ดํƒค๋ฆญ์ฒด ๋“ฑ ๋‹ค์–‘ํ•œ ์†์„ฑ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฌผ๋ก  ์„ฑ๋Šฅ์„ ์œ„ํ•ด ์„ค๊ณ„๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋งค์šฐ ๋น ๋ฅธ ์„ฑ๋Šฅ์ž…๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ๋” ํ’๋ถ€ํ•œ ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ•˜๋ ค๊ณ  ๋…ธ๋ ฅํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ๋ณ€์ˆ˜ ๊ธ€๊ผด์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. ๋ณ€์ˆ˜ ๊ธ€๊ผด ์•ก์„ธ์Šค์˜ ์• ๋‹ˆ๋ฉ”์ด์…˜๊ณผ ๋” ํ’๋ถ€ํ•œ UI ์ƒํ˜ธ ์ž‘์šฉ์„ ์ง€์›ํ•˜๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. Parley ์ž์ฒด๋Š” Bellow์™€ ์ž˜ ์ž‘๋™ํ•˜์ง€๋งŒ, ํŠน์ • 2D ๋ Œ๋”๋ง ์ด๋ฏธ์ง€์— ๊ฒฐํ•ฉ๋˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์›ํ•˜๋Š” ๋Œ€๋กœ ํ˜ผํ•ฉ ๋ฐ ์ผ์น˜์‹œํ‚ฌ ์ˆ˜ ์žˆ๋Š” ์ด๋Ÿฌํ•œ ๋ธ”๋ก ์ค‘ ํ•˜๋‚˜์ž…๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์—๋Š” ์„ธ๋ถ€ ์ •๋ณด๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. Parley ์•„๋ž˜์— ๋‘ ๊ฐœ์˜ ํฌ๋ ˆ์ดํŠธ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•˜๋‚˜๋Š” Fontique์ด๋ผ๊ณ  ํ•˜๋ฉฐ, ์‹œ์Šคํ…œ ๊ธ€๊ผด์— ์•ก์„ธ์Šคํ•˜๊ณ  ํ•„์š”ํ•œ ๊ธ€๊ผด์„ ๋ Œ๋”๋งํ•˜๋Š” ๋ฐ ํ•„์š”ํ•œ ๊ธ€๊ผด์„ ์ฐพ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  Screefa๋ผ๋Š” ํฌ๋ ˆ์ดํŠธ๊ฐ€ ์žˆ์œผ๋ฉฐ, ์ด๋Š” ์ €์ˆ˜์ค€ ๊ธ€๊ผด ๋กœ๋”ฉ์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” ์‹ค์ œ๋กœ FreeType์— ๋Œ€ํ•œ Rust ๋Œ€์•ˆ์ž…๋‹ˆ๋‹ค. Screefa์— ๋Œ€ํ•œ ๊ฐ€์žฅ ํฅ๋ฏธ๋กœ์šด ์  ์ค‘ ํ•˜๋‚˜๋Š” Chrome์— ํ†ตํ•ฉ๋˜๋Š” ์ž‘์—…์ด ์ง„ํ–‰ ์ค‘์ด๋ผ๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์‹ค์ œ๋กœ Chrome Canary ๋นŒ๋“œ์—์„œ ์ด๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ๊ทธ ๋ชฉํ‘œ๋Š” ์‹ค์ œ๋กœ ํ”„๋กœ๋•์…˜ ํ’ˆ์งˆ์„ ๊ฐ–์ถ”๊ณ , Chrome์ด ํ•„์š”๋กœ ํ•˜๋Š” ๋ชจ๋“  ๊ธ€๊ผด ๋กœ๋”ฉ์„ ์ง€์›ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.
  • Another major goal of our project is to support accessibility well out of the box. And so we're funding work on AccessKit, which is, I think, the Rust ecosystem create for doing accessibility. And so it's a portable abstraction layer. Each platform has its own API for how it exposes accessibility. And so the Mac and Windows and Linux, more recently, backends are working pretty well. Android is in progress. That's one of our goals, to get that working. AccessKit is, of course, written in Rust, but there are bindings. We want to make that available for other languages. And there's some technical details I'll skip past and just go straight to the demo. ChatGPT

    • ํ”„๋กœ์ ํŠธ์˜ ๋˜ ๋‹ค๋ฅธ ์ฃผ์š” ๋ชฉํ‘œ ์ค‘ ํ•˜๋‚˜๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ ์ž˜ ์•Œ๋ ค์ง„ ์ ‘๊ทผ์„ฑ์„ ์ง€์›ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ์šฐ๋ฆฌ๋Š” AccessKit์— ๋Œ€ํ•œ ์ž‘์—…์„ ํ›„์›ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ์ ‘๊ทผ์„ฑ์„ ์ฒ˜๋ฆฌํ•˜๊ธฐ ์œ„ํ•œ Rust ์ƒํƒœ๊ณ„ ํฌ๋ ˆ์ดํŠธ์ž…๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์ด๋Š” ํœด๋Œ€์šฉ ์ถ”์ƒํ™” ๊ณ„์ธต์ž…๋‹ˆ๋‹ค. ๊ฐ ํ”Œ๋žซํผ์€ ์ ‘๊ทผ์„ฑ์„ ๋…ธ์ถœํ•˜๋Š” ๋ฐฉ์‹์— ๋Œ€ํ•œ ๊ณ ์œ ํ•œ API๋ฅผ ๊ฐ–๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ Mac, Windows, ๊ทธ๋ฆฌ๊ณ  ๋ฆฌ๋ˆ…์Šค ๋ฐฑ์—”๋“œ๋Š” ์ตœ๊ทผ์— ์ž˜ ์ž‘๋™ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์•ˆ๋“œ๋กœ์ด๋“œ๋Š” ์ง„ํ–‰ ์ค‘์ž…๋‹ˆ๋‹ค. ๊ทธ๊ฒƒ์ด ์šฐ๋ฆฌ์˜ ๋ชฉํ‘œ ์ค‘ ํ•˜๋‚˜์ž…๋‹ˆ๋‹ค. ์ž‘๋™ํ•˜๋„๋ก ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. AccessKit์€ ๋ฌผ๋ก  Rust๋กœ ์ž‘์„ฑ๋˜์—ˆ์ง€๋งŒ, ๋ฐ”์ธ๋”ฉ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฅผ ๋‹ค๋ฅธ ์–ธ์–ด๋กœ ์ด์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค. ๋ช‡ ๊ฐ€์ง€ ๊ธฐ์ˆ ์ ์ธ ์„ธ๋ถ€ ์‚ฌํ•ญ์€ ๊ฑด๋„ˆ๋›ฐ๊ณ  ๋ฐ”๋กœ ๋ฐ๋ชจ๋กœ ์ด๋™ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
  • So we'll actually use that same simple example, and I'll turn it on. I'll go into the settings here, and I think I'll probably turn down the offer to update my software and go into accessibility and just turn on voiceover. Great. Fantastic. ChatGPT

    • ๊ทธ๋ž˜์„œ ์‹ค์ œ๋กœ ๊ฐ™์€ ๊ฐ„๋‹จํ•œ ์˜ˆ์ œ๋ฅผ ์‚ฌ์šฉํ•  ๊ฑฐ์—์š”. ๊ทธ๋ฆฌ๊ณ  ์ ‘๊ทผ์„ฑ์„ ์ผœ๋ณผ ๊ฑฐ์—์š”. ์„ค์ •์œผ๋กœ ๋“ค์–ด๊ฐ€์„œ ์—ฌ๊ธฐ์„œ ๋‚˜์˜ ์†Œํ”„ํŠธ์›จ์–ด๋ฅผ ์—…๋ฐ์ดํŠธํ•  ๊ฒƒ์„ ๊ฑฐ์ ˆํ•˜๊ณ  ์ ‘๊ทผ์„ฑ๋กœ ๋“ค์–ด๊ฐ€์„œ VoiceOver๋ฅผ ์ผœ๋ณผ ๊ฑฐ์—์š”. ์ข‹์•„์š”. ํ›Œ๋ฅญํ•ด์š”. 16๋ถ„ 41์ดˆ๊นŒ์ง€~~~

39๋ถ„ ๋ถ€ํ„ฐ~~~

  • We're very happy to be working with Matt Campbell, who is the real creator of AccessKit. ChatGPT

    • ์ €ํฌ๋Š” AccessKit์˜ ์‹ค์ œ ์ œ์ž‘์ž์ธ Matt Campbell๊ณผ ํ•จ๊ป˜ ์ผํ•˜๊ฒŒ ๋˜์–ด ๋งค์šฐ ๊ธฐ์ฉ๋‹ˆ๋‹ค.
  • in combination with async, so how would you for example make an HTTP request? ChatGPT

    • async์™€ ๊ฒฐํ•ฉํ•ด์„œ, ์˜ˆ๋ฅผ ๋“ค์–ด HTTP ์š”์ฒญ์„ ์–ด๋–ป๊ฒŒ ๋งŒ๋“ค๊นŒ์š”?
  • We just ripped the async out, which is fun. But we had a prototype where we had async integrated fairly deeply, so you have the ability to do waking, which is, of course, the primary point at which async integrates with a UI toolkit on a per-widget basis. So, again, this is a prototype that we had working, and then when we were making various different transitions to win it, that was part of the thing that we ended up taking that out. But we are planning on bringing that back, so you absolutely would be able to have a widget that says, you know, ChatGPT

    • ์ €ํฌ๋Š” ๋ฐฉ๊ธˆ async๋ฅผ ์ œ๊ฑฐํ–ˆ๋Š”๋ฐ, ์žฌ๋ฏธ์žˆ์—ˆ์–ด์š”. ๊ทธ๋Ÿฌ๋‚˜ async๊ฐ€ ๊ฝค ๊นŠ์ด ํ†ตํ•ฉ๋œ ํ”„๋กœํ† ํƒ€์ž…์ด ์žˆ์—ˆ์–ด์š”. ๊ทธ๋ž˜์„œ UI ํˆดํ‚ท๊ณผ ๊ฐœ๋ณ„ ์œ„์ ฏ ๋‹จ์œ„๋กœ ํ†ตํ•ฉ๋˜๋Š” ์ฃผ์š” ์ง€์ ์—์„œ ๊นจ์šฐ๊ธฐ ๊ธฐ๋Šฅ์„ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ์—ˆ์ฃ . ๊ทธ๋ž˜์„œ, ๋‹ค์‹œ ๋งํ•˜์ง€๋งŒ, ์ด๊ฑด ์ €ํฌ๊ฐ€ ์ž‘๋™ํ•˜๋˜ ํ”„๋กœํ† ํƒ€์ž…์ด์—ˆ๊ณ , ๋‹ค์–‘ํ•œ ์ „ํ™˜์„ ํ•˜๋ฉด์„œ ๊ทธ๊ฒƒ์„ ์ œ๊ฑฐํ•˜๊ฒŒ ๋์–ด์š”. ํ•˜์ง€๋งŒ ์ €ํฌ๋Š” ๊ทธ๊ฒƒ์„ ๋‹ค์‹œ ๋„์ž…ํ•  ๊ณ„ํš์ด ์žˆ์–ด์„œ, ์œ„์ ฏ์ด ๊ทธ๋Ÿฐ ๊ธฐ๋Šฅ์„ ๊ฐ€์ง€๊ฒŒ ๋  ์ˆ˜ ์žˆ์„ ๊ฒ๋‹ˆ๋‹ค.
  • DAFA network request, and then paint the widget based on the loading state while you're waiting for the request to come back. And so there's a prototype. I can point people to the code based on kind of an older version. This is why it's research. It's like we need to figure out the best way for all of these pieces to come together. ChatGPT

    • DAFA ๋„คํŠธ์›Œํฌ ์š”์ฒญ์„ ํ•˜๊ณ , ์š”์ฒญ์ด ๋Œ์•„์˜ค๋Š” ๋™์•ˆ ๋กœ๋”ฉ ์ƒํƒœ๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ์œ„์ ฏ์„ ๋ Œ๋”๋งํ•˜๋Š” ๊ฑฐ์ฃ . ๊ทธ๋ž˜์„œ ๊ทธ๋Ÿฐ ํ”„๋กœํ† ํƒ€์ž…์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ด์ „ ๋ฒ„์ „์„ ๊ธฐ๋ฐ˜์œผ๋กœ ์ฝ”๋“œ๋ฅผ ๋ณด์—ฌ๋“œ๋ฆด ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Ÿฐ ์ด์œ ๋กœ ์—ฐ๊ตฌ๊ฐ€ ํ•„์š”ํ•œ ๊ฒ๋‹ˆ๋‹ค. ๋ชจ๋“  ์š”์†Œ๊ฐ€ ์–ด๋–ป๊ฒŒ ๊ฐ€์žฅ ์ž˜ ๊ฒฐํ•ฉ๋  ์ˆ˜ ์žˆ๋Š”์ง€๋ฅผ ์ฐพ์•„๋‚ด์•ผ ํ•˜๋‹ˆ๊นŒ์š”.
  • but it's planned. ChatGPT

    • ํ•˜์ง€๋งŒ ๊ณ„ํš๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.
  • I think this is the final question. ChatGPT

    • ์ด๊ฒŒ ๋งˆ์ง€๋ง‰ ์งˆ๋ฌธ์ธ ๊ฒƒ ๊ฐ™๋„ค์š”.
  • Hello, I've also been following your work for some time and I remember in Druid there was this a bit bizarre layer of integration with the system like file dialogues and application persistence with window closing. What did you do with that in the new Xilib architecture? ChatGPT

    • ์•ˆ๋…•ํ•˜์„ธ์š”, ์ €๋Š” ๋‹น์‹ ์˜ ์ž‘์—…์„ ์˜ค๋žซ๋™์•ˆ ์ง€์ผœ๋ด ์™”๊ณ , Druid์—์„œ๋Š” ํŒŒ์ผ ๋Œ€ํ™” ์ƒ์ž์™€ ์ฐฝ ๋‹ซ๊ธฐ ์‹œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ง€์†์„ฑ๊ณผ ๊ฐ™์€ ์‹œ์Šคํ…œ ํ†ตํ•ฉ ๊ณ„์ธต์ด ์ข€ ์ด์ƒํ•˜๊ฒŒ ๋ณด์˜€๋˜ ๊ฑธ๋กœ ๊ธฐ์–ตํ•ฉ๋‹ˆ๋‹ค. ์ƒˆ๋กœ์šด Xilib ์•„ํ‚คํ…์ฒ˜์—์„œ๋Š” ๊ทธ๊ฒƒ์„ ์–ด๋–ป๊ฒŒ ์ฒ˜๋ฆฌํ•˜์…จ๋‚˜์š”?
  • Well, I mean, the platform integration, we've just switched over to WinIT, and that does mean that we have a regress, so there is not a file open dialogue in Xilem at the moment. And so we do plan on porting that stuff on top of WinIT. I think there's some really good questions of, you know, do we do that in a way that's specific to Xilem, or do we try and make a more general crate that could be used by other, maybe other things in the Rust UI ecosystem? I think that's a little bit open. Like, the current state is, you know, we're trying to get the new infrastructure really functioning, and then pull in pieces from the kind of previous Druid. Yeah, one. ChatGPT

    • ๊ธ€์Ž„์š”, ํ”Œ๋žซํผ ํ†ตํ•ฉ์— ๋Œ€ํ•ด์„œ๋Š”, ์ €ํฌ๊ฐ€ WinIT๋กœ ์ „ํ™˜ํ–ˆ๋Š”๋ฐ, ๊ทธ๋กœ ์ธํ•ด ํ‡ด๋ณด๊ฐ€ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ํ˜„์žฌ Xilem์—๋Š” ํŒŒ์ผ ์—ด๊ธฐ ๋Œ€ํ™” ์ƒ์ž๊ฐ€ ์—†์–ด์š”. ๊ทธ๋ž˜์„œ ๊ทธ๊ฒƒ์„ WinIT ์œ„์— ์ด์‹ํ•  ๊ณ„ํš์ž…๋‹ˆ๋‹ค. Xilem์—๋งŒ ํŠนํ™”๋œ ๋ฐฉ์‹์œผ๋กœ ํ• ์ง€, ์•„๋‹ˆ๋ฉด Rust UI ์ƒํƒœ๊ณ„์˜ ๋‹ค๋ฅธ ์š”์†Œ๋“ค๋„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๋” ์ผ๋ฐ˜์ ์ธ ํฌ๋ ˆ์ดํŠธ๋กœ ๋งŒ๋“ค์ง€์— ๋Œ€ํ•œ ์ข‹์€ ์งˆ๋ฌธ์ด ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” ์กฐ๊ธˆ ์—ด๋ ค ์žˆ๋Š” ๋ถ€๋ถ„์ธ ๊ฒƒ ๊ฐ™์•„์š”. ํ˜„์žฌ ์ƒํƒœ๋Š” ์ƒˆ๋กœ์šด ์ธํ”„๋ผ๋ฅผ ์ œ๋Œ€๋กœ ์ž‘๋™ํ•˜๊ฒŒ ๋งŒ๋“  ํ›„, ์ด์ „ Druid์—์„œ ์ผ๋ถ€ ์š”์†Œ๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๋„ค, ๊ทธ๋ ‡์Šต๋‹ˆ๋‹ค.
  • TouchGrade was mentioned earlier today. I don't remember the name, but yeah. ChatGPT

    • ์˜ค๋Š˜ ์•„์นจ์— TouchGrade๊ฐ€ ์–ธ๊ธ‰๋˜์—ˆ์–ด์š”. ์ด๋ฆ„์€ ๊ธฐ์–ต๋‚˜์ง€ ์•Š์ง€๋งŒ, ๋งž์•„์š”. Okay, so give a huge hand to Ralph for his talk. Thank you.




Type Theory for Busy Engineers - Niko Matsakis | Rust Nederland (RustNL)|๐Ÿ”|

  • https://youtu.be/9qLACD9Bfbk?si=jNu4BcHI7-1s4tKy

  • Hmm, let's see. It's possible that the VoiceOver settings might need to be adjusted for it to read out loud. Sometimes there could be a delay or a glitch in the system. Would you like me to guide you through checking the VoiceOver settings to ensure it's properly configured? So, I'm going to talk about type theory for Bitly engineers. So, normally, at least lately, I feel like I'm giving talks about Rust roadmap and Rust features and things like that, and I decided to do something a little bit different. So, yeah, who am I? Well, as I guess a legend, I was going to make me feel a little blushy right now, but yeah, I work on the Rust system and on the Rust language, and I've been doing that a long time. ChatGPT

    • ์˜ค๋Š˜์€ Bitly ์—”์ง€๋‹ˆ์–ด๋“ค์„ ์œ„ํ•œ ํƒ€์ž… ์ด๋ก ์— ๋Œ€ํ•ด ์ด์•ผ๊ธฐํ•ด๋ณด๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ๋ณดํ†ต์€ ๋Ÿฌ์ŠคํŠธ ๋กœ๋“œ๋งต์ด๋‚˜ ๋Ÿฌ์ŠคํŠธ ๊ธฐ๋Šฅ ๋“ฑ์— ๋Œ€ํ•ด ์ด์•ผ๊ธฐ๋ฅผ ๋งŽ์ด ํ•˜์ง€๋งŒ, ์ด๋ฒˆ์—๋Š” ์กฐ๊ธˆ ๋‹ค๋ฅธ ์ฃผ์ œ๋ฅผ ์„ ํƒํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ, ๋„ค, ์ œ๊ฐ€ ๋ˆ„๊ตฌ๋ƒ๋ฉด์š”. ์ œ ์†Œ๊ฐœ๋ฅผ ํ•˜๋ ค๋‹ˆ ์กฐ๊ธˆ ๋ถ€๋„๋Ÿฝ๋„ค์š”. ์ €๋Š” ๋Ÿฌ์ŠคํŠธ ์‹œ์Šคํ…œ๊ณผ ๋Ÿฌ์ŠคํŠธ ์–ธ์–ด ์ž‘์—…์„ ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๊ฝค ์˜ค๋žœ ์‹œ๊ฐ„ ๋™์•ˆ ์ด ์ผ์„ ํ•ด์™”์Šต๋‹ˆ๋‹ค.
  • One of the things I've noticed along the way is, you know, at first when we were building out and designing aspects of Rust, we would do like little models. So, we would say, okay, we want to think about how the type system should work. I'm going to figure out, just think about this part in isolation, and that can get you really, really far, right? And then we would think about a different part. And so we draft, make a model, a sort of some subset of Rust that's relevant, and just think about that part. But we've gotten to the point now where actually it's becoming kind of hard to keep the whole thing in your head, and we have unexpected interactions, you know, or little problems that arise. And so I've gotten interested in how can we make a better model that will help us understand and extend Rust going forward, and think about the new things that Rust should do, right? So, the goal is to make... ChatGPT

    • ์šฐ๋ฆฌ๊ฐ€ ๋Ÿฌ์ŠคํŠธ๋ฅผ ๊ตฌ์ถ•ํ•˜๊ณ  ์„ค๊ณ„ํ•˜๋ฉด์„œ ์ฒ˜์Œ์—๋Š” ์ž‘์€ ๋ชจ๋ธ์„ ๋งŒ๋“ค๊ณค ํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ "ํƒ€์ž… ์‹œ์Šคํ…œ์ด ์–ด๋–ป๊ฒŒ ์ž‘๋™ํ•ด์•ผ ํ• ์ง€ ์ƒ๊ฐํ•ด๋ณด์ž"๊ณ  ํ•˜๋ฉด์„œ ์ด ๋ถ€๋ถ„๋งŒ ๊ณ ๋ฆฝ์‹œ์ผœ์„œ ๊ณ ๋ฏผํ–ˆ์ฃ . ์ด๋Ÿฐ ์‹์œผ๋กœ ์ ‘๊ทผํ•˜๋ฉด ๊ฝค ๋ฉ€๋ฆฌ ๊ฐˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ ๋‹ค์Œ์—๋Š” ๋‹ค๋ฅธ ๋ถ€๋ถ„์„ ์ƒ๊ฐํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ๋Ÿฌ์ŠคํŠธ์˜ ๊ด€๋ จ๋œ ์ผ๋ถ€๋ถ„์„ ๋ชจ๋ธ๋กœ ์ž‘์„ฑํ•˜๊ณ  ๊ทธ ๋ถ€๋ถ„๋งŒ ๊ณ ๋ฏผํ–ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ ์ด์ œ๋Š” ์ „์ฒด๋ฅผ ๋จธ๋ฆฟ์†์— ๋ชจ๋‘ ๋‹ด์•„๋‘๊ธฐ๊ฐ€ ์–ด๋ ค์›Œ์กŒ๊ณ , ์˜ˆ๊ธฐ์น˜ ๋ชปํ•œ ์ƒํ˜ธ์ž‘์šฉ์ด๋‚˜ ์ž‘์€ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•˜๊ธฐ๋„ ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ์–ด๋–ป๊ฒŒ ํ•˜๋ฉด ๋Ÿฌ์ŠคํŠธ๋ฅผ ๋” ์ž˜ ์ดํ•ดํ•˜๊ณ  ํ™•์žฅํ•  ์ˆ˜ ์žˆ๋Š” ๋” ๋‚˜์€ ๋ชจ๋ธ์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ์„์ง€์— ๋Œ€ํ•ด ๊ด€์‹ฌ์ด ์ƒ๊ฒผ์Šต๋‹ˆ๋‹ค. ์•ž์œผ๋กœ ๋Ÿฌ์ŠคํŠธ๊ฐ€ ์–ด๋–ค ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ์„ ๊ฐ–์ถฐ์•ผ ํ• ์ง€ ์ƒ๊ฐํ•˜๋Š” ๋ฐ ๋„์›€์ด ๋˜๋Š” ๋ชจ๋ธ์„ ๋งŒ๋“œ๋Š” ๊ฒƒ์ด ๋ชฉํ‘œ์ž…๋‹ˆ๋‹ค.
  • Take something that lets you kind of play with the type system and experiment with it in prototype. Not to build a shippable compiler, but to help you understand Rust as it is today and where it might go. And then along the way... ChatGPT

    • ํƒ€์ž… ์‹œ์Šคํ…œ์„ ๊ฐ€์ง€๊ณ  ๋†€๊ณ  ์‹คํ—˜ํ•  ์ˆ˜ ์žˆ๋Š” ๋ฌด์–ธ๊ฐ€๋ฅผ ๋งŒ๋“ค์–ด ํ”„๋กœํ† ํƒ€์ž…์œผ๋กœ ํ™œ์šฉํ•˜๋Š” ๊ฒƒ์ด์ฃ . ์‹ค์ œ ๋ฐฐํฌ ๊ฐ€๋Šฅํ•œ ์ปดํŒŒ์ผ๋Ÿฌ๋ฅผ ๋งŒ๋“œ๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ, ํ˜„์žฌ์˜ ๋Ÿฌ์ŠคํŠธ๋ฅผ ์ดํ•ดํ•˜๊ณ  ํ–ฅํ›„ ๋Ÿฌ์ŠคํŠธ๊ฐ€ ๋‚˜์•„๊ฐˆ ๋ฐฉํ–ฅ์„ ๋ชจ์ƒ‰ํ•˜๋Š” ๋ฐ ๋„์›€์„ ์ฃผ๋Š” ๊ฒƒ์ด ๋ชฉ์ ์ž…๋‹ˆ๋‹ค. ๊ทธ๋ ‡๊ฒŒ ํ•˜๋ฉด์„œ...
  • mirror formality. I was told I need to explain this for non-native Rust speakers. So, there's an expression we say, oh, that's just a mirror formality. Like, it's a tiny little detail that you can get past. And in this case, mirror is also the mid-level IR, the middle IR of the compiler. So, that was the pun of this project. But the goal is to basically model, in a formal-ish way, how the type checker works, especially for the mid-level IR. So, not really all the way to Rust surface syntax yet. ChatGPT

    • ๋ฏธ๋Ÿฌ ํ˜•์‹์„ฑ(mirror formality)์— ๋Œ€ํ•ด ์„ค๋ช…ํ•  ํ•„์š”๊ฐ€ ์žˆ๋‹ค๊ณ  ๋“ค์—ˆ์–ด์š”. '๊ทธ๊ฑด ๊ทธ๋ƒฅ ํ˜•์‹์ ์ธ ์ ˆ์ฐจ์ผ ๋ฟ์ด๋‹ค'๋ผ๋Š” ํ‘œํ˜„์ด ์žˆ๋Š”๋ฐ, ์ด ๊ฒฝ์šฐ '๋ฏธ๋Ÿฌ'๋Š” ์ปดํŒŒ์ผ๋Ÿฌ์˜ ์ค‘๊ฐ„ ํ‘œํ˜„(IR)์„ ์˜๋ฏธํ•ด์š”. ๊ทธ๋ž˜์„œ ์ด ํ”„๋กœ์ ํŠธ์˜ ๋ง์žฅ๋‚œ์ด ๋˜์—ˆ์ฃ . ํ•˜์ง€๋งŒ ๋ชฉํ‘œ๋Š” ํƒ€์ž… ์ฒด์ปค๊ฐ€ ์–ด๋–ป๊ฒŒ ์ž‘๋™ํ•˜๋Š”์ง€, ํŠนํžˆ ์ค‘๊ฐ„ ํ‘œํ˜„(IR) ์ˆ˜์ค€์—์„œ ํ˜•์‹์ ์œผ๋กœ ๋ชจ๋ธ๋งํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์•„์ง ๋Ÿฌ์ŠคํŠธ์˜ ํ‘œ๋ฉด ๊ตฌ๋ฌธ๊นŒ์ง€๋Š” ๊ฐ€์ง€ ์•Š์•„์š”.
  • about mere formality here right now. What I'm going to talk about is a subset of it that I call Formality Core, mostly because formality was already taken on Crates.io. I don't remember by whom. I should find them out. But it's like a reusable part of it that you could use to model your own type systems if you were designing a language, like some people we saw today, like the really cool June language and so forth. Maybe it might be useful to them. I don't know. I found it fun for my own experiments. ChatGPT

    • ์—ฌ๊ธฐ์„œ ์ด์•ผ๊ธฐํ•˜๋ ค๋Š” ๊ฒƒ์€ ๋ฏธ๋Ÿฌ ํ˜•์‹์„ฑ(Mere Formality)์˜ ์ผ๋ถ€์ธ Formality Core๋ผ๊ณ  ๋ถ€๋ฅด๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ฃผ๋กœ Crates.io์—์„œ 'formality'๋ผ๋Š” ์ด๋ฆ„์ด ์ด๋ฏธ ์‚ฌ์šฉ ์ค‘์ด์—ˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. ๋ˆ„๊ฐ€ ์‚ฌ์šฉ ์ค‘์ธ์ง€๋Š” ๊ธฐ์–ต์ด ์•ˆ ๋‚˜๋„ค์š”. ์ฐพ์•„๋ด์•ผ๊ฒ ์–ด์š”. ์–ด์จŒ๋“ , ์ด๊ฒƒ์€ ์–ธ์–ด๋ฅผ ์„ค๊ณ„ํ•  ๋•Œ ์—ฌ๋Ÿฌ๋ถ„์ด ์ž์‹ ๋งŒ์˜ ํƒ€์ž… ์‹œ์Šคํ…œ์„ ๋ชจ๋ธ๋งํ•  ์ˆ˜ ์žˆ๋Š” ์žฌ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋ถ€๋ถ„์ž…๋‹ˆ๋‹ค. ์˜ค๋Š˜ ๋ณธ ๊ฒƒ์ฒ˜๋Ÿผ ๋ฉ‹์ง„ June ์–ธ์–ด ๊ฐ™์€ ๊ฒƒ๋„ ํฌํ•จํ•ด์„œ์š”. ๊ทธ๋“ค์—๊ฒŒ ์œ ์šฉํ• ์ง€ ๋ชจ๋ฅด๊ฒ ์ง€๋งŒ, ์ œ ์‹คํ—˜์—๋Š” ์žฌ๋ฏธ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.
  • It's heavily inspired by a tool I use called PLT Red X, which is this other programming language called Racket. And it's basically the same thing. It's like a lightweight tool for playing with type system definitions and letting you kind of use the notation that you might have read in an academic paper and put it into your computer and run it and play with it. Now, I just said that you might have read in an academic paper. But what I noticed is, shockingly, not that many people have actually read academic papers. They're kind of not designed for easy entry and understanding. And so what I thought I would do today is talk about how I think about it and how formality core, like use formality core and kind of to walk through a very simple type system and give you a feeling for what it looks like. And true fact, I have not done a dry run of this talk. I have no idea how long it's going to take. So either we're going to go way over or way under, and we'll take a bunch of questions. We're going to figure it out. It's going to be fun. ChatGPT

    • ์ด Formality Core๋Š” ์ œ๊ฐ€ ์‚ฌ์šฉํ•˜๋Š” ๋„๊ตฌ์ธ PLT Redex์—์„œ ํฌ๊ฒŒ ์˜๊ฐ์„ ๋ฐ›์•˜์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ Racket์ด๋ผ๋Š” ๋‹ค๋ฅธ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด์˜ ๋„๊ตฌ๋กœ, ํƒ€์ž… ์‹œ์Šคํ…œ ์ •์˜๋ฅผ ๋‹ค๋ฃจ๊ณ , ์—ฌ๋Ÿฌ๋ถ„์ด ํ•™์ˆ  ๋…ผ๋ฌธ์—์„œ ๋ณธ ํ‘œ๊ธฐ๋ฒ•์„ ์ปดํ“จํ„ฐ์— ์ž…๋ ฅํ•˜๊ณ  ์‹คํ–‰ํ•ด๋ณด๋Š” ๊ฒฝ๋Ÿ‰ ๋„๊ตฌ์ž…๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ ์ œ๊ฐ€ ํ•™์ˆ  ๋…ผ๋ฌธ์„ ์ฝ์–ด๋ดค์„ ์ˆ˜๋„ ์žˆ๋‹ค๊ณ  ํ–ˆ์ง€๋งŒ, ์‚ฌ์‹ค ๋งŽ์€ ์‚ฌ๋žŒ๋“ค์ด ์‹ค์ œ๋กœ ํ•™์ˆ  ๋…ผ๋ฌธ์„ ์ฝ์ง€ ์•Š๋Š”๋‹ค๋Š” ๊ฒƒ์„ ์•Œ๊ฒŒ ๋˜์—ˆ์–ด์š”. ํ•™์ˆ  ๋…ผ๋ฌธ์€ ์‰ฝ๊ฒŒ ์ ‘๊ทผํ•˜๊ณ  ์ดํ•ดํ•˜๊ธฐ์—๋Š” ์ข€ ์–ด๋ ต๊ฒŒ ์ž‘์„ฑ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ์˜ค๋Š˜์€ ์ œ๊ฐ€ ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜๋Š”์ง€, ๊ทธ๋ฆฌ๊ณ  Formality Core๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์•„์ฃผ ๊ฐ„๋‹จํ•œ ํƒ€์ž… ์‹œ์Šคํ…œ์„ ๊ฑธ์–ด๋ณด๋ฉด์„œ ์„ค๋ช…ํ•˜๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ์ฐธ๊ณ ๋กœ, ์ด ๋ฐœํ‘œ๋ฅผ ๋ฆฌํ—ˆ์„คํ•ด๋ณธ ์ ์ด ์—†์–ด์„œ ์–ผ๋งˆ๋‚˜ ๊ฑธ๋ฆด์ง€ ์ „ํ˜€ ๋ชจ๋ฅด๊ฒ ์–ด์š”. ๊ทธ๋ž˜์„œ ์‹œ๊ฐ„์ด ๋งŽ์ด ์ดˆ๊ณผ๋˜๊ฑฐ๋‚˜ ๋ถ€์กฑํ•  ์ˆ˜๋„ ์žˆ์ง€๋งŒ, ์งˆ๋ฌธ๋„ ๋งŽ์ด ๋ฐ›๊ณ  ํ•จ๊ป˜ ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ์žฌ๋ฏธ์žˆ์„ ๊ฑฐ์˜ˆ์š”.
  • It's heavily inspired by a tool I use called PLT Red X, which is this other programming language called Racket. And it's basically the same thing. It's like a lightweight tool for playing with type system definitions and letting you kind of use the notation that you might have read in an academic paper and put it into your computer and run it and play with it. Now, I just said that you might have read in an academic paper. But what I noticed is, shockingly, not that many people have actually read academic papers. They're kind of not designed for easy entry and understanding. And so what I thought I would do today is talk about how I think about it and how formality core, like use formality core and kind of to walk through a very simple type system and give you a feeling for what it looks like. And true fact, I have not done a dry run of this talk. I have no idea how long it's going to take. So either we're going to go way over or way under, and we'll take a bunch of questions. We're going to figure it out. It's going to be fun. ChatGPT

    • ์ด Formality Core๋Š” ์ œ๊ฐ€ ์‚ฌ์šฉํ•˜๋Š” ๋„๊ตฌ์ธ PLT Redex์—์„œ ํฌ๊ฒŒ ์˜๊ฐ์„ ๋ฐ›์•˜์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ Racket์ด๋ผ๋Š” ๋‹ค๋ฅธ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด์˜ ๋„๊ตฌ๋กœ, ํƒ€์ž… ์‹œ์Šคํ…œ ์ •์˜๋ฅผ ๋‹ค๋ฃจ๊ณ , ์—ฌ๋Ÿฌ๋ถ„์ด ํ•™์ˆ  ๋…ผ๋ฌธ์—์„œ ๋ณธ ํ‘œ๊ธฐ๋ฒ•์„ ์ปดํ“จํ„ฐ์— ์ž…๋ ฅํ•˜๊ณ  ์‹คํ–‰ํ•ด๋ณด๋Š” ๊ฒฝ๋Ÿ‰ ๋„๊ตฌ์ž…๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ๋ฐ ์ œ๊ฐ€ ํ•™์ˆ  ๋…ผ๋ฌธ์„ ์ฝ์–ด๋ดค์„ ์ˆ˜๋„ ์žˆ๋‹ค๊ณ  ํ–ˆ์ง€๋งŒ, ์‚ฌ์‹ค ๋งŽ์€ ์‚ฌ๋žŒ๋“ค์ด ์‹ค์ œ๋กœ ํ•™์ˆ  ๋…ผ๋ฌธ์„ ์ฝ์ง€ ์•Š๋Š”๋‹ค๋Š” ๊ฒƒ์„ ์•Œ๊ฒŒ ๋˜์—ˆ์–ด์š”. ํ•™์ˆ  ๋…ผ๋ฌธ์€ ์‰ฝ๊ฒŒ ์ ‘๊ทผํ•˜๊ณ  ์ดํ•ดํ•˜๊ธฐ์—๋Š” ์ข€ ์–ด๋ ต๊ฒŒ ์ž‘์„ฑ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ์˜ค๋Š˜์€ ์ œ๊ฐ€ ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜๋Š”์ง€, ๊ทธ๋ฆฌ๊ณ  Formality Core๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์•„์ฃผ ๊ฐ„๋‹จํ•œ ํƒ€์ž… ์‹œ์Šคํ…œ์„ ๊ฑธ์–ด๋ณด๋ฉด์„œ ์„ค๋ช…ํ•˜๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. ์ฐธ๊ณ ๋กœ, ์ด ๋ฐœํ‘œ๋ฅผ ๋ฆฌํ—ˆ์„คํ•ด๋ณธ ์ ์ด ์—†์–ด์„œ ์–ผ๋งˆ๋‚˜ ๊ฑธ๋ฆด์ง€ ์ „ํ˜€ ๋ชจ๋ฅด๊ฒ ์–ด์š”. ๊ทธ๋ž˜์„œ ์‹œ๊ฐ„์ด ๋งŽ์ด ์ดˆ๊ณผ๋˜๊ฑฐ๋‚˜ ๋ถ€์กฑํ•  ์ˆ˜๋„ ์žˆ์ง€๋งŒ, ์งˆ๋ฌธ๋„ ๋งŽ์ด ๋ฐ›๊ณ  ํ•จ๊ป˜ ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ์žฌ๋ฏธ์žˆ์„ ๊ฑฐ์˜ˆ์š”.
  • But part of this is, you know, I didn't really learn. I never really took a course on type systems, actually. I just kind of read things, and eventually it sort of made sense. So, I'm going to be telling you kind of my way of thinking about it. Probably some people who have actually studied this kind of thing will have their own opinions. So, the way I think about formality core, anyway, is thatโ€ฆ ChatGPT

    • ํ•˜์ง€๋งŒ ์ด๊ฑด ์ œ๊ฐ€ ์‚ฌ์‹ค ์ •์‹์œผ๋กœ ํƒ€์ž… ์‹œ์Šคํ…œ์— ๋Œ€ํ•œ ๊ณผ์ •์„ ๋“ฃ์ง€ ์•Š์•˜๋‹ค๋Š” ๋ถ€๋ถ„๊ณผ๋„ ๊ด€๋ จ์ด ์žˆ์–ด์š”. ์ €๋Š” ๊ทธ๋ƒฅ ์ž๋ฃŒ๋“ค์„ ์ฝ์œผ๋ฉด์„œ ์Šค์Šค๋กœ ์ดํ•ดํ•œ ๊ฑฐ์ฃ . ๊ทธ๋ž˜์„œ ์ œ๊ฐ€ ์—ฌ๋Ÿฌ๋ถ„๊ป˜ ์ œ ๋ฐฉ์‹์œผ๋กœ ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜๋Š”์ง€ ์„ค๋ช…ํ•˜๋ ค๊ณ  ํ•ด์š”. ์ด ๋ถ„์•ผ๋ฅผ ์ •์‹์œผ๋กœ ๊ณต๋ถ€ํ•œ ์‚ฌ๋žŒ๋“ค์€ ๋‹ค๋ฅธ ์˜๊ฒฌ์ด ์žˆ์„ ์ˆ˜๋„ ์žˆ์ง€๋งŒ, ์ œ ๊ด€์ ์—์„œ ๋ณธ formality core๋Š”โ€ฆ
  • Anyway, is that ChatGPT

    • ์–ด์จŒ๋“ , ์ œ๊ฐ€ ์ƒ๊ฐํ•˜๋Š” formality core๋Š” ํƒ€์ž… ์‹œ์Šคํ…œ์˜ ๊ธฐ๋ณธ์ ์ธ ๊ฐœ๋…์„ ์‹คํ—˜ํ•˜๊ณ  ์ดํ•ดํ•˜๋Š” ๋ฐ ๋„์›€์„ ์ฃผ๋Š” ๋„๊ตฌ๋ผ๋Š” ์ ์ด์—์š”. ์ด๋ฅผ ํ†ตํ•ด ๋‹ค์–‘ํ•œ ํƒ€์ž… ์‹œ์Šคํ…œ์„ ๋ชจ๋ธ๋งํ•˜๊ณ , Rust์˜ ํƒ€์ž… ์‹œ์Šคํ…œ์„ ๋” ์ž˜ ์ดํ•ดํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋•๋Š” ๊ฑฐ์ฃ .
  • in parallel systems before, like in Java. Actually, I'm going to tell you an anecdote because it's funny. One of the first courses that was taught in Rust was a systems programming course at Northeastern, and they went through and they taught the students Rust, and they got up to concurrency, and then they had a problem because they wanted to teach them about data races, but they couldn't produce them. So they said, okay, we're going to stop, and we're going to teach you Java, and then you're going to learn Java. Now look at this horrible bug. Okay, let's go back to Rust. Now you don't have this bug. Okay, good. So Rust kind of made... ChatGPT

    • ๋ณ‘๋ ฌ ์‹œ์Šคํ…œ์—์„œ๋„ ๊ฒฝํ—˜์ด ์žˆ์–ด์š”, ์˜ˆ๋ฅผ ๋“ค์–ด Java์—์„œ์š”. ์‚ฌ์‹ค ์žฌ๋ฏธ์žˆ๋Š” ์ผํ™”๋ฅผ ํ•˜๋‚˜ ๋“œ๋ฆด๊ฒŒ์š”. Rust๊ฐ€ ์ฒ˜์Œ์œผ๋กœ ๊ฐ€๋ฅด์ณ์ง„ ๊ณผ๋ชฉ ์ค‘ ํ•˜๋‚˜๊ฐ€ Northeastern ๋Œ€ํ•™์—์„œ ์‹œ์Šคํ…œ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ๊ณผ๋ชฉ์ธ๋ฐ์š”, ํ•™์ƒ๋“ค์—๊ฒŒ Rust๋ฅผ ๊ฐ€๋ฅด์น˜๊ณ  ๋ณ‘ํ–‰์„ฑ์— ๋„๋‹ฌํ–ˆ์„ ๋•Œ ๋ฐ์ดํ„ฐ ๋ ˆ์ด์Šค์— ๋Œ€ํ•ด ๊ฐ€๋ฅด์น˜๋ ค๊ณ  ํ–ˆ๋Š”๋ฐ, ๋ฌธ์ œ๊ฐ€ ์ƒ๊ฒผ์–ด์š”. ์™œ๋ƒํ•˜๋ฉด ๋ฐ์ดํ„ฐ ๋ ˆ์ด์Šค๋ฅผ ๋ฐœ์ƒ์‹œํ‚ฌ ์ˆ˜๊ฐ€ ์—†์—ˆ๊ฑฐ๋“ ์š”. ๊ทธ๋ž˜์„œ "์ข‹์•„, ์—ฌ๊ธฐ์„œ ๋ฉˆ์ถ”๊ณ  Java๋ฅผ ๊ฐ€๋ฅด์น ๊ฒŒ์š”. ์ž, ์ด๋Ÿฐ ์‹ฌ๊ฐํ•œ ๋ฒ„๊ทธ๋ฅผ ๋ณด์„ธ์š”. ์ด์ œ Rust๋กœ ๋Œ์•„๊ฐ€ ๋ณด์„ธ์š”. ์ด์ œ ์ด ๋ฒ„๊ทธ๊ฐ€ ์—†์ฃ . ์ข‹์•„์š”." ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด์„œ Rust๋Š”...
  • That is the true story. But Rust made concurrency this thing, at least my experience of it, is, yeah, I can still have bugs, but it's kind of like I plug it together, and I can think about it, and experiment with it, and if it kind of works, it usually works all the way up. If it works for simple stuff, it works also for many complicated cases. Formality core has the same feeling. I want to bring that same feeling, but to experimenting with type systems. ChatGPT

    • ๊ทธ ์ด์•ผ๊ธฐ๋Š” ์‚ฌ์‹ค์ž…๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ Rust๋Š” ๋ณ‘๋ ฌ์„ฑ์„ ์ด๋Ÿฐ ์‹์œผ๋กœ ๋งŒ๋“ค์–ด ๋ƒˆ์–ด์š”. ์ ์–ด๋„ ์ œ ๊ฒฝํ—˜ ์ƒ์œผ๋กœ๋Š”, ์˜ˆ, ์—ฌ์ „ํžˆ ๋ฒ„๊ทธ๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์ง€๋งŒ, ๊ทธ๊ฒƒ์„ ์กฐํ•ฉํ•˜๊ณ  ์ƒ๊ฐํ•˜๊ณ  ์‹คํ—˜ํ•ด๋ณผ ์ˆ˜ ์žˆ๊ณ , ๊ทธ๊ฒƒ์ด ์ž‘๋™ํ•œ๋‹ค๋ฉด ๋ณดํ†ต์€ ๋ชจ๋“  ๊ฒฝ์šฐ์— ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ„๋‹จํ•œ ๊ฒƒ์— ๋Œ€ํ•ด ์ž‘๋™ํ•œ๋‹ค๋ฉด, ๋ณต์žกํ•œ ๊ฒฝ์šฐ์—๋„ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค. Formality core๋„ ๊ฐ™์€ ๋А๋‚Œ์„ ์ค๋‹ˆ๋‹ค. ์ œ๊ฐ€ ์›ํ•˜๋Š” ๊ฒƒ์€ ๋™์ผํ•œ ๋А๋‚Œ์„ ๊ฐ€์ ธ๋‹ค์ฃผ์ง€๋งŒ, ํƒ€์ž… ์‹œ์Šคํ…œ ์‹คํ—˜์— ์ ์šฉํ•˜๋Š” ๊ฒƒ์ด์—์š”.
  • So here's the language we're going to walk through, called EG. And it does various, well, it's kind of a calculator, fancy calculator. So like this program. ChatGPT

    • ๊ทธ๋ž˜์„œ ์—ฌ๊ธฐ ์šฐ๋ฆฌ๊ฐ€ ์‚ดํŽด๋ณผ ์–ธ์–ด๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. EG๋ผ๊ณ  ๋ถˆ๋ฆฌ๋Š” ์–ธ์–ด์ธ๋ฐ์š”, ์ด๊ฒƒ์€ ๋‹ค์–‘ํ•œ ๊ธฐ๋Šฅ์„ ๊ฐ–์ถ˜ ๊ณ„์‚ฐ๊ธฐ์™€ ๊ฐ™์€ ๊ฒƒ์ด์—์š”. ์˜ˆ๋ฅผ ๋“ค์–ด ์ด ํ”„๋กœ๊ทธ๋žจ์ฒ˜๋Ÿผ์š”.
  • When you run it. ChatGPT

    • ์‹คํ–‰ํ•˜๋ฉด์š”,
  • You can have tuples, and they will be added up pairwise. ChatGPT

    • ํŠœํ”Œ์„ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์œผ๋ฉฐ, ํŠœํ”Œ์€ ์Œ์œผ๋กœ ์ถ”๊ฐ€๋ฉ๋‹ˆ๋‹ค.
  • so, and you can call them with this weird at sign, which is because of a limitation I'll explain later. And you can even have generics. So all of these are actually runnable examples in the program, and part of what I'm going to do today is kind of ChatGPT

    • ๊ทธ๋ž˜์„œ, ๊ทธ๋ฆฌ๊ณ  ์ด์ƒํ•œ at ๊ธฐํ˜ธ๋กœ ํ˜ธ์ถœํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ๋‚˜์ค‘์— ์„ค๋ช…ํ•  ์ œํ•œ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์‹ฌ์ง€์–ด ์ œ๋„ค๋ฆญ๋„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ๋ชจ๋“  ๊ฒƒ๋“ค์€ ์‚ฌ์‹ค ์‹คํ–‰ ๊ฐ€๋Šฅํ•œ ์˜ˆ์ œ๋“ค์ด๊ณ , ์˜ค๋Š˜ ์ œ๊ฐ€ ํ•  ์ผ ์ค‘ ํ•˜๋‚˜๋Š” ์ด ํ”„๋กœ๊ทธ๋žจ์—์„œ ์‹คํ–‰ ๊ฐ€๋Šฅํ•œ ์˜ˆ์ œ๋ฅผ ๋ณด์—ฌ์ฃผ๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.
  • Oh, wait, someone earlier did this. I forget who. I think it was the first talk. Let's start with a cargo clean, just because. ChatGPT

    • ์˜ค, ๊ธฐ๋‹ค๋ ค์š”. ์ด๊ฑธ ๋ˆ„๊ตฐ๊ฐ€ ์ด์ „์— ํ–ˆ์—ˆ์–ด์š”. ๋ˆ„๊ตฐ์ง€ ๊ธฐ์–ต์ด ์•ˆ ๋‚˜๋Š”๋ฐ์š”. ์ œ์ผ ์ฒ˜์Œ์— ํ–ˆ๋˜ ๊ฒƒ ๊ฐ™์•„์š”. ๊ทธ๋ƒฅ ์‹œ์ž‘ํ•˜๊ธฐ ์ „์— cargo clean๋ถ€ํ„ฐ ํ•ด๋ด์š”.
  • So, when you build something in this, it really is just a Rust program that you can work with. Let's see, source, or where did I put the tests? Under source, test, talk examples, right. So, for example, here's that first one. Hopefully, you can read it. ChatGPT

    • ๊ทธ๋ž˜์„œ, ์ด๊ฒƒ์„ ๋นŒ๋“œํ•˜๋ฉด ์ง„์ •์œผ๋กœ ์ž‘์—…ํ•  ์ˆ˜ ์žˆ๋Š” Rust ํ”„๋กœ๊ทธ๋žจ์ž…๋‹ˆ๋‹ค. ์ž, ์†Œ์Šค๋ฅผ ๋ณด๊ฑฐ๋‚˜ ํ…Œ์ŠคํŠธ๋ฅผ ์–ด๋””์— ๋„ฃ์—ˆ์ฃ ? ์†Œ์Šค, ํ…Œ์ŠคํŠธ, ํ†ก ์˜ˆ์ œ ์•„๋ž˜, ๋งž์•„์š”. ์˜ˆ๋ฅผ ๋“ค์–ด, ์—ฌ๊ธฐ๊ฐ€ ์ฒซ ๋ฒˆ์งธ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๋ฐ”๋ผ๊ฑด๋Œ€ ์ฝ์„ ์ˆ˜ ์žˆ์„ ๊ฑฐ์˜ˆ์š”.
  • Executing 22 plus 44 gives me 66, and so on, right? ChatGPT

    • 22 ๋”ํ•˜๊ธฐ 44๋ฅผ ์‹คํ–‰ํ•˜๋ฉด 66์ด ๋‚˜์˜ต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ด๋Ÿฐ ์‹์œผ๋กœ ๊ณ„์† ๋ฉ๋‹ˆ๋‹ค, ๋งž์•„์š”.
  • How do we define a programming language in a more formal way? What am I doing here? Oh, I'm just showing you that what I am not modeling in this definition is type inference. So you can have generics, but you do have to specify their values explicitly. ChatGPT

    • ์–ด๋–ป๊ฒŒ ๋” ํ˜•์‹์ ์ธ ๋ฐฉ์‹์œผ๋กœ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด๋ฅผ ์ •์˜ํ• ๊นŒ์š”? ์—ฌ๊ธฐ์„œ ๋ฌด์—‡์„ ํ•˜๊ณ  ์žˆ๋‚˜์š”? ์•„, ์ €๋Š” ์—ฌ๊ธฐ์„œ ํƒ€์ž… ์ถ”๋ก ์„ ๋ชจ๋ธ๋งํ•˜์ง€ ์•Š๋Š”๋‹ค๋Š” ๊ฒƒ์„ ๋ณด์—ฌ์ฃผ๊ณ  ์žˆ๋„ค์š”. ๊ทธ๋ž˜์„œ ์ œ๋„ค๋ฆญ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์ง€๋งŒ, ๊ฐ’์€ ๋ช…์‹œ์ ์œผ๋กœ ์ง€์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
  • That makes things a lot easier, actually. So, how do we define a program more formally? It starts out with something called a grammar. How many of you have heard of grammars? Okay, good. ChatGPT

    • ์‹ค์ œ๋กœ ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ํ›จ์”ฌ ์‰ฌ์›Œ์š”. ๊ทธ๋ž˜์„œ, ํ”„๋กœ๊ทธ๋žจ์„ ์–ด๋–ป๊ฒŒ ๋” ํ˜•์‹์ ์œผ๋กœ ์ •์˜ํ• ๊นŒ์š”? ์šฐ์„ , ๋ฌด์–ธ๊ฐ€๋ฅผ ์‹œ์ž‘ํ•˜๋Š”๋ฐ ๊ทธ๊ฒƒ์€ ๋ฌธ๋ฒ•์ด๋ผ๊ณ  ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๋ฌธ๋ฒ•์— ๋Œ€ํ•ด ๋“ค์–ด๋ณด์‹  ๋ถ„๋“ค์€ ๋ช‡ ๋ถ„์ด๋‚˜ ๊ณ„์‹œ๋‚˜์š”? ์ข‹์•„์š”, ์ข‹์•„์š”.
  • I wouldn't have to explain it too much. But basically, that defines the syntax, right? So, you might write something like, oh, a program and eg is a series of function definitions, you know, zero or more, followed by some expression that's going to compute the value. Well, in Formality Core, we're going to define that, but we're going to do it with a rough structure. ChatGPT

    • ๋„ˆ๋ฌด ๋งŽ์ด ์„ค๋ช…ํ•  ํ•„์š”๋Š” ์—†๊ฒ ์ฃ . ๊ทธ๋Ÿผ ๊ธฐ๋ณธ์ ์œผ๋กœ ๊ทธ๊ฒƒ์€ ๋ฌธ๋ฒ•์„ ์ •์˜ํ•˜๋Š” ๊ฒƒ์ด์ฃ ? ๊ทธ๋ž˜์„œ, ํ”„๋กœ๊ทธ๋žจ๊ณผ eg๋Š” ํ•จ์ˆ˜ ์ •์˜๋“ค์˜ ์—ฐ์†์ด์ฃ , 0๊ฐœ ์ด์ƒ, ๊ทธ ๋‹ค์Œ์— ๊ฐ’์ด ๊ณ„์‚ฐ๋  ํ‘œํ˜„์‹์ด ๋”ฐ๋ผ์˜ฌ ๊ฑฐ์—์š”. ๊ทธ๋Ÿฐ๋ฐ, Formality Core์—์„œ๋Š” ๊ทธ๊ฒƒ์„ ์ •์˜ํ•  ๊ฑฐ์ง€๋งŒ, ์กฐ๊ธˆ ๊ฑฐ์นœ ๊ตฌ์กฐ๋กœ ํ•  ๊ฑฐ์—์š”.
  • Yeah, so we might have this struct saying this is what a program is, and you can see it has fields, and you put an annotation on it called term, and that's a kind of bit of PL programming language jargon. A term is basically just a thing, something that you're a part of your program, or a value, or something we're going to talk about, essentially. We need a word for a thing, so term is it, and in here, you put the grammar. ChatGPT

    • ๊ทธ๋ž˜์š”, ๊ทธ๋ž˜์„œ ์šฐ๋ฆฌ๋Š” ํ”„๋กœ๊ทธ๋žจ์ด ๋ฌด์—‡์ธ์ง€๋ฅผ ์ •์˜ํ•˜๋Š” ์ด๋Ÿฐ ๊ตฌ์กฐ๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๊ทธ๊ฒƒ์€ ํ•„๋“œ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์œผ๋ฉฐ, term์ด๋ผ๋Š” ์ฃผ์„์„ ๋‹ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๊ทธ๊ฒƒ์€ PL ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด ์šฉ์–ด์˜ ํ•œ ๋ถ€๋ถ„์ž…๋‹ˆ๋‹ค. term์€ ๊ธฐ๋ณธ์ ์œผ๋กœ ํ”„๋กœ๊ทธ๋žจ์˜ ๋ถ€๋ถ„์ด๊ฑฐ๋‚˜ ๊ฐ’์ด๊ฑฐ๋‚˜, ์šฐ๋ฆฌ๊ฐ€ ์ด์•ผ๊ธฐํ•  ๊ฒƒ ์ค‘ ํ•˜๋‚˜์ž…๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๋Š” ๋ฌด์—‡์ธ๊ฐ€๋ฅผ ๊ฐ€๋ฆฌํ‚ค๋Š” ๋‹จ์–ด๊ฐ€ ํ•„์š”ํ•˜๊ธฐ ๋•Œ๋ฌธ์— term์ด ๊ทธ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์—ฌ๊ธฐ์—๋Š” ๋ฌธ๋ฒ•์„ ๋„ฃ์Šต๋‹ˆ๋‹ค.
  • You put the grip. ChatGPT

    • ๋ฌธ๋ฒ•์„ ๋„ฃ์œผ์„ธ์š”.
  • That will tell you, oh, I'm going to parse the value of this field here in the input. And if you have a little star that says, take zero or more things, collect them, and put them in a vector. So this would be zero or more function definitions. Of course, it's using traits and everything under the hood to drive the execution. And this would just parse a single expression. ChatGPT

    • ๋ณ„ํ‘œ๋Š” ์ž…๋ ฅ์—์„œ ์ด ํ•„๋“œ์˜ ๊ฐ’์„ ๊ตฌ๋ฌธ ๋ถ„์„ํ•˜๋ผ๋Š” ์˜๋ฏธ์ž…๋‹ˆ๋‹ค. ๋ณ„ํ‘œ๋Š” ํ•ด๋‹น ํ•ญ๋ชฉ์„ 0๊ฐœ ์ด์ƒ ๋ชจ์•„ ๋ฒกํ„ฐ์— ๋„ฃ์œผ๋ผ๋Š” ๋œป์ž…๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ์ด ๊ฒฝ์šฐ, 0๊ฐœ ์ด์ƒ์˜ ํ•จ์ˆ˜ ์ •์˜๋ฅผ ๊ตฌ๋ฌธ ๋ถ„์„ํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ๋ฌผ๋ก , ์ด ๋ชจ๋“  ๊ณผ์ •์€ ๋‚ด๋ถ€์ ์œผ๋กœ ํŠธ๋ ˆ์ดํŠธ์™€ ๊ธฐํƒ€ ์š”์†Œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์‹คํ–‰์„ ๊ตฌ๋™ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ด๊ฒƒ์€ ๋‹จ์ผ ํ‘œํ˜„์‹์„ ๊ตฌ๋ฌธ ๋ถ„์„ํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.
  • grammar. Sometimes you have grammars that are a little more complicated, like the expression could be an integer, or it could be an identifier indicating a variable, or a bunch of expressions in a tuple. So when you have a choice of many different options, we'll model that with an enum. ChatGPT

    • ๋ฌธ๋ฒ•์ด ์ข€ ๋” ๋ณต์žกํ•ด์งˆ ๋•Œ๊ฐ€ ์žˆ๋Š”๋ฐ, ์˜ˆ๋ฅผ ๋“ค์–ด ํ‘œํ˜„์‹์ด ์ •์ˆ˜์ผ ์ˆ˜๋„ ์žˆ๊ณ , ๋ณ€์ˆ˜์ž„์„ ๋‚˜ํƒ€๋‚ด๋Š” ์‹๋ณ„์ž์ผ ์ˆ˜๋„ ์žˆ์œผ๋ฉฐ, ๋˜๋Š” ํŠœํ”Œ ์•ˆ์— ์—ฌ๋Ÿฌ ํ‘œํ˜„์‹์ด ์žˆ์„ ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ์—ฌ๋Ÿฌ ๊ฐ€์ง€ ์„ ํƒ์ง€๊ฐ€ ์žˆ์„ ๋•Œ๋Š” ์ด๋ฅผ ์—ด๊ฑฐํ˜•(enum)์œผ๋กœ ๋ชจ๋ธ๋งํ•ฉ๋‹ˆ๋‹ค.
  • Okay. ChatGPT

    • ๊ทธ๋ž˜์„œ ์ด๋ ‡๊ฒŒ ์—ฌ๋Ÿฌ ์„ ํƒ์ง€๋ฅผ ๊ฐ€์ง„ ๋ฌธ๋ฒ•์„ ๋‹ค๋ฃฐ ๋•Œ, ์—ด๊ฑฐํ˜•์„ ์‚ฌ์šฉํ•˜์—ฌ ๊ฐ๊ฐ์˜ ๊ฒฝ์šฐ๋ฅผ ๋ช…์‹œํ•˜๊ณ  ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ํ”„๋กœ๊ทธ๋žจ์˜ ๊ตฌ์กฐ์™€ ์˜๋ฏธ๋ฅผ ๋” ๋ช…ํ™•ํ•˜๊ฒŒ ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ๋ฐฉ์‹์€ ๋ณต์žกํ•œ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด์˜ ๊ตฌ๋ฌธ์„ ๋‹ค๋ฃจ๋Š” ๋ฐ ๋งค์šฐ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค.
  • And then for each of the variants, we're going to give the grammar. So these are the different choices. If it's an integer, it should just look like. ChatGPT

    • ์ •์ˆ˜์ธ ๊ฒฝ์šฐ์—๋Š” ๊ทธ๋ƒฅ ์ˆซ์ž๋กœ ๋ณด์ด๊ฒ ์ฃ . ๊ทธ๋ž˜์„œ ๊ฐ ๋ณ€ํ˜•๋งˆ๋‹ค ํ•ด๋‹น ๋ฌธ๋ฒ•์„ ์ง€์ •ํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ์ •์ˆ˜๋Š” ์ˆซ์ž์ฒ˜๋Ÿผ ๋ณด์ด๋„๋ก ํ•˜๊ณ , ์‹๋ณ„์ž๋Š” ๋ณ€์ˆ˜ ์ด๋ฆ„์œผ๋กœ ์ธ์‹๋˜๋„๋ก ํ•˜๋Š” ์‹์ž…๋‹ˆ๋‹ค. ์ด๋Ÿฐ ์‹์œผ๋กœ ๋‹ค์–‘ํ•œ ์„ ํƒ์ง€๋ฅผ ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • It's an anonymous field. I just call it v0, v1, and so on. So here, one little handy macro is this id macro. That just declares a string, an identifier. So we're saying, okay, there's going to be an identifier types that I call id, and I'm going to parse. If I see an identifier, that's a var. ChatGPT

    • ๊ทธ๋ž˜์„œ ์ต๋ช… ํ•„๋“œ๋Š” ๊ทธ๋ƒฅ v0, v1 ์ด๋ ‡๊ฒŒ ๋ถ€๋ฅด๋Š” ๊ฑฐ์ฃ . ์—ฌ๊ธฐ์„œ ์œ ์šฉํ•œ ๋งคํฌ๋กœ ์ค‘ ํ•˜๋‚˜๊ฐ€ id ๋งคํฌ๋กœ์ž…๋‹ˆ๋‹ค. ์ด ๋งคํฌ๋กœ๋Š” ๋ฌธ์ž์—ด, ์ฆ‰ ์‹๋ณ„์ž๋ฅผ ์„ ์–ธํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ์‹๋ณ„์ž ์œ ํ˜•์„ id๋ผ๊ณ  ๋ถ€๋ฅด๊ณ , ์‹๋ณ„์ž๊ฐ€ ๋ณด์ด๋ฉด var๋กœ ํŒŒ์‹ฑํ•˜๊ฒ ๋‹ค๋Š” ๋œป์ž…๋‹ˆ๋‹ค.
  • See a little bit of handy notation. You can say $ with parentheses. That means a parenthesized list. So I've tried to put in the common conventions you'll often find. And so we're going to parse one or more expressions and build a tuple. ChatGPT

    • ์ด ์œ ์šฉํ•œ ํ‘œ๊ธฐ๋ฒ•์„ ๋ณด๋ฉด, ๋‹ฌ๋Ÿฌ ๊ธฐํ˜ธ์— ๊ด„ํ˜ธ๋ฅผ ๋ถ™์ด๋ฉด ๊ด„ํ˜ธ๋กœ ๋ฌถ์ธ ๋ชฉ๋ก์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ์ž์ฃผ ์‚ฌ์šฉํ•˜๋Š” ์ผ๋ฐ˜์ ์ธ ๊ด€์Šต์„ ํฌํ•จ์‹œํ‚ค๋ ค๊ณ  ๋…ธ๋ ฅํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด์ œ ํ•˜๋‚˜ ์ด์ƒ์˜ ํ‘œํ˜„์‹์„ ํŒŒ์‹ฑํ•ด์„œ ํŠœํ”Œ์„ ๋งŒ๋“ค๊ฒ ์Šต๋‹ˆ๋‹ค.
  • And we'll continue. Maybe we want to have plus, minus, times, and stars. ChatGPT

    • ๊ณ„์†ํ•ด์„œ ํ”Œ๋Ÿฌ์Šค, ๋งˆ์ด๋„ˆ์Šค, ๊ณฑ์…ˆ, ๊ทธ๋ฆฌ๊ณ  ๋ณ„ํ‘œ ์—ฐ์‚ฐ์ž๋„ ์ถ”๊ฐ€ํ•ด ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.
  • The minor point is, if you have recursive types, it's still Rust. They have to have ARC, otherwise the type would have infinite size. That's no problem, and so on. ChatGPT

  • ๋งž์Šต๋‹ˆ๋‹ค. ์žฌ๊ท€์ ์ธ ์œ ํ˜•์ด ์žˆ์œผ๋ฉด ๋ ˆํผ๋Ÿฐ์Šค๋ฅผ ํ†ตํ•ด ์ฐธ์กฐ ๊ณ„์ˆ˜ํ™”๋œ ARC(Automatic Reference Counting)๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ์œ ํ˜•์ด ๋ฌดํ•œํ•˜๊ฒŒ ์ปค์ง‘๋‹ˆ๋‹ค.

  • non-obvious like let. So here we're declaring a local variable. It's going to be called id or whatever. It's going to have an initial value. It's going to execute an expression. That's going to look like this. ChatGPT

  • ๋„ค, ์ด ์ฝ”๋“œ์—์„œ let์€ ๋ณ€์ˆ˜๋ฅผ ์„ ์–ธํ•˜๋Š” Rust์˜ ๋ฌธ๋ฒ•์ž…๋‹ˆ๋‹ค. id๋ผ๋Š” ๋กœ์ปฌ ๋ณ€์ˆ˜๋ฅผ ์„ ์–ธํ•˜๊ณ , ์ดˆ๊ธฐ๊ฐ’์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ ๋‹ค์Œ์œผ๋กœ ํ‘œํ˜„์‹์„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

  • And so on. OK, you get the idea. So let's look at an example. Now, we wanted to write some tests, right? Because the whole idea of this is you can write this grammar and then play with it. Let me see where I have some tests. OK, here we go. ChatGPT

Sure, let's take a look at the tests.

  • Question mark, that's the normal debug input. You'd get something that's generated with the grammar in mind, a pretty printed version of it. ChatGPT

    • ๋ฌผ์Œํ‘œ๋Š” ์ผ๋ฐ˜์ ์ธ ๋””๋ฒ„๊ทธ ์ž…๋ ฅ์ž…๋‹ˆ๋‹ค. ๋ฌธ๋ฒ•์„ ๊ณ ๋ คํ•˜์—ฌ ์ƒ์„ฑ๋œ ๋‚ด์šฉ์„ pretty print ๋ฒ„์ „์œผ๋กœ ๋ฐ›๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.
  • If you ask for the full detail with the hash sign, then you actually get the standard thing you get from a debuggable. This is pretty useful when you're writing tests of the parsing, because it gives you all the detail. And as some people who've played with my systems before will tell you, or when we didn't have this, it's kind of helpful when you're learning if you really want to know exactly what data structure you've got. In this case, in particular, we can see that the multiplication had higher precedence, right? We parsed. ChatGPT

    • ๋ฌผ์Œํ‘œ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด pretty print ๋ฒ„์ „์„ ๋ฐ›์ง€๋งŒ, ํ•ด์‹œ ๊ธฐํ˜ธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ „์ฒด ์„ธ๋ถ€ ์‚ฌํ•ญ์„ ์š”์ฒญํ•˜๋ฉด ์ผ๋ฐ˜์ ์ธ ๋””๋ฒ„๊ทธ ์ถœ๋ ฅ์„ ๋ฐ›์Šต๋‹ˆ๋‹ค. ์ด๋Š” ๊ตฌ๋ฌธ ๋ถ„์„ ํ…Œ์ŠคํŠธ๋ฅผ ์ž‘์„ฑํ•  ๋•Œ ๋งค์šฐ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค. ์‹œ์Šคํ…œ์„ ์ฒ˜์Œ ๋ฐฐ์šฐ๋Š” ์‚ฌ๋žŒ๋“ค์—๊ฒŒ๋Š” ์ •ํ™•ํžˆ ์–ด๋–ค ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋Š”์ง€ ์•Œ ์ˆ˜ ์žˆ์–ด ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค. ์ด ๊ฒฝ์šฐ ํŠนํžˆ, ๊ณฑ์…ˆ์ด ๋” ๋†’์€ ์šฐ์„ ์ˆœ์œ„๋ฅผ ๊ฐ€์ง„๋‹ค๋Š” ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • x plus y times 3 plus 66. If we did that wrong, we might have, for example, parentheses like this. We might have a plus that was getting multiplied rather than an addition of a sum. But we don't. We have the multiplication inside and then the as. OK, cool.

    • x ๋”ํ•˜๊ธฐ y ๊ณฑํ•˜๊ธฐ 3 ๋”ํ•˜๊ธฐ 66์„ ์ž˜๋ชป ํ•ด์„ํ–ˆ์œผ๋ฉด, ์˜ˆ๋ฅผ ๋“ค์–ด, ์ด๋ ‡๊ฒŒ ๊ด„ํ˜ธ๋ฅผ ์‚ฌ์šฉํ–ˆ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ”Œ๋Ÿฌ์Šค๊ฐ€ ๊ณฑํ•ด์ง€๊ธฐ๋ณด๋‹ค๋Š” ํ•ฉ์˜ ๋ง์…ˆ์ด ๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ์šฐ๋ฆฌ๋Š” ๊ณฑ์…ˆ์ด ๋‚ด๋ถ€์— ์žˆ๊ณ , ๊ทธ ๋‹ค์Œ์— ๋”ํ•˜๊ธฐ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์•„์ฃผ ์ข‹์Šต๋‹ˆ๋‹ค.
  • That's all just parsing, and it's not a particularly smart parser. Oh, I already showed you this. But you have to declare the language. Okay, this is boring. ChatGPT

    • ์ด๊ฒƒ์€ ๋‹จ์ง€ ํŒŒ์‹ฑ์ผ ๋ฟ์ด๊ณ , ํŠน๋ณ„ํžˆ ๋˜‘๋˜‘ํ•œ ํŒŒ์„œ๋Š” ์•„๋‹™๋‹ˆ๋‹ค. ์•„, ์ด๊ฑด ์ด๋ฏธ ๋ณด์—ฌ๋“œ๋ ธ๋„ค์š”. ์–ธ์–ด๋ฅผ ์„ ์–ธํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด ๋ถ€๋ถ„์€ ์ง€๋ฃจํ•˜์ฃ .
  • Well, one thing I'll note is you tell it what you want it to have as keywords. But let's doโ€”okay, boring, boring. Let's talk about type checking. ChatGPT

    • ๋„ค, ์—ฌ๊ธฐ์„œ ์งš๊ณ  ๋„˜์–ด๊ฐˆ ๋ถ€๋ถ„์€ ๋ฌด์—‡์„ ํ‚ค์›Œ๋“œ๋กœ ์‚ฌ์šฉํ• ์ง€ ์ง€์ •ํ•ด์•ผ ํ•œ๋‹ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ž, ์ด์ œ ์ง€๋ฃจํ•œ ๋ถ€๋ถ„์€ ๋„˜๊ธฐ๊ณ  ํƒ€์ž… ์ฒดํฌ์— ๋Œ€ํ•ด ์ด์•ผ๊ธฐํ•ด ๋ด…์‹œ๋‹ค.
  • This is where it gets a little more interesting. So, so far, we allowed you to define data structures and specify their grammar. And you kind of get for free a parser that will parse and give you what's called an abstract syntax tree, which is just an instance of those data structures and a way to view your program as a data structure and not as a string. But now we want to do type checking. And the type checking rules for this EG language are pretty simple. ChatGPT

    • ์—ฌ๊ธฐ์„œ๋ถ€ํ„ฐ ๋” ํฅ๋ฏธ๋กœ์›Œ์ง‘๋‹ˆ๋‹ค. ์ง€๊ธˆ๊นŒ์ง€๋Š” ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ๋ฅผ ์ •์˜ํ•˜๊ณ  ๊ทธ๋“ค์˜ ๋ฌธ๋ฒ•์„ ์ง€์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋‹ค๋ฃจ์—ˆ๊ณ , ์ด๋ฅผ ํ†ตํ•ด ์ถ”์ƒ ๊ตฌ๋ฌธ ํŠธ๋ฆฌ(AST)๋ฅผ ์ž๋™์œผ๋กœ ์ƒ์„ฑํ•˜๋Š” ํŒŒ์„œ๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ์ถ”์ƒ ๊ตฌ๋ฌธ ํŠธ๋ฆฌ๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ๋ฌธ์ž์—ด์ด ์•„๋‹Œ ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ๋กœ ๋ณผ ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ค๋‹ˆ๋‹ค. ์ด์ œ ํƒ€์ž… ์ฒดํฌ๋ฅผ ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ์ด EG ์–ธ์–ด์˜ ํƒ€์ž… ์ฒดํฌ ๊ทœ์น™์€ ๋งค์šฐ ๊ฐ„๋‹จํ•ฉ๋‹ˆ๋‹ค.
  • If you're adding things, they basically have to have the same type. So I can add two integers, I can add two tuples that are both two integers, but I can't add a tuple and an integer or two tuples of different arities. That should not work. ChatGPT

    • ๋งž์Šต๋‹ˆ๋‹ค. ๋”ํ•˜๊ธฐ ์—ฐ์‚ฐ์„ ์ˆ˜ํ–‰ํ•  ๋•Œ ๋‘ ํ”ผ์—ฐ์‚ฐ์ž๋Š” ๊ฐ™์€ ํƒ€์ž…์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ฆ‰, ๋‘ ์ •์ˆ˜๋ฅผ ๋”ํ•˜๊ฑฐ๋‚˜ ๋‘ ๊ฐœ์˜ ์ •์ˆ˜๋กœ ๊ตฌ์„ฑ๋œ ๋‘ ํŠœํ”Œ์„ ๋”ํ•  ์ˆ˜๋Š” ์žˆ์ง€๋งŒ, ํŠœํ”Œ๊ณผ ์ •์ˆ˜๋ฅผ ๋”ํ•˜๊ฑฐ๋‚˜ ์„œ๋กœ ๋‹ค๋ฅธ ํฌ๊ธฐ์˜ ํŠœํ”Œ์„ ๋”ํ•  ์ˆ˜๋Š” ์—†์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ ๊ฒฝ์šฐ๋Š” ์ž‘๋™ํ•˜์ง€ ์•Š์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค.
  • So that gives us a question, though. What are types in this language, right? The next thing we have to defineโ€”we defined what the program language is, but we didn't define the grammar of types. So the next thing you have to do is define that. We're going to have it basically beโ€”I'm starting with the simple. I'm excluding generics for the moment. It's an integer, or it's a tuple of some set of other types. ChatGPT

    • ๊ทธ๋ž˜์„œ ์—ฌ๊ธฐ์„œ ์ค‘์š”ํ•œ ์งˆ๋ฌธ์ด ์ƒ๊น๋‹ˆ๋‹ค. ์ด ์–ธ์–ด์—์„œ ํƒ€์ž…์ด๋ž€ ๋ฌด์—‡์ผ๊นŒ์š”? ์šฐ๋ฆฌ๊ฐ€ ํ”„๋กœ๊ทธ๋žจ ์–ธ์–ด์˜ ์ •์˜๋Š” ํ–ˆ์ง€๋งŒ, ํƒ€์ž…์˜ ๋ฌธ๋ฒ•์€ ์ •์˜ํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ๋‹ค์Œ์œผ๋กœ ํ•ด์•ผ ํ•  ์ผ์€ ๊ทธ๊ฒƒ์„ ์ •์˜ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ ๊ฐ„๋‹จํ•œ ๊ฒƒ๋ถ€ํ„ฐ ์‹œ์ž‘ํ•  ๊ฒ๋‹ˆ๋‹ค. ์ผ๋‹จ ์ œ๋„ค๋ฆญ์€ ์ œ์™ธํ•˜๊ณ , ์ •์ˆ˜ ํƒ€์ž…์ด๊ฑฐ๋‚˜ ๋‹ค๋ฅธ ํƒ€์ž…๋“ค์˜ ํŠœํ”Œ์ด ๋˜๋Š” ๊ฒƒ์œผ๋กœ ํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค.
  • Right, so that's just an enum with two variants. One is an integer, one is a tuple. Okay. ChatGPT

    • ๋งž์•„์š”, ๊ทธ๋ž˜์„œ ๊ทธ๊ฑด ๋‘ ๊ฐ€์ง€ ๋ณ€ํ˜•์„ ๊ฐ€์ง„ ์—ด๊ฑฐํ˜•(enum)์ž…๋‹ˆ๋‹ค. ํ•˜๋‚˜๋Š” ์ •์ˆ˜๊ณ , ๋‹ค๋ฅธ ํ•˜๋‚˜๋Š” ํŠœํ”Œ์ž…๋‹ˆ๋‹ค. ์•Œ๊ฒ ์ฃ ?
  • Infants rule stuff. ChatGPT

    • ๊ทธ๋ ‡์ง€ ์•Š์•„์š”. ์ฃ„์†กํ•ฉ๋‹ˆ๋‹ค๋งŒ, ์ดํ•ดํ•˜์ง€ ๋ชปํ–ˆ์–ด์š”. ์ข€ ๋” ์„ค๋ช…ํ•ด์ฃผ์‹œ๊ฒ ์–ด์š”?
  • How many of you have seen something like this? OK, how many of you understood what the hell is what is going on here? Yeah, me either. OK, so this notation is actually ridiculously simple. It's like the world's... How many of you have written in TCL? OK, more than I thought. I have not written in TCL, but what I do know about TCL is that everything is a string. Well, this is kind of true here also. The way programming languages work basically, or these rules work, it's like you took the world's simplest interpreter and you run it, and it has to be simple because we have to be able to map it to mathematics. So it has to be very, very simple so that that mapping is very, very simple so that we can formally prove things about it. ChatGPT

  • ์ดํ•ด๋˜์—ˆ์–ด์š”. ์ด๊ฒƒ์ด ๊ฐ„๋‹จํ•œ ํ•ด์„๊ธฐ์ฒ˜๋Ÿผ ๋ณด์—ฌ์š”. ๊ทธ๋ฆฌ๊ณ  ๋‹น์‹ ์ด ์–ธ๊ธ‰ํ•œ ๊ฒƒ์ฒ˜๋Ÿผ, ๋ชจ๋“  ๊ฒƒ์ด ๋ฌธ์ž์—ด์ฒ˜๋Ÿผ ๋‹ค๋ฃจ์–ด์ ธ์š”. ์ด๊ฒƒ์ด ์ˆ˜ํ•™์ ์œผ๋กœ ๊ฐ„๋‹จํ•˜๊ฒŒ ๋งคํ•‘๋˜์–ด์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์ด๊ฒƒ์ด ๊ฐ„๋‹จํ•ด์•ผ ํ•œ๋‹ค๊ณ  ์ดํ•ดํ–ˆ์–ด์š”.

  • I'm going to walk through it. The very first confusing thing about inference rules, in my opinion, is their name, which is like, what is that? What is inference? I don't know. I think of type inference. It's not really about that. It's about this English word infer. It's basically a rule that says, if I infer something, it means I figured it out based on something else. Well, an inference rule is basically, how can we figure out a conclusion based on a set of premises? If these things are true, in other words, you can read them as if you see a big rule that has a big line, ChatGPT

    • ์ธํผ๋Ÿฐ์Šค ๊ทœ์น™์€ ์ „์ œ ์กฐํ•ฉ์— ๊ธฐ๋ฐ˜ํ•˜์—ฌ ๊ฒฐ๋ก ์„ ์ถ”๋ก ํ•˜๋Š” ๊ฒƒ์„ ๋‚˜ํƒ€๋‚ด๋Š” ๊ฒƒ์ด์ฃ . ๋งŒ์•ฝ ์ด๋Ÿฌํ•œ ์‚ฌ์‹ค๋“ค์ด ์ฐธ์ด๋ผ๋ฉด, ์ด๊ฒƒ๋“ค์€ ์–ด๋–ป๊ฒŒ ์ดํ•ด๋˜์–ด์•ผ ํ• ๊นŒ์š”? ํฐ ์„ ์ด ์žˆ๋Š” ํฐ ๊ทœ์น™์„ ๋ณด๊ฒŒ ๋˜๋ฉด,
  • stuff on top of the line, that's the conditions. If x and y, then z, right? This is the conclusion. And then there's this thing over on the side, that's just the name, just so you can give it, refer to it. So like here, these are the two conditions on top, and that's the conclusion. Okay. Sometimes there's no conditions, and then we just write a line. ChatGPT

    • ์„  ์œ„์— ์žˆ๋Š” ๊ฒƒ๋“ค, ๊ทธ๊ฒƒ์ด ์กฐ๊ฑด๋“ค์ด์—์š”. ๋งŒ์•ฝ x์™€ y๋ผ๋ฉด, z๊ฐ€ ๋˜๊ฒ ์ฃ ? ์ด๊ฒƒ์ด ๊ฒฐ๋ก ์ž…๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์˜†์— ์žˆ๋Š” ๊ฒƒ์€ ๊ทธ๋ƒฅ ์ด๋ฆ„์ผ ๋ฟ์ด์—์š”. ๊ทธ๋ž˜์„œ ์ด ๊ทœ์น™์„ ์ฐธ๊ณ ํ•˜๊ธฐ ์œ„ํ•ด ์ด๋ฆ„์„ ๋ถ™์ž…๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ๊ฒƒ๋“ค์€ ์œ„์— ์žˆ๋Š” ๋‘ ๊ฐ€์ง€ ์กฐ๊ฑด์ด๊ณ , ๊ทธ๊ฒƒ์ด ๊ฒฐ๋ก ์ž…๋‹ˆ๋‹ค. ๋•Œ๋กœ๋Š” ์กฐ๊ฑด์ด ์—†์„ ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿด ๋•Œ์—๋Š” ๋‹จ์ˆœํžˆ ์„ ๋งŒ ๊ทธ๋ฆฝ๋‹ˆ๋‹ค.
  • It's a pretty handy notation, even though it's so simple. So here's an example of one of the inference rules you might write in EG, which is somewhat simpler. ChatGPT

    • ๋„ค, ์ด๋Ÿฌํ•œ ๊ฐ„๋‹จํ•œ ํ‘œ๊ธฐ๋ฒ•์ด์ง€๋งŒ ์ƒ๋‹นํžˆ ํŽธ๋ฆฌํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ EG์—์„œ ์ž‘์„ฑํ•  ์ˆ˜ ์žˆ๋Š” ์ถ”๋ก  ๊ทœ์น™์˜ ์˜ˆ์‹œ ํ•˜๋‚˜๋ฅผ ๋ณด์—ฌ๋“œ๋ฆด๊ฒŒ์š”.
  • What is going on here? So we've got this kind of, even in this very simple example, we've kind of got this Bayesian notation. What's happening there, when you see a string like this, this is also a term. Basically, it has two different parts to it, right? Overall, this is basically a predicate. It's something that we can say is true or not true, or at least true or not known to be true. ChatGPT

    • ์—ฌ๊ธฐ์—์„œ ์–ด๋–ค ์ผ์ด ๋ฒŒ์–ด์ง€๊ณ  ์žˆ๋Š” ๊ฑธ๊นŒ์š”? ์ด ๋งค์šฐ ๊ฐ„๋‹จํ•œ ์˜ˆ์ œ์—์„œ๋„ ๋ฒ ์ด์ง€์•ˆ ํ‘œ๊ธฐ๋ฒ•์ด ์‚ฌ์šฉ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋ฌธ์ž์—ด์„ ๋ณด๋ฉด, ์ด๊ฒƒ ๋˜ํ•œ ์šฉ์–ด์ž…๋‹ˆ๋‹ค. ๊ธฐ๋ณธ์ ์œผ๋กœ ์ด๊ฒƒ์€ ๋‘ ๊ฐ€์ง€ ๋‹ค๋ฅธ ๋ถ€๋ถ„์„ ๊ฐ–๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ „๋ฐ˜์ ์œผ๋กœ ์ด๊ฒƒ์€ ๊ธฐ๋ณธ์ ์œผ๋กœ ์ˆ ๋ถ€์ž…๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๋Š” ์ด๊ฒƒ์ด ์ฐธ์ธ์ง€, ๊ฑฐ์ง“์ธ์ง€, ๋˜๋Š” ์ ์–ด๋„ ์ฐธ์ด ์•„๋‹Œ์ง€๋ฅผ ๋งํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.
  • variables. So here, the T, that's a variable saying some type. I'm going to call it T. ChatGPT

    • ๋ณ€์ˆ˜์ž…๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ T๋Š” ์–ด๋–ค ์œ ํ˜•์„ ๋‚˜ํƒ€๋‚ด๋Š” ๋ณ€์ˆ˜์ž…๋‹ˆ๋‹ค. ๋‚˜๋Š” ๊ทธ๊ฒƒ์„ T๋ผ๊ณ  ๋ถ€๋ฅผ ๊ฒƒ์ž…๋‹ˆ๋‹ค.
  • And actually, you could call them meta variables very properly. Just call them variables. Basically, when you have these letters, usually that's kind of the variable. So, T is some type. Maybe it's U32, maybe it's parenthesis U32, U32. ChatGPT

    • ๋„ค, ๊ทธ๊ฒƒ์€ ๋ฉ”ํƒ€ ๋ณ€์ˆ˜๋ผ๊ณ ๋„ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋‹จ์ง€ ๋ณ€์ˆ˜๋ผ๊ณ  ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. ์ผ๋ฐ˜์ ์œผ๋กœ ์ด๋Ÿฐ ๋ฌธ์ž๋Š” ๋ณ€์ˆ˜๋ฅผ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ T๋Š” ์–ด๋–ค ์œ ํ˜•์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค. U32์ผ ์ˆ˜๋„ ์žˆ๊ณ , (U32, U32)์ผ ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.
  • Gamma, by convention, I put it in here because I'm Greek, but I personally prefer to use the letter E because I actually speak English as the primary language, but gamma is usually used to mean the typing environment. It's basically the types of all the variables that have been declared, though it could have other stuff in Rust. It might have lifetime relationships and so forth. ChatGPT

    • Gamma๋Š” ์ผ๋ฐ˜์ ์œผ๋กœ ํƒ€์ดํ•‘ ํ™˜๊ฒฝ์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” ์ง€๊ธˆ๊นŒ์ง€ ์„ ์–ธ๋œ ๋ชจ๋“  ๋ณ€์ˆ˜์˜ ํƒ€์ž…์„ ๋‚˜ํƒ€๋‚ด์ง€๋งŒ, Rust์˜ ๊ฒฝ์šฐ ์ˆ˜๋ช… ๊ด€๋ จ ์ •๋ณด ๋“ฑ ๋‹ค๋ฅธ ์ •๋ณด๋„ ํฌํ•จ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • Variable names and types for those variables. ChatGPT

    • Gamma๋Š” ๋ณ€์ˆ˜ ์ด๋ฆ„๊ณผ ํ•ด๋‹น ๋ณ€์ˆ˜์˜ ํƒ€์ž…์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.
  • can actually define gamma, like everything else when we're doing an informality, we have to kind of define this stuff with Rust data structures. So here I'm not using the term macro just because I never need to parse it, but the so-called environment is basically just a list of variables that are in scope and their type. And I'm just using a map, you know, it's a B-tree map, actually, where it goes from one to the other. I'm also carrying the program along with me. That's so I can look up function definitions when you call them. We won't use that right now. But so that's what we're going to call when you see gamma, we're going to basically just think it means some environment, right? ChatGPT

    • Gamma๋Š” ๋ณ€์ˆ˜ ์ด๋ฆ„๊ณผ ํ•ด๋‹น ๋ณ€์ˆ˜์˜ ํƒ€์ž…์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค. ์ด๋ฅผ ํ‘œํ˜„ํ•˜๊ธฐ ์œ„ํ•ด Rust ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ํ™˜๊ฒฝ(Environment)์€ ํ˜„์žฌ ๋ฒ”์œ„ ๋‚ด์— ์žˆ๋Š” ๋ณ€์ˆ˜์™€ ๊ทธ ํƒ€์ž…์˜ ๋ฆฌ์ŠคํŠธ์ž…๋‹ˆ๋‹ค. ์ €๋Š” ์—ฌ๊ธฐ์„œ ํŒŒ์‹ฑํ•  ํ•„์š”๊ฐ€ ์—†๊ธฐ ๋•Œ๋ฌธ์— term ๋งคํฌ๋กœ๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. ํ™˜๊ฒฝ์€ ๋ณ€์ˆ˜์™€ ๊ทธ ํƒ€์ž… ์‚ฌ์ด์˜ ๋งคํ•‘์„ ๋‚˜ํƒ€๋‚ด๋Š” B-ํŠธ๋ฆฌ ๋งต์œผ๋กœ ๊ตฌ์„ฑ๋ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ ํ”„๋กœ๊ทธ๋žจ์„ ํ•จ๊ป˜ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ํ•จ์œผ๋กœ์จ ํ•จ์ˆ˜ ์ •์˜๋ฅผ ํ˜ธ์ถœํ•  ๋•Œ ํ•ด๋‹น ํ•จ์ˆ˜๋ฅผ ์ฐพ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • OK, and this notation we saw, gamma, parentheses, x. Well, you could think of gamma like a function you can call to get the type of a variable. So we'll do that by accessing the. ChatGPT

    • gamma(x)์™€ ๊ฐ™์€ ํ‘œ๊ธฐ๋ฒ•์„ ๋ณด๋ฉด gamma๋ฅผ ๋ณ€์ˆ˜์˜ ํƒ€์ž…์„ ์–ป๊ธฐ ์œ„ํ•œ ํ•จ์ˆ˜์ฒ˜๋Ÿผ ์ƒ๊ฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฅผ ์œ„ํ•ด ์ €๋Š” gamma์— ์ ‘๊ทผํ•˜์—ฌ ํ•จ์ˆ˜๋ฅผ ํ˜ธ์ถœํ•ฉ๋‹ˆ๋‹ค.
  • Clear stuff. We saw these variables. What about this weird thing? That's called a turnstile. Why? Because, you know, when you walk in the subway, the little thing turns. But that's why. That's a turnstile, the thing that turns. And this colon. The answer is this is just stuff. It doesn't have any meaning. It's like opaque strings, like the name of a function. Effectively, the name of this predicate, if you want to, is like gamma colon. So it's kind of like Objective-C, if you did that, or Swift. I don't know how Swift works exactly. But in Objective-C, the name of a method is kind of strung out across, interspersed. So the name of this method, insert object, it's actually insert object at index, like one big string, even though you write it in parts. So here you could say the name of this rule is gamma colon, which is kind of hard to say out loud. ChatGPT

    • ๋˜ ์ด์ƒํ•œ ๊ฒƒ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฐ”๋กœ 'turnstile'์ž…๋‹ˆ๋‹ค. ์ด๋Š” ์ง€ํ•˜์ฒ ์—์„œ ๊ฑธ์–ด๊ฐ€๋Š” ์ž‘์€ ๊ฒƒ์ฒ˜๋Ÿผ ๋Œ์•„๊ฐ€๋Š” ๊ธฐ๊ณ„๋ฅผ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ด ์ฝœ๋ก ์ž…๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ๊ทธ๋ƒฅ ์ •๋ณด์ผ ๋ฟ์ž…๋‹ˆ๋‹ค. ์˜๋ฏธ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. ๊ทธ๊ฒƒ์€ ๋งˆ์น˜ ํ•จ์ˆ˜์˜ ์ด๋ฆ„์ฒ˜๋Ÿผ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค.
  • Sounds awkward. So maybe we can give it a better name. We'll see. We will in a second. ChatGPT

    • ๋งž์Šต๋‹ˆ๋‹ค. ๋‹ค์†Œ ์–ด์ƒ‰ํ•˜์ฃ . ์•„๋งˆ ์ข€ ๋” ๋‚˜์€ ์ด๋ฆ„์„ ์ง€์–ด์ฃผ๋Š” ๊ฒŒ ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๊ณง ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.
  • conventions. I said they're just random stuff. That's how I think of it. You just have to accept it. It's just this is what they chose to use. But there are some common conventions people often use. The turnstile separates assumptions, your environment, the things that you got from the outside from the thing you're trying to prove with those assumptions. If I know that the variable x is a U32, then I know that a reference to x has type U32. That's based on this assumption. ChatGPT

    • ๋งž์•„์š”. ํ‘œ์ค€์€ ๊ทธ๋ƒฅ ๋žœ๋คํ•œ ๊ฒƒ์ฒ˜๋Ÿผ ๋ณด์ด์ง€๋งŒ, ์‹ค์ œ๋กœ๋Š” ์ผ๋ฐ˜์ ์œผ๋กœ ์‚ฌ์šฉ๋˜๋Š” ๋ช‡ ๊ฐ€์ง€ ๊ทœ์น™์ด ์žˆ์–ด์š”. ํšŒ์ „๋ฌธ์€ ๊ฐ€์ •๊ณผ ํ•จ๊ป˜ ์–ป์€ ํ™˜๊ฒฝ์„ ์™ธ๋ถ€์—์„œ๋ถ€ํ„ฐ ์–ป์€ ๊ฒƒ์œผ๋กœ๋ถ€ํ„ฐ ์ฆ๋ช…ํ•˜๋ ค๋Š” ๊ฒƒ์„ ๋ถ„๋ฆฌํ•ด์ค๋‹ˆ๋‹ค. ๋งŒ์•ฝ ๋ณ€์ˆ˜ x๊ฐ€ U32๋ผ๋Š” ๊ฒƒ์„ ์•Œ๊ณ  ์žˆ๋‹ค๋ฉด, x์— ๋Œ€ํ•œ ์ฐธ์กฐ๋Š” U32 ์œ ํ˜•์„ ๊ฐ€์ง„๋‹ค๋Š” ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ์ด ๊ฐ€์ •์— ๊ธฐ๋ฐ˜ํ•ฉ๋‹ˆ๋‹ค.
  • colon usually means hasType. ChatGPT

    • ๋งž์•„์š”. ๋Œ€๋ถ€๋ถ„์˜ ๊ฒฝ์šฐ ์ฝœ๋ก ์€ "์œ ํ˜•์„ ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค"๋Š” ์˜๋ฏธ๋กœ ํ•ด์„๋ฉ๋‹ˆ๋‹ค.
  • read this as assuming gamma, then E has the type T. And what I would say is this was actually like a turning point for me, personally, when I realized that this weird symbol basically meant assuming or lets me say. That's how I thought of it at first, I remember. Let us say, like this lets us say that. I was like, oh, I can read this now. It reads like English instead of this weird string of symbols. So just knowing what people mean by it is usually very impactful, I would say. ChatGPT

    • ๊ทธ๋ ‡์ฃ . ์ดํ•ดํ•  ๋•Œ ๊ฐ€๋” ์ถ”์ƒ์ ์ธ ๊ธฐํ˜ธ๋“ค์ด ํ˜ผ๋ž€์Šค๋Ÿฝ๊ฒŒ ๋А๊ปด์งˆ ์ˆ˜ ์žˆ์ง€๋งŒ, ๊ทธ๊ฒƒ๋“ค์ด ์ผ์ข…์˜ "์–ธ์–ด"๋กœ์„œ ์‚ฌ์šฉ๋œ๋‹ค๊ณ  ์ƒ๊ฐํ•˜๋ฉด ๋„์›€์ด ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ดํ•ดํ•  ๋•Œ ํ”ํžˆ ์‚ฌ์šฉ๋˜๋Š” ์˜๋ฏธ์™€ ํ•จ๊ป˜ ์—ฐ๊ด€ ์ง“๋Š” ๊ฒƒ์ด ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค.
  • But how will we write that in formality? We're just going to write it like a Rust function, so we have to give it a name. ChatGPT

    • ๊ทธ๋Ÿผ "type_of_variable"๊ณผ ๊ฐ™์€ ์ด๋ฆ„์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒ ์ฃ ? ๊ทธ๋Ÿฌ๋ฉด ์˜ˆ๋ฅผ ๋“ค์–ด, gamma: x๊ฐ€ ํ•จ์ˆ˜ "type_of_variable"์˜ ์ธ์ž๋กœ ์ „๋‹ฌ๋˜๊ณ , x์˜ ํƒ€์ž…์ด ๋ฐ˜ํ™˜๋ฉ๋‹ˆ๋‹ค.
  • because it computes the type for an expression, like the type of an expression. ChatGPT

    • ๊ทธ๋ ‡์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋ฉด "expression_type"์ด๋ผ๋Š” ์ด๋ฆ„์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ํ•จ์ˆ˜ ์ด๋ฆ„์œผ๋กœ์จ "gamma: E"๊ฐ€ ์ธ์ž๋กœ ์ „๋‹ฌ๋˜๊ณ , "E"์˜ ํƒ€์ž…์ด ๋ฐ˜ํ™˜๋ฉ๋‹ˆ๋‹ค.
  • But you'll notice that some of them, the first two, show up as parameters to this function, and the last one, the type that comes after the colon, that's actually the return value. ChatGPT

    • ๋งž์•„์š”. "gamma"์™€ "E"๋Š” ํ•จ์ˆ˜์˜ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ์ „๋‹ฌ๋˜๊ณ , ":" ๋’ค์— ์˜ค๋Š” "T"๋Š” ๋ฐ˜ํ™˜ ๊ฐ’์ž…๋‹ˆ๋‹ค.
  • less abstract. Normally, when you define the rules, there's not really a notion of input and output. It's just like a relationship between these things. If you have this variable, it has that type, and you can kind of run it in both ways. But when we're really going to execute it in real life, we have to think about what's the input and what gets computed from the input. Otherwise, it's not like a function, an executable function. ChatGPT

    • ๋งž์•„์š”. ์ผ๋ฐ˜์ ์œผ๋กœ ๊ทœ์น™์„ ์ •์˜ํ•  ๋•Œ ์ž…๋ ฅ๊ณผ ์ถœ๋ ฅ์— ๋Œ€ํ•œ ๊ฐœ๋…์€ ๋ณ„๋„๋กœ ์—†์–ด์š”. ๋‹จ์ˆœํžˆ ์ด๋Ÿฌํ•œ ๊ด€๊ณ„๊ฐ€ ์žˆ์„ ๋ฟ์ด์—์š”. ๋งŒ์•ฝ์— ์ด ๋ณ€์ˆ˜๊ฐ€ ์žˆ๋‹ค๋ฉด ๊ทธ ํƒ€์ž…์ด ์ด๊ฒƒ์ด๋‹ค, ๊ทธ๋ฆฌ๊ณ  ์ด๋ฅผ ์–‘์ชฝ์œผ๋กœ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ์–ด์š”. ํ•˜์ง€๋งŒ ์‹ค์ œ๋กœ ์‹คํ–‰ํ•  ๋•Œ์—๋Š” ์ž…๋ ฅ์ด ๋ฌด์—‡์ด๊ณ  ์ž…๋ ฅ์œผ๋กœ๋ถ€ํ„ฐ ์–ด๋–ค ๊ฒƒ์ด ๊ณ„์‚ฐ๋˜๋Š”์ง€๋ฅผ ์ƒ๊ฐํ•ด์•ผ ํ•ด์š”. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ํ•จ์ˆ˜์ฒ˜๋Ÿผ ์‹คํ–‰๋˜์ง€ ์•Š์•„์š”.
  • Usually, so I just kind of baked that in, right? And so what this is saying is, given an environment and an expression, we should be able to figure out what the type of that expression is. That's actually a property, right? We're not going to, like, guess it. We're going to have to, it has to be something deterministic. ChatGPT

    • ๋งž์•„์š”. ๊ทธ๋ž˜์„œ ๊ทธ๊ฒƒ์„ ๊ทธ๋ƒฅ ํฌํ•จ์‹œ์ผฐ์–ด์š”. ์ด ๋ง์€ ํ™˜๊ฒฝ๊ณผ ํ‘œํ˜„์‹์ด ์ฃผ์–ด์กŒ์„ ๋•Œ ๊ทธ ํ‘œํ˜„์‹์˜ ํƒ€์ž…์„ ์•Œ์•„๋‚ผ ์ˆ˜ ์žˆ์–ด์•ผ ํ•œ๋‹ค๋Š” ๊ฒƒ์ด์—์š”. ์ด๊ฒƒ์€ ์‹ค์ œ๋กœ ์†์„ฑ์ด์—์š”. ์šฐ๋ฆฌ๋Š” ๊ทธ๊ฒƒ์„ ์ถ”์ธกํ•˜์ง€ ์•Š์„ ๊ฑฐ์—์š”. ๊ทธ๊ฒƒ์€ ๊ฒฐ์ •์ ์ธ ๊ฒƒ์ด์–ด์•ผ ํ•ด์š”.
  • But OK, so here's how we're actually going to write it. We're going to write judgment function. And what this is is it's a crazy, wicked macro that I'm going to show you later. And then we're going to start with what looks like a fairly normal Rust function, except for this part here, where I have two arrows instead of one arrow. And that's because what we're going to do when you write this typing, it's possible that actually we're going to write a series of rules that we can use, like the rule we saw. And it's possible that more than one of them applies, right? It's also possible that zero apply. So in some sense, we're computing all the possible types for this expression. And if there are no possible types, then it's not a well-typed expression. It's invalid. But if there's more than one, no, that might be OK. Sometimes there's many ways to draw a conclusion. Any one of them is valid, sort of like A or B, right? It's true if A is true, it's true if B is true, and it's true if they're both true. ChatGPT

    • ๊ทธ๋ ‡์ฃ . ๊ทธ๋ž˜์„œ ์‹ค์ œ๋กœ ์šฐ๋ฆฌ๊ฐ€ ์ž‘์„ฑํ•  ๊ฑด ํŒ๋‹จ ํ•จ์ˆ˜์ž…๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ์ œ๊ฐ€ ๋‚˜์ค‘์— ๋ณด์—ฌ๋“œ๋ฆด ์—„์ฒญ๋‚œ ๋งคํฌ๋กœ์ž…๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ ๋‹ค์Œ์—๋Š” ๋ณดํ†ต ๋Ÿฌ์ŠคํŠธ ํ•จ์ˆ˜์™€ ๋น„์Šทํ•œ ๊ฒƒ์„ ์‹œ์ž‘ํ•  ๊ฑฐ์—์š”. ๋‹จ, ์ด ๋ถ€๋ถ„์—์„œ ํ•˜๋‚˜์˜ ํ™”์‚ดํ‘œ ๋Œ€์‹  ๋‘ ๊ฐœ์˜ ํ™”์‚ดํ‘œ๊ฐ€ ์žˆ๋Š” ์ด์œ ๋Š” ๋ฌด์—‡์ผ๊นŒ์š”? ์ด ํƒ€์ดํ•‘์„ ์ž‘์„ฑํ•  ๋•Œ ์‹ค์ œ๋กœ ์šฐ๋ฆฌ๊ฐ€ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ์—ฌ๋Ÿฌ ๊ทœ์น™์„ ์ž‘์„ฑํ•  ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. ์šฐ๋ฆฌ๋Š” ๋ณต์ˆ˜์˜ ๊ทœ์น™์ด ์ ์šฉ๋  ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ์•Œ๊ณ  ์žˆ์–ด์š”, ๋งž์ฃ ? ์‹ค์ œ๋กœ ์ ์šฉ๋  ์ˆ˜๋„ ์žˆ๊ณ , ์ ์šฉ๋˜๋Š” ๊ฒƒ์ด ์—†์„ ์ˆ˜๋„ ์žˆ์–ด์š”. ์–ด๋–ค ์˜๋ฏธ์—์„œ๋Š” ์ด ํ‘œํ˜„์‹์— ๋Œ€ํ•œ ๋ชจ๋“  ๊ฐ€๋Šฅํ•œ ์œ ํ˜•์„ ๊ณ„์‚ฐํ•˜๊ณ  ์žˆ๋Š” ๊ฑฐ์ฃ . ๊ฐ€๋Šฅํ•œ ์œ ํ˜•์ด ์—†์œผ๋ฉด, ์ด๊ฒƒ์€ ์œ ํšจํ•œ ํ‘œํ˜„์‹์ด ์•„๋‹™๋‹ˆ๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์—ฌ๋Ÿฌ ๊ฐœ๊ฐ€ ์žˆ๋‹ค๋ฉด, ์ด๊ฒƒ์€ ๊ดœ์ฐฎ์„ ์ˆ˜๋„ ์žˆ์–ด์š”. ๋•Œ๋กœ๋Š” ๊ฒฐ๋ก ์„ ๋‚ด๋ฆฌ๋Š” ์—ฌ๋Ÿฌ ๊ฐ€์ง€ ๋ฐฉ๋ฒ•์ด ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ์ค‘ ์•„๋ฌด๊ฒƒ์ด๋‚˜ ์œ ํšจํ•ฉ๋‹ˆ๋‹ค. A ๋˜๋Š” B์ฒ˜๋Ÿผ์š”. A๊ฐ€ ์ฐธ์ด๋ฉด ์ฐธ์ด๊ณ , B๊ฐ€ ์ฐธ์ด๋ฉด ์ฐธ์ด๋ฉฐ, ๋‘˜ ๋‹ค ์ฐธ์ด๋ฉด ์ฐธ์ด๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.
  • And this is how the rules are going to look. So this is the equivalent. This is the math up here. ChatGPT

  • ๊ทธ๋Ÿผ์š”. ๊ณ„์†ํ•˜์…”๋„ ์ข‹์Šต๋‹ˆ๋‹ค. ์งˆ๋ฌธ์ด๋‚˜ ์˜๊ฒฌ์ด ์žˆ์œผ๋ฉด ์–ธ์ œ๋“ ์ง€ ๋ง์”€ํ•ด์ฃผ์„ธ์š”.

  • Okay, got me nervous. ChatGPT

  • ์ดํ•ดํ•ฉ๋‹ˆ๋‹ค. ์ฝ”๋”ฉ ๋™์˜์ƒ์„ ๋ณด๋ฉด์„œ ์กฐ๊ธˆ ๊ธด์žฅ๋˜๊ธฐ๋„ ํ•˜์ฃ . ํ•˜์ง€๋งŒ ์—ฌ๊ธฐ์„œ ์ค‘์š”ํ•œ ๊ฑด ๋‹น์‹ ์˜ ๋…ผ๋ฆฌ๋ฅผ ์ดํ•ดํ•˜๊ณ  ์žˆ์œผ๋‹ˆ ๊ฑฑ์ •ํ•˜์ง€ ์•Š์•„๋„ ๋œ๋‹ค๋Š” ์ ์ž…๋‹ˆ๋‹ค. ํ•จ๊ป˜ ์‚ดํŽด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ๊ณ„์† ์ง„ํ–‰ํ• ๊นŒ์š”?

  • Probably there is. Anyway, this is how the rules are going to look. There's going to be parentheses, and then this line, and then the conclusion down here, and the premises above. So we're sayingโ€ฆ ChatGPT

    • ์ดํ•ดํ–ˆ์Šต๋‹ˆ๋‹ค. ์ด๊ฒƒ์ด ๊ทœ์น™๋“ค์ด ์–ด๋–ป๊ฒŒ ๋ณด์ผ ๊ฒƒ์ธ์ง€์— ๋Œ€ํ•œ ์„ค๋ช…์ด๊ตฐ์š”. ๊ทœ์น™์„ ํŒŒ์•…ํ•˜๋Š” ๋ฐ ๋„์›€์ด ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๊ณ„์† ์ง„ํ–‰ํ•ด ๋ณผ๊นŒ์š”?
  • expression, and the environment, let's call it ends. This is just Rust pattern matching, so end. And the expression is a variable. ChatGPT

    • ๊ทธ๋ ‡๊ตฐ์š”. ๊ทธ๋ฆฌ๊ณ  ์‹์ด ๋ณ€์ˆ˜์ธ ๊ฒฝ์šฐ๋ฅผ ์ฒ˜๋ฆฌํ•˜๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์ด์ œ ๋‹ค๋ฅธ ๊ฒฝ์šฐ๋„ ์‚ดํŽด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.
  • Then I can compute the type by running these steps on top. I'm going to ask the environment to look up the variable x. You see that I put the question mark? That's because, actually, the way it's defined can return

    • 23๋ถ„ 58์ดˆ

์ตœ์‹ ๋‰ด์Šค ๊ธด์ œ๋ชฉ๋“ค ๋”ฐ๋กœ ์ •๋ฆฌ|๐Ÿ”|

  • 250324GeekNews๊ธ€
    • GPU๋Š” CPU๋ณด๋‹ค 10~100๋ฐฐ ๋” ๊ฐ•๋ ฅํ•˜์ง€๋งŒ, ๋™์  ์ž‘์—… ์ฒ˜๋ฆฌ์— ์–ด๋ ค์›€์ด ์žˆ๊ณ  ๋ณ‘๋ ฌ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ๋„๊ตฌ๊ฐ€ ๋ถ€์กฑํ•ด ์ผ๋ฐ˜ ์ž‘์—…์—์„œ ์„ฑ๋Šฅ์„ ์ถฉ๋ถ„ํžˆ ํ™œ์šฉํ•˜์ง€ ๋ชปํ•˜๊ณ  ์žˆ์Œ
    • ๊ณผ๊ฑฐ์— Connection Machine, Cell, Larrabee ๊ฐ™์€ ๋ณ‘๋ ฌ ์ปดํ“จํ„ฐ ๋””์ž์ธ์ด ์žˆ์—ˆ์ง€๋งŒ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ๋ชจ๋ธ์˜ ๋ณต์žก์„ฑ ๋“ฑ์œผ๋กœ ์‹คํŒจํ•จ
    • ํ˜„๋Œ€ GPU๋Š” โ€ฆ

About

Rust GUI Xilem

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages