Show simple item record

dc.contributor.authorTuras, Rafi
dc.date.accessioned2019-01-22 20:48:26 (GMT)
dc.date.available2019-01-22 20:48:26 (GMT)
dc.date.issued2019-01-22
dc.date.submitted2019
dc.identifier.urihttp://hdl.handle.net/10012/14377
dc.description.abstractThe work presented in this thesis deals with the problem of enhancing the performance of dynamically-typed programming languages by integrating features from statically-typed programming languages. Statically-typed languages focus on security and performance, but dynamically-typed languages focus on flexibility and automation. Optional type-systems and gradual type-systems realize some of the security benefits offered in statically-typed languages by adding a static type-system to a dynamically-typed language. However, these approaches generally do not provide the performance advantages of statically-typed languages. In this thesis, a programming language named Poseidon Lua is proposed. It extends Typed Lua, an optionally-typed programming language, with language features that are only available from statically-typed languages. A Poseidon Lua program is able to use manual memory management to bypass the performance costs related to automatic garbage collection. A Poseidon Lua program is also able to use direct memory programming using its C pointers to avoid the performance overhead of using Lua tables. Note that Lua does not allow a program to directly manipulate raw memory. This thesis presents an extension of the compiler and virtual machine of Lua, named Modified Lua, that does allow the direct manipulation of raw memory. All Poseidon Lua programs are translated to Modified Lua programs before execution. In addition, for calling external C functions, a Modified LuaFFI library is provided for Poseidon Lua. The Modified LuaFFI library is an extension of the luaffifb library that avoids the performance overhead of the extra dynamic typechecking that is carried out by the cdata values. Poseidon Lua, Modifed Lua, and the Modified LuaFFI library are implemented by modifying the compiler of Typed Lua, the compiler and the virtual machine of Lua, and the luaffifb library, respectively. Poseidon Lua is tested using a benchmark suite and a feature test suite. In the benchmark suite, Poseidon Lua programs achieve a speedup of 0.98X with respect to corresponding Lua programs and a speedup of 6.82X with respect to corresponding luaffifb programs, which is a Lua program that uses the luaffifb library. One Poseidon Lua program of the suite is able to achieve a maximum speedup of 10.76X with respect to the corresponding luaffifb program. In the feature test suite, relative to a Lua program, a Poseidon Lua program is able to achieve a speedup of 4.18X and 1.31X due to manual memory management and direct memory programming, respectively. A Poseidon Lua program that uses the Modified LuaFFI library is able to achieve a speedup of 10.32X over a luaffifb program. Poseidon Lua along with its components achieves significant performance advantages over the dynamically-typed language Lua using features from the statically-typed programming language C.en
dc.language.isoenen
dc.publisherUniversity of Waterlooen
dc.subjectstatic typingen
dc.subjectdynamic typingen
dc.subjectoptional typingen
dc.subjecttype soundnessen
dc.subjectgradual typingen
dc.subjectLuaen
dc.subjectTyped Luaen
dc.subjectCen
dc.subjectmanual memory managementen
dc.subjectdirect memory programmingen
dc.subjectforeign function interface libraryen
dc.subjectC APIen
dc.subjectPoseidon Luaen
dc.subjectModified Luaen
dc.subjectModified LuaFFI Libraryen
dc.titleGradual C Programming for Typed Luaen
dc.typeMaster Thesisen
dc.pendingfalse
uws-etd.degree.departmentDavid R. Cheriton School of Computer Scienceen
uws-etd.degree.disciplineComputer Scienceen
uws-etd.degree.grantorUniversity of Waterlooen
uws-etd.degreeMaster of Mathematicsen
uws.contributor.advisorRichards, Gregor
uws.contributor.affiliation1Faculty of Mathematicsen
uws.published.cityWaterlooen
uws.published.countryCanadaen
uws.published.provinceOntarioen
uws.typeOfResourceTexten
uws.peerReviewStatusUnrevieweden
uws.scholarLevelGraduateen


Files in this item

Thumbnail

This item appears in the following Collection(s)

Show simple item record


UWSpace

University of Waterloo Library
200 University Avenue West
Waterloo, Ontario, Canada N2L 3G1
519 888 4883

All items in UWSpace are protected by copyright, with all rights reserved.

DSpace software

Service outages