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
Hack Lang : an Introduction @ FB DevC Malang Meetup 2017
Search
DOT Indonesia
September 23, 2017
Programming
0
150
Hack Lang : an Introduction @ FB DevC Malang Meetup 2017
A short introduction to Hack programming language and it's HVVM.
Another technology from Facebook.
DOT Indonesia
September 23, 2017
Tweet
Share
More Decks by DOT Indonesia
See All by DOT Indonesia
Agile Testing To Support Short Cycle Development (@DOT TechTalk, 18 Januari 2019)
dotindonesia
0
96
How to be Agile (@DOT TechTalk, 11 Januari 2019)
dotindonesia
1
35
Build an Awesome CI/CD with Jenkins - Samsul (@PHP User Group Meetup, 17 September 2018)
dotindonesia
0
120
Mockup API to IMPROVE Team Collaboration - Toni (@DOT TechTalk, 10 Agustus 2018)
dotindonesia
0
71
Investment & Financing - Arya (@DOT TechTalk, 20 April 2018)
dotindonesia
3
61
Introduction to Docker Container - Samsul Ma'arif (@DILO Malang - 12 March 2018)
dotindonesia
0
160
Company Overview - DOT Indonesia (@Study Excursie UNIDA Gontor - March 2018)
dotindonesia
0
100
How to be a Great Mobile Developer - Agus (@Study Excursie UNIDA Gontor - March 2018)
dotindonesia
0
45
Rapid mobile development with React Native - Fahmi (@Study Excursie UNIDA Gontor - March 2018)
dotindonesia
0
41
Other Decks in Programming
See All in Programming
Ruby Function Composition
bkuhlmann
1
330
try! Swift Tokyo 初参加報告LT
hinakko2
0
210
Zero Waste, Radical Magic, and Italian Graft – Quarkus Efficiency Secrets
hollycummins
0
230
1인 개발자로 행복하게 살기 - GDG 송도 헬로월드 2024
benjaminkim
1
5.6k
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
670
Build with AI 2024 Seoul - 제로부터 시작하는 Flutter with Gemini 생활 - 박제창
itsmedreamwalker
0
200
Milestoner
bkuhlmann
1
410
GitHub Actionsで泣かないためにやっておきたい設定 / Recommended GHA settings to avoid crying
pinkumohikan
3
520
Komplexe Oberflächen mit SVG und der Web Animation API
joergneumann
0
670
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
160
スキーマ駆動開発による品質とスピードの両立 - 私達は何故、スキーマを書くのか
kentaroutakeda
0
160
Changed Rules: Architectures with Lightweight Stores
manfredsteyer
PRO
0
240
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
20
1.6k
YesSQL, Process and Tooling at Scale
rocio
163
13k
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.6k
Building a Scalable Design System with Sketch
lauravandoore
455
32k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
18
1.7k
Documentation Writing (for coders)
carmenintech
59
3.9k
Building Applications with DynamoDB
mza
88
5.6k
Debugging Ruby Performance
tmm1
70
11k
Fashionably flexible responsive web design (full day workshop)
malarkey
398
65k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
13
1.5k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
Transcript
Hack Lang : an Introduction by Ardi Imawan @ FB
DevC Malang Meetup 2017
What is Hack?
When you hit facebook.com, or you pull out your phone
and get a notification, or basically any interaction that you have with Facebook servers, these servers running hack code Julien Verlague –Facebook Engineer
Hack A gradually typed language for HHVM
2 Basic Type of Programming Languages 1. Statically Typed •
Java, C#, C++, etc • Steps: • Write code • Check the type • Run correctly Gradually Typed • Hack • You can decide to use which method 2. Dynamically Typed • Javascript, Python, PERL, PHP • Steps: • Write code • Run directly • Ups, something wrong..
Let’s try your first code • http://hacklang.org/
HHVM : The runtime for Hack Hip-Hop Virtual Machine
HHVM : Just In Time Compiler PHP Hack Hip-hop Byte
Code (HHBC) X86-64 machine code PHP Zend Opcode EXECUTE Compile (JIT) Interprate
Fast Iteration Cycle • Type checker is a daemon (run
in background)
Features
Type Checker Something wrong You may need to change this
code Or this one…
Error Messages Something wrong You may need to change this
code Or this one… Do you remember of Java/C#/C++ ?
Async / Await You can interrupt this process I want
to wait this async process
Async / Await
Async / Await What are you thinking now? C# or
NodeJS? :D
Nullable It can be NULL
Nullable It can be NULL Now, kotlin or swift? :D
Spaghetti Code : Rendering UI React Native PHP
XHP Define custom component Without escaping Use other component Handle
as a object
All in One
Hack Types • Nullable: ?string • Tuples: (int, bool, Object)
• Closures: (function(int): int) • Generics: A<T>, foo<T> (T $x): T{ } • Constraints: foo<T as A> (T $x) : T • Co/contravariance: interface X<+T1, -T2>
Thanks
References • https://www.youtube.com/watch?v=eDz8IbGsVrc • https://docs.hhvm.com