EZRust: Z80 for the Web

L
@stillinbeta // @brooklyn_js July 2019
EZ-rust
Z80 for the web
@stillinbeta // @brooklyn_js July 2019
@stillinbeta // @brooklyn_js July 2019
@stillinbeta // @brooklyn_js July 2019
What’s this Rust thing all about?
@stillinbeta // @brooklyn_js July 2019
The Borrow Checker
@stillinbeta // @brooklyn_js July 2019
Let’s talk about
Garbage Collection
@stillinbeta // @brooklyn_js July 2019
C, C++, etc: #yolo
@stillinbeta // @brooklyn_js July 2019
Here’s some memory.
Free it when you’re done
Whatever, MOM
@stillinbeta // @brooklyn_js July 2019
Javascript, Go, Python, etc:
are we there yet?
@stillinbeta // @brooklyn_js July 2019
You done with that?
No
You done with that?
No
@stillinbeta // @brooklyn_js July 2019
Rust: Chain of Custody
@stillinbeta // @brooklyn_js July 2019
This memory is yours
K
thnx
All Done
@stillinbeta // @brooklyn_js July 2019
Checked at Compile Time!
@stillinbeta // @brooklyn_js July 2019
Some other stuff
● Great ecosystem
● Cute mascot
● Really productive or something
● Basically Haskell but practical
@stillinbeta // @brooklyn_js July 2019
@stillinbeta // @brooklyn_js July 2019
Tell me about the Z80!
@stillinbeta // @brooklyn_js July 2019
https://upload.wikimedia.org/wikipedia/commons/1/19/Zilog_Z80.jpg
@stillinbeta // @brooklyn_js July 2019
80 Fast 80 Furious
https://upload.wikimedia.org/wikipedia/commons/3/3a/KL_Intel_i8080_Black_Background.jpg
@stillinbeta // @brooklyn_js July 2019
https://upload.wikimedia.org/wikipedia/commons/3/33/ZXSpectrum48k.jpg
@stillinbeta // @brooklyn_js July 2019
https://commons.wikimedia.org/wiki/File:Ti83-plus-silver.png
@stillinbeta // @brooklyn_js July 2019
https://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/Game-Boy-FL.jpg/800px-Game-Boy-FL.jpg
@stillinbeta // @brooklyn_js July 2019
zeerust
@stillinbeta // @brooklyn_js July 2019
http://www.imagineeringdisney.com/blog/2009/12/16/horizons-mural-the-prologue-and-the-promise-high-res.html
@stillinbeta // @brooklyn_js July 2019
z80 + rust
@stillinbeta // @brooklyn_js July 2019
@stillinbeta // @brooklyn_js July 2019
Zeerust?
● Z80 Emulator
● Written in Rust
● (Mostly) complete
@stillinbeta // @brooklyn_js July 2019
Zeerust demo
@stillinbeta // @brooklyn_js July 2019
But what if... internet
@stillinbeta // @brooklyn_js July 2019
@stillinbeta // @brooklyn_js July 2019
Like assembly, but make it internet
@stillinbeta // @brooklyn_js July 2019
@stillinbeta // @brooklyn_js July 2019
All major browsers*!.
@stillinbeta // @brooklyn_js July 2019
@stillinbeta // @brooklyn_js July 2019
cargo install cargo-web
@stillinbeta // @brooklyn_js July 2019
cargo web start
@stillinbeta // @brooklyn_js July 2019
Z80 Assembly ld B, 9
get_local 1
i32.load8_u offset=0 align=1
tee_local 3
i32.const 1
....
and %r14d,%ecx
mov %rcx,%rsi
shl $0x4,%rsi
lea (%rbx,%rsi,1),%r13
...
@stillinbeta // @brooklyn_js July 2019
https://en.wikipedia.org/wiki/Turtles_all_the_way_down#/media/File:River_terrapin.jpg
@stillinbeta // @brooklyn_js July 2019
And we’re all done!
@stillinbeta // @brooklyn_js July 2019
rust compiles to wasm,
but browsers speak html
@stillinbeta // @brooklyn_js July 2019
React
● Very popular
● Lots of support
● Good life skill
● javascript
@stillinbeta // @brooklyn_js July 2019
React
● Very popular
● Lots of support
● Good life skill
● javascript
Angular
● Even more popular!
● Backed by Google
● Excellent tooling
● javascript
@stillinbeta // @brooklyn_js July 2019
React
● Very popular
● Lots of support
● Good life skill
● Javascript
Angular
● Even more popular!
● Backed by Google
● Excellent tooling
● Javascript
Yew
● Totally unknown
● Maybe abandoned
● No documentation
● Rust
@stillinbeta // @brooklyn_js July 2019
guess what I picked
@stillinbeta // @brooklyn_js July 2019
So Yew is Cool!
@stillinbeta // @brooklyn_js July 2019
html! {
<div class={"register-8"},>
<strong>{ format!("{}:", self.label) }</strong>
<code>{ format!("{:02x}", self.value) }</code>
</div>
}
@stillinbeta // @brooklyn_js July 2019
pub enum CPUCommand {
Step,
Run,
Reset,
ShowMemory(bool),
LoadProgram(&'static [u8]),
}
@stillinbeta // @brooklyn_js July 2019
html! {
<div id={ "buttons" },>
<button onclick=|_| CPUCommand::Step,> { "Step" } </button>
<button onclick=|_| CPUCommand::Run,> { "Run" } </button>
<button onclick=|_| CPUCommand::Reset,> { "Reset" } </button>
</div>
}
@stillinbeta // @brooklyn_js July 2019
fn update(&mut self, msg: Self::Message) -> ShouldRender {
match msg {
CPUCommand::Step => self.machine.z80.step(),
CPUCommand::Run => self.machine.z80.run(),
CPUCommand::ShowMemory(b) => self.show_memory = b,
}
}
}
@stillinbeta // @brooklyn_js July 2019
And then... CSS happened
@stillinbeta // @brooklyn_js July 2019
CSS Grids
Are harder
than
they
look
@stillinbeta // @brooklyn_js July 2019
CSS
is harder
than
it
looks
@stillinbeta // @brooklyn_js July 2019
Gra󰈥󰈋󰈎c 󰇷󰇵󰈼ig󰈝 󰈎󰈼 m󰉘 󰈦as󰈻󰈎󰈢󰈞
@stillinbeta // @brooklyn_js July 2019
But we got there
@stillinbeta // @brooklyn_js July 2019
@stillinbeta // @brooklyn_js July 2019
whoops, no javascript ;)
@stillinbeta // @brooklyn_js July 2019
zeerust.stillinbeta.com
Thank you!
@stillinbeta // @brooklyn_js July 2019
1 of 57

