LtU Forum

Rules of good declarative language design

I was wondering, are there any. I would normally think of this as the kind of thing that is an art, and not to be guided by rules, but I am having to criticize a declarative DSL that seems poorly designed to me and I would like to have some things to point to.

The major initial sin I can see here is that the format is very verbose, requiring the declaration of many things the compiler could find for itself
(the compiler compiles to C# for Asp.NET and clientside html/javascript)

Functional Object-Oriented Programming

I've been experimenting, in Ruby, with something that we may loosely call 'functional' object-oriented programming. I write objects with non-mutating methods -- basically, these objects are stored 'requests' of a certain type. Various values can be derived from the request on demand. If I ever decide to implement caching, well, that wouldn't be functional but it's hidden from the user.

Whenever I need actual state in my application, I make sure to split it out from the classes. Instead, I pass stateful information from method call to method call until the result is complete -- saving myself the hassle of state-tracking and so forth.

I'm sure there is some efficiency penalty for this approach, though it makes my life much easier (and more reproducible!). There is a similarity between what I am doing and 'continuation passing style' though I can't quite place my finger on it.

What do you all think of this style of "functional object-oriented programming"? There are quite a few approaches fucntional object-oriented programming out there already, like FOOPS and Object-Gofer; but these proposals are about faking object-oriented semantics -- a stateful object -- with monads.

SICP picture

I finished reading SICP today so I made this picture to sum up the incredible experience: The SICP experience
:D

How about you? What did you do after reading SICP?

Is Integer wrapping an exceptional condition?

Is there any language that throws an exception when an integer wraps around?

I am curious, why even strongly typed languages like OCaml allow integers to wrap around. Why isn't integer wrapping considered an inconsistent state? Is lack of support from hardware the reason why it is not implemented? (I think we can use the overflow flag to detect integer wrapping. Is this the right way to do it?)

Any pointers (like papers or articles) on this topic will be helpful.

Microsoft's new Dynamic Language Runtime (DLR)

From Jim Hugunin's blog:

The CLR has good support for dynamic languages today. IronPython-1.0 demonstrates this. The new Dynamic Language Runtime (DLR) adds a small set of key features to the CLR to make it dramatically better. It adds to the platform a set of services designed explicitly for the needs of dynamic languages. These include a shared dynamic type system, standard hosting model and support to make it easy to generate fast dynamic code. With these additional features it becomes dramatically easier to build high-quality dynamic language implementations on .NET. More importantly, these features enable all of the dynamic languages which use the DLR to freely share code with other dynamic languages as well as with the existing powerful static languages on the platform such as VB.NET and C#.

This is being packaged as part of Microsoft's Silverlight initiative, where JavaScript, IronPython, and in the future Ruby, are being put forward as languages for building rich cross-platform web clients. It will be interesting to see what they've included in the DLR when the documentation is released.

Dynamic interactivity in Mathematica 6

From http://www.wolfram.com/products/mathematica/newin6/

Building on two decades of world-class algorithm and software development, Mathematica 6 represents a dramatic breakthrough that immensely broadens Mathematica's scope and applicability—and redefines the very way we think about computation. Made possible by Mathematica's unique symbolic architecture, Mathematica 6 introduces a sweeping unification of language and interface concepts that makes possible a new level of automation in algorithmic computation, interactive manipulation and dynamic presentation—as well as a whole new way of interacting with the world of data.

By looking at the demos and documentation, it looks like they provide constructs to interact with functions; e.g., by being able to view or fiddle with symbolic expression parameters. This functionality seems to be tied up nicely in an interactive shell. Something to play around with.

Rubato - Composing Music with Functorials

Rubato is a functional language for composing music based on Topos theory. I've never used it, but the documentation, particularly the PHD thesis of G. Milmeister The Rubato Composer Music Software - Component Based Implementation of a Functorial Concept Architecture , describes the use of Topos theory for a specialized programming language for music composition. It's very well written and it's mapping of Topos Theory concepts to programming concepts has helped me to understand some Topos Theory concepts in a more concrete fashion (which is possibly a mistake!). There is also a book The Topos of Music which looks interesting.

The Monad.Reader

I am pleased to announce that the latest issue of The Monad.Reader is now available.

The Monad.Reader is a quarterly magazine about functional programming. It is less-formal than journal, but somehow more enduring than a wiki page or blog post. I think it may be of interest to many of the readers of LtU.

Issue 7 consists of the following four articles:

  • Matthew Naylor
    A Recipe for controlling Lego using Lava
  • Yaron Minsky
    Caml Trading: Experiences in Functional Programming on Wall Street
  • Duncan Coutts
    Book Review: “Programming in Haskell” by Graham Hutton
  • Dimitry Golubovsky, Neil Mitchell, Matthew Naylor
    Yhc.Core – from Haskell to Core

Feedback and comments are very welcome.

Open Quark (CAL language) 1.4.0 Released

The Open Quark Framework for Java V1.4.0 was recently released.

There have been considerable improvements in this release in regard to the CAL language support in the Eclipse Plug-in. A new video showcasing features of this plug-in is also now available on the main CAL page.

1.4.0 also added some language features. See the release notes on the same page for more details.

Finally, the discussion forum for the CAL language has now moved to a Google Group. This is a more neutral place than the old Business Objects Diamond site, and offers some nice features, such as "pages" for persistent articles.

Arc in action (a.k.a. it's aliiiiive!)

Recent discussion of what software LtU is running, and what languages it relies on, reminded me of Paul Graham's language, Arc. Despite many rumors of its death, Arc's seed finally sprouted in February, when Paul's startup incubator, Y Combinator, launched a reddit-like social news site for startups, Y Combinator Startup News. In the launch announcement, it was mentioned that the site is built with Arc:

And of course another reason we made this site is that last summer we wrote the first reasonably efficient implementation of Arc, and we were looking for something to build with it.

This month, a new version of the news site was released, based on a new version of of Arc with the innards redone by Robert Morris to reduce consing[*], resulting in a 2-3x speedup.

Arc still isn't available to the public, but painstaking NSA-class analysis of the related threads, Why we made this site and New, much faster version of News.YC reveals that Arc code in the current implementation compiles, mainly by macroexpansion, to MzScheme code. The news site's web server is also written in Arc.

There's not much more news than that, which is why I'm not posting this as a front-page story.

[*] Perhaps this could be considered an example of the hot new trend for zero-cons programming?

XML feed