archives

Hop: a Language for Programming the Web 2.0

Hop, A Language for Programming the Web 2.0

From the abstract:

"Hop is a new higher-order language designed for programming interactive web applications such as web agendas, web galleries, music players, etc. It exposes a programming model based on two computation levels. The first one is in charge of executing the logic of an application while the second one is in charge of executing the graphical user interface. Hop separates the logic and the graphical user interface but it packages them together and it supports strong collaborations between the two engines. The two execution flows communicate through function calls and event loops. Both ends can initiate communications."

It appears to be implemented in Scheme. The Hop website has a nice demo.

Continuations for Parallel Logic Programming

Continuations for Parallel Logic Programming
by Eneia Todoran and Nikolaos S. Papaspyrou

This paper gives denotational models for three logic programming
languages of progressive complexity, adopting the
"logic programming without logic" approach. The first language
is the control ow kernel of sequential Prolog, featuring
sequential composition and backtracking. A committed-choice
concurrent logic language with parallel composition
(parallel AND) and don't care nondeterminism is studied
next. The third language is the core of Warren's basic Andorra
model, combining parallel composition and don't care
nondeterminism with two forms of don't know nondeterminism
(interpreted as sequential and parallel OR) and favoring
deterministic over nondeterministic computation. We show
that continuations are a valuable tool in the analysis and
design of semantic models for both sequential and parallel
logic programming. Instead of using mathematical notation,
we use the functional programming language Haskell
as a metalanguage for our denotational semantics, and employ
monads in order to facilitate the transition from one
language under study to another.

This paper happens to combine several topics that interest me lately - AKL (a precursor of Oz), denotational semantics, continuations, and implementing programming languages in Haskell.

If you share at least some of these interests - take a look!

Trying to get embedded python co-routines to work

Sorry if this has been talked about before, but I can't seem to find any resources on this site or with Google anywhere...

I'm trying to get embedded python co-routines to work, and thinking about what the best strategy would be, so I figured I'd ask if anyone had dealt with this before.

Basically what I'm looking to accomplish is a bunch of separate interpreter states (or threads I guess, if I can get that to work elegantly) that I schedule myself (i.e. when a certain process gets a tick, I tell the python thread to do a tick of its execution), with many sequential blocking functions for each process. So basically I want to have concurrently:

Process A trying to do actions P, Q, R
Process B trying to do actions X, Y, Z

where I schedule when each one gets a tick, and the responsibility for "am I done" checking is inside P, Q, etc, not in A or B

This would be a C application, with A and B being Python scripts and P, Q, etc being Python extensions written in C, possibly with Python wrappers...

Some ways I'm considering doing it:
- building off generators (no support of going to/from C or yielding the whole stack that I can find)
- throwing exceptions to escape to the top level and hacking continuations in
- using the debugging trace functionality accessing some shared data to allow me to step until I hit a blocking instruction (still requires nasty frame saving/restoring)
- somehow scheduling the python threads by myself (it seems like this should be trivial, but somehow I can't seem to find any interface for doing this... still searching through docs, I'm assuming it should be doable somehow...)

Does anyone have any experience with this or anything similar? I hope my descriptions are clear enough...

Thanks in advance,

Raoul