archives

Optimization - Symmetric Reductions

I notice in stack based languages certain symmetric programs reduce to no-ops:

f1 = [swap swap] = []
f2 = [dup pop] = []
f3 = [cons uncons] = [] 
f4 = [dup swap cons uncons swap pop] = [dup swap swap pop] = [dup pop] = []

So how much of this is blindingly obvious to the research community? It seems that this must be much harder to detect in non stack based languages.

Building Interpreters by Composing Monads

Building Interpreters by Composing Monads

We exhibit a set of functions coded in
Haskell that can be used as building blocks to construct
a variety of interpreters for Lisp-like languages. The
building blocks are joined merely through functional
composition. Each building block contributes code to
support a specific feature, such as numbers, continuations,
functions calls, or nondeterminism. The result of
composing some number of building blocks is a parser,
an interpreter, and a printer that support exactly the
expression forms and data types needed for the combined
set of features, and no more.
The data structures are organized as pseudomonads,
a generalization of monads that allows composition.
Functional composition of the building blocks implies
type composition of the relevant pseudomonads.

So actually it is about building interpreters by composing pseudomonads.

PS: I stumbled upon this paper while trying to factor an interpreter into a set of features (and yes, I tried to package them as monads).
After a day of fighting with undecidable instances and rigid type variables I gave up and started googling - well, I was trying to invent a wheel.
Any comments on how pseudomonads relate to arrows (and other generalizations of monads) are appreciated.

Links to research on/in ....

Hi i'm looking for literature and/or research on/in programming language design, implementation, etc, etc specifically in the domain of numerical analysis and scientific computing in general.

There seems to be a lack or slow down in development of array functional languages. From what i've investigated/researched already constraint-based programming is very well suited to numerical analysis problems and i can find alot of literature in that department.

I'm kind of curious of the possibility of a new language that is an array functional language which is purely functional, supports constraint-based programming, light-weight dependently typed type system, some kind of effects system in the type system for controlled, localized side-effects.

I know you probably think i'm crazy but i'm just curious :-)

The case for Semantic Analysis

How to statically ensure software reliability is aimed mostly at C programmers in the embedded space:

The term semantic analysis refers to a group of advanced static analysis techniques that enable users to detect runtime and/or dynamic errors in software applications.

There is a conspicuous silence in the article on how PLs might help the tools. And I can't help but think that the static semantic analysis amounts to Constraint Programming (propagate and branch).

really simple list/newline oriented language

First, thanks all to those responded to my post awhile ago. I picked a few brains and got some help, sorry if I didn't get a chance to write back to you.

So I am trying to make a very simple list oriented language (well more like preprocessor ala m4), I think there is a very "natural" solution (something that basically writes itself) to what I am looking for, but I was wondering if I could get some (more) help fleshing out the idea. Basically, I would just want to define list assignment, functions and function application over lists that is very \n delimiter oriented, with the default interpolation behaviour to take cross-products. This would be pseudo example, the idea being that the syntax would be very lightweight over a normal text file...

denotes output



As->{
1
2
3
4
5
}

Bs->{
6
7
8
9
}

AsBs

>16
27
38
49
5

x-> is some number

6x

>6 is some number

6{1,2,3,4}

>61
62
63
64

level1a->{
A
AA
}

level1b->{
B
BB
}

level2->{
level1a level1a
level1a level1b
}

level2

>A A
A AA
AA A
AA AA
A B
A BB
AA B
AA BB




I am not sure exactly how well I've thought this out, but it gives you an idea...it's basically just subsitition with and emphasis on cross products that sacrifices some flexibility for simplicity by imposing things like new line delimiters. I would just need to be able to define lists function and apply them appropriately.

I can kinda see that by imposing newlines, I could swallow things one line at a time, but I keep thinking in terms of encoding an FSM with a bunch of "if" statements...

Should this be a peice of cake using something like recdescent? I would be cool if this was just basically something like a syntax modified perl, so that I could define functions with all the normal goodies.

Many thanks for any advice.