LtU Forum

Overloading in a statically typed functional language

I am working on a statically typed functional array language that would benefit greatly from operator overloading. I originally wanted to use something as elegant as type classes, but they don't mesh well with multiple meanings for the same operator (matrix * matrix, matrix * vector, scalar * matrix, etc... multiplication). I've looked at multiparameter type classes (with functional dependencies) but I think that approach would clutter up an already complicated language and create too much cognitive overhead for potential users. I've also looked at Furuse's work with G'Caml, which is thus far the most promising technique I've seen. Unfortunately, the complicated type signatures might be a deal breaker. I'm writing my language with current Matlab users in mind and I don't think they would tolerate deciphering the messy derived generic types that seem to crop up for even simple functions. Can anyone suggest any other mechanisms for implementing operator overloading?

the power of GNU Awk

Two alternative perspectives on GNU Awk (both from 1996):

"Ve are using ze GNU AWK" by Philip Greenspun:

"Relational databases and the World Wide Web: Automatic generation of hypertext based on reverse-engineered meta information." That sounded like it would be the best talk in the conference. I settled into my plastic chair in the plastic Holiday Inn conference room with high hopes. A young Austrian began to page through some Viewgraphs. "Ve are dumping ze database catalog tables out of ze Oracle system into Microsoft Access. Un dan, ve are using an AWK script to generate ze static files. Ze big challenge is making ze 6 character file names for some operating systems as can't have ze long file names."

A man raised his hand. I figured he was going to say "Why didn't you install Oracle WebServer and then get a 10-year-old to write three PL/SQL functions to extract the data from the RDBMS on the fly?" but instead he asked "Why did you use AWK instead of perl?"

The Austrian responded "AWK is the only language that I know."

Why GAWK for AI? [.txt version] by Ronald P. Loui:
Most people are surprised when I tell them what language we use in our undergraduate AI programming class. That's understandable. We use GAWK. GAWK, Gnu's version of Aho, Weinberger, and Kernighan's old pattern scanning language isn't even viewed as a programming language by most people. Like PERL and TCL, most prefer to view it as a "scripting language." It has no objects; it is not functional; it does no built-in logic programming. Their surprise turns to puzzlement when I confide that (a) while the students are allowed to use any language they want; (b) with a single exception, the best work consistently results from those working in GAWK. (footnote: The exception was a PASCAL programmer who is now an NSF graduate fellow getting a Ph.D. in mathematics at Harvard.) Programmers in C, C++, and LISP haven't even been close (we have not seen work in PROLOG or JAVA).

future history of logic programming

A Possible Future History of Logic Programming [PDF, 98KB] by M.H. van Emden:

When the first edition of Senner's history came out in 2020, it was widely praised for its compelling view of the development over many decades of logic programming. Reviewers praised it for its broad perspective, but deplored its lack of historical detail. Since then several collections of papers have made their way from estates via the auctions to various libraries. Senner has taken this opportunity to incorporate these recent findings in a new edition.

What has not changed in the new edition, and this is what I take issue with, is that Senner presents the development of logic programming as a relentless forward march towards an inevitable outcome. Of course, it is true that not a decade went by without some of the building blocks being fashioned that we take for granted as part of the majestic edifice that now dominates the landscape of programming.

How did Prolog achieve world domination? (I thought Forth was going to win for sure?) Easy. Through the following contributions of the 90's to logic programming:

  1. XML. The tree as universal data structure.
  2. Execution via virtual machine.
  3. Constraint programming.

What Senner's History of Logic Programming (MIT Press, 2020) fails to do is pinpoint the year in which revisionist historians of logic programming were decisively exposed for the frauds that they were. (Kidding.)

This class type

That may have been discussed before, but I did not find the right search terms for it. In strongly typed object-oriented languages like C++ or Java, how do you designate the type of the class in class methods?
A typical use would be the return type of factory methods but it would be useful elsewhere too. Eg.

MyClass MyClass::newInstance();

The problem with the code above is that in a derived class, the signature allows newInstance to return an instance of the base class-- the signature is not restrictive enough.

class MySubClass: MyClass
...
MyClass MySubClass::newInstance(); // WRONG newInstance must return MySubClass

There should be some way to tell the compiler that the type returned is that of the class it is invoked on, is there? Or is there simply a covalence rule for return types such that you would write

MySubClass MySubClass::newInstance();

...which looks a bit hackish to me. The signature needs to be written again for each subclass. And it needs to be extended to parameters too for eg. clone

