Back to Search
Start Over
Type Inference of Simple Recursive Functions in Scala
- Source :
- Acta Cybernetica. 25:797-815
- Publication Year :
- 2020
- Publisher :
- University of Szeged, 2020.
-
Abstract
- Scala is a well-established multi-paradigm programming language known for its terseness that includes advanced type inference features. Unfortunately this type inferring algorithm does not support typing of recursive functions. This is both against the original design philosophies of Scala and puts an unnecessary burden on the programmer. In this paper we propose a method to compute the return types for simple recursive functions in Scala. We make a heuristic assumption on the return type based on the non-recursive execution branches and provide a proof of this method's correctness. The algorithm does not have a significant effect on the compilation speed. We implemented our method as an extension prototype in the Scala compiler and used it to successfully test our method on various examples. The compiler extension prototype is available for further tests.
- Subjects :
- 0209 industrial biotechnology
Information Systems and Management
Correctness
Scala
Computer science
0102 computer and information sciences
02 engineering and technology
Management Science and Operations Research
computer.software_genre
01 natural sciences
Theoretical Computer Science
020901 industrial engineering & automation
Computer Science (miscellaneous)
Electrical and Electronic Engineering
Programmer
computer.programming_language
Recursion
Programming language
Heuristic
Type inference
Return type
010201 computation theory & mathematics
Computer Vision and Pattern Recognition
Compiler
Software_PROGRAMMINGLANGUAGES
computer
Software
Subjects
Details
- ISSN :
- 2676993X and 0324721X
- Volume :
- 25
- Database :
- OpenAIRE
- Journal :
- Acta Cybernetica
- Accession number :
- edsair.doi...........d0bd6dcc2c8d6f63d7615f28aa9f5343