Recommended

Web Archives at the Nexus of Good Fakes and Flawed Originals by
Web Archives at the Nexus of Good Fakes and Flawed OriginalsWeb Archives at the Nexus of Good Fakes and Flawed Originals
Web Archives at the Nexus of Good Fakes and Flawed OriginalsMichael Nelson
5.9K views103 slides
It's 2019 & I'm still using Python 2! Should I be worried? by
It's 2019 & I'm still using Python 2! Should I be worried?It's 2019 & I'm still using Python 2! Should I be worried?
It's 2019 & I'm still using Python 2! Should I be worried?Sebastian Witowski
4.7K views117 slides
Sharing of demuxed 2019 by
Sharing of demuxed 2019Sharing of demuxed 2019
Sharing of demuxed 2019Neal Tsai
48 views38 slides
OSC2019_Tokyo_Spring_スポンサーLT by
 OSC2019_Tokyo_Spring_スポンサーLT OSC2019_Tokyo_Spring_スポンサーLT
OSC2019_Tokyo_Spring_スポンサーLT虎の穴 開発室
30 views15 slides
You got database in my cloud! by
You got database  in my cloud!You got database  in my cloud!
You got database in my cloud!Liz Frost
207 views80 slides
Kubernetes from a Box Mix by
Kubernetes from a Box MixKubernetes from a Box Mix
Kubernetes from a Box MixLiz Frost
304 views74 slides

More Related Content

Recently uploaded

Object Oriented Programming with JAVA by
Object Oriented Programming with JAVAObject Oriented Programming with JAVA
Object Oriented Programming with JAVADemian Antony D'Mello
95 views28 slides
Design and analysis of a new undergraduate Computer Engineering degree – a me... by
Design and analysis of a new undergraduate Computer Engineering degree – a me...Design and analysis of a new undergraduate Computer Engineering degree – a me...
Design and analysis of a new undergraduate Computer Engineering degree – a me...WaelBadawy6
53 views4 slides
Literature review and Case study on Commercial Complex in Nepal, Durbar mall,... by
Literature review and Case study on Commercial Complex in Nepal, Durbar mall,...Literature review and Case study on Commercial Complex in Nepal, Durbar mall,...
Literature review and Case study on Commercial Complex in Nepal, Durbar mall,...AakashShakya12
57 views115 slides
String.pptx by
String.pptxString.pptx
String.pptxAnanthi Palanisamy
47 views24 slides
Investor Presentation by
Investor PresentationInvestor Presentation
Investor Presentationeser sevinç
20 views26 slides
13_DVD_Latch-up_prevention.pdf by
13_DVD_Latch-up_prevention.pdf13_DVD_Latch-up_prevention.pdf
13_DVD_Latch-up_prevention.pdfUsha Mehta
10 views16 slides

Recently uploaded(20)