int MyClass::clone(MyClass obj1, MyClass& obj2);

What I am looking for is something like:

ThisClassType MyClass::newInstance();

Any insight is welcome.

Teaching oneself Abstract Interpretation ?

My current work deals with extracting security properties from C source code. Without entering too much into the details, it started as a type-and-effects type system with dependent types, but it's slowly starting to look like abstract interpretation-and-effects. Now, my knowledge of abstract interpretation is somewhat limited: I have read one or two of Girard's papers, and everything else I know comes from talks and discussions. So I guess it's time for me to learn more.

So, here's the question: does anyone around here have good references on abstract interpretation and the techniques involved?

Concurrent Composition and Algebras of Events, Actions, and Processes

Possibly interesting, if you are into process algebras. I am insufficiently clueful about the topic area to pass serious judgement on the paper, but I found it a mostly accessible read at any rate.

Mark BURGIN and Marc L. SMITH 2006

PDF

There are many different models of concurrent processes. The goal of
this work is to introduce a common formalized framework for current research in
this area and to eliminate shortcomings of existing models of concurrency.
Following up the previous research of the authors and other researchers on
concurrency, here we build a high-level metamodel EAP (event-action-process) for
concurrent processes. This metamodel comprises a variety of other models of
concurrent processes.

I mean, any paper that says "One of the reasons is that, as experts claim, nontrivial concurrent programs based on threads, semaphores, and mutexes are incomprehensible to humans" can't be all bad.

CFP: ALTA 2008 (Architectures and Languages for Throughput Applications)

This is an abbreviated Call-For-Papers (CFP).

ALTA 2008 Workshop

Held in conjunction with the
2008 International Symposium on Computer Architecture (ISCA-35)

Sunday June 22nd, Beijing, China

Submitted papers will be considered to be published on one or more special issues of journals or newsletters highlighting the "Best of ISCA 2008 Workshops."

Workshop Theme

Throughput-oriented applications are attracting broader interest because of the proliferation of multi- and many-core CPUs and GPUs. The reasons are many-fold. Increasing software-exposed parallelism is necessitated by power-constrained design. Moreover, the emphasis on visual quality in entertainment-oriented applications is driving demand on client platforms. Finally, the pre-existing demands for compute cycles in high-performance computing is challenged by the changing programming and optimization landscape found in highly integrated multi-core devices.

This workshop seeks an interdisciplinary set of commercial and academic researchers and practitioners working at the frontiers of throughput oriented programming models, applications, and architectures.

For more details, please see the web site at http://www.sei.buaa.edu.cn/alta08/

Ongoing work on Supercompilation of Java code (or supercompilation in general)?

I was intrigued by this description of a technology for "supercompiling" Java code.

But I notice that a lot of the information on that website appears to be "stale", and hasn't been updated for a few years.

Is anyone aware of the current state of research on supercompilers, especially as it relates to Java?

Regards,

Ian.

Constraint Imperative Programming

I'm amazed on not finding anything relating to constraint imperative programming. Nothing on LtU comes up for languages like Alma, Turtle, and Kaleidoscope.

From the Abstract on Turtle:

Ideally, in constraint programs, the solutions of problems are obtained
by specifying their desired properties, whereas in imperative programs,
the steps which lead to a solution must be defined explicitly, rather
than being derived automatically. This paper describes the design and
implementation of the programming language Turtle, which integrates
declarative constraints and imperative language elements in order to
combine their advantages and to form a more flexible programming
paradigm suitable for solving a wide range of problems.

These languages are very related to languages based on Design-by-contract. It seems like many technologies are evolving towards a logical and/or constraint style of programming. After all, there is UML 2.0's OCL, the semantic web, VHDL, AOP, Dataflow, etc.

Algebraist Network

The network of Aldor users and developers at:

would like to promote the development and use of the Aldor programming language by facilitating the interaction between developers and users of the language. Readers of this forum are cordially invited to join this new community.

Aldor is a programming language with an expressive type system well-suited for mathematical computing and which has been used to develop a number of computer algebra libraries. Originally known as A#, Aldor was conceived as an extension language for the Axiom system, but is now used more in other settings.

In Aldor, types and functions are first class values that can be constructed and manipulated within programs. Pervasive support for dependent types allows static checking of dynamic objects. What does this mean for a normal user? Aldor solves many difficulties encountered in widely-used object-oriented programming languages. It allows programs to use a natural style, combining the more attractive and powerful properties of functional, object-oriented and aspect-oriented styles.

(aldor.org)
XML feed