SlideShare a Scribd company logo
How to make
the calculator
.NET FRINGE JAPAN 2018 KOUJI MATSUI (@KEKYO2)
2
Kouji Matsui - kekyo
• NAGOYA city, AICHI pref., JP
• Twitter – @kekyo2 / Facebook
• ux-spiral corporation
• Microsoft Most Valuable Professional VS
and DevTech 2015-
• Certified Scrum master / Scrum product
owner
• Center CLR organizer.
• .NET/C#/F#/IL/metaprogramming or
like…
• Bike rider
CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
3
Agenda
• Introduction
• Operator notations
• Demo
• Conclusion
CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
4
How bring
up about
the
calculator?
CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI
MATSUI
HP16C (RPN)
5
Operator notations
• Operator notation variation:
CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
Polish notation
(PN)
“+ 123 456”
Infix notation
“123 + 456”
Reverse polish notation
(RPN)
“123 456 +”
6
Operator notations
• Polish notation (PN):
• Operator first
• Trailing two values and more
CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
“+ 123 456”
“* + 123 456 789”
 123 + 456
 (123 + 456) * 789
7
Operator notations
CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
(* (+ 123 456) 789)
(* (+ 123 456) (- 11 22))
“* + 123 456 789”
“* + 123 456 - 11 22”
8
Operator notations
• Parse and construct AST easier
CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
“+ 123 456”
+ 123
456
9
Operator notations
CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
AbstractNode
OperatorNode
ReducibleNode
NumericNode
ExpressionNodeReduce()
10
Operator notations
CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
“+ 123 456”
+ 123
456OperatorNode
NumericNode
NumericNode
ExpressionNode
11
Operator notations
CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
+ 123
456
“* + 123 456 789”
*
789
ExpressionNode
ExpressionNode
• Nested nodes
12
Operator notations
• Reduce() “Beta reduction”
CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
+ 123
456
*
789
return 123
return 456
return 123+456
return 789
return 579*789
456831
13
Demo
CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
14
CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
Making archive
IL2C
#6-52
2018.1.27 CENTER CLR VIDEO #6-52
.NET Fringe Japan 2018 New Year Party
- Kouji Matsui (@kekyo2)
再放送
15
Between dotnet600 and fringe2018
• Will slow down (but better incremental development)
• System.String turn to use UTF16LE
• Take down concurrent GC support (bad) code elements.
• Flow analyzer causes detecting bad path.
• Flow path may constructs randomly.
• Stack analyzer causes matching bad path.
• Support derived class type and can handle virtual/abstract/override
methods.  AbstractNode and ASTs
• Tested on UEFI environments (The demo).
CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
16
Derived class type
Current version not supported cast operator and exceptions.
◦ Transleted to C language: can’t detect invalid pointer conversion.
Virtual methods:
◦ We have to support vtable/vptr or other technics.
◦ IL2C already has type-information structure. I use it storage by store
function pointers into side-by-side.
◦ Lookup vtable at runtime (likely C++).
CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
17
Conclusion
• Polish notation – easyway parsing expressions.
• IL2C now UEFI, WDM, Win32, Arduino
• We’ll be making IL2C on multi-platform
• IL2C is under construction.
• Primitive types.
• String
• Class / ValueType / Boxing
• Polymorphism (by class)
• GC (non concurrent)
• P/Invoke (basic)
CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
Playlist: http://bit.ly/2xtu4MH
GitHub: https://github.com/kekyo/IL2C
18
Thank you joining my session!!
• Become slides on slideshare and my blog entry.
http://www.kekyo.net/ (Sorry blog only Japanese language)
• My twitter account @kekyo2, follow <3
• GitHub https://github.com/kekyo/ contains:
• IL2C, FusionTasks, RelaxVersioner, fscx and more…
• Open conference with “Center CLR” in Aichi
pref., Japan! Join us!!
https://www.meetup.com/en-US/CenterCLR/
CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI

