Thursday, December 12, 2019
Design A Programming Language For Problem â⬠Myassignmenthelp.Com
Question: Discuss About The Design A Programming Language For Problem? Answer: Introduction Pia is a Swahili (Eastern Africa language) name which means another. The name is derived from the need to come up with another more usable and friendly programming language for mobile application development. Pia is a high-level programming language for the purpose of developing cross platform mobile applications. It is an interpreted language which tries to eliminated redundancy and repetition of lines of codes by enhancing the concept of Object Oriented Programming by giving objects power to be used entirely by any conceivable operation or functionality. This language consolidates the thinking of a human being and constructs logic and functionality based on the behavior of the human mind in terms of response and behavior of objects embedded in the constructed programs. It is a hybrid mobile business development language because of the increasing demand for a single, complete and satisfactory language that can develop mobile applications across the mobile operating system divide. The choice of the cross-platform is largely influenced by the mass mobile application users who use different mobile devices but would want exact integration and interconnectivity between those devices without any difficulties hence efficient and effective integration. Its inception was influenced by the increasing concern of mobile application users concerned with the problem of sharing and interconnect mobile devices especially those that are from different operating systems. Pia is a purpose-driven programming language that is event driven purely on the interaction of the activities of the mobile applications under development. It offers the mobile application developers a range of cool and powerful features that enhance their development processes. It is mainly known for the simplicity that it offers to the developers whereby it reduces the average time between the start of a mobile application and its fully production launch. Pia being an interpreted language, its interpreters have been developed for many different operating systems including Windows operating system, Linux, Unix, Mac O among others. It is an open source piece of application that is geared to be improved and enhanced by the vast majority of application developers that stand with the development team that carefully and keenly scrutinize for any grammatical mistakes or improvements of logic representation. Choice and justification of interpretation/compilation methods used Pia is an interpreted programming language, interpreted languages are languages that do not require machine code in order to execute the program; instead, interpreters will run through a program line by line and execute each command unlike compiled languages which are compiled to a machine-readable language before being executed (Krauss, 2017). The choice of the interpretation and compilation methods has been largely influenced by one of the core mission and goal of the language to offer a hybrid platform to offer application developers develop mobile applications for cross platform environments. Therefore, this could only be achieved by a platform independence behavior of a language hence the interpreting choice. Interpreting languages are platform independence that do not rely on the underlying operating system in order to compile its code to a machine-readable format, rather its interpreter can be able to execute the code with ease, efficient and effective way. The need to minimize battery usage in mobile applications has been a huge concern by the users of mobile devices. Mobile applications are developed with powerful functionalities but lack the mechanism to conserve the battery usage because of their intensity in power consumption. This could only force the need to use an interpreted language that produce small program sizes since they have a flexibility to choose instruction executable code. Therefore, it reduces the general power usage in executing the same program on a different compilation method. With the rise in better and efficient programming practices, application developers opt for easy, clear, flexible and dynamic conceptualization of ideas. An incoming programming language therefore has to adhere to competitive market demands of programmers. Interpreting languages offer dynamic scoping and dynamic typing mechanisms which are powerful modern mechanisms that help in writing more understandable codes that are human readable, clear, maintainable, testable and easy to debug. Since Pia programming language reduces the average time in development of the mobile applications, it is therefore crucial to use interpreting language that do not have write, compile or execution cycle hence rapid prototyping. This mechanism will help develop prototype of mobile applications with a few lines of codes that can demonstrate the underlying functionality and behavior of the intended final mobile application hence proper decision marketing is done. Moreover, games can be easily constructed and structured with the help of this method. Memory management. Garbage collection Pia programming language uses automatic mechanisms to recursively run during execution in order to identify any unused memory spaces and allocate them to objects that require intensive memory. A powerful programming language is able to identify memory leakages and automatically do a repair mechanism to prevent more memory leakages (Ravenbrook Limited, 2017). Through the implementation of persistent data structures, Pia programming language uses a garbage collector that reclaims all the unused memory spaces from objects that had been allocated some memory but are not needed anymore for the execution of the application. The garbage collector will also delete any unreferenced objects that are not required by the application, this will not only help in freeing more space for the crucial objects but also it will help in shortening the execution path for faster and efficient running of the programs. Reference Counting Reference counting works in a way that anytime you reference a memory location on the heap, a counter for that particular memory location increments by 1. Every time a reference to that location is deleted, the counter decrements by 1. When that counter gets to 0, then that particular memory location is garbage collected (Krauss, Programming Concepts: Garbage Collection, 2017). This helps in collection of all the unreferenced memory locations that is clogged by unused objects thereby freeing more spaces for the objects that are actively and constantly referenced by the running application. Scoping Scopes in a programming language refer to the visibility of a particular variable or a piece of code either locally or globally in the application execution cycle. A local scope is a piece of code or a variable that is only visible and accessible in the area where it defined while a global scope is a variable of a piece of code that is accessible everywhere in the entire application and can be referenced to be used by any particular calling method for execution purposes. Pia programming language implements both local and global scopes to ensure abstraction of data whereby a variable or a piece of code whenever is declared locally the rest part of the application cannot be able to access or manipulate it whatsoever. In the implementation of programming languages, two types of scopes have been used; static scopes and dynamic scopes. However, Pia implements static scopes as compared to dynamic scopes. When using static scopes, the program that exists in source code is examined without running it first while when using dynamic scopes, one examines the logic behind while executing the program at runtime. Pia programming use static scopes because it is more readable to implement piece of codes statically as opposed to dynamically. It also helps in locality of reasoning in terms of functionality and logic manipulation without losing the track of variables and the flow of logic. Moreover, static scopes have a less run-time overhead as compare to dynamic scopes, this is because the pieces of codes are examined first before evaluated and is referenced in the immediate enclosing piece of code unlike the dynamic scopes which can be reference and called outside their declared area in the application. The pursuit for simplicity in programming languages had not been easy, with the campaigns for everyone to learn programming come at a cost of the designer of programming languages like me to ensure that upcoming languages are both simple to read and simple to understand. Pia programming language uses symbols that are recognizable and easy to relate to any person that has been near a computer. It uses the @ symbol to declare a variable, the @ symbol is common and denotes attachments to human minds, therefore, its usage to declare a variable would mean an attachment of a new variable tot eh program. It will also use diagrams that are familiar to human cognitive understanding when it comes to drag-and-drop menus. The symbols, icons and menus that Pia uses to denote a particular object will symbolize the common noticeable objects in the real world. In computer programming, "orthogonality in a programming language means that a relatively small set of primitive constructs can be combined in a relatively small number of ways to build the control and data structures of the language" (Jens Dietrich, 2013). An orthogonal language enables software developers to independently change one operation of a system, without triggering a ripple effect of changes to subsidiary or dependent operations (TechTarget, 2017). Pia programming language will ensure that different independent modules of the mobile applications are interdependent on other modules but still independent in terms of changes that are done to them or rather manipulative changes that are persisted on them. This programming language combines different small sets of simple data structures such as lists, objects and arrays to form more complex data structures such as trees and heaps. These more complex data structures are then used to implement more complex logic and functionalities of the mobile applications. Like any programming language, Pia involves storing and manipulating data in the processing and execution of the applications. Pia programming language being a loosely-coupled language, does not require the declaration of a data type before a variable. It automatically evaluates the given data and assigns a data type to the variable according to the data type of the data given assigned to the variable. However, all variables are prepended with an @ symbol to denote a declaration of the variable. Some of the data types includes This data type represents a collection of characters that is denoted by either single or double quotes e.g. @name = John Doe This data type represents numerical data. It composes of numbers without decimal places. Its declaration is by the use of numerals without any quotes. e.g. @salary = 120000 This data type represents data that is evaluated on a truth basis of either true of false according to given expression. e.g. @contacted = true @africa == africa This is a data type that represents a collection of related data. It is denoted by []. Data inside the array is separated by commas. e.g. @letters = [a, b, c,] Syntax design is one of the vital concepts that differentiate one programming language from another. It describes the rules that evaluate the correctness of wrongness of a piece of code under the given environment. Pia programming contains may different rules that govern whether a code is executable or not. It therefore has predefined set of rules that are to be followed when writing code for mobile development. Some of the syntax include: Variables are to be declared with a prefix of @ symbol without specifying the data type of the variable because the language is a loosely coupled programming language that evaluate the data type given the data. Examples @message = I am Designing @cost = 50.63 @fruits = [apple, banana, pineapple] Statement termination Pia programming language does not include any symbol to denote a termination of a statement. However, a new line automatically evaluates to a next executable statement. This syntax rule has forced the language to be very strict on indentation in order to determine piece of code under one parent block such as a function. Comments Single line comments in this programming language is implemented by the use of / comment / / declaration of the cost of living / @cost = 124000.55 Multiple lines comments are implemented by the use of / multiple lines comment / Example / declare a variable use the variable in a function define the logic inside the function return the processed result A function is a block of code that execute a single logic of operation and returns a value after its evaluation. The declaration of function in this language is by prepending the word func before the function name and appending (). Functions without arguments have empty appended brackets while those with arguments, have the arguments inside the appended brackets. func area() @length @width = 4 @area = @length * @width return @area func area(@len, @wid) @area = @len * @wid return @area Data abstraction refers to, providing only essential information to the outside world and hiding their background details, i.e., to represent the needed information in program without presenting the details (Tutorials Point, 2017). Through the process of abstraction, a programmer hides all but the relevant data about an object in order to reduce complexity and increase efficiency (Tech Target, 2017). Pia implements a great deal of abstraction of data that involves the separation of their interface from implementation. In order to protect restrict the accessibility of data, Pia has implemented data access level of private, protected and public. Public data is denoted by prepending the @ symbol followed by the word public, e.g. @public fullname, @public area(). Public access level allows the defined data to be accessed anywhere in the application. The data defined under this access level does not have privacy and can be used and manipulated by any piece of code anywhere in the application. However, it helps in the usage of a consistent data across the entire application. Private data is denoted by prepending the @ symbol followed by the word private, e.g. @private firstname, @private perimeter(). Private access level restrict data to be only accessed in a certain class and cannot be accessed outside that defining class. It protects the defined data from being changed or manipulated by other outside classes other than the defining class. Protected data is denoted by prepending the @ symbol followed by the word protected, e.g. @protected lastname, @protected taxation(). Protected access level restrict data to be only access by a child class of the parent class defining the data. This is an essential mechanism of inheritance by which child classes can inherit and use defined data and functions from their corresponding parent classes. This is the ability to write code that is clear, concise, easy to read, easy to understand and avoids repetition. Pia programming language uses basic English to describe a certain expression that anyone can comprehend the logic behind it. in keyword Pia uses the in keyword to evaluate whether an item is present in an array or not. It also uses not in or !in to evaluate that an item is not in the given array. Examples a in [c, d, a] a not in [v, w, x, f] Pia uses the is keyword to evaluate whether a certain variable is of a given data type. Example @a = Letter A / declare a variable a / @a is string Type checking also known as a type system is a collection of rules that assign a property called type to various constructs in a computer program, such as variables, expressions, functions or modules, with the end goal of reducing the number of bugs by verifying that data is represented properly throughout a program (Krauss, Programming Concepts: Static vs. Dynamic Type Checking, 2017). Pia program uses dynamic type checking whereby the type checking is done at run time rather that static type checking where type checking is done at compile time. This implementation does not require one to specify or declare the data type of the variable instead, the language compiler evaluates the given data at run time and assigns the variable a corresponding data type accordingly. @language = French / string declaration / @price = 200 / integer declaration / From the examples above, there is no specification of data type of both language and price but rather the system will evaluate language to be of type string and price to be of type integer at runtime. This is a mechanism that its implementation instructs the program what to do when encountering an unexpected condition. It is a crucial technique that ensures reliability of the developed application. It is a fundamental concept of test driven development, whereby a developed program is ascertained to produce the expected outcome with accuracy. Pia programming uses try-catch block to handle these expectations and raises a necessary executable code to handle the exception. Aliasing is the use of two or more distinct referencing methods or names for the same memory cell (www.cs.ubc.ca, 2017). For example, the following code instantiated an object salon from the user-defined class Salon1 and then introduces an alias BestSalon: Salon1 time = new Salon1() / calls Salon1 constructor / Salon1 BestSalon = salon Later the programmer deletes this object by salon = null; The syntax of Pia programming language uses basic English that anyone can easily understand. The use of in keyword to check if an item exists in an array or not is a good example that explains the usage of comprehensive key words to explain a given logic. The usage of abbreviations derived from a full name of a common used name is a good practice to immediately understand what a piece of code means. The use of func keyword to define a function is another example of what a human being can easily derive without more explanations. Indentation in Pia is a strict syntax rule whereby any executable line of code within a parent function must be indented inside it. This principle helps in the readability of code whereby one can easily identify and differentiate one block of code from another. Pia uses a comment-system that is easy to comprehend whereby a single line comment is denoted by a forward slash and a single quote(/.../) while a multi-line comment is denoted by a forward slash and a double quote(/.../). This helps the reader to easily differentiate between a single and a double comment through the usage of single and double quotes inside the forward slashes. Writability Pia programming language favors a relatively number of data types which facilitates simplicity and orthogonality. This implementation therefore describes the writability ability of the language. It also supports abstraction of data through different access levels. The abstraction of implementation of complex data structures and operations from their interface has facilitated a great deal in ensuring that Pia programming language is writable. Pia has also ensured Expressivity of its logic and expressions. These techniques also help in the writability of the language. Reliability By applying dynamic type checking of data for type errors at runtime, Pia programming language ensures that the developed code does not contain errors which assures proper functioning of the developed mobile application. Pia also supports aliasing at low level, regardless of this being costly dangerous technique, it assures reliability of the program being executed by checking if the aliased name operates similar to the original name with the same memory space. References Jens Dietrich. (2013, May 1). Java Tip: Orthogonality by example. Retrieved from JAVAWORLD: https://www.javaworld.com/article/2078767/open-source-tools/java-tip-orthogonality-by-example.html Krauss, A. (2017). Programming Concepts: Compiled and Interpreted Languages. Retrieved from Aaron Krauss: https://thesocietea.org/2015/07/programming-concepts-compiled-and-interpreted-languages/ Krauss, A. (2017, January 26). Programming Concepts: Garbage Collection. Retrieved from Aaron Krauss: https://thesocietea.org/2017/01/programming-concepts-garbage-collection/ Krauss, A. (2017). Programming Concepts: Static vs. Dynamic Type Checking. Retrieved from AarSome of the syntax include:on Krauss: https://thesocietea.org/2015price to be of type integer at runtime./11/programming-concepts-static-vs-dynamic-type-checking/ Ravenbrook Limited. (2017). Memory management in various languages. Retrieved from Memory Management Reference: https://www.memorymanagement.org/mmref/lang.html Tech Target. (2017). abstraction. Retrieved from Tech Target: https://whatis.techtarget.com/definition/abstractio TechTarget. (2017). orthogonal. Retrieved from TechTarget: https://searchstorage.techtarget.com/definition/orthogonal Tutorials Point. (2017). Data Abstraction in C++. Retrieved from Tutorials Point: https://www.tutorialspoint.com/cplusplus/cpp_data_abstraction.htm www.cs.ubc.ca. (2017). Programming Concepts and Methods for Enhanced Student Learning. Retrieved from www.cs.ubc.ca: https://www.cs.ubc.ca/wccce/Program03/papers/TongXu/TongXu.htm
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.