How much time will D1 be around?

Ary Borenszweig ary at esperanto.org.ar
Thu Nov 13 17:07:40 PST 2008


Frits van Bommel escribió:
> Ary Borenszweig wrote:
>> Now that D2 is being developed, I don't know how much time it will 
>> take until it is finished. Once it is, what will happen to D1? Will 
>> anyone still use it?
> 
> I think I might keep using it for a while yet. D2 has some features I 
> dislike. On the other hand, some others are very tempting...
> 
>> I ask this because from time to time I like to add new features to 
>> Descent to improve D1 support. Semantic analysis is pretty done for 
>> D1, except for some bugs that are hard to fix, or at least take a lot 
>> of time. :-P
> 
> Well, some places I'm still really missing semantic analysis in Descent:
> * Nested functions (their bodies don't seem to get analyzed)

Do you have an example? It seems to work for me. Maybe you are talking 
about templates? These are not analyzed.

> * Mixins (functions defined by (string) mixins don't get highlighting, 
> don't show up in code completion, etc.)

Again, it works for me, but this time not always (because the semantic 
analysis ported from DMD isn't finished/has bugs). But I tried this example:

module other;

char[] foo(char[] name) {
	return "char[] " ~ name ~ "() { return \"" ~ name ~ "\"; }";
}

mixin(foo("fix"));

---

module another;

import other;

const y = fix();

---

module main;

import other;
import another;

const someVar = y;

void foo() {
}

---

Now, if you request autocompletion inside "foo", "fix" should appear as 
a proposal. If you ctrl+shift+hover over "fix" you should see that "fix" 
appears. ctrl+shift+hover over foo("fix") should show you:

char[] fix() {
	return "fix";
}

> Or are those the "hard to fix"/"take a lot of time" cases? (Or fixed in 
> trunk but not up on the update site?)

Semantic analysis bugs are hard to fix (and, well, kinda boring), 
specially since Descent doesn't use DMD's code unmodified because I had 
to introduce some optimizations and lazy loading. Template semantic 
analysis is also hard, because I'd had to write it myself almost from 
scratch. DMD analyzes templates in instantiations only. Maybe I could 
analyze every template with a dummy instantation; the problem is I don't 
know which concrete arguments to use (they might lead to static ifs 
failing, etc.).



More information about the Digitalmars-d mailing list