Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
言語書いてみた話 #学生LT
Search
coord.e
December 09, 2017
Programming
0
410
言語書いてみた話 #学生LT
C++で言語を書いてみた話です。12/9の学生LTでLTしました
coord.e
December 09, 2017
Tweet
Share
More Decks by coord.e
See All by coord.e
いい感じのCコンパイラを作る (seccamp19)
coorde
0
1.5k
Other Decks in Programming
See All in Programming
設計の知識と技能で駆動するソフトウェア開発
masuda220
PRO
18
11k
孤独のCTOグルメという やや奇抜な企画をやった目的と効果
shoheimitani
3
1k
Why 1 + 1 = 2 in Swift?
1plus4
1
250
object-oriented-conference-2024
fuwasegu
6
2k
incrementalモデルの理解を深める
ikkimiyazaki
2
640
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
530
TCAの Shared Stateって どういう仕組みになってんの?
yimajo
0
330
OpenAPI を守るのは難しい
ohmori_yusuke
1
140
デザインシステムで Tailwind CSSとCSS in JSに分散投資をしたら良かった話
fsubal
14
3.5k
Open Source Swiftc Workshop
kitasuke
1
290
生成 AI の中身を覗いてみよう〜基礎から医療現場での応用まで〜
soh9834
2
770
実践!RDRAを活用した既存システムの仕様変更 / Specification Changes in Existing Systems Utilizing RDRA
imamotohikaru
0
2.8k
Featured
See All Featured
Code Review Best Practice
trishagee
54
15k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
14
1.3k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
39
4.3k
The MySQL Ecosystem @ GitHub 2015
samlambert
242
12k
Designing Experiences People Love
moore
135
23k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
124
32k
Fashionably flexible responsive web design (full day workshop)
malarkey
397
65k
YesSQL, Process and Tooling at Scale
rocio
160
13k
Become a Pro
speakerdeck
PRO
8
4.4k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
5
1.4k
The Cult of Friendly URLs
andyhume
73
5.6k
Debugging Ruby Performance
tmm1
68
11k
Transcript
Think less, write more. A statically-typed functional programming language with
powerful objective syntax > 鎉铂剅ְג鑧
ࢲ… About me ▪ $ FS ▪ \'SPOU #BDL^FOE+4ͨ·ʹ ▪
ϚΠίϯɾిࢠ࡞ \1*$ "SEVJOP &EJTPO^ ▪ !DPPSE@F DPPSEF ▪ ϩϘοτͭ͘Γ·ͤΜ͔ XXXZNPEJGZPSH !ZNPEJGZ :NPEJGZ ŢŖŲƅŽŲƅŽŕš-
About scopion (ͳʹͦΕ)
ςʔϚ: Think less, Write more. ߟ͑ͣʹͨ͘͞Μॻ͚Δݴޠ
ϓϩάϥϛϯάɺ͖Ͱ͔͢ Do you like programming? ͖ ͚ͩͲ ͨ·ʹ ͩΔ͍
scopionͳΒ… (1/2) ▪ ܕΛॻ͘ͷ͕ΊΜͲ͍͘͞ ˠ ܕਪ ▪ ม໊Λߟ͑Δͷ͕ͩΔ͍ ˠ ༧ޠͷഉআ
▪ ؔͷ෭࡞༻Λҙࣝ͢Δͷ͕ͩΔ͍ ˠ ͦΜͳͷͳ͍ (ࢀরಁա) Features (1/2)
scopionͳΒ… (2/2) ▪ ಈతܕ͚/ΠϯλϓϦλ͍ ˠ ੩తܕ͚/ίϯύΠϥ ▪ ΦϒδΣΫτࢦ͕͍͍ ˠ Ͳ͏ͧ(?)
▪ CݴޠͷϥΠϒϥϦ͕͍͍ͨ ˠ Ͳ͏ͧ Features (2/2)
1 (argc, argv){ 2 /* CϔομͷಡΈࠐΈ */ 3 io =
@import#c:stdio.h; 4 lib = @import#c:stdlib.h; 5 math = @import#c:math.h; 6 7 argc > 2 ? { // ݅ذ 8 base = lib.atof(argv[1]); 9 exp = lib.atof(argv[2]); 10 io.printf("%f^%f = %f\n", base, exp, math.pow(base, exp)); 11 |> 0; // return 12 } : { 13 io.printf("Invaild argument!\n"); 14 |> -1; 15 }; 16 }
❯ scopc pow.scc –o pow ❯ ./pow 3 2 3.000000^2.000000
= 9.000000 ❯ ./pow 2 10 2.000000^10.000000 = 1024.000000
Construction ߏ ύʔα τϥϯεϨʔλ *3ίϯύΠϥ จ๏ʹैͬͯ۠Γ σʔλߏ "45 ʹ ม͢Δ
"45͔ΒҙຯΛղੳ͠ ͦΕʹԠͯ͡ɺதؒݴ ޠ --7.*3 ʹ༁͢Δ தؒݴޠ --7.*3 ͔Βػցޠʹ༁ ͢Δ ΑΓίϯϐϡʔλʔʹΘ͔Γ͍͢දݱ༁͍ͯ͘͠ ιʔείʔυ ࣮ߦՄೳ ϑΝΠϧ scopc compiler ࢲ੍͕࡞ͨ͠෦ By LLVM ›_
WebαΠτ Website
ΦϯϥΠϯίϯύΠϥ online compiler
ͥͻ͓ࢼ͍ͩ͘͠͞ Feel free to try it out scopion.coord-e.com
Construction ߏ
ߏ ▪ ੩తαΠτ෦babel+sass+webpackΛ༻͍ES6 & SCSS ▪ ίϯύΠϧٴͼ࣮ߦϦιʔεͷ੍ݶ͞ΕͨDockerίϯςφͰߦΘΕ ͦͷίϯςφ1࣮ߦ͝ͱʹੜ/ഁغ͞ΕΔͨΊ҆શ ▪ αʔόʔʹnode.js+express.jsΛ༻͍ɺ
͍ͭͰʹLet’s encryptΛ༻͍ͯhttpsʹରԠͤͨ͞ ▪ t2.microͰ༨༟ ▪ coord-e/scopion-website Construction
ͦͷଞ Misc
Q: RustͰΑ͘ͳ͍? A: Θ͔Δ
͜Ε͔Β ▪ ·ͱͳܕγεςϜ ▪ ඪ४ϥΠϒϥϦΛॻ͘ ▪ ᘳͳίϯύΠϧ࣌ॲཧ ▪ ෦ద༻ ▪
ύλʔϯϚον ▪ Nullable TODO
࠷ޙʹݴ͍͍ͨ͜ͱ What I wanna say
ݴޠ࡞Ζ͏
Boost.Spirit.X3ͱLLVMͷίϯϘ͕ᖵ྾Ρ! ͍͍࣌
Boost.Spirit.X3 &#/'Λιʔεʹॻ͍͍ͯΔ৺ ͍͢͝ύʔα auto const mul_expr_def = pow_expr[detail::assign] >> *(("*"
> pow_expr)[detail::assign_op<ast::mul, 2>] | ("/" > pow_expr)[detail::assign_op<ast::div, 2>]); auto const add_expr_def = mul_expr[detail::assign] >> *(("+" > mul_expr)[detail::assign_op<ast::add, 2>] | ("-" > mul_expr)[detail::assign_op<ast::sub, 2>] | ("%" > mul_expr)[detail::assign_op<ast::rem, 2>]);
LLVM ๛ͳ"1*ΛΈ߹Θ͍͚ͤͯͩ͘ ࠷ڧͷίϯύΠϥج൫ llvm::IRBuilder<> builder; builder.CreateAdd(builder.getInt32(1), builder.getInt32(2)) // -> 1+2
ϓϧϦΫ͍ͩ͘͞ ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠! by @coord_e <
[email protected]
> https://github.com/coord-e/scopion