LtU Forum

(newbie question) Covariance and contravariance

Firstly I don't have any theoretical background in Category Theory. My goal is just trying to understand the following:-

On wikipedia,
there is the following definition:

A covariant type operator in a type system preserves the ordering ≤ of types. 
A contravariant operator reverses ≤. If neither of these apply, the operator 
is invariant. These terms come from category theory.

What is type operator referring to in the context say Java ?
The entry goes on to say:

The array type is usually covariant on the base type.

Would I be right to say that the type operator is the assignment operator ?
e.g.

String[] a = new String[1];
Object[] b = a;

Thanks.

Early vs. late binding dogma/experiences?

Seeking to learn from other's experience:

I'm probably a knee-jerk static kind of person (SML, Java) but have heard plenty of smart folks extoll the virtues of late binding [1] [2]. And I think I'm even seeing those once-pretty-static places have to loosen up for pragmatic software development/engineering reasons [3] [4].

What is a good middle ground, theoretically? Where is a good middle ground, in terms of a concrete language or system available today?

thank you.

FringeDC Formal Meeting- Jan 5th 2008- Presentation by Gary Knott of Civilized Software

FringeDC is a group for people interested in fringe programming
languages (Lisp, Haskell, Erlang, Prolog, etc) in the Washington DC
area. http://www.lisperati.com/fringedc.html

Details Here: http://www.lisperati.com/jan5th.html

Protium ..

The Protium Project talks about Diarmuid Pigott's programming language that I had the opportunity to peek at several years ago and was definitely interesting from a language perspective - the keyword being pasigraphic.

The site, however, has been down for a long time now and Diarmuid (who's been an LtU member for a while) has been unreachable.

Any leads anyone?

Process Algebras: Whats the point?

There seems to be quiet a few parallel/concurrent oriented languages (Erlang) and dialects of languages (Split C, Titanium (java variant), Hi Performance Fortran), and language specific libraries that enable parallelization (MPI, OpenMP, JPPF). With respect to process algebras, what type of analysis do process algebras allow us to do? Simply characterize the different implementations? Provide us a framework to improve the different implementatons? Have process algebras had any impact on real world languages and compilers?

So, process algebra, what have you done for me lately?

ML Modules in C#

In building languages using C#, I've often run into typing difficulties. These difficulties are well known, and have been discussed on LTU before, as have the possible solutions.

Since I couldn't wait for the next release which may or may not address these difficulties, I recently came up with a simple source to source translation which allows me to express the required type structure constraints. Basically, the difficulties come down to the fundamental tradeoffs between objects and modules, aka abstract data types. My translation restructures the object into an abstract data type ala ML modules, so the type structure of previously inexpressible functions, such as list flattening, are now easily expressed.

I first used this translation in my recent Orc implementation, and I'd be interested whether anyone has described a similar solution before, or whether there exist any other known solutions to the problem. I'm also curious about the interaction with inheritance, and other extensibility problems anyone might be able to foresee. I plan to explore how this translation also affects C# solutions to The Expression Problem.

Nested Schedulers: A Tree Is Not Enough?

In a recent discussion, naasking mentioned nested schedulers of Manticore.
Incidentally, I am currently interested in exactly this topic.
I am, however, confused by the fact that most of nested scheduling papers repeatedly stress the point that schedulers form a tree structure.
Indeed, a tree seemed a natural idea initially, but after playing with toy implementations I quickly started to suspect that this is too hard a constraint.

Specifically, in face of synchronization between threads, it looks logical for a blocked thread to sponsor progress of the blocking thread (let's call this "helping", and this differs from "stealing" by cardinality - more than one thread may help a given thread, while only one can steal, and the act of stealing usually transfers the ownership). Yes, this may interfere with cache, and processor affinity, but at least to evaluate negative effects of the feature we have to model it.
As soon as we introduce helping, a tree does not look adequate. In fact, I suspect even a DAG of schedulers may be too restrictive. A cycle in the graph of helping not necessarily means a deadlock, as first, not all helping edges are induced by a block, and second, the sponsored CPU ticks may outflow outside of the cycle and thus further the progress.

To bring this closer to languages: what languages/calculi are known for support of explicit CPU scheduling?
I know that (nested) engines can be implemented in any language with first class continuations, but this approach is far from ideal (e.g., separately compiled or in general non-cooperating code cannot be preempted, as I understand). Same limitations apply to any schema that relies on an "upwards" cooperation (timely yield) - e.g., coroutines.

Module Level Purity

As the new age of multi-cores on the horizon, parallelism and state handling is getting more and more important. Currently mainstream languages are imperative ones which are designed without concerning these topics.
Is there any language that "has a module system with a just monadic public interfaces (exported code-interface of the module must be a Monad); and still supports side-effects inside module level code"?
That would construct a great ecosystem in which all imperative developers can solve their problems in imperative ways and yet benefit from module level purity!
That would be very interesting to work with such a system!

PLT online?

Hi there,

I tried to locate the Programming Language Texts online repository, but could not find it, the links I have found did not work. Any hint what has happened to it?

Concurrency with Scheme

My new laptop has one of those multi-core CPUs. And, as Herb Sutter suggests I want to start doing some serious concurrent programming with Scheme.

Since I'm relatively new to Scheme, I decided to ask the LtU experts about effective/real world ways to fully exploit those two CPU cores with Scheme. Here's what I come with after a little research:

  • Termite is an Erlang-like distributed programming system written in Scheme. It includes a parallel map and different message-passing mechanisms. This looks pretty cool.
  • Kali Scheme (abandoned?) is a distributed implementation of Scheme
  • MultiLisp is a Scheme implementation with some special constructs for easy parallelization. Seems to me to be a little bit outdated
  • Multiple processes on multiple cores is on the wishlist of Gambit Scheme

So here're my questions to the LtU Scheme experts:

  • What is your preferred way to exploit multicores/multiprocessors from Scheme?
  • Do you know of any other Scheme implementations that ease concurrent programming? Any libraries?
XML feed