An Introduction to NPL
Suman Karumuri
Hyderabad,India
suman.karumuri@gmail.com
ABSTRACT
Even in this Internet age, reading code is quite hard. Ex-isting Program Visualisation systems could not make visu-alisation of code in existing languages any easier becausethe semantics of the languages were not designed with codevisualisation in mind.
NPL
is an experimental procedural language designed toaid program visualisation and is based on a paradigm called
”Connect Oriented Paradigm”
in which the control and dataflow in a program are unified into a
Signal
and processingin the program is unified into a
Connect
.NPL makes it easy to read and maintain software as itvisualises the execution of code with its semantics intact.Owing of its simplicity and generality, future applicationsof NPL include interactive testing and debugging of appli-cations, domain specific visualisation and also the ability tomodel a subset of existing languages.
Keywords
Programming Languages, Compilers and Interpreters, Pro-gram Visualisation
1. INTRODUCTION
Reading a novel is difficult. But watching a movie basedon the novel is easy. Similarly reading code is quite hard [5][3].Though the compiler understands what the code would do,it would not help the programmer while he is reading it.Reading code would be a lot easier if the compiler couldcreate a movie out of the code, which we can just watch.Such precise visualisation of code at various levels of detailwill help solve many software engineering problems [10]. Inthis paper, we will see how NPL interpreter can create aprecise visualisation of its code.
To understand a program you must become both the ma-chine and the program - Alan J. Perlis Epigram
Intuitive Visualisation of code is a tricky business as itinvolves careful tracking of data flow, control flow and theprocessing that goes on in the interpreter by instrumenting
Permissiontomakedigitalorhardcopiesofallorpartofthisworkforpersonalorclassroomuseisgrantedwithoutfeeprovidedthatcopiesarenotmadeordistributedforprofitorcommercialadvantageandthatcopiesbearthisnoticeandthefullcitationonthefirstpage.Tocopyotherwise,torepublish,topostonserversortoredistributetolists,requirespriorspecificpermissionand/orafee.
OOPSLA
’06Portland,USACopyright200XACMXXXXXXXXX/XX/XX...
$
5.00.
it(the machine details). The data obtained in-turn shouldbe mapped back to semantics of the language and actualcode to produce an intuitive visualisation (the program).Accurate reconstruction of the semantics from the low-level execution details is very difficult as the compiler has al-ready morphed our code for efficiency to a point from whichthe high-level semantics cannot be recovered. Moreover,such a technique is highly dependent on the implementa-tion of the interpreter. Every Program Visualisation systemfaces this problem because the important low-level execu-tion details are left out of language specifications since codevisualisation was not one of the design goals of a language.Hence, a language designed to aid visualisation must spec-ify the low-level execution mechanisms of the code and thehigher level semantics of the language in a coherent way.The careful balance of these contradictory requirements willmake it possible to intuitively visualise the low-level execu-tion of the programs with the high-level semantics of thelanguage intact, thus making reading code easier.
NPL
is an experimental procedural language designed toaid precise and intuitive visualisation of the execution of code with its semantics intact. To the best of my knowledge,NPL is the first language whose code can be accurately vi-sualised by the interpreter. In this paper we shall see howNPL is able to do it:
•
In
§
2 we will support our claim that languages re-designed to aid visualisation would yield better visual-isation than better visualisation tools for existing lan-guages.
•
The redesigned language is built on
Connect Oriented Paradigm
which acts as an intermediary representa-tion between higher level semantics and low level exe-cution details of code in
§
4.2
•
Next we will discuss the syntax and semantics of the
NPL language
based on ”Connect Oriented Paradigm”in
§
4. Then we prove our claims that we can visualisecode with its semantics, by visualising a few examplesin
NPL UI
, the code visualiser for NPL, in
§
5.
•
In
§
5.4, we will discuss how the NPL language designacts as a foundation for other potential avenues of soft-ware visualisation like domain specific visualisationsand interactive testing and debugging of programs.
Note:
The main contribution of this paper is the abilityof a language interpreter to be able to visualise the sourcecode with its semantics. The intuitiveness of the visualisa-tion can be improved by better art work and minor visual
Leave a Comment