More Related Content

PDF
osvehicle-connected-20160429
ODP
Introduction To The Eclipse Platform
PDF
SFScon19 - Marvin W - MicroG – what it is and where it’s going
PDF
RISC-V Summit 2019: Next-generation IDE for your RISC-V Product in 20 Minutes
PDF
The internet of things in now , see how golang is a part of this evolution
PDF
OpenHW TV S2 E04: Software Task Group Project Updates
PPTX
Tizen OS
PDF
Building the IoT - Coding Serbia 2015
osvehicle-connected-20160429
Introduction To The Eclipse Platform
SFScon19 - Marvin W - MicroG – what it is and where it’s going
RISC-V Summit 2019: Next-generation IDE for your RISC-V Product in 20 Minutes
The internet of things in now , see how golang is a part of this evolution
OpenHW TV S2 E04: Software Task Group Project Updates
Tizen OS
Building the IoT - Coding Serbia 2015

What's hot (20)

PDF
Iotivity atmel-20150328rzr
PPTX
WebRTC From Asterisk to Headline - MoNage
PPTX
Mobile CICD
PDF
SthlmWebRTC #1 :: OpenWEBRTC introduction
PDF
Flogo - A Golang-powered Open Source IoT Integration Framework (Gophercon)
PDF
Resin.io overview (2016 July)
PDF
Open Source Internet of Things 101 – EclipseCon 2016
PDF
Windows 10 IoT Core, a real sample
PPTX
The Things Network Madrid
PPTX
6 Months of WebRTC in 10 minutes
PDF
SFScon 2020 - Reto Schneider - Outsourcing to Open Source
PDF
Digital Forensics and Incident Response (DFIR) using Docker Containers
PDF
Видео+Конференция 2015: Секреты WebRTC: как вендоры извлекают пользу из проры...
PDF
Develop, deploy and manage your IoT Fleet with Balena - IoT Portugal Meetup
PDF
Astricon WebRTC Update
PDF
Eclipse IoT presentation
PDF
aframe-webthing-20190710
PDF
Pushing the hassle from production to developers. Easily
PPTX
Node-RED Installer, Standalone Installer using Electron
PPTX
Demo kinect & web sockets
Iotivity atmel-20150328rzr
WebRTC From Asterisk to Headline - MoNage
Mobile CICD
SthlmWebRTC #1 :: OpenWEBRTC introduction
Flogo - A Golang-powered Open Source IoT Integration Framework (Gophercon)
Resin.io overview (2016 July)
Open Source Internet of Things 101 – EclipseCon 2016
Windows 10 IoT Core, a real sample
The Things Network Madrid
6 Months of WebRTC in 10 minutes
SFScon 2020 - Reto Schneider - Outsourcing to Open Source
Digital Forensics and Incident Response (DFIR) using Docker Containers
Видео+Конференция 2015: Секреты WebRTC: как вендоры извлекают пользу из проры...
Develop, deploy and manage your IoT Fleet with Balena - IoT Portugal Meetup
Astricon WebRTC Update
Eclipse IoT presentation
aframe-webthing-20190710
Pushing the hassle from production to developers. Easily
Node-RED Installer, Standalone Installer using Electron
Demo kinect & web sockets
Ad

Similar to How to make the calculator (20)

