Erlang language issues

Richard Carlsson <>
Mon Apr 22 20:35:14 CEST 2002


On Mon, 22 Apr 2002, Chris Pressey wrote:

> I know next to nothing about XML, but - isn't it supposed to provide
> alternatives for this sort of thing?  By supplying a 'structured
> document' approach?  Parts of a document can be in Erlang, parts can
> be in HTML, parts can be Javascript, parts can be English
> commentary, and parts can be diagrams and theme music and whatever
> else.  The Erlang part can be automatically extracted just before
> compilation - it's not as if the compiler should care what's in
> comments.

Well, you'd want a special editor (or Emacs-mode) that can handle this
for you, since it would mean that every program file would have to be a
proper XML file (beginning with some painful XML-declaration stuff), and
of course, you'd have to escape every '<' or '&' character, unless
you're in a CDATA ("verbatim") block.

Basically: XML is just a formalisation of how to represent a tree
structure as text. It's a more picky version of SGML - e.g., you cannot
leave out end tags - with some extra stuff like name spaces and data
types. (And XHTML is thus a picky version of HTML.)

I just don't think the world is ready yet to go from plain text files
(simple to read, use any text editor) to "XML everywhere". Not until
practically all text editors and similar tools can handle it.

> Erlang is in theory self-documenting - but choosing appropriate
> function and variable names is a lot harder than it sounds.  Many
> functions should probably be nested, but aren't, resulting in some
> very strange names, suffixed with _tail or 0.  And single-letter
> variable names are a hard habit to break, when called for -
> sometimes they are OK, in utility functions where there is not much
> that can be assumed about the values.  Other times they are
> disastrous, although, probably worse in a non-single-assignment
> language like C.

That's true, but again, I was really only talking about the API part,
i.e., the public functions. As long as you give those good names and
reasonable input/output conventions, it does not matter to a user if it
looks horrible inside. :-]

(Not until they try to fix your bugs, anyway...)

	/Richard


Richard Carlsson ()   (This space intentionally left blank.)
E-mail: 	WWW: http://www.csd.uu.se/~richardc/
 "Having users is like optimization: the wise course is to delay it."
   -- Paul Graham




More information about the erlang-questions mailing list