SlideShare a Scribd company logo
Visual Studio Code
&
2017-04-25
Part B
•
• @senokay @lifthrasiir
• http://mearie.org/
•
•
• Rust, , IOCCC, , IRC , …
…
2014 1 2 3 4 5 6 7 8 9 10 11 12
2015 1 2 3 4 5 6 7 8 9 10 11 12
2016 1 2 3 4 5 6 7 8 9 10 11 12
1 CBT
2 CBT CBT
PC
?
Python
Lua
PHP
Haskell
Rust
C
C++
ML/F#
Perl
Ruby
Java
JavaScript
LISP/Scheme
C#/VB.net
Objective-C
D
Go
Scala
Perl6
Clojure
Dart
Coq/Agda/…
Swift
Julia
FORTRAN
Erlang
Ada
?
?
🌴 Kailua
•
• ,
• Rust
La'aloa Beach County Park, Kailua-Kona, Hawaii © W Nowicki, CC-BY
?
🌴
--# open lua51
--v function(id: int) —> {id = int, name = string, meta = Meta?}
local function build_packet(id)
local p = {}
p.id = id
p.name = to_name(id)
p.aliases = {} --: vector<string>
if has_meta then
local meta = get_meta_from_json(id)
--# assume meta: Meta
p.meta = meta
end
return p
end ( )
1 .
?
!
nil 💩
IDE …
Visual Studio?
• Visual Studio Gideros Studio …
• VS !
• API : MEF, COM (EnvDTE)
• API
• COM … …
Visual Studio Code
•
•
• VS !
• JavaScript TypeScript
2015 1 2 3 4 5 6 7 8 9 10 11 12
2016 1 2 3 4 5 6 7 8 9 10 11 12
2017 1 2 3
VS
VS Code
NDC
VS
!!!
Star Trek: The Next Generation © Paramount Pictures
이승재, 강성훈, 내가 만든 언어의 개발환경을 Visual Studio Code로 빠르고 쉽게 구축하기 #2, NDC2017
VS Code
?
8
Read The Fine Manual
• .
• …
• https://code.visualstudio.com/Docs/extensionAPI/vscode-api

TypeScript
• https://github.com/Microsoft/language-server-protocol

• https://www.bpak.org/blog/?p=2160

( )
IDE
( )
( )
, ( …)
( )
IDE :
• . ( VS Code )
•
• “TM ” 

• .

