Nemerle 2.x & Cx# (enu)
От: VladD2 Российская Империя
Дата: 14.01.17 13:21
#Имя: wiki.Nitra.DotNetLanguages.Enu
We are ready to start work on Nemerle 2 and Cx#. Therefore, in the topic I will present my vision on its projects and explain why I want to merge these projects together.

Why combine the two languages in one project?

Why combine the projects? The point is that a ideology close languages have very much in common. Despite the fact that their syntax may be vary different, but internal implementation of these languages will coincide on 80%.

In fact the analysis of complex syntax currently no longer a problem. Without false modesty I say that our parser was very powerful.

The main difficulty in a languages development (on everything, including on Nitra) is typing (semantic analysis). In this area Nitra also provides very powerful solution, but typing of a language with a complex type inference, and complex scopes (which is true for Nemerle, and C#) is an intellectual challenge. Nitra only increases the level of abstraction and allows you to keep the complexity within acceptable limits by increasing the level of abstraction and decomposition capability.

Typing in Nitra performed on a AST (not to be confused with the Parse Tree). AST can be either unique to a language and common to a number of languages. In practice, the more common general AST. Differences in semantics can be abstracted by factories algorithms and by parameters.

Moving common AST in separate project/assembly, we obtain the union of both languages (and in the future, other .Net languages). This will give us the opportunity to work on both languages simultaneously.

I offer in most cases, to refuse semantic features Nemerle1 in favor of greater compatibility with C#. Of course! We will do this is not to the detriment of language expressiveness. Just a Nemerle1 there are many decisions that have been made different with C#, not because C# solutions were bad, but because so happened during the implementation or because the authors simply do not know the language specification.

Just offer use the Nemerle2 semantic solutions in Cx# if they are a superset of C#. For example, in my opinion, it is permissible to use is more powerful type inference in Cx#, and make type inference of Nemerle2 more like type inference in C#, where appropriate.

About a extended type system and other mega-features

Mega-features — it is very interesting! But we must take into account the following considerations:

1. We can not implement everything at once. Taking up a cool but not vital a feature, is possible to spend a lot of time, and not get the desired result, in the foreseeable future.

2. Thinking about the language development and extending: most of us are thinking about language as about monolithic solutions, which should be designed entirely at once, thinking through all features integration. This is the wrong approach! Nitra is designed in such a way that allows you to integrate a syntax/semantic/type system extension. Of course, we should to consider the compatibility of features. But we do not have the problems faced by the authors of monolithic languages:

2.1. Fear of spoil a language.
2.2. Fear of breaking compatibility.

In addition, we need quickly get a working compiler (and IDE engine) for subset of Nemerle1 (used in Nitra). It is necessary for the following reasons (listed in order of importance):
1. To speed up the Nemerle compilation. This is a very important issue! Nemerle1 compilation speed at 10 times (or more) lower than that of MS C# compiler.
2. To support IntelliSens in a Nemerle code blocks embeded in a .nitra files.
3. In order to make full bootstrapping of Nitra. Currently Nitra is dependent on the old version of Nemerle 1.2.x compiler. This prevents Nitra move to another platform.
4. It will improve Nemerle support in the IDE, which again will speed up development and make it more comfortable.

Therefore, I propose to defer the implementation of mega-features before the end of the Nemerle1 basic features implementation (used in Nitra subset).
Есть логика намерений и логика обстоятельств, последняя всегда сильнее.
Отредактировано 14.01.2017 13:31 VladD2 . Предыдущая версия .
Подождите ...
Пока на собственное сообщение не было ответов, его можно удалить.