Some key points:
- PHP is an easy to read and learn scripting language but is interpreted and suffers from weak typing, making it slower than compiled languages like C++.
- The HipHop Compiler transforms PHP code and syntax into equivalent C++ code. This allows the code to be compiled by g++ for native execution, gaining significant performance improvements over PHP's interpreter.
- The compiler handles dynamic features like functions, variables, and classes through techniques like static binding, global symbol tables, and dynamic dispatch tables to map PHP elements to their C++ equivalents.
- Issues like weak
Graph databases come with enhanced connectivity of data and whiteboard friendly paradigm. It requires learning a new Graph Traversal Language, that crawls the network and brings informations. It's indeed a fresh new look at how we store web of data and search for it. We'll meet gremlin, from Apache TinkerPop, which provides an abstract layer that make it easy to express your business logic without fighting with the code, and several Open Source graph databases, available for testing and toying.
Graph databases come with enhanced connectivity of data and whiteboard friendly paradigm. It requires learning a new Graph Traversal Language, that crawls the network and brings informations. It's indeed a fresh new look at how we store web of data and search for it. We'll meet gremlin, from Apache TinkerPop, which provides an abstract layer that make it easy to express your business logic without fighting with the code, and several Open Source graph databases, available for testing and toying.
An Introduction to Object-Oriented Programming (DrupalCamp London 2015)Bart Feenstra
If most of your web development work focuses around current stable versions of Drupal, you may be new to object-oriented programming. This is an approach to coding that centers around objects, which are data of their own types (classes) with their own behavior that are defined by developers and can easily be built upon by other developers. It also includes concepts such as interfaces, more compartmentalized design, dependency injection and unit testing.
This session will explain these concepts to you from the point of view of someone coming from procedural programming, which was Drupal’s predominant coding style before version 8. Afterwards, you will be familiar with the main concepts used by Drupal 8 and other modern PHP libraries and frameworks and you will be able to recognize and work with them in your favorite new Drupal version.
Climbing the Abstract Syntax Tree (Forum PHP 2017)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
How to avoid Go gotchas - Ivan Daniluk - Codemotion Milan 2016Codemotion
One of the primary strengths of Go programming language is a built-in first-class support for concurrency. We're going to learn about it in a completely new way, using interactive 3D visualizations, which help us understand the complex but astonishing world of modern concurrent software. We'll see what’s happening inside the real code—from a simple “Hello, World” to real production-level high-loaded servers, and learn different approaches and concurrency patterns that are used for building concurrent pipelines and algorithms. And we'll do it all in 3D!
Climbing the Abstract Syntax Tree (PHP UK 2018)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run. To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before. After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (PHP Russia 2019)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Introduction to the Python programming language (version 2.x)
Ambient intelligence: technology and design
http://bit.ly/polito-ami
Politecnico di Torino, 2015
Climbing the Abstract Syntax Tree (Midwest PHP 2020)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Almost every web site that delivers dynamic content has one or more listings of all kinds of stuff, e.g. news articles on news pages or procucts within an online shop. Many hours of web development are kind of wasted with programming stuff like pagers, sorting and filters over and over again.
pt_extlist tries to fulfill these requirement in a generic approach. Lists of any database records you keep within your TYPO3 instance or even on external databases can be set up easily using TypoScript and hence be generated by Integrators without writing a single line of PHP code. Once configured, a list can be put on any page using content elements. Fluid templating makes it easy to adapt the look and feel of all elements.
In this talk you will learn how to set up prototypes for web applications much faster than your competitors and speed up development by re-using existing tools. Creating lists will never be the same once you started using this extension!
Climbing the Abstract Syntax Tree (DPC 2017)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
IPC 2013 - High Performance PHP with HipHopSteve Kamerman
A look at Facebook's HipHop for PHP library, both the first generation, HPHPc, and the new HHVM. This presentation walks through the challenges that faced Facebook and their PHP-based solution from a year after their explosive growth in 2007 to late-2013.
An Introduction to Object-Oriented Programming (DrupalCamp London 2015)Bart Feenstra
If most of your web development work focuses around current stable versions of Drupal, you may be new to object-oriented programming. This is an approach to coding that centers around objects, which are data of their own types (classes) with their own behavior that are defined by developers and can easily be built upon by other developers. It also includes concepts such as interfaces, more compartmentalized design, dependency injection and unit testing.
This session will explain these concepts to you from the point of view of someone coming from procedural programming, which was Drupal’s predominant coding style before version 8. Afterwards, you will be familiar with the main concepts used by Drupal 8 and other modern PHP libraries and frameworks and you will be able to recognize and work with them in your favorite new Drupal version.
Climbing the Abstract Syntax Tree (Forum PHP 2017)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
How to avoid Go gotchas - Ivan Daniluk - Codemotion Milan 2016Codemotion
One of the primary strengths of Go programming language is a built-in first-class support for concurrency. We're going to learn about it in a completely new way, using interactive 3D visualizations, which help us understand the complex but astonishing world of modern concurrent software. We'll see what’s happening inside the real code—from a simple “Hello, World” to real production-level high-loaded servers, and learn different approaches and concurrency patterns that are used for building concurrent pipelines and algorithms. And we'll do it all in 3D!
Climbing the Abstract Syntax Tree (PHP UK 2018)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run. To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before. After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Climbing the Abstract Syntax Tree (PHP Russia 2019)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Introduction to the Python programming language (version 2.x)
Ambient intelligence: technology and design
http://bit.ly/polito-ami
Politecnico di Torino, 2015
Climbing the Abstract Syntax Tree (Midwest PHP 2020)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you’ll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
Almost every web site that delivers dynamic content has one or more listings of all kinds of stuff, e.g. news articles on news pages or procucts within an online shop. Many hours of web development are kind of wasted with programming stuff like pagers, sorting and filters over and over again.
pt_extlist tries to fulfill these requirement in a generic approach. Lists of any database records you keep within your TYPO3 instance or even on external databases can be set up easily using TypoScript and hence be generated by Integrators without writing a single line of PHP code. Once configured, a list can be put on any page using content elements. Fluid templating makes it easy to adapt the look and feel of all elements.
In this talk you will learn how to set up prototypes for web applications much faster than your competitors and speed up development by re-using existing tools. Creating lists will never be the same once you started using this extension!
Climbing the Abstract Syntax Tree (DPC 2017)James Titcumb
The new Abstract Syntax Tree (AST) in PHP 7 means the way our PHP code is being executed has changed. Understanding this new fundamental compilation step is key to understanding how our code is being run.
To demonstrate, James will show how a basic compiler works and how introducing an AST simplifies this process. We’ll look into how these magical time-warp techniques* can also be used in your code to introspect, analyse and modify code in a way that was never possible before.
After seeing this talk, you'll have a great insight as to the wonders of an AST, and how it can be applied to both compilers and userland code.
(*actual magic or time-warp not guaranteed)
IPC 2013 - High Performance PHP with HipHopSteve Kamerman
A look at Facebook's HipHop for PHP library, both the first generation, HPHPc, and the new HHVM. This presentation walks through the challenges that faced Facebook and their PHP-based solution from a year after their explosive growth in 2007 to late-2013.
What is HHVM?
HHVM is an open-source virtual machine designed for executing programs written in Hack and PHP. HHVM uses a just-in-time (JIT) compilation approach to achieve superior performance while maintaining the development flexibility that PHP provides.
HHVM supports Hack, PHP 5 and the major features of PHP 7. We are aware of minor incompatibilities, so please open issues when you find them. HHVM also supports many extensions as well.
This is the presentation which I used during the awesome "WPSession #11: Security for Site Owners". I shared important information about how site owners should react to website attacks. I talked about risk management, assets evaluation and getting help from the right people that know WordPress and care about security.
Using weaponized data from the more than 700 million accounts compromised last year, criminals test stolen credit cards and start to make money on the internet.
This is my talk from the PyDataLondon conference in May 2016. I outline some time management techniques and useful learning resources for those interested in transitioning into data science.
This C tutorial covers every topic in C with the programming exercises. This is the most extensive tutorial on C you will get your hands on. I hope you will love the presentation. All the best. Happy learning.
Feedbacks are most welcome. Send your feedbacks to dwivedi.2512@gmail.com. You can download this document in PDF format from the link, http://www.slideshare.net/dwivedi2512/learning-c-an-extensive-guide-to-learn-the-c-language
With the economy being what it is these days, and the IT industry constantly changing we need to actively work on our career.
What do you need to do to stay relevant in your job?
We did some research into the most wanted jobs in 2012
Programming is hard. Programming correct C and C++ is particularly hard. Indeed, both in C and certainly in C++, it is uncommon to see a screenful containing only well defined and conforming code.Why do professional programmers write code like this? Because most programmers do not have a deep understanding of the language they are using.While they sometimes know that certain things are undefined or unspecified, they often do not know why it is so. In these slides we will study small code snippets in C and C++, and use them to discuss the fundamental building blocks, limitations and underlying design philosophies of these wonderful but dangerous programming languages.
This content has a CC license. Feel free to use it for whatever you want. You may download the original PDF file from: http://www.pvv.org/~oma/DeepC_slides_oct2012.pdf
Those slides, inspired by the works and ideas of many, are a state of what PHP gets in upgrades as of Q4 2018.
Market share and evolution.
PHP 7.3
PHP 7.4
PHP 8.0
This PPT gives the details about Introduction, Syntax, Comments, Case Sensitivity,Variables,Data Types, Strings, Constants,Operators,Control Flow Statements,Functions,Arrays
, and Forms
Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)James Titcumb
Have you ever used PHP's built in reflection, only to find you can't do quite what you wanted? What about finding types for parameters or properties? What about reflecting on classes that aren't loaded, so that you can modify them directly?
Better Reflection is an awesome new library that uses magical time-warp techniques* (*actual magic or time-warp not guaranteed) to improve on PHP's built-in reflection by providing additional functionality. In this talk we'll cover what reflection is all about, explore the cool features of Better Reflection already implemented, the difficulties we faced actually writing the thing, and how you can use Better Reflection in your projects to maximise your reflection-fu.
A bird's eye view on some programming languages, focusing on concepts like typing, execution model or style. Presented on T3chFest 2016 in Leganés, Madrid, Spain.
Talk I gave to The Coding Machine about PHP 8. Overview of the RFC process and which QoL, features and notable BC breaks before finishing on some performance improvements.
Practical tips for dealing with projects involving legacy code. Covers investigating past projects, static analysis of existing code, and methods for changing legacy code.
Presented at PHP Benelux '10
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofsAlex Pruden
This paper presents Reef, a system for generating publicly verifiable succinct non-interactive zero-knowledge proofs that a committed document matches or does not match a regular expression. We describe applications such as proving the strength of passwords, the provenance of email despite redactions, the validity of oblivious DNS queries, and the existence of mutations in DNA. Reef supports the Perl Compatible Regular Expression syntax, including wildcards, alternation, ranges, capture groups, Kleene star, negations, and lookarounds. Reef introduces a new type of automata, Skipping Alternating Finite Automata (SAFA), that skips irrelevant parts of a document when producing proofs without undermining soundness, and instantiates SAFA with a lookup argument. Our experimental evaluation confirms that Reef can generate proofs for documents with 32M characters; the proofs are small and cheap to verify (under a second).
Paper: https://eprint.iacr.org/2023/1886
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
Maruthi Prithivirajan, Head of ASEAN & IN Solution Architecture, Neo4j
Get an inside look at the latest Neo4j innovations that enable relationship-driven intelligence at scale. Learn more about the newest cloud integrations and product enhancements that make Neo4j an essential choice for developers building apps with interconnected data and generative AI.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
The Art of the Pitch: WordPress Relationships and Sales
Hiphop php
1. HipHop Compiler for PHP
Transforming PHP into C++
HipHop Compiler Team
Facebook, Inc.
May 2010
Facebook 2010 (confidential)
2. PHP is easy to read
<?php
function tally($count) {
$sum = 0;
for ($i = 0; $i< $count; ++$i) {
$sum += $i;
}
return $sum;
}
print tally(10) . “n”;
Facebook 2010 (confidential)
3. PHP syntax is similar to C++/Java
<?php
class Tool extends Object {
public $name;
public use($target) {}
}
$tool = new Tool();
$tool->name = „hammer‟;
$tool->use($nail);
Facebook 2010 (confidential)
6. Core PHP library is small
- Most are in functional style
- ~200 to 500 basic functions
<?php
$len = strlen(“hello”); // C library
$ret = curl_exec($curl); // open source
Facebook 2010 (confidential)
7. PHP is easy to debug
<?php
function tally($count) {
$sum = 0;
for ($i = 0; $i< $count; ++$i) {
$sum += $i;
var_dump($sum);
}
return $sum;
}
Facebook 2010 (confidential)
8. PHP is easy to learn
easy to read
easy to write
easy to debug
Hello, World!
Facebook 2010 (confidential)
9. PHP is slow
http://shootout.alioth.debian.org/u64q/benchmark.ph
p?test=all&lang=all
50
40
30
20 CPU
10
0
C++ Java C# Erlang Python Perl PHP
Facebook 2010 (confidential)
18. GlobalVariables Class
class GlobalVariables : public SystemGlobals {
public:
// Direct Global Variables
Variant gv_foo;
// Indirect Global Variables for large compilation
enum _gv_enums {
gv_foo,
}
Variant gv[1];
};
Facebook 2010 (confidential)
22. Static Binding with Classes
Class methods
Class properties
Class constants
Re-declared classes
Deriving from re-declared classes
Volatile classes
Facebook 2010 (confidential)
23. Summary - Dynamic Symbol Lookup
Problem is nicely solved
Rule of 90-10
Dynamic binding is a general form of static
binding
Generated code is a super-set of static
binding and dynamic binding
Facebook 2010 (confidential)
24. Problem 2. Weakly Typing
Type Inference
Runtime Type Info (RTTI)-Guided Optimization
Type Hints
Strongly Typed Collection Classes
Facebook 2010 (confidential)
30. Type Specialization Method 1
template<typename T>
void foo(Tx) {
// generate code with generic T (tough!)
}
-Pros: smaller generated code
-Cons: no type propagation
Facebook 2010 (confidential)
31. Type Specialization Method 2
void foo(int64 x) {
// generate code assuming x is integer
}
void foo(Variantx) {
// generate code assuming x is variant
}
-Pros: type propagation
-Cons: variant case is not optimized
Facebook 2010 (confidential)
32. Type Specialization Method 3
void foo(int64 x) {
// generate code assuming x is integer
}
void foo(Variantx) {
if (is_integer(x)) {
foo(x.toInt64()); return;
}
// generate code assuming x is variant
}
-Pros: optimized for integer case
-Cons: large code size
Facebook 2010 (confidential)
34. Strongly Typed Collection Classes
That omnipotent “array” in PHP
Swapping out underlying implementation:
Array escalation
PHP classes:
Vector
Set
Map: un-ordered
Then Array: ordered map
Facebook 2010 (confidential)
35. Compiler Friendly Scripting Language
If all problems described here are
considered when designing a new
scripting language, will it run
faster than Java?
Facebook 2010 (confidential)