Pluvo : new hybrid scripting language

Pluvo is a functional and imperative programming language intended to be highly practical for scripting and CGIs, interpreted using a just-in-time compiler. Its hybrid dynamic and strict typing is flexible enough to allow duck typing. Its functions are, more specifically, closures, and it allows object orientation using prototypes.

From Sean B. Palmer.

Knowing he's a big fan of Python I expected a fair bit of influence - and there is, in fact the implementation is written in Python. Flexibility over typing was to be expected too, Sean's done a lot of work around RDF. Slightly surprising was Pluvo's syntax, which owes more to Bash.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

it uses prefix notation, but

it uses prefix notation, but supports infix by scanning a list of arguments until a "callable" value is found. is that going to work in general? it seems to imply, for example, that once you start using higher order functions you need to use prefix notation (since if you start using functions as arguments of functions, then it's unclear what is "the" function and what is an argument).

i can't remember what rebol does - is it similar to this? also an early article of graham's on arc had another solution for getting "infix for free". it might be interesting to compare them. on the one hand it's a silly little detail; on the other it seems like a really good solution to presenting prefix as infix would make s-exp based macro processing much more popular (didn't see anything about macros here though)

Context-dependent parsing is evil

It's limited to declaring operator precedence in Haskell and Prolog. This is not nice but it works quite well in practice, until you want to implement a custom Haskell parser.

It's present in lots of very subtle lexing details in Perl; see toke.c file in the sources. This is bad because these cases are unexpected and the rules are tricky (some are heuristic).

It's present in C (type names must be distinguished from other names) and C++ (type names and template names must be distinguished, including qualified names). This causes programmer headaches in templates (the typename keyword and some uses of the template keyword exist because of this). This forces a precise C++ parser to implement the whole C++ type system and template system, which for perverse programs requires to know machine-dependent integer sizes for evaluation of integer constants.

It's horrible in Logo and Rebol because you must know the arity of every function to understand what is an argument of what.

It would be a very bad idea to decide between infix and prefix function application syntax at runtime, basing on which expression has evaluated to a function.

Are you shure that the

Are you shure that the compiler holds relevant information about callables / non-callables? I guess this is all runtime information. So parsing does not have to be context sensitive. The compiler might create an argument list only.

---

Maybe one can repair coördination for HOF by annotating some symbol to a callable in order to let the interpreter skip it when searching through an argument list for the first callable to use:

'f isa function

Here 'f is a callable f that will be handled as data and passed into the binary operator isa.

Macros

It supports a @quote function for it's code blocks (which are stored as tables), so I imagine even if it doesn't have builtin support for macros, they wouldn't be too hard to add.

It looks interesting but

It looks interesting but it's built on top of another (not very fast) interpreted language; hardly a win in the performance arena.

No performance win but

The author clearly states that ``It's mainly an experiment and a playground...''. The ease of use of today's scripting languages makes them the ultimate playground to create new conceptual programming languages like Pluvo.

Maybe someday the author will implement his language in something like C, or (maybe better) will bootstrap a compiler to a bytecode for the JVM or Parrot.

Or Neko...

Or Neko, which is exactly meant for this kind of things.