Outline Introduction to the Phalanger System

Slides:



Advertisements
Similar presentations
What is.Net Gary Devendorf. .Net Framework.Net framework works like the Domino Objects only much lower level and very complete It is part of the OS (or.
Advertisements

Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 12 Introduction to ASP.NET.
Introduction to .NET Framework
Tahir Nawaz Introduction to.NET Framework. .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
JSP: JavaServer Pages Juan Cruz Kevin Hessels Ian Moon.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
64bit Development Overview March 28 Microsoft. Objectives Learn about the current 64-bit platforms from a hardware, software and tools perspective Review.
History  We first begin with Java which was released in 1995 by Sun Microsystems  Initially Java was 100% interpreted at runtime and was very slow 
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Apache Jakarta Tomcat Suh, Junho. Road Map Tomcat Overview Tomcat Overview History History What is Tomcat? What is Tomcat? Servlet Container.
SEEM4570: XAMPP, Eclipse, Summary of Html Kangfei Zhao Room 711,ERB
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Eric Vogel Software Developer A.J. Boggs & Company.
The Metadata System1. 2 Introduction Metadata is data that describes data. Traditionally, metadata has been found in language- specific files (e.g. C/C++
.NET Overview. 2 Objectives Introduce.NET –overview –languages –libraries –development and execution model Examine simple C# program.
Session 1 - Introduction and Data Access Layer
@2011 Mihail L. Sichitiu1 Android Introduction Platform Overview.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
Self-Contained CLI Assemblies Dipl.-Inf. Bernhard Rabe Operating Systems & Middleware Group Hasso-Plattner-Institute University of Potsdam.
Jan Benda Martin Maly Tomas Matousek Ladislav Prosek Pavel Novak Vaclav Novak Tomas Matousek Department of Software Engineering Faculty.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
The HipHop Compiler from Facebook By Megha Gupta & Nikhil Kapoor.
Running PHP and WordPress in.NET CLR and IIS Svetlin Nakov Ph.D., Computer Science WordCamp Sofia, 26-Oct-2013.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Eagle: Maturation and Evolution 17th Annual Tcl Conference Joe Mistachkin.
Active Server Pages (ASP), also known as Classic ASP or ASP Classic, was Microsoft's first server-side script engine for dynamically generated web pages.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
CIS 375—Web App Dev II ASP.NET 1 Getting Started.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Inheritance and Class Hierarchies Chapter 3. Chapter Objectives  To understand inheritance and how it facilitates code reuse  To understand how Java.
DEV394.NET Framework: Migrating To Managed Code Adam Nathan QA Lead Richard Lander Program Manager Microsoft Corporation.
INTRODUCTION CHAPTER #1 Visual Basic.NET. VB.Net General features It is an object oriented language  In the past VB had objects but focus was not placed.
CS 440 Database Management Systems Stored procedures & OR mapping 1.
Presented By Sushil K. Chaturvedi Assistant Professor SRCEM,Banmore 1.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Top 10 Entity Framework Features Every Developer Should Know
Part 1: Overview of LINQ Intro to LINQ Presenter: PhuongNQK.
The language focusses on ease of use
Lecture 1b- Introduction
/* LIFE RUNS ON CODE*/ Konstantinos Pantos Microsoft MVP ASP.NET
PROGRAMMING LANGUAGES
LOCO Extract – Transform - Load
Platform as a Service.
Microsoft .NET 3. Language Innovations Pan Wuming 2017.
Jim Fawcett CSE775 – Distributed Objects Spring 2012
Introduction Enosis Learning.
Array Array is a variable which holds multiple values (elements) of similar data types. All the values are having their own index with an array. Index.
PHP / MySQL Introduction
CS360 Windows Programming
Introduction to Java Dept. Business Computing University of Winnipeg
Introduction to C# AKEEL AHMED.
Introduction Enosis Learning.
Programming in C# CHAPTER 1
Web Development Using ASP .NET
Advanced Programming: C# Lecture 01: Introduction
CS-0401 INTERMEDIATE PROGRAMMING USING JAVA
Google App Engine Ying Zou 01/24/2016.
CS105 Introduction to Computer Concepts Intro to programming
.Net Framework Details Imran Rashid CTO at ManiWeber Technologies.
CSC 551: Web Programming Spring 2004
CSC 551: Web Programming Spring 2004
Eagle: Maturation and Evolution
Windows Forms in Visual Studio 2005: An in-depth look at key features
Enterprise Web Services
IS 135 Business Programming
Plug-In Architecture Pattern
Presentation transcript:

Outline Introduction to the Phalanger System main features and goals Why PHP on .NET Framework? Performance benchmarks Interesting Issues inclusions, local variables optimization, multi-version types/functions accessing .NET objects, adding fields on .NET objects at run-time using PHP native libraries Future Work: Phalanger 2.0 PHP/CLR – extending PHP to the first-class .NET language Support for Mono Platform

Phalanger Extends the family of .NET languages with PHP versions 4, 5, and 6 introduces language extensions for using .NET types (PHP/CLR) Makes it possible to run existing PHP applications on ASP.NET web server Significant performance improvement Higher reliability of the web server Better configurability More errors revealed by the compilation Source-free application deployment Brings virtually all PHP libraries to .NET Framework migration from PHP interpreter is simple in practice without additional costs Enriches both worlds PHP applications with the functionality of the .NET platform .NET applications with a possibility to use a popular dynamic language Integrates PHP with Visual Studio .NET

PHP Sample include "a.php"; class C extends D implements I, J { public function m($a, $b = 1, $c = array(3,2,1)) $f = "sort"; $f($c); $x = "b"; if ($$x) { function f() { echo "version 1"; } } else { function f() { echo "version 2"; } } f(); eval('$a++;'); } private $d; function __get($field_name) { return $d->$field_name; } function __set($field_name, $value) { $d->$field_name = $value; }

Micro-benchmarks each operation performed 10M times in a loop; machine: Pentium M Dothan 1.8GHz/2MB cache the lesser the better

phpBB Benchmark Results (Apache 2.0.54) MSDE 2000 SP3 MySQL 4.1.11 phpBB Benchmark Results (Apache 2.0.54) requests per second Phalanger 1.0 PHP + Zend Optimizer PHP the greater the better

Major Issues missing specification inclusions “correctness” criteria: existing applications should work well without modifications inclusions standard PHP mode inclusions similar to C language; the included file needn’t to be known at compile-time pure mode (since Phalanger 2.0) C# like project – unconditional declarations visible in all files comprising the project multi-version and compile-time unknown types/functions classes and functions can be declared conditionally in multiple versions classes and functions can be generated at run-time class can extend/implement compile-time unknown class/interface local variables optimization creating a hash table for each call is expensive and unnecessary compile-time known variables can be stored in CLR locals in majority cases

Using PHP Native Extensions a necessity for a seamless migration from PHP interpreter PHP Many functions and classes implemented in PHP extensions php_imap.dll, php_pdf.dll, php_sockets.dll, php_gtk.dll, … PHP interpreter exposes so called Zend API to extensions (php4ts.dll) Phalanger Makes the functionality in PHP extensions available for any .NET app. managed wrappers encapsulates and shields out native implementation Extension Manager emulates the PHP interpreter environment (Zend API) within the application process using the extension or in a separate process, isolating untrustworthy extensions Native Code php_imap.dll Managed Code Mixed Code Application (PHP, C#, …) Extension Wrapper Extension Manager C++/CLI php4ts.dll php_pdf.dll … Zend API optional process boundary bridged by .NET Remoting via Shared Memory Channel

Managed Wrappers Assemblies generated automatically from native extensions and optional type information in XML format ... <function returnType="int" name="socket_write" > <param type="resource" name="socket" /> <param type="string" name="buf" /> <param optional="true" type="int" name="length" /> </function> php_sockets.xml PHP_FUNCTION(socket_write) { zend_parse_parameters(...); ZEND_FETCH_RESOURCE(...); // ... RETURN_LONG(...); } php_sockets.dll .method public hidebysig static int32 socket_write( class [PhpNetCore]PHP.Core.PhpResource socket, string buf, int32 length) cil managed .custom instance void PhpNetCore]PHP.Core.ImplementsFunctionAttribute ... call object [PhpNetCore]PHP.Core.Externals::InvokeFunction(...) ret string buf) cil managed php_sockets.mng.dll

Summary & Future Work Phalanger 1.0 Phalanger 2.0, PHP/CLR goal achieved: to make existing application working under .NET much better performance in practice final version available for download Phalanger 2.0, PHP/CLR Make PHP a first-class language for .NET extensions to the language enabling PHP programs to work directly with .NET types, methods, delegates, events, generics, … extending .NET classes, overload resolution, run-time fields addition, … multi-threading support for Language Integrated Query (LINQ) minimize necessary language modifications keep the dynamic nature of the language e.g. run-time specified generic type arguments, etc. ASP.NET Controls in PHP etc.

Related Work Dynamic languages on .NET PHP compilers IronPython Python is a bit more dynamic e.g. replacing methods at run-time less optimizations possible PyStone benchmark overall improvement by factor 1.84 micro-benchmark results range from 10x faster to 10x slower Ruby, Perl, JScript, … PHP compilers Resin Quercus PHP to Java translation, compilation to JVM byte-code Roadsend Compiler PHP to C translation, compilation to native code

Q & A