{"id":{"repo_id":"brock","oai_identifier":"oai:brocku.scholaris.ca:10464/20719"},"canonical_url":"https://search.ndltd.org/etd/brock/oai:brocku.scholaris.ca:10464/20719","repository":{"repo_id":"brock","name":"Brock University","base_url":"https://brocku.scholaris.ca/server/oai/request"},"display":{"title":"Optimization in a Combinator-Based Compiler for a Functional Programming Language","abstract":"Functional programming (FP), rooted in the lambda calculus, enables concise, modu- lar, and declarative programs through immutable data, pure functions, and referential transparency. These properties support clearer reasoning, improved testability, and stronger correctness guarantees. Yet a persistent implementation challenge remains: high-level lambda abstractions are elegant, but not directly suited to efficient low-level execution. Our work investigates combinator-based compilation as a practical route from typed functional source programs to native code. The central idea is to eliminate variables by translating source terms into combinator expressions. A variable-free target simplifies execution by avoiding the management of environments and substi- tution at runtime. However, a naive combinator translation based only on the classical SKI basis can expand terms dramatically and introduce redundant computation. To study this problem concretely, we design and implement Kavah, a statically typed functional language supporting higher-order functions, algebraic data types, pattern matching, recursion, primitive arithmetic and boolean operations, and syn- tactic conveniences such as sections. We develop a Java compiler for Kavah that parses complete programs, checks them using a unification-based type system, and lowers them through Scott encoding and an intermediate representation into a combinator language. The translation uses bracket abstraction and an extended basis including B, C, W, Y, and C∗, together with source-level and combinator-level optimizations. One major contribution is the architecture that coordinates established optimiza- tion techniques across source-level, abstraction-elimination, and combinator-level rep- resentations. Before lambda elimination, the compiler performs common subexpres- sion elimination to preserve source-level sharing. After translation, it applies function inlining, algebraic simplification of combinator expressions, and partial evaluation of constant and pattern-driven computations. These passes reduce unnecessary combi- nator growth, expose opportunities for compile-time computation, and significantly improve the quality of the generated target terms. Finally, the optimized combinator program is lowered to a small abstract-machine style backend that emits x86 assembly and produces native executables. By con- necting a rich typed source language, an optimized combinator translation, and a concrete machine-code backend, our work demonstrates that combinator compila- tion can serve not merely as a theoretical curiosity, but as a viable and transparent compilation strategy for functional languages.","abstract_html":"Functional programming (FP), rooted in the lambda calculus, enables concise, modu- lar, and declarative programs through immutable data, pure functions, and referential transparency. These properties support clearer reasoning, improved testability, and stronger correctness guarantees. Yet a persistent implementation challenge remains: high-level lambda abstractions are elegant, but not directly suited to efficient low-level execution. Our work investigates combinator-based compilation as a practical route from typed functional source programs to native code. The central idea is to eliminate variables by translating source terms into combinator expressions. A variable-free target simplifies execution by avoiding the management of environments and substi- tution at runtime. However, a naive combinator translation based only on the classical SKI basis can expand terms dramatically and introduce redundant computation. To study this problem concretely, we design and implement Kavah, a statically typed functional language supporting higher-order functions, algebraic data types, pattern matching, recursion, primitive arithmetic and boolean operations, and syn- tactic conveniences such as sections. We develop a Java compiler for Kavah that parses complete programs, checks them using a unification-based type system, and lowers them through Scott encoding and an intermediate representation into a combinator language. The translation uses bracket abstraction and an extended basis including B, C, W, Y, and C∗, together with source-level and combinator-level optimizations. One major contribution is the architecture that coordinates established optimiza- tion techniques across source-level, abstraction-elimination, and combinator-level rep- resentations. Before lambda elimination, the compiler performs common subexpres- sion elimination to preserve source-level sharing. After translation, it applies function inlining, algebraic simplification of combinator expressions, and partial evaluation of constant and pattern-driven computations. These passes reduce unnecessary combi- nator growth, expose opportunities for compile-time computation, and significantly improve the quality of the generated target terms. Finally, the optimized combinator program is lowered to a small abstract-machine style backend that emits x86 assembly and produces native executables. By con- necting a rich typed source language, an optimized combinator translation, and a concrete machine-code backend, our work demonstrates that combinator compila- tion can serve not merely as a theoretical curiosity, but as a viable and transparent compilation strategy for functional languages.","abstract_has_math":false,"creators":["Antwi Kwaku Robert"],"institution":"Brock University","degree_name":"M.Sc. Computer Science","degree_level":"Master","degree_discipline":"Faculty of Mathematics and Science","degree_department":"Department of Computer Science","school":null,"contributors":[],"advisors":["Prof. Michael Winter"],"committee_chairs":[],"committee_members":[],"year":2026,"date_issued":"2026","date_published":"2026","updated_at":"2026-11-19T07:11:50Z","subjects":["Functional Programming, Compiler Optimization, Combinatory Logic, Graph Reduction"],"languages":["eng"],"rights":[],"rights_urls":[],"identifier_entries":[],"person_identifier_entries":[]},"links":{"outbound_url":"https://hdl.handle.net/10464/20719","outbound_label":"Handle","outbound_source":"dc:identifier.uri","record_url":"https://hdl.handle.net/10464/20719","record_label":"Repository record","record_kind":"handle","record_source":"dc:identifier.uri","access_status":null,"embargo_until":null,"access_note":null},"oai_pmh_record":{"url":"https://union.ndltd.org/oai-pmh/?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai%3Aunion.ndltd.org%3Arepo%3Abrock%3Aoai%3Abrocku.scholaris.ca%3A10464%2F20719","prefix":"oai_dc"},"source_record":{"url":"https://brocku.scholaris.ca/server/oai/request?verb=GetRecord&metadataPrefix=dim&identifier=oai%3Abrocku.scholaris.ca%3A10464%2F20719","prefix":"dim"},"metadata_groups":[{"id":"people","label":"People","entries":[{"key":"dc:contributor.advisor","label":"Advisor","values":["Prof. Michael Winter"]},{"key":"dc:contributor.department","label":"Department","values":["Department of Computer Science"]},{"key":"dc:creator","label":"Author","values":["Antwi Kwaku Robert"]}]},{"id":"academic_context","label":"Academic Context","entries":[{"key":"dc:date.accessioned","label":"Dc Date Accessioned","values":["2026-09-22T15:56:02Z"]},{"key":"dc:date.issued","label":"Date","values":["2026"]},{"key":"dc:publisher","label":"Institution","values":["Brock University"]},{"key":"dc:type","label":"Dc Type","values":["Electronic Thesis or Dissertation"]},{"key":"thesis:degree_discipline","label":"Discipline","values":["Faculty of Mathematics and Science"]},{"key":"thesis:degree_level","label":"Degree Level","values":["Master"]},{"key":"thesis:degree_name","label":"Degree Name","values":["M.Sc. Computer Science"]}]},{"id":"subjects_keywords","label":"Subjects and Keywords","entries":[{"key":"dc:subject","label":"Dc Subject","values":["Functional Programming, Compiler Optimization, Combinatory Logic, Graph Reduction"]}]},{"id":"language_rights","label":"Language and Rights","entries":[{"key":"dc:language.iso","label":"Language (ISO)","values":["eng"]}]},{"id":"identifiers","label":"Identifiers","entries":[{"key":"dc:identifier.uri","label":"Identifier URI","values":["https://hdl.handle.net/10464/20719"]}]},{"id":"additional","label":"Additional Metadata","entries":[{"key":"dc:description.abstract","label":"Abstract","values":["Functional programming (FP), rooted in the lambda calculus, enables concise, modu- lar, and declarative programs through immutable data, pure functions, and referential transparency. These properties support clearer reasoning, improved testability, and stronger correctness guarantees. Yet a persistent implementation challenge remains: high-level lambda abstractions are elegant, but not directly suited to efficient low-level execution. Our work investigates combinator-based compilation as a practical route from typed functional source programs to native code. The central idea is to eliminate variables by translating source terms into combinator expressions. A variable-free target simplifies execution by avoiding the management of environments and substi- tution at runtime. However, a naive combinator translation based only on the classical SKI basis can expand terms dramatically and introduce redundant computation. To study this problem concretely, we design and implement Kavah, a statically typed functional language supporting higher-order functions, algebraic data types, pattern matching, recursion, primitive arithmetic and boolean operations, and syn- tactic conveniences such as sections. We develop a Java compiler for Kavah that parses complete programs, checks them using a unification-based type system, and lowers them through Scott encoding and an intermediate representation into a combinator language. The translation uses bracket abstraction and an extended basis including B, C, W, Y, and C∗, together with source-level and combinator-level optimizations. One major contribution is the architecture that coordinates established optimiza- tion techniques across source-level, abstraction-elimination, and combinator-level rep- resentations. Before lambda elimination, the compiler performs common subexpres- sion elimination to preserve source-level sharing. After translation, it applies function inlining, algebraic simplification of combinator expressions, and partial evaluation of constant and pattern-driven computations. These passes reduce unnecessary combi- nator growth, expose opportunities for compile-time computation, and significantly improve the quality of the generated target terms. Finally, the optimized combinator program is lowered to a small abstract-machine style backend that emits x86 assembly and produces native executables. By con- necting a rich typed source language, an optimized combinator translation, and a concrete machine-code backend, our work demonstrates that combinator compila- tion can serve not merely as a theoretical curiosity, but as a viable and transparent compilation strategy for functional languages."]},{"key":"dc:title","label":"Title","values":["Optimization in a Combinator-Based Compiler for a Functional Programming Language"]},{"key":"others:access_status","label":"Others Access Status","values":["open.access"]}]}],"canonical_facts":{"dc:contributor.advisor":["Prof. Michael Winter"],"dc:contributor.department":["Department of Computer Science"],"dc:creator":["Antwi Kwaku Robert"],"dc:date.accessioned":["2026-09-22T15:56:02Z"],"dc:date.issued":["2026"],"dc:description.abstract":["Functional programming (FP), rooted in the lambda calculus, enables concise, modu- lar, and declarative programs through immutable data, pure functions, and referential transparency. These properties support clearer reasoning, improved testability, and stronger correctness guarantees. Yet a persistent implementation challenge remains: high-level lambda abstractions are elegant, but not directly suited to efficient low-level execution. Our work investigates combinator-based compilation as a practical route from typed functional source programs to native code. The central idea is to eliminate variables by translating source terms into combinator expressions. A variable-free target simplifies execution by avoiding the management of environments and substi- tution at runtime. However, a naive combinator translation based only on the classical SKI basis can expand terms dramatically and introduce redundant computation. To study this problem concretely, we design and implement Kavah, a statically typed functional language supporting higher-order functions, algebraic data types, pattern matching, recursion, primitive arithmetic and boolean operations, and syn- tactic conveniences such as sections. We develop a Java compiler for Kavah that parses complete programs, checks them using a unification-based type system, and lowers them through Scott encoding and an intermediate representation into a combinator language. The translation uses bracket abstraction and an extended basis including B, C, W, Y, and C∗, together with source-level and combinator-level optimizations. One major contribution is the architecture that coordinates established optimiza- tion techniques across source-level, abstraction-elimination, and combinator-level rep- resentations. Before lambda elimination, the compiler performs common subexpres- sion elimination to preserve source-level sharing. After translation, it applies function inlining, algebraic simplification of combinator expressions, and partial evaluation of constant and pattern-driven computations. These passes reduce unnecessary combi- nator growth, expose opportunities for compile-time computation, and significantly improve the quality of the generated target terms. Finally, the optimized combinator program is lowered to a small abstract-machine style backend that emits x86 assembly and produces native executables. By con- necting a rich typed source language, an optimized combinator translation, and a concrete machine-code backend, our work demonstrates that combinator compila- tion can serve not merely as a theoretical curiosity, but as a viable and transparent compilation strategy for functional languages."],"dc:identifier.uri":["https://hdl.handle.net/10464/20719"],"dc:language.iso":["eng"],"dc:publisher":["Brock University"],"dc:subject":["Functional Programming, Compiler Optimization, Combinatory Logic, Graph Reduction"],"dc:title":["Optimization in a Combinator-Based Compiler for a Functional Programming Language"],"dc:type":["Electronic Thesis or Dissertation"],"others:access_status":["open.access"],"thesis:degree_discipline":["Faculty of Mathematics and Science"],"thesis:degree_level":["Master"],"thesis:degree_name":["M.Sc. Computer Science"]},"updated_at":"2026-11-19T07:11:50Z"}