Master’s Thesis Presentation • Programming Languages — Gradual C Programming for Typed LuaExport this event to calendar

Friday, October 26, 2018 — 11:00 AM EDT

Rafi Shan Turas, Master’s candidate
David R. Cheriton School of Computer Science

In this thesis, we deal 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, we propose a programming language named Poseidon Lua that 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 able to use direct memory programming using its C pointers to avoid the performance overhead of using Lua tables. We also propose an extension of Lua named Modified Lua. All Poseidon Lua programs are translated to Modified Lua programs before execution. In addition, for calling external C functions, we provide a Modified LuaFFI, luaffi_cs, library for Poseidon Lua. Poseidon Lua, Modifed Lua, and luaffi_cs library are implemented by modifying the compiler of Typed Lua, the compiler and the virtual machine of Lua, and the luaffifb library, respectively. 

We test Poseidon Lua 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.8x 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 luaffi_cs 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 named Lua using features from the statically-typed programming language named C.

The future work is identified as follows: 1) integration of JIT-compiler, 2) development of language features that can mitigate the security risk from unrestricted memory accesses due to the use of C pointers, 3) extension of Modified LuaFFI library to handle composite C values other than C pointers, and 4) extension of Poseidon Lua to perform static typechecking for the arguments of an external C function.

Location 
DC - William G. Davis Computer Research Centre
2314
200 University Avenue West

Waterloo, ON N2L 3G1
Canada

S M T W T F S
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
  1. 2020 (1)
    1. January (1)
  2. 2019 (255)
    1. December (21)
    2. November (25)
    3. October (16)
    4. September (20)
    5. August (18)
    6. July (12)
    7. June (23)
    8. May (23)
    9. April (32)
    10. March (25)
    11. February (16)
    12. January (24)
  3. 2018 (220)
    1. December (16)
    2. November (19)
    3. October (26)
    4. September (22)
    5. August (17)
    6. July (20)
    7. June (13)
    8. May (25)
    9. April (34)
    10. March (24)
    11. February (3)
    12. January (1)
  4. 2017 (36)
  5. 2016 (21)
  6. 2015 (36)
  7. 2014 (33)
  8. 2013 (23)
  9. 2012 (4)
  10. 2011 (1)
  11. 2010 (1)
  12. 2009 (1)
  13. 2008 (1)