14
Hello, dear programmer! In this document you will (hopefully) find all information regarding how to write
15
your programs using using the Presto programming language. The Presto language is very different from
16
conventional programming language, and so will be this manual.
18
In Presto you write music and this music represents an algorithm. Therefore this will be a document about
19
how to write music\ldots nice, huh? We'll give you the basic guidelines of how the language \emph{works},
20
i.e, it's fundamental constructs, and also give some tips of style of how to write some very common
15
Hello, dear programmer! In this document you will (hopefully) find all information regarding how to write
16
your programs using using the Presto programming language. The Presto language is very different from
17
conventional programming languages, and so will be this manual.
19
In Presto you write music and this music represents an algorithm. Therefore this will be a document about
20
how to write music\ldots nice, huh? We'll give you the basic guidelines of how the language \emph{works},
21
i.e, it's fundamental constructs, and also give some tips of style of how to write some very common
25
\section*{Introduction, or ``What we wanted Presto to be''}
26
So, what did we have in mind when designing a ``musical language''? A very short answer is: we wanted
27
that the user be able to create \emph{beautiful} programs. Presto programs are not meant to be
28
efficient, although some simple optimizations are performed; it's an esoteric language, to demonstrate
29
the regular and algorithmic nature of music (and the musical nature of algorithms). This simple
30
thought has guided our design in several ways:
32
\item There are multiple ways of achieving the same computational task. We wanted to give the
33
programmer (or rather, the \emph{composer}) as much freedom as possible. For instance, to
34
build an arithmetic series the composer can use several tempos, several rhythmic patterns and
35
various melodic patterns also.
36
\item Whenever possible, algorithmic concepts are to be represented by their direct musical
37
counterpart. For example, an ascending numerical sequence can be built using ascending
38
melodies, and a quicker rhythm makes the sequence grow faster.
39
\item Our \emph{machine model} should be as simple as possible: a small number of primitive
40
operations would enable our goal to give more freedom to the composer, even though it might be
41
\emph{more difficult} to write Presto programs. We've settled on a stack machine model, with
42
one single stack and a very limited number of operations.