scholarly journals V: a language with extensible record accessors and a trait-based type system

2018 ◽  
Vol 25 (3) ◽  
pp. 89
Author(s):  
Arthur Giesel Vedana ◽  
Rodrigo Machado ◽  
Álvaro Freitas Moreira

This article introduces the V language, a purely functional programming language with a novel approach to records.Based on a system of type traits, V attempts to solve issues commonly found when manipulating records in purely functional programming languages.

1995 ◽  
Vol 5 (1) ◽  
pp. 81-110 ◽  
Author(s):  
Peter Achten ◽  
Rinus Plasmeijer

AbstractFunctional programming languages have banned assignment because of its undesirable properties. The reward of this rigorous decision is that functional programming languages are side-effect free. There is another side to the coin: because assignment plays a crucial role in Input/Output (I/O), functional languages have a hard time dealing with I/O. Functional programming languages have therefore often been stigmatised as inferior to imperative programming languages because they cannot deal with I/O very well. In this paper, we show that I/O can be incorporated in a functional programming language without loss of any of the generally accepted advantages of functional programming languages. This discussion is supported by an extensive account of the I/O system offered by the lazy, purely functional programming language Clean. Two aspects that are paramount in its I/O system make the approach novel with respect to other approaches. These aspects are the technique of explicit multiple environment passing, and the Event I/O framework to program Graphical User I/O in a highly structured and high-level way. Clean file I/O is as powerful and flexible as it is in common imperative languages (one can read, write, and seek directly in a file). Clean Event I/O provides programmers with a high-level framework to specify complex Graphical User I/O. It has been used to write applications such as a window-based text editor, an object based drawing program, a relational database, and a spreadsheet program. These graphical interactive programs are completely machine independent, but still obey the look-and-feel of the concrete window environment being used. The specifications are completely functional and make extensive use of uniqueness typing, higher-order functions, and algebraic data types. Efficient implementations are present on the Macintosh, Sun (X Windows under Open Look) and PC (OS/2).


2001 ◽  
Vol 11 (5) ◽  
pp. 439-440
Author(s):  
CHRIS OKASAKI

Algorithms can be dramatically affected by the language in which they are implemented. An algorithm that is elegant and efficient in one language may be ugly and inefficient in another. If you have ever attempted to implement an assignment-intensive algorithm in a functional programming language, you are probably more familiar with this phenomenon than you ever wanted to be! But this sword does not cut in only one direction. Functional programming languages are wonderfully suited to expressing certain kinds of algorithms in a clean, modular way, and researchers over the last five to ten years have greatly expanded the range of algorithms for which this is true.


Author(s):  
Igor Oblomov ◽  
Vyacheslav Rzhavin ◽  
Natalia Pervova ◽  
Alina Gerasimova

В статье рассматривается модель синтаксически управляемого перевода простых арифметических выражений и ее использование в процессе обучения. Атрибутно-транслируемая грамматика предполагает перевод последовательности актов в последовательность действий, которые, в свою очередь, будут являться исходными данными для следующих этапов трансляции. Раскрываются основные моменты обучения студентов декларативному языку программирования Пролог, делается упор на обработку множества символов действия. Дальнейшие исследования предполагают разработку моделей синтаксического анализа с помощью средств императивных и функциональных языков программирования с целью получения и анализа объективных оценок эффективности полученных моделей в процессе обучения будущих специалистов.This article discusses the model of syntactically controlled translation of simple arithmetic expressions and its use in the learning process. The attribute-translated grammar involves the translation of a sequence of acts into a sequence of actions, which will be the source data for the next stages of translation. The article reveals the main points of teaching students the Prolog programming language, focuses on the processing of many action symbols. Further research involves the development of models of syntactic analysis by means of imperative and functional programming languages in order to obtain and analyze the objective estimates of the effectiveness of the obtained models in the training of future specialists.


2004 ◽  
Vol 14 (5) ◽  
pp. 519-546 ◽  
Author(s):  
MÁRIO FLORIDO ◽  
LUÍS DAMAS

In this paper we present a notion of expansion of a term in the lambda-calculus which transforms terms into linear terms. This transformation replaces each occurrence of a variable in the original term by a fresh variable taking into account non-trivial implications in the structure of the term caused by these simple replacements. We prove that the class of terms which can be expanded is the same of terms typable in an Intersection Type System, i.e. the strongly normalizable terms. We then show that expansion is preserved by weak-head reduction, the reduction considered by functional programming languages.


2014 ◽  
Vol 26 (1) ◽  
pp. 3-37 ◽  
Author(s):  
BENEDIKT AHRENS

