caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Formal specifications of programming languages
@ 2008-02-13 18:22 Andrej Bauer
  2008-02-13 18:27 ` [Caml-list] " Christopher L Conway
  0 siblings, 1 reply; 9+ messages in thread
From: Andrej Bauer @ 2008-02-13 18:22 UTC (permalink / raw)
  To: caml-list

I see people have opinions about formal semantics.

Having formal semantics for a programming language is a valuable thing,
even if most people do not understand it. Such semantics is a piece of
mathematics that removes (hopefully) every doubt as to what we are
talking about, and has other benefits as well. High priests can then
write sermons in common language and explain the meaning of the Holy Word.

It would probably be quite hard to provide formal semantics for complete
ocaml, for several reasons, such as sheer size, C interface, and the
fact that it is a moving target.

But what is formal semantics good for?

Complete formal semantics written with a tool such as Coq, together with
formal proofs of its properties (existence of principal types,
uniqueness of typing, type preservation, progress lemma) is good for
automatic extraction of a prototype type-checker and/or interpreter.
This can be extremely valuable for PL researchers who want to experiment
with new features.

Incomplete formal semantics written in a series of papers and
dissertations is still quite useful. It allows researchers to clearly
express and communicate ideas. Once a person learns how to read the
mathematics that may greatly help his or her understanding of corner
cases and peculiar examples.

We (researchers) should encourage "ordinary programmers" to read formal
semantics by writing manuals and textbooks that incorporate the
formalism and decorate it with sufficient explanation.

Think about the fact that specifying concrete syntax in BNF-like
formalism has become the norm. Programmers happily read it and the
benefits are obvious. Nobody suggests that syntax should be explained in
English prose because BNF is too hard to understand. So why are you
suggesting that the norm for describing other pieces of a programming
language, such as typing rules and operational semantics, should be
primarily (or only) English prose?

Andrej


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-02-18 21:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-13 18:22 Formal specifications of programming languages Andrej Bauer
2008-02-13 18:27 ` [Caml-list] " Christopher L Conway
2008-02-13 19:45   ` Andrej Bauer
2008-02-14  9:00     ` Jacques Garrigue
2008-02-14  9:08     ` Xavier Leroy
2008-02-15 14:30       ` Christopher L Conway
2008-02-18 10:05         ` Jacques Garrigue
2008-02-18 16:44           ` Jacques Carette
2008-02-18 21:52             ` Christophe Raffalli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).