Www.php-compiler.net Jan Benda Martin Maly Tomas Matousek Ladislav Prosek Pavel Novak Vaclav Novak Tomas Matousek Department of Software Engineering Faculty.

Slides:



Advertisements
Similar presentations
Introduction to .NET Framework
Advertisements

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.
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
.NET Technology.
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.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
1 Classic ASP vs. ASP.NET Technical Information and Market Adoption Lance Welker University of San Diego Dr. Rebman MSIT 526 December 20, 2005.
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 
Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Intro to dot Net Dr. John Abraham UTPA – Fall 09 CSCI 3327.
Rajeswari Indupuri Introduction to.NET Framework.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
1 Why C# and Why.NET in the Undergraduate IS Curriculum ISECON November 3 -7, 2004, Newport, RI Association of Information Technology Professionals Mehdi.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Language Systems Chapter FourModern Programming Languages 1.
Introduction to .Net Framework
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
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
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
Introduction to.NET Framework. .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a library for.
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
CIS 375—Web App Dev II Microsoft’s.NET. 2 Introduction to.NET Steve Ballmer (January 2000): Steve Ballmer "Delivering an Internet-based platform of Next.
Putting it all together: LINQ as an Example. The Problem: SQL in Code Programs often connect to database servers. Database servers only “speak” SQL. Programs.
.NET Language Supports. .NET Language Support Operating System Common Language Runtime Base Class Library ADO.NET and XML ASP.NET Web Forms Web Services.
Component-Based Software Engineering Introduction to.NET Paul Krause.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Programming in C#. I. Introduction C# (or C-Sharp) is a programming language. C# is used to write software that runs on the.NET Framework. Although C#
Self-Contained CLI Assemblies Dipl.-Inf. Bernhard Rabe Operating Systems & Middleware Group Hasso-Plattner-Institute University of Potsdam.
Introduction and Features of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++
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.
Rajiv and Shipra Introduction to.NET (asp.net,c#,vb)
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.
LANGUAGE SYSTEMS Chapter Four Modern Programming Languages 1.
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.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
PRIOR TO WEB SERVICES THE OTHER TECHNOLOGIES ARE:.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Getting Started with.NET Getting Started with.NET/Lesson 1/Slide 1 of 31 Objectives In this lesson, you will learn to: *Identify the components of the.NET.
© 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.
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
Text Introduction to.NET Framework. CONFIDENTIAL Agenda .NET Training – Purpose  What is.NET?  Why.NET?  Advantages  Architecture  Components: CLR,
Lecture Set 1 Part B: Understanding Visual Studio and.NET – Structure and Terminology 1/16/ :04 PM.
C# Fundamentals An Introduction. Before we begin How to get started writing C# – Quick tour of the dev. Environment – The current C# version is 5.0 –
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Applications Active Web Documents Active Web Documents.
Lecture 1b- Introduction
Outline Introduction to the Phalanger System
Platform as a Service.
Microsoft .NET 3. Language Innovations Pan Wuming 2017.
Introduction to Java Dept. Business Computing University of Winnipeg
Introduction to C# AKEEL AHMED.
CS-0401 INTERMEDIATE PROGRAMMING USING JAVA
Google App Engine Ying Zou 01/24/2016.
.Net Framework Details Imran Rashid CTO at ManiWeber Technologies.
Eagle: Maturation and Evolution
Presentation transcript:

Jan Benda Martin Maly Tomas Matousek Ladislav Prosek Pavel Novak Vaclav Novak Tomas Matousek Department of Software Engineering Faculty of Mathematics and Physics Charles University in Prague Czech Republic

Matousek,.NET Technologies, 5/30/2006 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

Matousek,.NET Technologies, 5/30/2006 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

Matousek,.NET Technologies, 5/30/2006 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; } }

Matousek,.NET Technologies, 5/30/2006 Micro-benchmarks each operation performed 10M times in a loop; machine: Pentium M Dothan 1.8GHz/2MB cache the lesser the better

Matousek,.NET Technologies, 5/30/2006 phpBB Benchmark Results (Apache ) requests per second MSDE 2000 SP3 MySQL Phalanger 1.0 PHP + Zend Optimizer PHP the greater the better

Matousek,.NET Technologies, 5/30/2006 Major Issues missing specification “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

Matousek,.NET Technologies, 5/30/2006 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 Extension Wrapper C++/CLI php4ts.dll Mixed Code php_imap.dll php_pdf.dll … Zend API Application (PHP, C#, …) optional process boundary bridged by.NET Remoting via Shared Memory Channel Native Code Managed Code Extension Manager

Matousek,.NET Technologies, 5/30/2006 Managed Wrappers Assemblies generated automatically from native extensions and optional type information in XML format 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 }.method public hidebysig static int32 socket_write( class [PhpNetCore]PHP.Core.PhpResource socket, string buf) cil managed {.custom instance void PhpNetCore]PHP.Core.ImplementsFunctionAttribute... //... call object [PhpNetCore]PHP.Core.Externals::InvokeFunction(...) //... ret } php_sockets.mng.dll

Matousek,.NET Technologies, 5/30/2006 Summary & Future Work Phalanger 1.0 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.

Matousek,.NET Technologies, 5/30/2006 Related Work Dynamic languages on.NET 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

Matousek,.NET Technologies, 5/30/2006 Q & A