Evaluating the Haxe Programming Language

Total Page:16

File Type:pdf, Size:1020Kb

Evaluating the Haxe Programming Language Evaluating the Haxe Programming Language Performance comparison between Haxe and platform-specific languages Bachelor of Science Thesis in Software Engineering and Management STEPAN STEPASYUK YAVOR PAUNOV University of Gothenburg Chalmers University of Technology Department of Computer Science and Engineering Göteborg, Sweden, June 2013 The Author grants to Chalmers University of Technology and University of Gothenburg the non- exclusive right to publish the Work electronically and in a non-commercial purpose make it accessible on the Internet. The Author warrants that he/she is the author to the Work, and warrants that the Work does not contain text, pictures or other material that violates copyright law. The Author shall, when transferring the rights of the Work to a third party (for example a publisher or a company), acknowledge the third party about this agreement. If the Author has signed a copyright agreement with a third party regarding the Work, the Author warrants hereby that he/she has obtained any necessary permission from this third party to let Chalmers University of Technology and University of Gothenburg store the Work electronically and make it accessible on the Internet. Evaluating the Haxe Programming Language Performance comparison between Haxe and platform-specific languages STEPAN STEPASYUK, YAVOR PAUNOV. © STEPAN STEPASYUK, June 2013. © YAVOR PAUNOV, June 2013. Examiner: RICHARD TORKAR University of Gothenburg Chalmers University of Technology Department of Computer Science and Engineering SE-412 96 Göteborg Sweden Telephone + 46 (0)31-772 1000 Department of Computer Science and Engineering Göteborg, Sweden June 2013 Evaluating the Haxe Programming Language Performance comparison between Haxe and platform-specific languages Stepan Stepasyuk Yavor Paunov Gothenburg University Gothenburg University Department of Computer Science and Engineering Department of Computer Science and Engineering Gothenburg, Sweden Gothenburg, Sweden [email protected] [email protected] Abstract 2. Background The goal of this paper is to evaluate the performance of Haxe, a cross-platform programming language. By applying an experi- 2.1 Haxe mental method and a statistical test, we measure and analyze the 2 performance associated with compiling Haxe source code to five Haxe is a strictly typed object-oriented language whose standard of its targets. We find a significant difference in performance libraries are licensed under the “two-clause” BSD license while the compiler is under GPLv2+ in order to “keep it free open soft- between Haxe-compiled and target-specific language code on four 3 out of five targets, two of which in favour of Haxe and two ware” . Advertised mainly for its multiplatform nature Haxe against it. Our findings are useful for developers who are consid- compiles to a number of different programming platforms, includ- ering adopting the language with the intent of replacing their ing JavaScript, Flash, PHP, C++, and NekoVM and provides current development toolbox with it. experimental support for C# and Java. The practical implications of this are that Haxe code can be compiled for applications run- Keywords: evaluation, performance, language design, experi- ning on desktop, mobile and web platforms. Haxe comes with a ment, statistical testing standard library that can be used on all supported targets and platform-specific libraries for each of them. 1. Introduction 2.1.1 Multiplatform The recent years have seen a growing demand for cross-platform development solutions1, especially in the mobile sector where new The biggest selling point of Haxe is its multiplatform nature, a platforms come out rather often and a big part the market is frag- noticeable benefit of which is saving the trouble of switching mented. In order to reach a wider audience, applications have to languages. For example, in a web-development project where target multiple platforms and thus must be developed multiple PHP is used for back-end and JavaScript for front-end. By using times. This requires more effort from the developers and creates Haxe, it is possible to develop for both platforms using the same additional development and maintenance costs [1]. Tools that language. simplify this process already exist in great numbers and focus on Moreover, Haxe provides features missing in the languages of different domains such as web, desktop and mobile. some of the target platforms. For instance, it provides enumera- One such tool is Haxe, a language with the ability to compile tions that are missing from ActionScript 3 and PHP and type to a number of different platforms. Although not a complete safety missing in loosely typed languages such as PHP and JavaS- cross-platform solution by itself, Haxe can greatly ease the pro- cript. cess. For instance, platform-specific code still needs to be written but conditional compilation makes an abstraction layer easy to 2.1.2 Comprehensive type system implement. Haxe can be useful when targeting a single platform, The Haxe type system comes with several different groups of as well because many of its features are lacking on its targets types. For example, basic types like class or enum. The class type This paper aims to test how the performance of programs is similar to that in other object-oriented languages. It supports compiled from Haxe compares to code written in the platform- inheritance and can implement interfaces. The enum type which specific languages. This led to the following research question: works in a similar way to that in Java. Is there a significant overhead related to compiling Haxe source Haxe also allows for more advanced types like the anonymous code? structure that represents a list of fields, which do not refer to a specific class. Structures can be made reusable by using the The targets used during the testing were Flash, C++, PHP, Ja- vaScript, and Java. The architecture and the inner workings of the typedef keyword. Haxe is a strictly typed language. However, there are several compiler, although of potential interest for a future study, are not ways to get around compile-time type checking. One of them is by within the scope of the paper. using the untyped keyword, which disables type checking for the specified block of code. Another option is to use the Dynamic 2 1http://software.intel.com/en-us/blogs/2013/03/07/cross-platform- http://haxe.org/doc/intro [Accessed: 25 May 2013] development-what-the-stats-say [Accessed: 25 May 2013] 3 http://haxe.org/doc/license [Accessed: 25 May 2013] type when declaring variables. A variable of the Dynamic type 3.1 Experimental setup can hold a value of any other type. Moreover, an infinite number The experimental consisted of comparing the execution time of of fields can be added to a Dynamic variable. All of those will Haxe-compiled and platform-specific code on the following tar- also be Dynamic unless a type parameter is given, in which case gets: all fields will be of the specified type. Flash 2.1.3 Code embedding C++ It is possible to use code written in some of the targeted languages Java while writing Haxe. This can be done with JavaScript, PHP, C# and Java. It is important to note that since C# and Java are exper- PHP imental targets, code embedding for these targets is discouraged4. JavaScript Code embedding can be achieved by utilizing Haxe magic func- tions. For example, the functions __js__ and __php__ will embed The Mann–Whitney U test [6] was used in order to distinguish the presence of significant statistical difference between the re- JavaScript and PHP code respectively. Using external libraries on sults. This particular test was selected due to the nature of data to the other targets is possible as well but not as straightforward and requires certain workarounds5,6. be compared. Samples of execution times are independent since execution time of one implementation does not affect the execu- tion time of another in any way. Moreover, the obtained data is of 2.1.4 Compiler metadata a rational level9 because it can be ranked (from shortest to longest Haxe allows metadata annotation using the @ sign, in which it time of execution and vice versa). It is meaningful because we can shares similarity to that of Java. What makes metadata in Haxe compare two given executions and find out which one was the powerful is that under certain circumstances it can affect the way quickest. It also has an absolute minimum of 0 seconds execution the compiler works. In order to mark compiler metadata, a colon time, and it is possible to calculate ratios based on it. However, character (‘:’) is added in front of the identifier. A number of the absolute minimum is a subject for argument since no execu- general identifiers can be used on all platforms in addition to a tion time can be exactly 0 seconds in practice. It can be 0.01 or few platform-specific ones. 0.000001 and the amount of zeros between the decimal point and Examples of platform independent identifiers include the 1 can span infinitely. On the other hand, no algorithm can execute @:final annotation, preventing a class from being further extend- in less than 0 seconds, for instance -0.1 seconds. ed. This is similar to the final keyword in ActionScript 37 and The performed test was two-tailed which means that finding Java8 , providing the same feature. Although, Haxe itself does not the presence of significant statistical difference and not its direc- support method overloading, the @:overload identifier allows tion is the main goal of the test [6]. Thus, hypotheses were formu- overloading of external methods. Other examples of compiler lated accordingly. Null hypothesis was stating that overhead in metadata are the @:macro and @:build identifiers, used to create performance of compiling from Haxe is statistically significant in macros. comparison to compiling from platform-specific languages.
Recommended publications
  • Thoughts on Flash
    Apple has a long relationship with Adobe. In fact, we met Adobe’s founders when they were in their proverbial garage. Apple was their first big customer, adopting their Postscript language for our new Laserwriter printer. Apple invested in Adobe and owned around 20% of the company for many years. The two companies worked closely together to pioneer desktop publishing and there were many good times. Since that golden era, the companies have grown apart. Apple went through its near death experience, and Adobe was drawn to the corporate market with their Acrobat products. Today the two companies still work together to serve their joint creative customers – Mac users buy around half of Adobe’s Creative Suite products – but beyond that there are few joint interests. I wanted to jot down some of our thoughts on Adobe’s Flash products so that customers and critics may better understand why we do not allow Flash on iPhones, iPods and iPads. Adobe has characterized our decision as being primarily business driven – they say we want to protect our App Store – but in reality it is based on technology issues. Adobe claims that we are a closed system, and that Flash is open, but in fact the opposite is true. Let me explain. First, there’s “Open”. Adobe’s Flash products are 100% proprietary. They are only available from Adobe, and Adobe has sole authority as to their future enhancement, pricing, etc. While Adobe’s Flash products are widely available, this does not mean they are open, since they are controlled entirely by Adobe and available only from Adobe.
    [Show full text]
  • Haxe Game Development Essentials
    F re e S a m p le Community Experience Distilled Haxe Game Development Essentials Create games on multiple platforms from a single codebase using Haxe and the HaxeFlixel engine Jeremy McCurdy In this package, you will find: The author biography A preview chapter from the book, Chapter 1 'Getting Started' A synopsis of the book’s content More information on Haxe Game Development Essentials About the Author Jeremy McCurdy is a game developer who has been making games using ActionScript, C#, and Haxe for over four years. He has developed games targeted at iOS, Android, Windows, OS X, Flash, and HTML5. He has worked on games that have had millions of gameplay sessions, and has built games for many major North American television networks. He is the games technical lead at REDspace, an award-winning interactive studio that has worked for some of the world's largest brands. They are located in Nova Scotia, Canada, and have been building awesome experiences for 15 years. Preface Developing games that can reach a wide audience can often be a serious challenge. A big part of the problem is fi guring out how to make a game that will work on a wide range of hardware and operating systems. This is where Haxe comes in. Over the course of this book, we'll look at getting started with Haxe and the HaxeFlixel game engine, build a side-scrolling shooter game that covers the core features you need to know, and prepare the game for deployment to multiple platforms. After completing this book, you will have the skills you need to start producing your own cross-platform Haxe-driven games! What this book covers Chapter 1, Getting Started, explains setting up the Haxe and HaxeFlixel development environment and doing a quick Hello World example to ensure that everything is working.
    [Show full text]
  • Update Your Browser Software to the Most Current Version
    Update Browser Software MigovBOE Rev. 6/1/2018 DISPLAYING AND RUNNING CONTENT IN THE MICHIGAN ELECTIONS ELEARNING CENTER: *** Note – The Michigan Elections eLearning Center operates best and is most secure if you use an updated version of internet browsing software. Please update your browser software to the most current version. See the table of contents for download links for each program. TABLE OF CONTENTS Course or Form Doesn’t Load Or A New Window Doesn’t Open ..................................................................................... 1 No or Low Audio ................................................................................................................................................................ 2 Course Not Running or Displaying Graphics ..................................................................................................................... 2 Determine Your Internet Browser Software Program ........................................................................................................ 3 Google Chrome (recommended) ................................................................................................................................... 4 Mozilla Firefox (recommended) ..................................................................................................................................... 5 Internet Explorer (must be version 10 or newer) ........................................................................................................... 6 Internet Explorer (continued)
    [Show full text]
  • How to Enable Flash Player
    How to Enable Flash on Your Web Browser Many of the online courses in the UC Learning Center use the Adobe Flash Player. Locate your web browser from the list below for instructions on how to enable flash. Internet Explorer Google Chrome Mozilla Firefox Mac Safari Internet Explorer 1. Launch your Internet Explorer web browser. 2. Click the Tools icon in the upper-right corner of Internet Explorer. (The icon looks like a gear.) 3. In the pop-up menu that appears, click Manage Add-ons. 1 4. In the dialogue box that appears, select Toolbars and Extensions. 5. In the list of Add-ons, look for “Shockwave Flash Object” (another name for Flash Player). In the Status column, check to see whether Shockwave Flash Object is Disabled. If it is disabled, click the row for Shockwave Flash Object to select it. 2 6. In the lower-right corner of the Manage Add-ons dialog box, click Enable. 7. Close the Manage Add-ons dialog box. Source: https://helpx.adobe.com/flash-player/kb/install-flash-player-windows.html Google Chrome To enable Flash in Google Chrome, 1. Type the following in the URL field of a Chrome browser tab: chrome://settings/content/flash 2. On the Settings screen, make sure Flash is enabled by checking the Ask first (recommended) option. 3 3. Attempt to launch the course again. Mozilla Firefox Beginning with Firefox 52, the browser will not activate plugins (e.g. Flash Player) by default. Instead, Firefox lets you choose whether to allow a plugin to run on a website.
    [Show full text]
  • Protecting Online Video Distribution with Adobe Flash Media Technology
    White Paper Protecting Online Video Distribution with Adobe Flash Media Technology Table of contents Introduction 1 Introduction Online video is a growing phenomenon. Record numbers of people are going online to watch 1 Overview of Adobe video everything from user-generated videos and breaking news events to television programs and distribution solutions full-length movies. Gone are the days of waiting for a program to air; consumers can now choose 2 Best practices for effective content protection from a plethora of high-quality content, available on-demand. 2 Flash Media Server content From advertising-funded videos to subscriptions to pay-per-view, content providers are adapting protection features a variety of business models to monetize content in the online world. As an owner or distributor 3 Flash Media Server workflow of premium commercial content, such as films and TV shows, you must ensure that hackers do example 4 Persistent content protection with not bypass your business model or violate your copyrights. Flash Media Rights Management Content protection solutions help create and preserve revenue streams; maintain copyright; and Server preserve content integrity or privacy. For instance, hackers may attempt to bypass payment in a 5 Flash Media Rights Management Server content protection pay-per-view model. Others may try to rip your content for redistribution. Worse, someone features could try to make money from pirated content, or may introduce their own advertising or 5 Comparison between Flash Media branding but skip paying content licenses or bandwidth fees by piggybacking on your Rights Management Server and distribution platform. In an enterprise situation, a disgruntled employee may be tempted to post Flash Media Server valuable or private company information on public video sites.
    [Show full text]
  • Adobe® Media Server 5 Standard High Quality Video Playback Consistent Across Devices
    Adobe Media Server 5 Standard Datasheet Adobe® Media Server 5 Standard High quality video playback consistent across devices Step up from progressive download video delivery and deliver adaptive streams to the widest audience. Stream to iOS and Adobe Flash® Player with a single media source. Adobe Media Server 5 Standard is an economical solution that enables you to start streaming live and on demand content quickly and easily to a wide variety of platforms and devices. It provides all the features you need to stream and encrypt video and audio, providing a consistent playback across Apple iOS, Android, connected TVs, and the desktop—with a simplified workflow and better performance. New features in Adobe Media Server 5 Standard Adobe Media Server 5 Standard provides numerous video streaming innovations—over standard HTTP connections as well as RTMP delivery. • Simplified publishing workflows for HTTP streaming—Use the same source media and live streams to deliver full adaptive bitrate experiences to Adobe Flash, Android, and Apple devices. • Integration with Adobe Access 4—Enjoy protected RTMP support via a content license technology embedded in the server (Adobe Access 4 licensing server is a separate purchase). • 608/708 Closed Caption compliance—Support all avenues to increase your audience size with full support for closed caption transmission to Adobe Flash and Apple iOS devices such as the New iPad. EIA-608 (line 21) closed caption support meets FCC requirements • Reduced storage and infrastructure costs—A single MPEG-4 asset is required for each bitrate, and optional real time packaging eliminates the need to prepare content in advance.
    [Show full text]
  • Flex Resources*
    OpenStax-CNX module: m34542 1 Flex Resources* R.G. (Dick) Baldwin This work is produced by OpenStax-CNX and licensed under the Creative Commons Attribution License 3.0 Abstract The purpose of this document is to provide a list of links to online Flex and ActionScript resources to supplement the other lessons in the series. 1 Table of Contents • Preface (p. 1) • Resources (p. 1) • Miscellaneous (p. 3) 2 Preface This tutorial lesson is part of a series of lessons dedicated to programming using Adobe Flex. The purpose of this document is to provide a list of links to online Flex and ActionScript resources to supplement the other lessons in the series. note: The material in these lessons is based on Flex version 3 and Flex version 4. 3 Resources • Baldwin's Flex programming website 1 • Baldwin's ActionScript programming website 2 • Adobe Flex Home 3 • Download free open-source Adobe Flex 3.5 SDK 4 · Adobe Flex SDK Installation and Release Notes 5 · Application Deployment 6 • Download free open-source Adobe Flex 4 SDK 7 *Version 1.2: Jun 8, 2010 3:07 pm -0500 http://creativecommons.org/licenses/by/3.0/ 1http://www.dickbaldwin.com/tocFlex.htm 2http://www.dickbaldwin.com/tocActionScript.htm 3http://www.adobe.com/products/ex/?promoid=BPDEQ 4http://www.adobe.com/cfusion/entitlement/index.cfm?e=ex3sdk 5http://www.adobe.com/support/documentation/en/ex/3/releasenotes_ex3_sdk.html#installation 6http://livedocs.adobe.com/ex/3/html/help.html?content=Part3_deploy_1.html 7http://opensource.adobe.com/wiki/display/exsdk/Download+Flex+4 http://cnx.org/content/m34542/1.2/
    [Show full text]
  • Adobe Trademark Database for General Distribution
    Adobe Trademark List for General Distribution As of May 17, 2021 Please refer to the Permissions and trademark guidelines on our company web site and to the publication Adobe Trademark Guidelines for third parties who license, use or refer to Adobe trademarks for specific information on proper trademark usage. Along with this database (and future updates), they are available from our company web site at: https://www.adobe.com/legal/permissions/trademarks.html Unless you are licensed by Adobe under a specific licensing program agreement or equivalent authorization, use of Adobe logos, such as the Adobe corporate logo or an Adobe product logo, is not allowed. You may qualify for use of certain logos under the programs offered through Partnering with Adobe. Please contact your Adobe representative for applicable guidelines, or learn more about logo usage on our website: https://www.adobe.com/legal/permissions.html Referring to Adobe products Use the full name of the product at its first and most prominent mention (for example, “Adobe Photoshop” in first reference, not “Photoshop”). See the “Preferred use” column below to see how each product should be referenced. Unless specifically noted, abbreviations and acronyms should not be used to refer to Adobe products or trademarks. Attribution statements Marking trademarks with ® or TM symbols is not required, but please include an attribution statement, which may appear in small, but still legible, print, when using any Adobe trademarks in any published materials—typically with other legal lines such as a copyright notice at the end of a document, on the copyright page of a book or manual, or on the legal information page of a website.
    [Show full text]
  • Flash Lite Datasheet
    Datasheet ADOBE® FLASH® LITE™ 3 DELIVER MULTIMEDIA EXPERIENCES TO MOBILE DEVICES Adobe Flash Lite 3 software is a powerful runtime engine that helps mobile and consumer electronics device manufacturers differentiate their products by delivering web browsability as well as video and interactive content to a broad range of devices. Flash Lite 3 enables developers to quickly create engaging mobile applications, speed time to market, and increase customer adoption. Experience true mobile multimedia manufacturers can easily access device data to Flash Lite 3 enables mobile and consumer enable UI personalization and customization. electronics device manufacturers to deliver For instance, device home screens can display multimedia experiences across devices, different images or content depending on allowing consumers to browse Adobe Flash locality—the same device could display Big enabled websites and enjoy video and other Ben when powered up in London, with the rich content. Flash Lite 3 devices offer access Eiffel Tower appearing when used in Paris. to dynamic applications such as interactive Customizable UIs enable manufacturers games, mobile magazines, daily comics, and mobile operators to engage subscribers screensavers, infotainment, and personal with dynamic content and target new productivity applications, plus the ability market segments. to browse websites powered by Adobe Flash Choose a proven application platform software, including vibrant sports and Flash Lite 3 is based on the Flash platform, entertainment sites. In a first for mobile which is supported by a community of devices, Flash Lite 3 also plays back FLV, two million designers and developers. The the most popular video format on the platform includes the desktop player and Internet.
    [Show full text]
  • Full Stack Developer, Javascript Hacker
    Full Stack Developer, Javascript Hacker Our vision We believe in ad supported content. But digital advertising has gone too far and users are reacting to legitimate threats around privacy, data usage, and at times, the unreasonably high exposure to ads. Secret Media provides publishers and advertisers with a sustainable solution to monetize and reach ad-blocked traffic, in respect with users privacy and browsing experience. By helping premium publishers manage the rise of adblocking, we help 3 billion internet users to access free information and we help journalists maintain their independence. We have been funded by the best French serial entrepreneurs and our headquarters are in ​ NYC, with an office for the tech team in Paris. We are open to remote (in French or English), our tools and development process are ready for this as we already have one developer working remotely and coming to Paris offices twice a month. We’re looking for a well-rounded and passionate full stack developer with a capacity to hack the ad tech industry. If you’re interested in working on all layers of a complex system from developing systems to intercept and encrypt calls on the client side to creating flexible and scalable proxy architectures transforming the JS scripts on the fly then Secret Media is for you! You will contribute to an environment that enables you to do your best engineering work, and you’ll do it with new web standards and frameworks like Haxe, Javascript (all flavors), Node.js, ​ ​ ElasticSearch and many CI tools. We encourage automation of tests, builds, deploys and analytics for feedback to continuously improve the product.
    [Show full text]
  • BATIK DIGITAL” (The “Initiative”)
    1. Title. This initiative is known as “Digital Content Technology Infrastructure Support Programme “BATIK DIGITAL” (the “Initiative”). 2. Objectives. Key objectives of the Initiative are as follows: a) To ensure Digital Creative Content companies business continuity by leveraging latest technology in operating business and seize economic opportunities; b) To encourage Digital Creative Content companies investing additional resources in maintaining effectiveness and credibility in securing jobs and maintaining the current workforces; c) To support Digital Creative Content companies in maintaining content production quality, data security and consistency of deliverables despite working away from their studio; and d) To establish sustainability of creative technology ecosystem and might minimise the gap among industry player for them to move forward in the economy value chain. 3. Scope of Incentive The Incentive is to reimburse the cost incurred by the approved Applicant (“Recipient”) for purchasing one or more of the software or technology solution listed in Paragraph 7.0 below for the following purposes: a) Financial support for active digital creative content studios based on company size; and/or b) New / additional / renewal design / development / communication software subscription related to digital creative content activities. 4. Incentive Amount. Incentive amount based on number of employee category limit: a) Category A: 5 – 30 employees; Up to RM 10,000 b) Category B: 31 – 100 employees; Up to RM 20,000 c) Category C: 101 and above employees; Up to RM 40,000 5. Closing Date. The closing date of the Program for ALL categories are as follows: Batch 1 Batch 2 Batch 3 15 April 202 @ 6.00pm 30 April 2021 @ 6.00pm 25 May 2021 @ 6.00pm 6.
    [Show full text]
  • CGT 353: Principles of Interactive and Dynamic Media Moving On: Other Aspects of the Flash Platform Mobile Development, AIR, Flex, and Catalyst
    CGT 353: Principles of Interactive and Dynamic Media Moving on: Other Aspects of the Flash Platform Mobile Development, AIR, Flex, and Catalyst The Adobe Flash Platform: • What you have learned in this class is only the beginning… • The entirety of the Flash Platform is enormous. • Includes: o Flash o Flash Lite o AIR o Flex and FlexBuilder o Catalyst o BlazeDS Server o Adobe Flash Media Server family • Continue to explore the platform more thoroughly in CGT 451… Introduction to Mobile Development: • Current version of Player is Flash Lite 3.1 • FL 3.1 does NOT provide support for AS 3.0 • FL 3.1 DOES provide support for Flash Player 8 and flv videos • Version comparison: http://www.adobe.com/products/flashlite/version • According to Strategy Analytics, the number of Flash Lite shipped devices will reach 1 billion in 2009 and more than 2.5 billion by the end of 2010. • See supported devices list: http://www.adobe.com/mobile/supported_devices • See penetration statistics here. • Checkout Adobe Device Central • Also sign up for and install the Device Profile Updater on the Adobe Website – this will allow you to update the phones on your device central. Resources: • Adobe Mobile and Devices Center: http://www.adobe.com/devnet/devices Going Wireless: • Are over 2.5 billion mobile users today! • Consumers are now more likely to purchase a higher-end or smart phone than they are a computer. • Mobile applications (games, etc…) are overtaking desktop/ browser based apps… • Significant portion of CGT 451 is based on mobile Flash development… Flash
    [Show full text]