PDF
Functional concepts in C#
PDF
C# 10 in a Nutshell_ The Definitive Reference-O'Reilly Media (2022).pdf
PDF
Functional Programming in C# and F#
PPTX
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
PDF
Stale pointers are the new black - white paper
DOC
10266 developing data access solutions with microsoft visual studio 2010
PDF
Beachhead implements new opcode on CLR JIT
PPTX
Skillwise - Enhancing dotnet app
PPT
DotNet Introduction
PPT
Csharp4 operators and_casts
PPT
Chapter 1 Presentation
PDF
Static analysis should be used regularly
PPT
Dotnetintroduce 100324201546-phpapp02
PPTX
19csharp
PPTX
PDF
SEC5261_SAT_Week08_Spring22.pdf
PDF
The F# Path to Relaxation
PPTX
Operators & Casts
PPTX
Good functional programming is good programming
PDF
Analysis of Microsoft Code Contracts
Functional concepts in C#
C# 10 in a Nutshell_ The Definitive Reference-O'Reilly Media (2022).pdf
Functional Programming in C# and F#
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Stale pointers are the new black - white paper
10266 developing data access solutions with microsoft visual studio 2010
Beachhead implements new opcode on CLR JIT
Skillwise - Enhancing dotnet app
DotNet Introduction
Csharp4 operators and_casts
Chapter 1 Presentation
Static analysis should be used regularly
Dotnetintroduce 100324201546-phpapp02
19csharp
SEC5261_SAT_Week08_Spring22.pdf
The F# Path to Relaxation
Operators & Casts
Good functional programming is good programming
Analysis of Microsoft Code Contracts
Ad

More from Kouji Matsui (20)

PDF
パターンでわかる! .NET Coreの非同期処理
PDF
Making archive IL2C #6-55 dotnet600 2018
PDF
Matrix signal controller and BrainPad overview
PDF
Fun with BrainPad
PDF
What's Functional?
PDF
Pitfall for WioLTE
PDF
Write common, run anywhere
PDF
Locality of Reference
PDF
Nespのコード生成
PDF
C#でわかる こわくないMonad
PDF
You will be assimilated. Resistance is futile.
PDF
How to meets Async and Task
PDF
Async deepdive before de:code
PDF
Thread affinity and CPS
PDF
Async DeepDive basics
PDF
continuatioN Linking
PDF
真Intermediate languageのキホン
PDF
.NET Coreから概観する.NETのOSSへの取り組み
PDF
Win32 APIをてなずけよう
PDF
式の体を成して無い式を式の体を成すように式と式木で何とかする式
パターンでわかる! .NET Coreの非同期処理
Making archive IL2C #6-55 dotnet600 2018
Matrix signal controller and BrainPad overview
Fun with BrainPad
What's Functional?
Pitfall for WioLTE
Write common, run anywhere
Locality of Reference
Nespのコード生成
C#でわかる こわくないMonad
You will be assimilated. Resistance is futile.
How to meets Async and Task
Async deepdive before de:code
Thread affinity and CPS
Async DeepDive basics
continuatioN Linking
真Intermediate languageのキホン
.NET Coreから概観する.NETのOSSへの取り組み
Win32 APIをてなずけよう
式の体を成して無い式を式の体を成すように式と式木で何とかする式

Recently uploaded (20)

PPTX
ai tools demonstartion for schools and inter college
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
medical staffing services at VALiNTRY
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Understanding Forklifts - TECH EHS Solution
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Nekopoi APK 2025 free lastest update
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
Introduction to Artificial Intelligence
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
System and Network Administraation Chapter 3
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
System and Network Administration Chapter 2
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
L1 - Introduction to python Backend.pptx
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
CHAPTER 2 - PM Management and IT Context
ai tools demonstartion for schools and inter college
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
medical staffing services at VALiNTRY
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Understanding Forklifts - TECH EHS Solution
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Nekopoi APK 2025 free lastest update
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Introduction to Artificial Intelligence
Odoo Companies in India – Driving Business Transformation.pdf
System and Network Administraation Chapter 3
Which alternative to Crystal Reports is best for small or large businesses.pdf
System and Network Administration Chapter 2
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Odoo POS Development Services by CandidRoot Solutions
L1 - Introduction to python Backend.pptx
2025 Textile ERP Trends: SAP, Odoo & Oracle
CHAPTER 2 - PM Management and IT Context

