• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Introduction to Eqela development
 

Introduction to Eqela development

on

  • 3,541 views

 

Statistics

Views

Total Views
3,541
Views on SlideShare
2,742
Embed Views
799

Actions

Likes
2
Downloads
1
Comments
0

4 Embeds 799

http://www.eqela.com 778
http://rmyasis.wordpress.com 19
http://127.0.0.1 1
https://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Introduction to Eqela development Introduction to Eqela development Presentation Transcript

    • Copyright © 2012 Job and Esther Technologies, Inc.(1) INTRODUCTIONIndustry overviewCross platform developmentIntroduction to EqelaEqela syntax / language features
    • Copyright © 2012 Job and Esther Technologies, Inc.Our world(.. And all platforms come in various versions)
    • Copyright © 2012 Job and Esther Technologies, Inc.From an application development perspective ..While targeting only the most populartarget platforms, a developer will need towork with 10-20 different operating systemplatforms/versions, at least 3-5 differentprogramming languages, each withdifferent API libraries.
    • Copyright © 2012 Job and Esther Technologies, Inc.Big problem in the industryAll software developers need todeal with this one way or theother
    • Copyright © 2012 Job and Esther Technologies, Inc.HOW?
    • Copyright © 2012 Job and Esther Technologies, Inc.Usual solutions(1) Work only on one platform(2) Create the same application severaltimes (once per platform)(3) Do “cross platform development”
    • Copyright © 2012 Job and Esther Technologies, Inc.Traditional ways to do cross platform development(1) The “scripted” approach(Adobe Air / Flex, Appcelerator, Corona, RhoMobile, ..)(2) The “bytecode” approach(MoSync, Mono)(3) The “C++” approach(Marmalade, Qt, WxWidgets, Unity)(4) The “embed a web browser” approach(PhoneGap)(5) HTML5
    • Copyright © 2012 Job and Esther Technologies, Inc.Five different crossplatform developmentapproaches
    • Copyright © 2012 Job and Esther Technologies, Inc.#1: The “scripted” approachSource codeIn a scriptinglanguageDevelopmenttoolUnmodifiedSource code+Interpreter /Virtual machineFor iOSUnmodifiedSource code+Interpreter /Virtual machineFor AndroidRun inbrowserAndroidapplicationiOSapplication(JavaScript,(JavaScript,Lua, Ruby, ..)Lua, Ruby, ..)(Adobe Air / Flex, Appcelerator, Corona, RhoMobile, ..)Runtime /Virtualmachine
    • Copyright © 2012 Job and Esther Technologies, Inc.The “scripted” approach: ArchitectureOperating systemLanguage interpreter / runtimeAPIs and libraries Application code
    • Copyright © 2012 Job and Esther Technologies, Inc.The “scripted” approach: ArchitectureOperating systemLanguage interpreter / runtimeAPIs and libraries Application code Makes applicationInstallers much biggerIncreases memoryusageReduces runtimePerformanceDue to this approach being very popular, many considercross platform development to be slow, high in memory use,and producing bigger installers.Applications can onlyAccess selectedParts of the native API
    • Copyright © 2012 Job and Esther Technologies, Inc.#2: The “bytecode” approachSourcecodeBytecodeCompilerAndroidapplicationRun inbrowserClassLibrary(MoSync, Mono)iOSapplicationWindowsPhoneapplicationVery similar to the “scripted” approach,with the added bytecode compilation step.BytecodeDevelopmentToolRuntime /Virtualmachine
    • Copyright © 2012 Job and Esther Technologies, Inc.The “bytecode” approach: ArchitectureOperating systemBytecode interpreter / runtimeAPIs and libraries Application code Makes applicationInstallers much biggerIncreases memoryusageReduces runtimePerformanceDue to its similarity with the “interpreted” approach, thebenefits and disadvantages are very similarApplications can onlyAccess selectedParts of the native API
    • Copyright © 2012 Job and Esther Technologies, Inc.#3: The “C++” approachSource codeIn a specificLanguageSDK /compilerRun inbrowserAndroidapplicationiOSapplication(C++)(C++)CrossPlatformClass libraryIn the specificlanguage(C++)(C++)(Marmalade, Qt, WxWidgets, Unity)BlackBerryapplicationWindowsPhoneapplication+ Truly native (100%)+ High performance- Limited platform support(not really cross platform)
    • Copyright © 2012 Job and Esther Technologies, Inc.#4: The “embed a web browser” approachSourceCode inHTML, CSS,JavaScriptThetoolLibraries C source codeThat opens aBrowser andDisplays theprogramJava source codeThat opens aBrowser andDisplays theprogramAndroidSDKAndroidapplicationiOSSDKiOSapplicationRun inbrowser(PhoneGap, AppGyver)- Very poor performance- Suitable for only “web-style” apps- Limited access to platform APIs- Application source code can be easily retrieved+ Easy way to convert existing websites to“native apps”
    • Copyright © 2012 Job and Esther Technologies, Inc.#5: HTML5+ Commonly known skillset (HTML, CSS, JavaScript)+ Very popular, many Internet resources available- Unfinished standard- Fragmented, non-compatible implementations- Extremely poor performance on mobile- The language is poorly suited for large programs- Applications are inherently “open source”
    • Copyright © 2012 Job and Esther Technologies, Inc.Common issuesLarge installer sizeExcessive memory useLow performanceLimited API access
    • Copyright © 2012 Job and Esther Technologies, Inc.Cross platform development tool .... Based on programming language conversiontechnology
    • Copyright © 2012 Job and Esther Technologies, Inc.Eqela videohttp://www.youtube.com/watch?v=WcWf7SXGBv0
    • Copyright © 2012 Job and Esther Technologies, Inc.How it worksSourceCode(Eqela)EqelaCompilerLibraries CsourcecodeJavasourcecodeJavascriptcodeAndroidSDKAndroidapplicationiOSSDKiOSapplicationRun inbrowser
    • Copyright © 2012 Job and Esther Technologies, Inc.The technical benefits ..Small installer sizeOptimal memory useNative performanceNo API access limitations
    • Copyright © 2012 Job and Esther Technologies, Inc.How it works: A sample applicationclass Main : LayerWidget{public void initialize() {base.initialize();add(LabelWidget.instance().set_text(“Hello World”));}}Main.eqEqelaCompilerLayerWidget,LabelWidgetMain.java,LayerWidget.java,LabelWidget.javaAndroidSDKAndroidapplication
    • Copyright © 2012 Job and Esther Technologies, Inc.100% nativeMain.eqEqelaCompilerLayerWidget,LabelWidgetMain.java,LayerWidget.java,LabelWidget.javaAndroidSDKAndroidapplicationOnly native code → “100% native”No virtual machine addedNo interpreter added
    • Copyright © 2012 Job and Esther Technologies, Inc.Main.eq → Main.javaclass Main : LayerWidget{public void initialize() {base.initialize();add(LabelWidget.instance().set_text(“Hello World”));}}package mk.test;public class Main extends eq.gui.LayerWidget{@Overridepublic void initialize() {super.initialize();((eq.gui.ContainerWidget)this).add(((eq.gui.Widget)eq.widget.LabelWidget.eq_widget_LabelWidget_instance().set_text(eq.api.StringStatic.eq_api_StringStatic_for_strptr("Hello world"))));}public Main() {}}(EQELA)(JAVA)
    • Copyright © 2012 Job and Esther Technologies, Inc.Eqela is many things ..
    • Copyright © 2012 Job and Esther Technologies, Inc.Eqela is ..(1) A modern, object orientedprogramming languagePowerful, object oriented, easy touse, efficient to programDesigned to fit the needs of thedifferent target platformsPart of the C syntax familyInstantly familiar to anyone withexperience in C, C++, Java, C#,JavaScript
    • Copyright © 2012 Job and Esther Technologies, Inc.Eqela is ..(2) An advanced compiler /programming language translatorConverts the source programminglanguage (Eqela) to other languages(Java, C#, C, JavaScript, ..)Generates project files / directoriesbe used by the development tools ofthe various target platformsPulls in libraries to link with theapplication
    • Copyright © 2012 Job and Esther Technologies, Inc.Eqela is ..(3) An application frameworkA cross-platform API that worksacross programming languagesAll common functionalities, such asfile I/O, networking, threading, datastructures, ..Same API on any language andoperating system
    • Copyright © 2012 Job and Esther Technologies, Inc.Eqela is ..(4) A cross platform graphicaluser interface (GUI) APIA rich set of user interfacecomponents and controlsA powerful graphics rendering API fordevelopment of custom controlsWorks the same way across allplatforms (mobile, desktop, web)
    • Copyright © 2012 Job and Esther Technologies, Inc.Eqela is ..(5) A development tool / environment
    • Copyright © 2012 Job and Esther Technologies, Inc.Eqela is ..Programming languageCompilerApplication frameworkGUI toolkitDevelopment tool / environment
    • Copyright © 2012 Job and Esther Technologies, Inc.How can it be used?
    • Copyright © 2012 Job and Esther Technologies, Inc.ONLINE / WEB DOWNLOAD / INSTALLEQELA LIVETarget Android / HMTL5Free of chargeNo installation requiredEQELA “FULL VERSION”All supported platformsPayment per platformInstalled per workstationThe different editions
    • Copyright © 2012 Job and Esther Technologies, Inc.Supported platformsAndroid, BlackBerry 10, BlackBerry 5/6/7, HTML5,Apple iOS, J2ME, Linux, Mac OS X, Symbian,Windows, Windows Phone
    • Copyright © 2012 Job and Esther Technologies, Inc.Source files and modulesEqela source file extension: “.eq”Generally file is named after the class, eg. “Main.eq”for class “Main” (convention only, not enforced)Usually one class per file (also convention)Directory name names the module and acts as the“application id”
    • Copyright © 2012 Job and Esther Technologies, Inc.The Eqela syntaxBelongs to the “C” syntax family:C, C++, Objective-C, Java, C#, PHP, ..
    • Copyright © 2012 Job and Esther Technologies, Inc.Eqela syntax / language features
    • Copyright © 2012 Job and Esther Technologies, Inc.Eqela is a fully object oriented,class based programminglanguage
    • Copyright © 2012 Job and Esther Technologies, Inc.Class declarations[modifiers] class [classname] : [basetypes]{[implementation]}public class MySampleClass : SuperClass{public void do_something() {// more code here}}The base class and interfaces may be mixed in the [basetypes]section of the class declaration in any order.
    • Copyright © 2012 Job and Esther Technologies, Inc.Class declarationsClass declarations can include these components:1.Modifiers: public, private (default) or fundamental.public – the class will be exported in the modules APIprivate – the class is only available for use internallywithin the modulefundamental – the class will not have any base class2.The class name, by convention in CamelCase3.The base class (superclass) and a comma-separated list ofinterfaces implemented by the class may be mixed in the[basetypes] section of the class declaration in any order.4.The class body surrounded by braces, { }.
    • Copyright © 2012 Job and Esther Technologies, Inc.Automatic base classingclass MyClass{// field, constructor, and// method declarations}class MyClass : Object{// field, constructor, and// method declarations}=fundamental class MyClass{// field, constructor, and// method declarations}!=
    • Copyright © 2012 Job and Esther Technologies, Inc.There can be no programwithout a class(no standalone functions)
    • Copyright © 2012 Job and Esther Technologies, Inc.Comments// This is a valid comment/* This is also a valid comment *//* This* comment* spans* multiple* lines.*/Comments are described in a way familiar withmany languages, using either the "//" notation orthe "/*" .. "*/" method.
    • Copyright © 2012 Job and Esther Technologies, Inc.Data typesDifferent kinds of data types:Primitive typesObject types(Strings)
    • Copyright © 2012 Job and Esther Technologies, Inc.Primitive types● Built in to the language as basic building blocks, andcannot be extended by the programmer. Passed byvalue in method calls.● strptr, ptr, void, double, bool, int, long, bytestrptr var_name = “abc”.to_strptr();ptr var_name = null;double var_name = 123.45;bool var_name = true;int var_name = 100000;long var_name = 100000;byte var_name = 100;void //refers to no data type at all
    • Copyright © 2012 Job and Esther Technologies, Inc.Object typesObjects = Instances of classesPassed by reference in method callsclass MyClass{public int method() {return(10);}}var o = new MyClass();
    • Copyright © 2012 Job and Esther Technologies, Inc.StringsString literal = "This is a string literal";var str = "Another string literal";if(str is String) {; // This is true}Eqela API provides a “String” class that offers astring implementation as an object (object type).String literals are automatically assigned asinstances of the “String” object, not as “strptr”variables.
    • Copyright © 2012 Job and Esther Technologies, Inc.String operations// assignmentvar str1 = "String 1";// concatenationvar str2 = str1.append(" + More stuff");// console outputLog.message(str2); // prints out "String 1 + More stuff"// comparisonif(str1.equals(str2)) {; // not true}// comparison with a literalif("String 1".equals(str1)) {; // true}
    • Copyright © 2012 Job and Esther Technologies, Inc.Constructing stringsvar sb = StringBuffer.create().sb.append("First");sb.append_c( );sb.append("Second");Log.message(sb.to_string()); // prints "First Second"Normal String objects are immutableStringBuffer class is provided as part of the APIto efficiently construct strings
    • Copyright © 2012 Job and Esther Technologies, Inc.Class constructorWhat is a “constructor”?
    • Copyright © 2012 Job and Esther Technologies, Inc.A method with the same name as the class nameHas no return typeA class can only have one constructor function, and theconstructor is not allowed to have any parameters.public MyClass{public MyClass() {; // implementation}}Class constructor
    • Copyright © 2012 Job and Esther Technologies, Inc.Supplying object parameters upon creationpublic MyClass{private int variable = 0;public MyClass() {}public static MyClass create(int value) {var v = new MyClass();v.variable = value;return(v);}}var o = MyClass.create(10);(1) By using static creation methods
    • Copyright © 2012 Job and Esther Technologies, Inc.public MyClass{property int variable = 0;public MyClass() {}}var o = new MyClass().set_variable(10);Supplying object parameters upon creation(2) By using properties
    • Copyright © 2012 Job and Esther Technologies, Inc.Class destructorWhat is a “destructor”?
    • Copyright © 2012 Job and Esther Technologies, Inc.public MyClass{~Myclass() {; // actions here}}As is usual in all modern languages withautomatic memory management, it is highlydiscouraged to use destructors in Eqelaapplications. Generally the only well-knownacceptable use for a destructor is to deallocateresources allocated manually.Class destructor
    • Copyright © 2012 Job and Esther Technologies, Inc.Member variables[modifiers] [type] [variablename] = [initializer];class MyClass{int number = 10;public static MyClass second;private MyClass third = null;}Modifiers : "private", "public", "static"Initializer is optional
    • Copyright © 2012 Job and Esther Technologies, Inc.Declaring methodspublic int SomeMethod(int int_value, bool bool_value) {// method bodyreturn(10);}modifiers returntypemethodnameparameterlistIf the return type is NOT void, the method mustend in a “return” line
    • Copyright © 2012 Job and Esther Technologies, Inc.Virtual methods and overridingclass BaseClass{public virtual void hello() {Log.message("hello 1");}}class DerivedClass : BaseClass{public override void hello() {Log.message("Hello enhanced!");}}If a method is declared with modifier "virtual", it becomesa virtual function.To override a method in a subclass, it should be declaredusing the "override" modifier
    • Copyright © 2012 Job and Esther Technologies, Inc.Method hidingEqela does NOT allow method hidingIf a method is declared in a base class, and it is not virtual, nomethod of the same name may be declared in any of thesubclasses, even if the parameters would differ.
    • Copyright © 2012 Job and Esther Technologies, Inc.Static methodsclass MyClass{public static void hello() {Log.message("MyClass hello");}}class SecondClass{public void method() {var mc = new MyClass();mc.hello(); // not rightMyClass.hello(); // the correct way}}Called by the name of the class they areassociated with, not through an object instance
    • Copyright © 2012 Job and Esther Technologies, Inc.Abstract methodsWhat is an “abstract method”?
    • Copyright © 2012 Job and Esther Technologies, Inc. Methods that have a method signature but noimplementation Declared using the modifier "abstract“ If no "abstract" modifier is present, but method body is missing,the "abstract" keyword is automatically assumed No "override" keyword is required to override abstract methodsinterface MyInterface{public void first_method();public abstract void second_method();}Abstract methods
    • Copyright © 2012 Job and Esther Technologies, Inc.What is an interface?
    • Copyright © 2012 Job and Esther Technologies, Inc.Interfaceinterface MyInterface{public void method1();public int method2();}A group of related methods with empty bodiesDefines a standard and public way of specifyingthe behavior of the class (defines a contract)Declared using the interface keyword
    • Copyright © 2012 Job and Esther Technologies, Inc.InterfacesTo use an interface, you must implement that interface ina classImplementing an interfaceImplement multiple interfacesclass MyClass : MyInterface{// class body}class MyClass : MyInterface, MyOtherInterface{// class body}
    • Copyright © 2012 Job and Esther Technologies, Inc.PrerequisitesIn Eqela, an interface may not "inherit" anotherinterface, but it may instead have "prerequisites",through which roughly the same functionality isachieved
    • Copyright © 2012 Job and Esther Technologies, Inc.Multiple inheritanceMultiple inheritance is not allowed – butimplementing multiple interfaces IS allowed
    • Copyright © 2012 Job and Esther Technologies, Inc.Legal interface usageinterface First{public void method1();}interface Second : First{public void method2();}class MyClass : Second, First{public void method1() {}public void method2() {}}
    • Copyright © 2012 Job and Esther Technologies, Inc.Illegal interface usageinterface First{public void method1();}interface Second : First{public void method2();}class MyClass : Second{public void method1() {}public void method2() {}}
    • Copyright © 2012 Job and Esther Technologies, Inc.Other language features ..
    • Copyright © 2012 Job and Esther Technologies, Inc.Operators and expressionsGroup OperatorUnary -, !, ++, --Logical binary ||, &&Comparative binary ==, !=, <, <=, >, >=, isOperative binary +, -, *, /, %int a = 10 + 5;int b = a / 10;If(a == 15 || b == 7) {}if(a == 15 && b == 7) {}if(a != b) {}
    • Copyright © 2012 Job and Esther Technologies, Inc.Type castingWhat is the meaning of “type casting”?
    • Copyright © 2012 Job and Esther Technologies, Inc.Type castingStatic type castingOne data type can be cast into another in a fairly liberalmanner by using the "(typename)" notation.(Fast but may lead to runtime errors)Dynamic type castingUses the “as” operator to cast one data type to another.(Slightly slower than static type casting, due to extra checking involved, but a much saferway)double n = 100.43;int ni = (int)n;var x = new MyClass();var y = (MyOtherClass)x;var x = new MyClass();var y = x as MyOtherClass; // will be null if not a subclass of MyOtherClass
    • Copyright © 2012 Job and Esther Technologies, Inc.Control structuresIf .. ElseWhileDo .. WhileForForeachSwitch
    • Copyright © 2012 Job and Esther Technologies, Inc.If .. Elseif(condition) {; // execute if condition is true}else {; // execute if condition is false}
    • Copyright © 2012 Job and Esther Technologies, Inc.Whilewhile(condition) {; // execute while condition is true}while(condition) {if(want_to_stop) {break;}continue;; // will not reach here}While blocks can be interruptedwith the "break" statement orrestarted with the "continue"statement
    • Copyright © 2012 Job and Esther Technologies, Inc.Do .. Whiledo{; // execute here}while(condition);
    • Copyright © 2012 Job and Esther Technologies, Inc.Forfor(initializer; condition; execute_after) {; // actions here}
    • Copyright © 2012 Job and Esther Technologies, Inc.Foreachforeach(var variablename in collection) {; // actions here}foreach(String variablename in collection) {; // actions here}The data type of the loopvariable may be dynamicallyassigned as above ("var"), orit can be explicitly set by theuser.
    • Copyright © 2012 Job and Esther Technologies, Inc.Switchswitch(expression) {case value1: {; // statements}case value2: {; // statements}default: {; // statements}}•All "case" blocks must beenclosed in curly braces "{"and "}".•Only one "case" statement isallowed per block.•No break statements arerequired to terminate the caseblocks.
    • Copyright © 2012 Job and Esther Technologies, Inc.Propertiesclass MyClass{property int myproperty;}class MyClass{int myproperty;public MyClass set_myproperty(int v) {myproperty = v;return(this);}public int get_myproperty() {return(myproperty);}}
    • Copyright © 2012 Job and Esther Technologies, Inc.class MyClass{property int myproperty;}class AnotherClass{public void method() {MyClass cl = new MyClass().set_myproperty(10);}}Using properties
    • Copyright © 2012 Job and Esther Technologies, Inc.Default parameterspublic void my_method(int n = 0) {// (method implementation code here)}obj.my_method(10);obj.my_method();Automatically supply parameter values whereno parameters are given
    • Copyright © 2012 Job and Esther Technologies, Inc.Embedding other languages
    • Copyright © 2012 Job and Esther Technologies, Inc.Embedding codeThe dictionary definition of “embed” is to makesomething an integral part ofIn Eqela programming language, “embedding” refersto adding other programming languages into blockswithin the Eqela code
    • Copyright © 2012 Job and Esther Technologies, Inc.Embed: Syntaxembed “(language name)” {{{// code in other language}}}Languages: c, c++, objc, java, js, cs, ..int n;embed “c” {{{char* str = “Hello World”;n = strlen(str);}}}Log.message(“Length = %d”.printf().add(n));
    • Copyright © 2012 Job and Esther Technologies, Inc.Embed: Exampleclass Main{embed "c" {{{#include <stdio.h>}}}public static void print() {embed "c" {{{printf("Hello worldn");}}}embed "java" {{{System.out.println("Hello world");}}}}embed "c" {{{int main(int c, char** v) {hello_Main_print();return(0);}}}}embed "java" {{{public static void main(String[] args) {hello_Main_print();}}}}}
    • Copyright © 2012 Job and Esther Technologies, Inc.Thank you