Design and analysis of a new undergraduate Computer Engineering degree – a me... by WaelBadawy6
Design and analysis of a new undergraduate Computer Engineering degree – a me...Design and analysis of a new undergraduate Computer Engineering degree – a me...
Design and analysis of a new undergraduate Computer Engineering degree – a me...
WaelBadawy653 views
Literature review and Case study on Commercial Complex in Nepal, Durbar mall,... by AakashShakya12
Literature review and Case study on Commercial Complex in Nepal, Durbar mall,...Literature review and Case study on Commercial Complex in Nepal, Durbar mall,...
Literature review and Case study on Commercial Complex in Nepal, Durbar mall,...
AakashShakya1257 views
13_DVD_Latch-up_prevention.pdf by Usha Mehta
13_DVD_Latch-up_prevention.pdf13_DVD_Latch-up_prevention.pdf
13_DVD_Latch-up_prevention.pdf
Usha Mehta10 views
A multi-microcontroller-based hardware for deploying Tiny machine learning mo... by IJECEIAES
A multi-microcontroller-based hardware for deploying Tiny machine learning mo...A multi-microcontroller-based hardware for deploying Tiny machine learning mo...
A multi-microcontroller-based hardware for deploying Tiny machine learning mo...
IJECEIAES12 views
_MAKRIADI-FOTEINI_diploma thesis.pptx by fotinimakriadi
_MAKRIADI-FOTEINI_diploma thesis.pptx_MAKRIADI-FOTEINI_diploma thesis.pptx
_MAKRIADI-FOTEINI_diploma thesis.pptx
fotinimakriadi6 views
STUDY OF SMART MATERIALS USED IN CONSTRUCTION-1.pptx by AnnieRachelJohn
STUDY OF SMART MATERIALS USED IN CONSTRUCTION-1.pptxSTUDY OF SMART MATERIALS USED IN CONSTRUCTION-1.pptx
STUDY OF SMART MATERIALS USED IN CONSTRUCTION-1.pptx
AnnieRachelJohn31 views
9_DVD_Dynamic_logic_circuits.pdf by Usha Mehta
9_DVD_Dynamic_logic_circuits.pdf9_DVD_Dynamic_logic_circuits.pdf
9_DVD_Dynamic_logic_circuits.pdf
Usha Mehta28 views
DevOps to DevSecOps: Enhancing Software Security Throughout The Development L... by Anowar Hossain
DevOps to DevSecOps: Enhancing Software Security Throughout The Development L...DevOps to DevSecOps: Enhancing Software Security Throughout The Development L...
DevOps to DevSecOps: Enhancing Software Security Throughout The Development L...
Anowar Hossain12 views
7_DVD_Combinational_MOS_Logic_Circuits.pdf by Usha Mehta
7_DVD_Combinational_MOS_Logic_Circuits.pdf7_DVD_Combinational_MOS_Logic_Circuits.pdf
7_DVD_Combinational_MOS_Logic_Circuits.pdf
Usha Mehta59 views
2_DVD_ASIC_Design_FLow.pdf by Usha Mehta
2_DVD_ASIC_Design_FLow.pdf2_DVD_ASIC_Design_FLow.pdf
2_DVD_ASIC_Design_FLow.pdf
Usha Mehta19 views

Featured

ChatGPT and the Future of Work - Clark Boyd by
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
21.3K views69 slides
Getting into the tech field. what next by
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
5.2K views22 slides
Google's Just Not That Into You: Understanding Core Updates & Search Intent by
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
5.9K views99 slides
How to have difficult conversations by
How to have difficult conversations How to have difficult conversations
How to have difficult conversations Rajiv Jayarajah, MAppComm, ACC
4.5K views19 slides
Introduction to Data Science by
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data ScienceChristy Abraham Joy
82.2K views51 slides
Time Management & Productivity - Best Practices by
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
169.7K views42 slides

Featured(20)

ChatGPT and the Future of Work - Clark Boyd by Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd21.3K views
Getting into the tech field. what next by Tessa Mero
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero5.2K views
Google's Just Not That Into You: Understanding Core Updates & Search Intent by Lily Ray
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray5.9K views
Time Management & Productivity - Best Practices by Vit Horky
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky169.7K views
The six step guide to practical project management by MindGenius
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius36.6K views
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright... by RachelPearson36
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson3612.6K views
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present... by Applitools
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools55.4K views
12 Ways to Increase Your Influence at Work by GetSmarter
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter401.6K views
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G... by DevGAMM Conference
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference3.6K views
Barbie - Brand Strategy Presentation by Erica Santiago
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago25.1K views
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well by Saba Software
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software25.2K views
Introduction to C Programming Language by Simplilearn
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn8.4K views
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr... by Palo Alto Software
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
The Pixar Way: 37 Quotes on Developing and Maintaining a Creative Company (fr...
Palo Alto Software88.3K views
9 Tips for a Work-free Vacation by Weekdone.com
9 Tips for a Work-free Vacation9 Tips for a Work-free Vacation
9 Tips for a Work-free Vacation
Weekdone.com7.2K views
How to Map Your Future by SlideShop.com
How to Map Your FutureHow to Map Your Future
How to Map Your Future
SlideShop.com275.1K views

EZRust: Z80 for the Web