Successfully reported this slideshow.
Your SlideShare is downloading. ×

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

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 50 Ad
Advertisement

More Related Content

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

Advertisement

More from devCAT Studio, NEXON (20)

Recently uploaded (20)

Advertisement

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

  1. 1. Visual Studio Code & 2017-04-25
  2. 2. Part B
  3. 3. • • @senokay @lifthrasiir • http://mearie.org/ • • • Rust, , IOCCC, , IRC , …
  4. 4.
  5. 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 ?
  6. 6. 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
  7. 7. ? ?
  8. 8. 🌴 Kailua • • , • Rust La'aloa Beach County Park, Kailua-Kona, Hawaii © W Nowicki, CC-BY ?
  9. 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. 10. 1 .
  11. 11. ? ! nil 💩 IDE …
  12. 12. Visual Studio? • Visual Studio Gideros Studio … • VS ! • API : MEF, COM (EnvDTE) • API • COM … …
  13. 13. Visual Studio Code • • • VS ! • JavaScript TypeScript
  14. 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
  15. 15. VS Code ? 8
  16. 16. 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
 ( )
  17. 17. IDE ( ) ( ) , ( …) ( )
  18. 18. IDE : • . ( VS Code ) • • “TM ” 
 • .
 .
  19. 19.             "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_`])<.*?>", .
  20. 20. • ,
 . • … • • 
 ( : )
  21. 21. IDE : • Language Server . • ???
  22. 22. TypeScript
  23. 23. IDE : • Language Server . • • → , ! • .
  24. 24. • IDE . • VS Code • IDE • , . local x = {} local y = x .. 'string' .. `{...}` ( ) `"string"` └ `{...}` ( ) `(number|string)` (10:11) string
  25. 25. IDE : • ? • , • • . • VS …
  26. 26. IDE : + • ? • , • • . • VS … • .
  27. 27. IDE : + • ? • , • • . • VS … • …
  28. 28. 🌴 ! IDE • • • • • 
 • 
 • 1 , IDE 2 6 … VS 2 ?
  29. 29. 🌴 ! • IDE . • ? ?
 ? … • IDE .
  30. 30. IDE : • IDE … • . • • ( ) , • , .
  31. 31. local x = {a = 3, b = 'string'} local y = x. a b • . • partial parsing • ( ) • .
  32. 32. ©
  33. 33. © https://marketplace.visualstudio.com/items?itemName=devCAT.kailua
  34. 34. https://github.com/devcat-studio/kailua/
  35. 35. 🌴 II +
  36. 36. v2 • nil … • nil • C# • TypeScript v1
  37. 37. T? nil , . . T nil . nil . T! nil ( ). T? . T . .
  38. 38. • nil ! • ( nil ) • ( ) 
 ! • union type ,
 nil •
  39. 39. IDE : • Spanned<T> • , Source • generic … • SpannedSlotSeq orz • ,
  40. 40. #[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 `!` }
  41. 41. IDE : • (…) • (Report) • • IDE (TypeReport) • • … orz
  42. 42. IDE : • futures-rs , • CPU futures-rs I/O (tokio ) • I/O CPU • • Rayon
  43. 43. • 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 .
  44. 44. • • … • Line coverage path coverage • cargo-fuzz cargo-fuzz • / ?
  45. 45. • … ~/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 -------------------------------------------------------------------------------
  46. 46. vs Rust • . . • Rust : • , • ,
 • Fearless Refactoring
  47. 47. … • , • ( ) • … • ; • .

×