LtU Forum

Tom 2.6 released : matching constraints, strategic programming with java objects

Tom 2.6 was just released, and includes a whole lot of interesting things.

Among them, there are :
- the introduction of constraints in the matching algorithm, improving the readability of programs
- strategies now work with zero efforts on any java data structure, all you have to do is provide the tom mapping, which you already did since you use %match
- a much better integration of the antlr parser generator
- term graph rewriting

have fun !

The complete announce:
-------------------------------------------------------------------------
Tom 2.6 announcement

It is our great privilege and pleasure to announce the availability of
Tom version 2.6 .

This release continues our work on the integration of pattern matching
and rule based programming facilities into Java and C.

Tom is a pattern matching compiler developed at INRIA. It is
particularly well-suited for programming various transformations on
trees/terms and XML based documents. Its design follows our research on
the semantics and the efficient compilation of rule based languages.

Many applications have been developed in Tom, both in academia and
industry. Among them, let us mention:
- the Tom compiler itself
- languages semantics, interpreters and program transformation tools
- a generator of canonical abstract syntax trees (Gom)
- a proof assistant for supernatural deduction
- a compiler algorithm for anti-pattern matching and disunification

Tom is a complex compiler which adds powerful constructs to Java and C:
rewrite rules, strategies, non linear syntactic matching, associative
matching with neutral element (a.k.a. list-matching), XML based pattern
matching, string matching, and equational rewriting.
This offers the possibility to analyze and transform any kind of
data-structure. Tom can be used for large scale developments and
applications. It comes with a detailed documentation, as well as with
programming and debugging support.

This new release contains many improvements and new features:

- new alternative syntax for '%match', based on atomic constraints
that can be combined with '&&' and '||' operators. This gives a
higher expressiveness and conciseness. Works also in '%strategy'

- hand-written strategies became easier to write. No more 'Forward'
class is needed.

- strategy support for hand-written mappings

- new tool based on ANTLR 3 for implementing parsers that
directly output Gom terms: GomAntlrAdapter.

- term-graph rewriting support in Gom

- Gom's lists now implement the interface Collection. Consequently,
Java's classic iteration techniques can be employed.

- several speed-ups of the compilation process as well as for the
generated code.

