archives

functions vs procedures..

been reading up a bit on functional languages lately out of interest (99% a c/c++ programmer myself)

I was curious if any of the multi-paradigm languages distinguished 'Functions'(without side-effects) from 'Procedures'(with side-effects) as a means of cleanly separating pure functional code from the rest... is this a common/usefull concept or not?

obviously in c++ i'm used to the idea of const pointers to have some concept of what gets modified but there's always globals & over-rides there...

The Discrete Event Calculus as a Programming Language

The Event Calculus is a formalism coming from the AI community that's been applied to a variety of areas, such as common sense reasoning, natural language, and robotics. See Erik Mueller's book "Commonsense Reasoning" for an exhaustive discussion. I also think it's a promising formalism for dealing with (soft real time) event driven systems generally. My work has led me to develop a system using the Discrete Event Calculus (DEC) as a programming language and I'm wondering who else would be interested.

In a nutshell, the event calculus is a logic over two kinds of terms - events and fluents. Fluents are terms that either do or do not Hold for stretches of time (i.e., they are true at some times and false at others). Events Happen at various times and can Initiate or Terminate fluents. An Event Calculus program is a set of rules each of whose LHS is a condition over events and fluents and whose RHS is (mostly) an Initiate or Terminate predicates (there are a few other possibilities). DEC is the version of the Event Calculus which has discrete time (things happen in time steps). Up to this point, (D)EC has been used statically by creating a set of rules and then either doing model checking, planning, or otherwise determining if some property holds true in the future of the model.

Over the last few years I've been involved in a startup to enable NPCs in various environments to engage in meaninful dialog. Because of the context that can go into understanding an expression, I ended up using DEC as a programming language because it allows reasoning over past and present, as well as who's doing what right now. The system executes a time step at a time (basically a frame at a time). Events in the outside world are converted to events that Happen at that time step in the simulation, and some of the events generated in the simulation are in turn transmitted to the outside world as commands.

There's a draft paper describing this at http://www.paideiacomputing.com/EventCalculusGames.pdf

An example of it working is at http://paideiacomputing.com/videos. In the second movie (Simon Says), the NPC is entirely driven by a DEC program.

Workshop on Non-Traditional Programming Models for High-Performance Computing

Registration is now open for the Workshop on Non-Traditional Programming Models for High-Performance Computing (part of the Los Alamos Computer Science Symposium). The symposium and workshop will be held in Santa Fe, New Mexico on October 13-14, 2009.

The goals of the workshop are two-fold:

  1. To begin to identify, specify and capture in writing, the problematic issues and barriers inherent in today's scientific software construction process.
  2. To expose attendees to non-traditional programming models with the express purpose of igniting thought and discussion on the future of large-scale scientific programming.

The one-day workshop will consist of three sequential tracks, each lead by a moderator/facilitator. The tracks will include a small number of speakers who will each present a short position paper outlining their thoughts on current problems and how specific non-traditional techniques may be applied to address these issues. Following the presentations, the moderator will lead a discussion with the audience on the ideas presented by the speakers. Both the position papers and the captured discussion will be published on the workshop web site. It is our hope that the output of this workshop, perhaps refined, can act as input to a future meeting or workshop on this topic.

(at the web site, click on the workshop title to display the preliminary agenda)

something strange happened after implementing a first interpreter

I've been reading about programming language implementation for a while now as a hobby. Last week I had the knowledge, time and energy to implement in C an interpreter for a portion of Scheme. I'd long wanted to do just that. It was definitely the biggest thrill I've had in programming to implement an interpreter and see it run while interacting at the REPL. :-)

Then suddenly I had a "now what?" moment. Even though I didn't implemented an efficient interpreter, I now understand the basic, general principles of language implementation (interpreter or compiler.) Clearly I'm not a highly skilled language implementer after my little bits of book reading and experimentation. Even so, the big mystery of programming languages seems mostly gone. It is a strange feeling after years of thinking programming languages were something the gods handed down to some mortal on a hill.

Programming languages are certainly the part of computing that interest me the most. That said, I don't think I'd ever find a job that suits my life better than my current web programming job. From what I understand programming language implementation jobs are rare anyway. Stopping work to indulge in grad school for five years is not an option. Maybe when I retire. Developing a hobby language that fits the bill of dynamic languages like Scheme/Perl/Python/Ruby seems like an unnecessary reinventing of the wheel.

I'm not sure what will be next for me and programming language hobby time. Anyone else have similar experience wondering what to do with newly acquired abilities?