We give an algebraic characterization of the syntax and semantics of a class of untyped functional programming languages.To this end, we introduce a notion of 2-signature: such a signature specifies not only the terms of a language, but also reduction rules on those terms. To any 2-signature (S, A) we associate a category of ‘models’. We then prove that this category has an initial object, which integrates the terms freely generated by S, and which is equipped with reductions according to the rules given in A. We call this initial object the programming language generated by (S, A). Models of a 2-signature are built from relative monads and modules over such monads. Through the use of monads, the models – and in particular, the initial model – come equipped with a substitution operation that is compatible with reduction in a suitable sense.The initiality theorem is formalized in the proof assistant Coq, yielding a machinery which, when fed with a 2-signature, provides the associated programming language with reduction relation and certified substitution.


2008 ◽  
Vol 18 (4) ◽  
pp. 729-751 ◽  
Author(s):  
ZHAOHUI LUO

We incorporate the idea of coercive subtyping, a theory of abbreviation for dependent type theories, into the polymorphic type system in functional programming languages. The traditional type system with let-polymorphism is extended with argument coercions and function coercions, and a corresponding type inference algorithm is presented and proved to be sound and complete.


2009 ◽  
Vol 19 (3-4) ◽  
pp. 287-310 ◽  
Author(s):  
ANDREAS ABEL

AbstractIn the simply typed λ-calculus, a hereditary substitution replaces a free variable in a normal formrby another normal formsof typea, removing freshly created redexes on the fly. It can be defined by lexicographic induction onaandr, thus giving rise to a structurally recursive normalizer for the simply typed λ-calculus. We implement hereditary substitutions in a functional programming language with sized heterogeneous inductive types$\Fhat$, arriving at an interpreter whose termination can be tracked by the type system of its host programming language.


2016 ◽  
Vol 8 (2) ◽  
pp. 115-136 ◽  
Author(s):  
Konrad Grzanek

Abstract Using formal methods for software verification slowly becomes a standard in the industry. Overall it is a good idea to integrate as many checks as possible with the programming language. This is a major cause of the apparent success of strong typing in software, either performed on the compile time or dynamically, on runtime. Unfortunately, only some of the properties of software may be expressed in the type system of event the most sophisticated programming languages. Many of them must be performed dynamically. This paper presents a flexible library for the dynamically typed, functional programming language running in the JVM environment. This library offers its users a close to zero run-time overhead and strong mathematical background in category theory.


Author(s):  
LUKAS CONVENT ◽  
SAM LINDLEY ◽  
CONOR MCBRIDE ◽  
CRAIG MCLAUGHLIN

Abstract We explore the design and implementation of Frank, a strict functional programming language with a bidirectional effect type system designed from the ground up around a novel variant of Plotkin and Pretnar’s effect handler abstraction. Effect handlers provide an abstraction for modular effectful programming: a handler acts as an interpreter for a collection of commands whose interfaces are statically tracked by the type system. However, Frank eliminates the need for an additional effect handling construct by generalising the basic mechanism of functional abstraction itself. A function is but the special case of a Frank operator that interprets no commands. Moreover, Frank’s operators can be multihandlers which simultaneously interpret commands from several sources at once, without disturbing the direct style of functional programming with values. Effect typing in Frank employs a novel form of effect polymorphism which avoids mentioning effect variables in source code. This is achieved by propagating an ambient ability inwards, rather than accumulating unions of potential effects outwards. With the ambient ability describing the effects that are available at a certain point in the code, it can become necessary to reconfigure access to the ambient ability. A primary goal is to be able to encapsulate internal effects, eliminating a phenomenon we call effect pollution. Moreover, it is sometimes desirable to rewire the effect flow between effectful library components. We propose adaptors as a means for supporting both effect encapsulation and more general rewiring. Programming with effects and handlers is in its infancy. We contribute an exploration of future possibilities, particularly in combination with other forms of rich type systems.


2020 ◽  
Vol 27 (3) ◽  
pp. 13-24
Author(s):  
André Rauber Du Bois ◽  
Rodrigo Ribeiro ◽  
Maycon Amaro

Unification is the core of type inference algorithms for modern functional programming languages, like Haskell and SML. As a first step towards a formalization of a type inference algorithm for such programming languages, we present a formalization in Coq of a type unification algorithm that follows classic algorithms presented in programming language textbooks. We also report on the use of such formalization to build a correct type inference algorithm for the simply typed λ-calculus.


Sign in / Sign up

Export Citation Format

Share Document