LtU Forum

The Sphere Online Judge

This site will automatically judge solutions to 121 problems in 21 languages.

Some interesting forum posts:

Type systems and software evolution

Since the "why are type systems interesting" thread is getting so long, I thought I'd start a new thread on this somewhat more specific issue.

I agree with Frank that software development is concerned with building artefacts (i.e, program, program modules, classes, libraries and what not) about which we can reason statically - which seems to me to be tantamount to saying that we must be able to understand the product we are building, not just be able to run it.

But let's back up a bit, and consider the problematic issue of gathring software requirements. This is one of the issues software engineering is struggling with. We aren't very good at establishing what the real customer requirements are, and even when we do, customers change their mind, or want more features in the next release. The iterative life cycle model isn't only (or even primarily) about fixing bugs. It's about evolving software per customer requirements.

Now let's assume a best case scenario, where we have consistent, even formal, requirements, and we design a software system that fulfills them. We can reason statically, with the aid of a static type system, and convince ourselves that the software does what's expected from it.

Now comes the next cycle, because users want changes and additional features ("show longer names on the tracker page", "enable keywords for comments" etc.) Some would argue that unless we are talking about making trivial changes, we should start form scratch and redesign the system. For various reasons, most of them obvious, this isn't what usually happens. We modify the exisiting sytem. Techniques like regression testing help us make sure we haven't caused too much damage.

Now, let's consider the question of whether the type system helps us with this sort of activity. Obviously, types give that same static guarantees for the changed program they give any type correct program. But can the type system do more? It's likely that some of the changes require chaneging the types we use in our system. Which type systems help us make such changes locally? Do types introduce unnecessary coupling to the sytem, making evolution harder? How about support for (sound) refinement, which would allow checking that changes are consistent with prior specification, while not propagating the the changes in the system in such a way that the impact of the change becomes unmanagable?

I think these sort of questions are worth considering. Thye may help us design better type systems, which would help solve a real need.

Eclipse C/C++ Dev Tools 2.0 Released

It's a milestone season for Eclipse. The Eclipse C/C++ Development Tools project has released CDT 2.0 final for Eclipse 3.0. They posted some nice CDT screenshots. There are screenshots for Eclipse, too.

Having trouble with 'purity'

I am having trouble wrapping my mind around the semantics of a pure functional programming language. In writing my current programming language I chose to treat the variable assignment expression:

x = 5

as the creation of a function named x.

x = 5 is semantically equivalent to:

x = fn () -> 5

Is this sort of 'variable assignment' considered to be an example of pure in the FP sense?

NOTE: if x (in the above example) were to be redefined, a new closure would be created with the associated value.

Sorry to ask such a trivial question, but I am having trouble finding semantic discussions concerning simple functional programming idioms.

Best regards,

M.J. Stahl


Mila takes a minimalistic approach to language design: As much as possible is delegated to libraries, the rest is a small set of language constructs. Hashtables, lists, objects and namespaces are all the same thing, for example. Other features: All parameters are named and have default values, variables are strongly typed, and there's a nice syntax to write objects with indentation.

I am the author of the language and all feedback is very welcome.

Introducing o:XML

What is o:XML?

It's a dynamically typed, general-purpose object-oriented programming language. It's got threads, exception handling, regular expressions, namespaces, and all the other things you would expect from a modern language. And it's expressed entirely in XML.


And so we return to the question: Why o:XML? My preferred answer would be: Using the same format for code as we use for data allows us to think slightly differently about the code. The application is not only a runtime executable, magically incantated by the source code -- it is structured data, information, a document!


Database Theory and Type systems/Programming Languages.

So, just recently I read The Third Manifesto, and since I'm interested in programming languages, dissatisfied with SQL, and thinking about databases I figured I would post some of my questions here.

I don't know that much about modern type systems, but in the book, their discussion of type systems seems a little archaic compared to the sorts of things people bring up here. If there is anyone more knowledgable than I, I would appreciate some insight into how their stuff fits in the grand scheme of things.

Also, I recall in Concepts, Techniques, and Models of Computer Programming they discuss transactions and constraint based programming and do some connections with databases, but it mostly just left me wanting more. Has anyone successfully added the "Relational Model" to a programming language and integrated into the type system in a nice, and theoretically justified way?

I'm sorry if my questions aren't quite coherent. I don't know enough to ask it, but it seems like there are strong connections to their work with other areas of programming language research, but that perhaps the two camps have not gotten together and seen to integrate the two areas.

Oh yeah, I've read enough of DB Debunkings to realize that C.J. Date and company can be a bit ornery, but I just want to see how these two things intersect. I'm definitely not part of the camp trying to clamour for "Object Oriented/Relational/whatever" database, just someone trying to understand the theoretical aspects of databases in the context of programming languages.

PyCLIPS - expert systems shell in Python

PyCLIPS embeds the CLIPS "expert systems shell" in Python.

It appears to be a set of Python wrappers for the CLIPS C modules themselves, rather than a complete reimplementation in Python. In fact, the CLIPS engine runs in its own memory space and allocates its own objects. However, the integration with the engine is extensive enough to be of interest here, because some of the challenges it poses are similar to those involved in embedding one language in another (e.g. finding a good fit between Python syntax and the protocol used to communicate with the engine).

More details can be found in the manual, downloadable from the project's sourceforge site.

Info needed

I need references discussing the place of pl education in the CS curriculum.

Also: Which top universities (e.g., MIT, Yale, Stanford, Harvard, etc.) require (or don't) a PL course in their undergrad curriculum?


Epigram - incremental interactive typechecking

You can download Epigram itself and follow the tutorial. It's worth trying.

The part that most impressed me is the interactivity. I really like this halfway point between a structure editor and a free text editor.

I think this approach would be great for designing parsers as well, where you have the content to be parsed in a separate buffer, and you interactively build the parser and see which bits gets parsed.

Also, dependently typed languages are very nifty.

XML feed