[svn]
r5842: nemerle/trunk/doc/presentation/rotor-workshop-2005/raport.tex
malekith
svnadmin at nemerle.org
Mon Oct 24 15:14:49 CEST 2005
Log:
Some fixes.
Author: malekith
Date: Mon Oct 24 15:14:49 2005
New Revision: 5842
Modified:
nemerle/trunk/doc/presentation/rotor-workshop-2005/raport.tex
Modified: nemerle/trunk/doc/presentation/rotor-workshop-2005/raport.tex
==============================================================================
--- nemerle/trunk/doc/presentation/rotor-workshop-2005/raport.tex (original)
+++ nemerle/trunk/doc/presentation/rotor-workshop-2005/raport.tex Mon Oct 24 15:14:49 2005
@@ -18,8 +18,8 @@
\section{Introduction}
-The objective of the Nemerle project is to create a high--level
-general purpouse, statically typed, programming language. The language supports
+The objective of the Nemerle project is to create a high--level,
+general purpose, statically typed programming language. The language supports
object--oriented, functional and imperative programming paradigms.
The functional part is bundled with type inference and pattern matching.
@@ -27,20 +27,20 @@
The design of the \net\ platform had great impact on it.
Another thing worth mentioning here is support for a powerful,
-Turing--complete metaprogramming system, which is interesting from
+Turing--complete meta--programming system, which is interesting from
both practical and theoretical point of view.
\section{Reasons}
\subsection{Why \net\ ?}
-The \net\ platform was choosen because of several
-pragmatical reasons. It provides a wide variety of libraries,
-has reasonable support for multilanguage programming,
+The \net\ platform was chosen because of several
+pragmatic reasons. It provides a wide variety of libraries,
+has reasonable support for multi--language programming,
provides an efficient runtime environment (including a garbage
collector and Just--In--Time compiler) with the possibility
of generating code on the fly. Last but not least the executable
-files genarated by the compiler are portable -- they can be used
+files generated by the compiler are portable -- they can be used
on several architectures and operating systems using one
of the available implementations of the \net\ platform
(Microsoft \net, Mono, DotGNU, Rotor).
@@ -48,13 +48,13 @@
\subsection{Why a new language, from a user perspective?}
The idea that can attract users is the ability of easily
-combining obiect--oriented design with functional implementations.
+combining object--oriented design with functional implementations.
A user can design an application or a library at the high level using the
-familar model known from C\# but implement the method bodies
+familiar model known from C\# but implement the method bodies
in a functional style. This allows for smooth switch from object--oriented
to functional programming paradigm, in areas where it is more applicable.
Moreover the resulting library can be used from other object--oriented
-\net\ languages without any additional hessle.
+\net\ languages without any additional effort.
Nemerle doesn't force the programmer to use functional paradigm. It provides
easy access to both object--oriented and imperative features. User
@@ -66,31 +66,32 @@
syntactic changes we ended up creating something that could be called
Extended C\# with better functional programming support.
-One of our goal was to ease code maintainance. We for example consider
+One of our goal was to ease code maintenance. We for example consider
type inference helpful here -- the idea is that the information that
can be thought out by the simple type inference algorithm is redundant
-anyway and immedietly clear to the programmer. And reducing amount
-of redundant information clearlt help with program readabilty, which in
-turn helps code maintaince.
+anyway and immediately clear to the programmer. And reducing amount
+of redundant information clearly helps with program readability, which in
+turn helps code maintenance.
-Another thing that can help with maintaince is wise use of macros. They
+Another thing that can help with maintenance is wise use of macros (compiler
+extensions provided by the programmer). They
provide a way to avoid repetitive code, which should help both with
-readability. Additionaly, a macro once tested will always produce correct
+readability. Additionally, a macro once tested will always produce correct
code, which one cannot tell about a programmer coding the same SQL
query execution over and over again.
\subsection{Why a new language, from a computer scientist perspective?}
-From the computer scientist point of view there can be only one
-main reasons for creating programming languages: to experiment.
+From the computer scientist point of view the
+main reason for creating programming languages is to experiment.
Main areas here was the meta--programming system, type inference
algorithms for class--based object--oriented languages, and programming
language design in general.
-Another good reason was to excercise and experiment with
-System.Reflection.Emit especially with respect to generation
-of code using generics. We actully have found quite a few of
+Another good reason was to exercise and experiment with {\tt
+System.Reflection.Emit}, especially with respect to generation of code
+using generics. We actually have found (and reported) quite a few of
limitations there.
@@ -134,28 +135,28 @@
The type inference algorithm has to take macros into account. For
example the \texttt{foreach} macro needs to known the type of collection
it is iterating over to generate proper code. We resolve this issue
-by leaving up to the macro the decision if it has enough information,
+by leaving up to the macro the decision if it has enough information already,
or if it wants to defer parts of its execution for later, when
more typing information is available.
\section{Macros}
-Very important outcome of the Nemerle project is mature meta--programming
-system. It featres macros -- dynamically loaded compiler modules,
-that can transform, generate and analyse programs.
+Very important outcome of the Nemerle project is a mature meta--programming
+system. It features macros -- dynamically loaded compiler modules,
+that can transform, generate and analyze programs.
Macros have broad possibilities of interaction with the compiler.
They can alter the parser to extend the syntax of the language.
There are several possibilites here:
\begin{itemize}
-\item let macro invocation look like a regular function invocation,
+\item let macro invocation look like a regular function invocation;
this is the default, no special rules are required
-\item add a yacc--like rule, for example
+\item add a EBNF--like rule, for example
\begin{verbatim}
syntax ("return", Optional (expr))
syntax ("if", "(", cond, ")", e1, Optional (";"), "else", e2)
\end{verbatim}
-\item add a yacc--like rule with special RawToken parameter,
+\item add a EBNF--like rule with special {\tt RawToken} parameter,
which allows a list of lexing symbols to be passed
to the macro and interpreted in any way, example invocation
of such a macro would look like this:
@@ -166,15 +167,16 @@
though they are lexically valid, so macro can process them as it wish
\end{itemize}
-Macros can also obtain information about types of objects they are
-working on. This can (and should to get proper user experience) be
+Macro can also obtain information about types of objects it is
+working on. This can (and should, to provide proper user experience) be
combined with deferal, as explained later.
As macros are regular Nemerle programs they can read external
files, connect to databases and in general do almost anything.
This can be useful to for example generat classes from XML Schema,
or to check if given SQL query is valid and what would it return
-at compile time.
+at compile time (we can connect to the database, execute query, examine
+column names and do a rollback).
One important, from both practical and theoretical, feature of the macro
system is hygiene. It means that the macro system will protect accidential
@@ -217,20 +219,6 @@
the programmer side. It is however possible to write a set
of macros to restrict functionality to the regular AOP patterns.
-\subsection{Example use of macro}
-This macro checks syntax and type validity of a query at compile-time
-(by connecting to a database). It creates code, which uses {\tt SqlParameter}
-to pass value of {\it myval} to {\tt SqlCommand} securely.
-
-\begin{verbatim}
-def myval = "Kate";
-sqlloop ("SELECT * FROM employee WHERE"
- " firstname = $myval", dbcon)
-{
- printf ("%s %s\n", firstname, lastname)
-}
-\end{verbatim}
-
\section{The project}
@@ -278,7 +266,7 @@
\subsubsection{Community}
-We use a mailing list and (till recently) web forum for communication
+We use a mailing list and (since recently) web forum for communication
and general community building. The mailing list has about 70 subscribers.
Our webpage is wiki--based, which makes external user contributions
in the documentation area easy. The contributions do happen.
More information about the svn
mailing list