.
            "name": "invalid.kailua.dangerous"
        },
        "kailua-literal-type": {
            "match": "b(false|nil|true)b",
            "name": "constant.language.lua"
        },
        "kailua-prim-type": {
            "match": "b(any|bool|boolean|int|integer|number|string|table|thread|userdata)b",
            "name": "storage.type.kailua"
        },
        "kailua-keyword": {
            "match": "b(assume|class|const|global|map|method|module|open|static|type|var|vector)b",
            "name": "keyword.control.kailua"
        },
        "kailua-namelike": {
            "match": "(?:b([A-Za-z_]w*)b|`(?:[^`]|.)*`)(?:s*.s*(?:b([A-Za-z_]w*)b|`(?:[^`]|.)*`))*(?=s*[=:])",
            "name": "variable.other.kailua.field-or-argument-or-type-name"
        },
        "kailua-quoted-name": {
            "begin": "`",
            "beginCaptures": {
                "0": {
                    "name": "punctuation.definition.kailua.quoted-name.begin.lua"
                }
            },
            "end": "`|(?=n)",
            "endCaptures": {
                "0": {
                    "name": "punctuation.definition.kailua.quoted-name.end.lua"
                }
            },
            "name": "entity.name.kailua.quoted-name",
            "patterns": [
                {
                    "match": ".",
                    "name": "constant.character.escape.kailua"
                }
            ]
        },
        "kailua-tag": {
            "match": "(?<![)[[^[]]+](?!])",
            "name": "support.type.kailua.tag"
        },
        "kailua-internal-type": {
            "match": "(?<![A-Za-z0-9_`])<.*?>",
.
• ,

.
• …
•
• 

( : )
IDE :
• Language Server .
• ???
TypeScript
IDE :
• Language Server .
•
• → , !
• .
• IDE .
• VS Code
• IDE
• , .
local x = {}
local y = x .. 'string'
.. `{...}` ( ) `"string"`
└ `{...}` ( ) `(number|string)` (10:11)
string
IDE :
• ?
• ,
•
• .
• VS …
IDE : +
• ?
• ,
•
• .
• VS …
• .
IDE : +
• ?
• ,
•
• .
• VS …
• …
🌴 !
IDE
•
•
•
•
• 

• 

•
1 , IDE 2 6 … VS 2 ?
🌴 !
• IDE .
• ? ?

? …
• IDE .
IDE :
• IDE …
• .
•
• ( ) ,
• , .
local x = {a = 3, b = 'string'}
local y = x.
a
b
• .
• partial parsing
• ( )
• .
©
©
https://marketplace.visualstudio.com/items?itemName=devCAT.kailua
https://github.com/devcat-studio/kailua/
이승재, 강성훈, 내가 만든 언어의 개발환경을 Visual Studio Code로 빠르고 쉽게 구축하기 #2, NDC2017
🌴 II
+
v2
• nil …
• nil
• C#
• TypeScript v1
T? nil , .
.
T nil .
nil .
T! nil ( ).
T? . T .
.
• nil !
• ( nil )
• ( ) 

!
• union type ,

nil
•
IDE :
• Spanned<T>
• , Source
• generic …
• SpannedSlotSeq orz
• ,
#[derive(Clone, PartialEq)]
pub struct Sig {
pub attrs: Vec<Spanned<Attr>>,
pub args: Spanned<Seq<TypeSpec<Spanned<ScopedId>>, Varargs>>,
pub returns: Option<Returns>,
}
--v [NO_CHECK]
--v function(x: string, y: int) --> (int, int)
#[derive(Clone, PartialEq)]
pub enum Returns {
Seq(Seq<Spanned<Kind>>),
Never(Span), // a span for `!`
}
IDE :
• (…)
• (Report)
•
• IDE (TypeReport)
•
• … orz
IDE :
• futures-rs ,
• CPU futures-rs I/O
(tokio )
• I/O CPU
•
• Rayon
• 1 . …
--8<-- assume-table
local f = function() end
--# assume f: table
local p = f.index --@< Error: Cannot index `table` without further type information;
specify more detailed type, or use `--# assume` as a last resort
--! error
--8<-- conjunctive-lhs-1
local a = ('string' and 53) + 42
--! ok
--8<-- conjunctive-lhs-2
local a = (53 and 'string') + 42 --@< Error: Cannot apply + operator to `"string"` and `42`
--@^ Cause: `"string"` is not a subtype of `number`
--! error
.
•
• …
• Line coverage path coverage
• cargo-fuzz cargo-fuzz
• /
?
• …
~/Works/git/kailua$ tokei
-------------------------------------------------------------------------------
Language Files Lines Code Comments Blanks
-------------------------------------------------------------------------------
JSON 5 491 491 0 0
Lua 17 8365 2781 4201 1383
Markdown 5 983 983 0 0
Rust 60 29152 22122 3199 3831
TOML 11 304 262 1 41
TypeScript 4 225 161 30 34
-------------------------------------------------------------------------------
Total 102 39520 26800 7431 5289
-------------------------------------------------------------------------------
vs Rust
• . .
• Rust :
• ,
• ,

• Fearless Refactoring
…
• ,
• ( )
• …
• ;
• .
이승재, 강성훈, 내가 만든 언어의 개발환경을 Visual Studio Code로 빠르고 쉽게 구축하기 #2, NDC2017

More Related Content

PDF
강성훈, 마비노기 듀얼 서버, 동적 타입 언어에서 반 정적 타입 언어로의 변신, NDC2016
PDF
ECMAScript 6 im Produktivbetrieb
PDF
詳説WebAssembly
PDF
Java script.trend(spec)
PPTX
OpenResty/Lua 70+ Advanced Programming Skills and Optimization tips
PPTX
es6.concurrency()
PPTX
Rubyslava2102
PDF
Docstringを書こう!
강성훈, 마비노기 듀얼 서버, 동적 타입 언어에서 반 정적 타입 언어로의 변신, NDC2016
ECMAScript 6 im Produktivbetrieb
詳説WebAssembly
Java script.trend(spec)
OpenResty/Lua 70+ Advanced Programming Skills and Optimization tips
es6.concurrency()
Rubyslava2102
Docstringを書こう!

What's hot (8)

PDF
Menguak Misteri Module Bundler
PDF
Comprendre la programmation fonctionnelle, Blend Web Mix le 02/11/2016
KEY
Yapc Asia 2009 ペパボでのPerlの使い方
PDF
淺談編譯器最佳化技術
PDF
Collection pipeline par Mathieu Godart
PDF
C/C++とWebAssemblyを利用したライブラリ開発
PDF
JQuery
PPTX
2014 it - app dev series - 03 - interagire con il database
Menguak Misteri Module Bundler
Comprendre la programmation fonctionnelle, Blend Web Mix le 02/11/2016
Yapc Asia 2009 ペパボでのPerlの使い方
淺談編譯器最佳化技術
Collection pipeline par Mathieu Godart
C/C++とWebAssemblyを利用したライブラリ開発
JQuery
2014 it - app dev series - 03 - interagire con il database
Ad

More from devCAT Studio, NEXON (20)

PPTX
김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019
PPTX
이봄, 스토리텔링으로 즐기는 콘서트 - 시나리오 기획자를 위한 TRPG의 세계, NDC2019
PDF
유인호, <드래곤하운드>비주얼이펙트 연출, NDC2019
PDF
홍성우, 게임 서버의 목차 - 시작부터 출시까지, NDC2019
PPTX
윤석주, 신입 게임 프로그래머가 되는 법 - 넥슨 채용 프로세스 단계별 분석, NDC2019
PDF
이현기, <드래곤하운드> 새로움과의 새로운 싸움, NDC2019
PDF
강성훈, 실버바인 대기열 서버 설계 리뷰, NDC2019
PDF
김호용, 드래곤하운드 비주얼 개발기 - 프로젝트 킥오프부터 현재까지, 아트의 기둥 세우기, NDC2019
PDF
이무림, Enum의 Boxing을 어찌할꼬? 편리하고 성능좋게 Enum 사용하기, NDC2019
PDF
김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019
PDF
전형규, SilvervineUE4Lua: UE4에서 Lua 사용하기, NDC2019
PDF
윤석주, 인하우스 웹 프레임워크 Jul8 제작기, NDC2018
PDF
홍성우, 게임 프로그래머는 어떻게 가르치나요?, NDC2018
PDF
심예람, <프로젝트DH> AI 내비게이션 시스템, NDC2018
PDF
문석진, 프로젝트DH의 절차적 애니메이션 시스템 Ⅱ, NDC2018
PDF
이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018
PDF
모광택, 모바일 TCG 게임의 라이브 서비스에 대한 경험 공유, NDC2018
PDF
전형규, 좋은 이름, 나쁜 이름, 이상한 이름, NDC2018
PDF
백승엽, 매직 더 개더링 20년간의 게임디자인 엿보기, NDC2012
PDF
백승엽, M2프로젝트의 애니메이션 로딩 전략, NDC2011
김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019
이봄, 스토리텔링으로 즐기는 콘서트 - 시나리오 기획자를 위한 TRPG의 세계, NDC2019
유인호, <드래곤하운드>비주얼이펙트 연출, NDC2019
홍성우, 게임 서버의 목차 - 시작부터 출시까지, NDC2019
윤석주, 신입 게임 프로그래머가 되는 법 - 넥슨 채용 프로세스 단계별 분석, NDC2019
이현기, <드래곤하운드> 새로움과의 새로운 싸움, NDC2019
강성훈, 실버바인 대기열 서버 설계 리뷰, NDC2019
김호용, 드래곤하운드 비주얼 개발기 - 프로젝트 킥오프부터 현재까지, 아트의 기둥 세우기, NDC2019
이무림, Enum의 Boxing을 어찌할꼬? 편리하고 성능좋게 Enum 사용하기, NDC2019
김혁, <드래곤 하운드>의 PBR과 레이트레이싱 렌더링 기법, NDC2019
전형규, SilvervineUE4Lua: UE4에서 Lua 사용하기, NDC2019
윤석주, 인하우스 웹 프레임워크 Jul8 제작기, NDC2018
홍성우, 게임 프로그래머는 어떻게 가르치나요?, NDC2018
심예람, <프로젝트DH> AI 내비게이션 시스템, NDC2018
문석진, 프로젝트DH의 절차적 애니메이션 시스템 Ⅱ, NDC2018
이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018
모광택, 모바일 TCG 게임의 라이브 서비스에 대한 경험 공유, NDC2018
전형규, 좋은 이름, 나쁜 이름, 이상한 이름, NDC2018
백승엽, 매직 더 개더링 20년간의 게임디자인 엿보기, NDC2012
백승엽, M2프로젝트의 애니메이션 로딩 전략, NDC2011
Ad

이승재, 강성훈, 내가 만든 언어의 개발환경을 Visual Studio Code로 빠르고 쉽게 구축하기 #2, NDC2017

  • 3. • • @senokay @lifthrasiir • http://mearie.org/ • • • Rust, , IOCCC, , IRC , …
  • 4.
  • 5. 2014 1 2 3 4 5 6 7 8 9 10 11 12 2015 1 2 3 4 5 6 7 8 9 10 11 12 2016 1 2 3 4 5 6 7 8 9 10 11 12 1 CBT 2 CBT CBT PC ?
  • 7. ? ?
  • 8. 🌴 Kailua • • , • Rust La'aloa Beach County Park, Kailua-Kona, Hawaii © W Nowicki, CC-BY ?
  • 9. 🌴 --# open lua51 --v function(id: int) —> {id = int, name = string, meta = Meta?} local function build_packet(id) local p = {} p.id = id p.name = to_name(id) p.aliases = {} --: vector<string> if has_meta then local meta = get_meta_from_json(id) --# assume meta: Meta p.meta = meta end return p end ( )
  • 10. 1 .
  • 12. Visual Studio? • Visual Studio Gideros Studio … • VS ! • API : MEF, COM (EnvDTE) • API • COM … …
  • 13. Visual Studio Code • • • VS ! • JavaScript TypeScript
  • 14. 2015 1 2 3 4 5 6 7 8 9 10 11 12 2016 1 2 3 4 5 6 7 8 9 10 11 12 2017 1 2 3 VS VS Code NDC VS !!! Star Trek: The Next Generation © Paramount Pictures
  • 17. Read The Fine Manual • . • … • https://code.visualstudio.com/Docs/extensionAPI/vscode-api
 TypeScript • https://github.com/Microsoft/language-server-protocol
 • https://www.bpak.org/blog/?p=2160
 ( )
  • 18. IDE ( ) ( ) , ( …) ( )
  • 19. IDE : • . ( VS Code ) • • “TM ” 
 • .
 .
  • 20.             "name": "invalid.kailua.dangerous"         },         "kailua-literal-type": {             "match": "b(false|nil|true)b",             "name": "constant.language.lua"         },         "kailua-prim-type": {             "match": "b(any|bool|boolean|int|integer|number|string|table|thread|userdata)b",             "name": "storage.type.kailua"         },         "kailua-keyword": {             "match": "b(assume|class|const|global|map|method|module|open|static|type|var|vector)b",             "name": "keyword.control.kailua"         },         "kailua-namelike": {             "match": "(?:b([A-Za-z_]w*)b|`(?:[^`]|.)*`)(?:s*.s*(?:b([A-Za-z_]w*)b|`(?:[^`]|.)*`))*(?=s*[=:])",             "name": "variable.other.kailua.field-or-argument-or-type-name"         },         "kailua-quoted-name": {             "begin": "`",             "beginCaptures": {                 "0": {                     "name": "punctuation.definition.kailua.quoted-name.begin.lua"                 }             },             "end": "`|(?=n)",             "endCaptures": {                 "0": {                     "name": "punctuation.definition.kailua.quoted-name.end.lua"                 }             },             "name": "entity.name.kailua.quoted-name",             "patterns": [                 {                     "match": ".",                     "name": "constant.character.escape.kailua"                 }             ]         },         "kailua-tag": {             "match": "(?<![)[[^[]]+](?!])",             "name": "support.type.kailua.tag"         },         "kailua-internal-type": {             "match": "(?<![A-Za-z0-9_`])<.*?>", .
  • 22. IDE : • Language Server . • ???
  • 24. IDE : • Language Server . • • → , ! • .
  • 25. • IDE . • VS Code • IDE • , . local x = {} local y = x .. 'string' .. `{...}` ( ) `"string"` └ `{...}` ( ) `(number|string)` (10:11) string
  • 26. IDE : • ? • , • • . • VS …
  • 27. IDE : + • ? • , • • . • VS … • .
  • 28. IDE : + • ? • , • • . • VS … • …
  • 29. 🌴 ! IDE • • • • • 
 • 
 • 1 , IDE 2 6 … VS 2 ?
  • 30. 🌴 ! • IDE . • ? ?
 ? … • IDE .
  • 31. IDE : • IDE … • . • • ( ) , • , .
  • 32. local x = {a = 3, b = 'string'} local y = x. a b • . • partial parsing • ( ) • .
  • 33. ©
  • 38. v2 • nil … • nil • C# • TypeScript v1
  • 39. T? nil , . . T nil . nil . T! nil ( ). T? . T . .
  • 40. • nil ! • ( nil ) • ( ) 
 ! • union type ,
 nil •
  • 41. IDE : • Spanned<T> • , Source • generic … • SpannedSlotSeq orz • ,
  • 42. #[derive(Clone, PartialEq)] pub struct Sig { pub attrs: Vec<Spanned<Attr>>, pub args: Spanned<Seq<TypeSpec<Spanned<ScopedId>>, Varargs>>, pub returns: Option<Returns>, } --v [NO_CHECK] --v function(x: string, y: int) --> (int, int) #[derive(Clone, PartialEq)] pub enum Returns { Seq(Seq<Spanned<Kind>>), Never(Span), // a span for `!` }
  • 43. IDE : • (…) • (Report) • • IDE (TypeReport) • • … orz
  • 44. IDE : • futures-rs , • CPU futures-rs I/O (tokio ) • I/O CPU • • Rayon
  • 45. • 1 . … --8<-- assume-table local f = function() end --# assume f: table local p = f.index --@< Error: Cannot index `table` without further type information; specify more detailed type, or use `--# assume` as a last resort --! error --8<-- conjunctive-lhs-1 local a = ('string' and 53) + 42 --! ok --8<-- conjunctive-lhs-2 local a = (53 and 'string') + 42 --@< Error: Cannot apply + operator to `"string"` and `42` --@^ Cause: `"string"` is not a subtype of `number` --! error .
  • 46. • • … • Line coverage path coverage • cargo-fuzz cargo-fuzz • / ?
  • 47. • … ~/Works/git/kailua$ tokei ------------------------------------------------------------------------------- Language Files Lines Code Comments Blanks ------------------------------------------------------------------------------- JSON 5 491 491 0 0 Lua 17 8365 2781 4201 1383 Markdown 5 983 983 0 0 Rust 60 29152 22122 3199 3831 TOML 11 304 262 1 41 TypeScript 4 225 161 30 34 ------------------------------------------------------------------------------- Total 102 39520 26800 7431 5289 -------------------------------------------------------------------------------
  • 48. vs Rust • . . • Rust : • , • ,
 • Fearless Refactoring
  • 49. … • , • ( ) • … • ; • .