At first: This mail is only about the question: Is Scheme a bad choice
as programming language for TeXmacs?
Norbert Nemec wrote:
Henri Lesourd wrote:
But perhaps I don't look exactly at the right
place : could you elaborate more on why, precisely
you feel that Scheme is one of the more uncomfortable
languages for you ?
I think it is for a large part the syntax. There are other functional
programming languages that have a greatly improved syntax compared to
the old style Lisp. (Haskell, Ocaml and others)
The "improved" syntax of Haskell or Ocaml as opposed to Scheme's
"non-syntax" is an extremely superficial aspect to compair these
programming languages. The main contrast is that Haskell as well as ML
(or its dialect Ocaml) is a statically typed language whereas Scheme is
dynmaically typed. And the well known main advantage of statically typed
languages is that they reduce in general the number of runtime errors
signficantly.
And the main advantage of functional languages like Haskell as opposed
to all imperative statically typed languages (I know) is that Haskell
and ML have a very powerfull type inference system which makes code even
more reliable and moreover disburden the programmer from explictly
typing each argument and return value of a procedure.
First, one should get rid of all the parenthesis. Then, there should be
sane infix notations for operators.
Finally, it would also be possible to use a syntax that is very near to
what people know from imperative languages. Fact is: the majority of
programmers has experience in C/C++, only few are comfortable with
functional programming. It is possible to hide the functional character
of a language to a large extent. Basically, Scheme already is not purely
functional any more. One could very well adjust the syntax to that fact.
In fact Scheme's "non-syntax" is something I appriciate very much. Every
expression is in prefix notation and there is no precedence of one
operator over the other. So you don't need to learn any syntax and don't
need to rmemeber any precendence rules. (One reason why Sussman chose
Scheme for his very famous book "Structure and Interpretation of
Computer Programs"). Moreover lists and procedures share the same simple
syntax which facilitate all the possibilities of transforming code to
data and vice versa. One application are macros.
Finally I find Scheme a good choice for TeXmacs since it is a lot of
manipulting trees i.e. lists of lists and that is something you can do
with a functional programming languages much more compact and concise
then in any standard imperative language.
The only point I see against Scheme (and any functional language) is
that there are much more programmers with experience in imperative
languages than in functional languages. It seems that some concepts of
functional programming (e.g. higher order functions) are a barrier for
impertive programmers. However these concepts are very powerful and may
be they contributed considerbaly to the success of TeXmacs.
Immanuel Normann
_______________________________________________
Texmacs-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/texmacs-dev