- a lot of new features for the Eclipse plug-in, including the
availability of all the functionalities of the Java editor for
".t" files ( a complete list is available on the plug-in page:
http://tom.loria.fr/plugin.php )

Tom is available, in open source (GPL/BSD License), from the web page:

http://tom.loria.fr/

Best regards,
Tom's development team

Un-filter (or merge) lists

What is the standard functional construct which is the converse of filter?

Eg. if I want to add 0 between all elements of a list?

Or if I want to merge two sorted lists preserving sorting?

I am thinking of a "unfilter" construct which takes a list of lists, and a list of functions applied in turn

(*insert 0 between two elements of the list*)
unfilter [a] [fun x::xs -> (x, [xs]); fun as -> (0, [as])]

(*merge two sorted lists*)
unfilter [a;b] [fun as, bs -> match as, bs with
   | x::xs, y::ys => if y < x then (y, [as;ys]) else (x, [xs;bs])
   | [], y::ys => (y, [[];ys])
   | x::xs, [] => (x, [xs;[]])]

M.Sc thesis ideas on the intersection: Artificial intelligence, Category theory, and Programming languages.

Hello all

I am searching for M.Sc thesis ideas on the intersection: Artificial intelligence, Category theory, and Programming languages. References to relevant papers will be appreciated.

Cheers

YAJVML: Qi4j

Another language on top of ye olde JVM is Qi4j. There's a list of thoughts behind it, including something which sorta ran a bell with layman-me. (Recently, due to design frustrations at work and due to Warnock's "Stay an order of magnitude more general than you think you need" quote, I've been thinking that really atomizing things in a design would be neat, so you could more easily in theory use the bits a la lego to refactor into whatever new take on your app you need.)

Decoupling is Virtue:
Decoupling is more important than developers in general think. If you could have every OOP class decoupled from all other classes, it is easy to re-use that class. But when that class references another class and the chain never ends, your chances of re-use diminishes quickly.
Object Oriented Programming is suffering a lot from this, and many mechanisms have been introduced over time to counter this problem. But in reality, the best we can manage is subsystems of functionality, which client code can re-use. And these subsystems tend to be infrastructure related, since domain models are less prone to be similar enough from one project to the next, and since OOP in reality constrains the the re-use of individual domain classes, we need to re-do the domain model from scratch ever time.

Static Typing and Expressivity

I recently discovered an essay, "What To Know Before Debating Type Systems." It is an excellent essay, and I highly recommend reading all of it. However, there was one particular section that really caught my attention: "Fallacy: Static types imply longer code." The author suggests that a static type system can actually allow a programmer to write more concise solutions to some problems.

There is one Haskell example given to support this: if you compare the return value of Data.Map.lookup to "Nothing" or "Just object", then the function's return value will be of type "Maybe object". If you don't do this check, then the function will throw an exception if the search value isn't found. Unfortunately, I'm new to Haskell and having trouble understanding how this capability can make code more concise. If I'm not mistaken, the "lookup" function is polymorphic on the return type. The person that wrote "lookup" created several versions with different return types, and Haskell can infer the correct one to use based on the way that the return value is used. But if I were using an untyped language, wouldn't it be possible for me to write the same functions with slightly different names for different return types? Perhaps "lookupEx" could throw an exception while "lookupNull" could return some sort of Null value. I admit that this solution seems somewhat less elegant and reliable, but I think the code would be about the same length.

I would really appreciate it if anyone could offer some insight into this issue. Also, if you happen to know of any other articles or papers describing examples of improved expressivity through static typing, I'd love to read them.

To clarify, I certainly agree that a static type system can catch errors at compile time that wouldn't be caught until runtime in a dynamically typed language (even including some infinite loop bugs!). However, right now I'm mainly curious about expressiveness. Unfortunately, many people refer to a static type system that can express a lot of information about the variables and thus catch more bugs as an "expressive" type system. This ambiguity has made it difficult to find answers with Google.

Thanks

Breaking region nesting in type-and-effect systems?

Type and effect systems have been studied in the context of region-based memory management. The Disciple compiler is a recent example of such a system, and the MLKit has had such a region system for quite some time.

Unfortunately, the Tofte-Talpin region calculus and its variants requires nested region lifetimes, which turns out to be unnatural for some programs.

Substructural region systems relax this restriction, by reifying region deallocation as an explicit operation. Instead, the authority to use and free a region is encapsulated in a linear capability.

It's not clear to me why this approach of separating deallocation to break the lifetime nesting would not work in a type and effect system. I'm not specifically referring to the Tofte-Talpin type and effect system, but whether some type and effect system could be designed which avoids the nesting restrictions. Has this been studied anywhere, and if not, what are the difficulties in designing such a type and effect system?

Fan Programming Language

Just came across the Fan object-oriented programming Language, running on the JVM and the CLR. They're shooting for portability across both VMs. Looks like they took an interesting approach language-wise, such as default immutability for concurrency, closures, mixins and exporting namespaces as REST-like URIs. This last feature is one I first encountered in the Waterken capability-secure HTTP application server.

I was disappointed to read that Fan eschews generics/parametric polymorphism however. All told, it seems to lean slightly more towards the dynamic end of the spectrum than C#/Java.

more power and less verbiage

LSBU's Dennis Furey produced a language the likes of which you have never seen:

There is a very small subset of the language vaguely resembling pure Lisp, and any program expressible in the language is expressible in this subset. However, programs are written mostly using operators representing functional combinators.

Extended Deadline - ALTA 2008 CFP

Paper submission deadline: EXTENDED: April 21, 2008

Architectures and Languages for Throughput Applications
(ALTA 2008)

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

Sunday June 22nd, Beijing, China

Official Web Site

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.

Career paths and concerns

This may be slightly off-topic, but I was wondering if some of you in the community could point me in the right direction with some questions I have about a career in computer science research. To give you some background, I recently graduated from college with a CS degree, and I'm currently working for a small-to-medium-sized consulting firm doing software development in .NET.

Lately I've been thinking that software development in general might not be for me, and that I might be better off getting into research, or at least something closer to it. I feel like most of the problems I run into in my work are not that difficult, and that I just won't be putting all of my technical skills to good use in this line of work. I want to work on technical problems with some real "meat" on them, instead of just putting buttons on a form. One of my interest areas is programming languages, which is why I've come here for advice.

I guess I was initially turned off from graduate school and research after I read this article on Joel on Software, specifically the part about the dynamic logic class. After seeing that, I thought that the only way to do work that would actually make it to the "real world" would be to get into software development. I realize now that that's not entirely true, but I'm still concerned about making sure any work I do is useful, and doesn't solve a problem that no one cares about.

With all of that said, here are my questions:

  • Can anyone explain to me, or link to an article that explains, the general timeline of research getting implemented in industry? I at least have a vague idea of how researchers find problems, come up with solutions, and publish papers, but from that point there's a gap in my knowledge - how does the information from that paper trickle down to a point where developers in the trenches like me know about it? I know not every piece of research is used everywhere, but something like object-oriented programming might be a good example: It originally started, more or less, with Simula and Smalltalk. How did it get to the point where practically every developer uses it, and bookstores are filled with shelves on design patterns and object-oriented languages like Java and C#?
  • As a follow-up to my first question, are there careers that bridge that gap between research and industry (in this case, specifically in programming languages)? Is there a job where one can read research that others have done, evaluate it, and decide if it would be useful to put that work into some form usable by the masses? And if so, what kind of path would one take to get there? Grad school? Climb the ladder at a certain kind of company?
  • Am I at all justified in being concerned about the usefulness of my work if I were to go into research? Is that something that researchers worry about, or does it tend to not be an issue?

As you can possibly tell, I'm primarily just ignorant of the various options out there, and trying to figure out what they are. As a result, any answers, advice, or links to relevant information are appreciated, and thank you for reading this long message.

XML feed