How to make the calculator

  • 1. How to make the calculator .NET FRINGE JAPAN 2018 KOUJI MATSUI (@KEKYO2)
  • 2. 2 Kouji Matsui - kekyo • NAGOYA city, AICHI pref., JP • Twitter – @kekyo2 / Facebook • ux-spiral corporation • Microsoft Most Valuable Professional VS and DevTech 2015- • Certified Scrum master / Scrum product owner • Center CLR organizer. • .NET/C#/F#/IL/metaprogramming or like… • Bike rider CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
  • 3. 3 Agenda • Introduction • Operator notations • Demo • Conclusion CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
  • 4. 4 How bring up about the calculator? CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI HP16C (RPN)
  • 5. 5 Operator notations • Operator notation variation: CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI Polish notation (PN) “+ 123 456” Infix notation “123 + 456” Reverse polish notation (RPN) “123 456 +”
  • 6. 6 Operator notations • Polish notation (PN): • Operator first • Trailing two values and more CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI “+ 123 456” “* + 123 456 789”  123 + 456  (123 + 456) * 789
  • 7. 7 Operator notations CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI (* (+ 123 456) 789) (* (+ 123 456) (- 11 22)) “* + 123 456 789” “* + 123 456 - 11 22”
  • 8. 8 Operator notations • Parse and construct AST easier CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI “+ 123 456” + 123 456
  • 9. 9 Operator notations CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI AbstractNode OperatorNode ReducibleNode NumericNode ExpressionNodeReduce()
  • 10. 10 Operator notations CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI “+ 123 456” + 123 456OperatorNode NumericNode NumericNode ExpressionNode
  • 11. 11 Operator notations CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI + 123 456 “* + 123 456 789” * 789 ExpressionNode ExpressionNode • Nested nodes
  • 12. 12 Operator notations • Reduce() “Beta reduction” CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI + 123 456 * 789 return 123 return 456 return 123+456 return 789 return 579*789 456831
  • 13. 13 Demo CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
  • 14. 14 CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI Making archive IL2C #6-52 2018.1.27 CENTER CLR VIDEO #6-52 .NET Fringe Japan 2018 New Year Party - Kouji Matsui (@kekyo2) 再放送
  • 15. 15 Between dotnet600 and fringe2018 • Will slow down (but better incremental development) • System.String turn to use UTF16LE • Take down concurrent GC support (bad) code elements. • Flow analyzer causes detecting bad path. • Flow path may constructs randomly. • Stack analyzer causes matching bad path. • Support derived class type and can handle virtual/abstract/override methods.  AbstractNode and ASTs • Tested on UEFI environments (The demo). CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
  • 16. 16 Derived class type Current version not supported cast operator and exceptions. ◦ Transleted to C language: can’t detect invalid pointer conversion. Virtual methods: ◦ We have to support vtable/vptr or other technics. ◦ IL2C already has type-information structure. I use it storage by store function pointers into side-by-side. ◦ Lookup vtable at runtime (likely C++). CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI
  • 17. 17 Conclusion • Polish notation – easyway parsing expressions. • IL2C now UEFI, WDM, Win32, Arduino • We’ll be making IL2C on multi-platform • IL2C is under construction. • Primitive types. • String • Class / ValueType / Boxing • Polymorphism (by class) • GC (non concurrent) • P/Invoke (basic) CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI Playlist: http://bit.ly/2xtu4MH GitHub: https://github.com/kekyo/IL2C
  • 18. 18 Thank you joining my session!! • Become slides on slideshare and my blog entry. http://www.kekyo.net/ (Sorry blog only Japanese language) • My twitter account @kekyo2, follow <3 • GitHub https://github.com/kekyo/ contains: • IL2C, FusionTasks, RelaxVersioner, fscx and more… • Open conference with “Center CLR” in Aichi pref., Japan! Join us!! https://www.meetup.com/en-US/CenterCLR/ CC-BY-SA 4.0 COPYRIGHT (C) 2016 KOUJI MATSUI