Coroutines in Lua

Link: The Lua folks discuss their implementation of coroutines, using Create, Resume and Yield methods.

Lua implements the concept of asymmetric coroutines, which are commonly denoted as semi-symmetric or semi-coroutines. Asymmetric coroutine facilities are so called because they involve two types of control transfer operations: one for (re)invoking a coroutine and one for suspending it, the latter returning control to the coroutine invoker. An asymmetric coroutine can be regarded as subordinate to its caller, the relationship between them being similar to that between a called and a calling routine.


Lua coroutine facilities provide three basic operations: create, resume and yield... Function coroutine.create creates a new coroutine, and allocates a separate stack for its execution... Function coroutine.resume (re)activates a coroutine, and receives as its required first argument the coroutine reference... A coroutine suspends by calling function coroutine.yield in this case, the coroutine’s execution state is saved and the corresponding call to coroutine.resume returns immediately.

The main difference with typical thread implementations is that (a). the caller is suspended until completion and (b). a coroutine can return values like a function call. I suppose I'd summarize it as functions that retain state between calls.

Back to the language roots

Link: The article discusses the future of HDLs given the encroachment of software programming languages.

It's not time for the revolution yet. Traditional hardware-description languages have specific features that make them superior to software programming languages; although SystemC has its place in the hardware-design process, it still can't compete with Verilog and VHDL...
Verilog may have C-like syntax and VHDL an Ada-like syntax, but there are significantly different concepts in HDLs and software programming languages. Most importantly, an HDL adds the notions of concurrency and time.

From a PL perspective, it always seems to get back to whether a dedicated language is better suited than a more flexible general purpose one. And whether the specifications are best verified within the language or by a suite of tools and tests.

Modelica: Modeling of Complex Physical Systems

The object-oriented modeling language Modelica is designed to allow convenient, component-oriented modeling of complex physical systems, e.g., systems containing mechanical, electrical, electronic, hydraulic, thermal, control, electric power or process-oriented subcomponents. The free Modelica language, free Modelica libraries and Modelica simulation tools are available, ready-to-use and have been utilized in demanding industrial applications, including hardware-in-the-loop simulations. The development and promotion of Modelica is organized by the non-profit Modelica Association.

I stumbled upon this site a couple of days ago. It look pretty interesting, the overview offers a good introduction to its features.

Hume Programming Language

Stumbled across the Hume Programming Language while looking for some ML info. Hadn't seen it discussed on LtU before:

Hume is a domain-specific language targeting real-time embedded systems. Hume provides a number of high level features including higher-order functions, polymorphic types, arbitrary but sized user-defined data structures, asynchronous processes, lightweight exception handling, automatic memory management and domain-specific metaprogramming features, whilst seeking to guarantee strong space/time behaviour and maintaining overall determinacy.

A bit too preliminary and research oriented for my tastes, but the main point of interest is the attempt to provide static guarantees of resource usage (time and memory). A binary version for Linux and Mac is available, but the source code is not available for other builds (written in GHC which I notice is now available for a number of target platforms since last i checked).

Absence

My father passed away Thursday night.

I will be away for at least a week.

Please keep LtU for me while I am away.

Killer Props for Computer Scientist!

Who is the most thanked person in Computer Science? No, it's not Ehud Lamm, or Superman! It's...Olivier Danvy, famous PL researcher. PL research does pay (in...umm...intangible rewards).

Read the full story on Nature

Choosing a Language for Interactive Fiction

Link: Can't recall that we've ever discussed programming languages that are dedicated to authoring text adventures (much less MUDs). These languages are geared towards constructing worlds that have a built-in english language like parser. Kind of Lisp meets Prolog aspects, where the emphasis is on a declarative type of programming.

How birds learn songs

Research on Teaching Birds to Sing. Since we periodically delve into general language issues, I thought this work might be of interest since it is related to language learning.

Learning how baby sparrows learn to sing their songs could provide clues to how humans learn to speak languages. University of Utah biologist Gary J. Rose and his colleagues have taught baby sparrows to sing a complete song, even though the birds were exposed only to overlapping segments of the tune rather than the full melody.

(Though, we still appear years away from providing a general purpose PL for the winged community. And even then, we'll have to engage a full combinatory community).

Tim Bray: Sun & Dynamic Java

Tim Bray,

So on Tuesday we held a summit here at Sun, with a few of our internal Java leaders, and on the dynamic-languages side, Larry Wall and Dan Sugalski (Perl and Parrot), Guido van Rossum, Samuele Pedroni and Sean McGrath (Python), and James Strachan (Groovy). It was an educational day for us; herewith some take-aways and pictures.

Everyone and his sister is linking to this blog post, so you might have seen it already.

For a touch of flavor, here’s just part of the list that of things to discuss that Larry had prepared: anonymous code/closures, lvalue methods/functions, variadic call/return, constant/rw/copy/ref/lazy parameters, wrappers/AOP, eval, exception handling/undef/nil/unthrown exceptions, exception handlers with lexical access, temporization/hypotheticality, efficient regex with complete semantics, access to dynamic context/want/caller, redispatch of methods (fallback upon "fail"), efficient switch statement?, versioned modules/classes, virtual classnames, continuations.

Feel free to express your opinion regarding this list, and other relevant factors.

LLVM 1.4 Released

LLVM 1.4 is now out in the wild. This release adds a large number of new features including JIT support for PowerPC machines, improved debugging information with the C/C++ front-end, better optimizers, new archive support, and a new compiler driver.

Get it now!

-Chris