D's future discussed in forums

Posted 2019-04-01

Thread with Andrei talking about changes, rvalue ref brought up again (this time by Andrei), tip on CTFE in -betterC, Adam works on web stuff more.

Core D Development Statistics

In the community

Community announcements

See more at the announce forum.

Tip of the Week

From alphaglosnined on IRC:

behold, a class pool with the -betterC switch

It is pretty simple code, but it shows a few things with -betterC that you might not expect works: it makes a static buffer of classes.

First, an extern(C++) class is used to get around -betterC's usual class restriction. Second, it uses a global array initialized with CTFE to get around the usual forbidden new operator - it works at compile time, rather than run time. Third, it calls an anonymous function inline, which I just think is a kinda cool technique.

static something = () { /* construct and return something here */ }();

That can be arbitrarily complex and will run at CTFE as an initializer.

Big forum thread

We had a beast of a thread this week called Generality creep which started off saying Phobos is too general, and should simplify its interfaces, but then went for a hundred posts down a whole new direction: D's leadership and future course.

"We've been worrying too much about changing things." Andrei Alexandrescu said, and there was much rejoicing. His idea: make a new namespace, std.v2, which redesigns things from the ground up. No more autodecoding, tweaks to the fundamental definition of ranges (such as no more save), thinking about the attributes they'd support like @nogc from the start.

And then he dropped an even bigger bombshell: "Oh, and druntime must go.". Whoa - he wants to change the language so runtime bits are brought in as-needed rather than a monolithic piece.

(Note that some movement has already happened in this direction, as I pointed out a month ago, but there is a lot of potential for more.)

This got Mike Franklin, who has previously said he left D because of the overall course, to say this has gotten his attention. I agree, if we do this right, it is going to be better for everyone.

But, will we do it right? That's where my skepticism comes in... I still have very little confidence in D's current leadership. And as we saw around page ten of that thread, I'm not alone.

I watched the American TV show called "The Office" a little while ago. I found the first few episodes absolutely insufferable, but my friends insisted I stay on with them. The boss in the show, Michael, is horrible. (And yes, I realize that's the point.) It made me wonder, how did this guy ever get that job?

Then an episode showed him making a big sale, and believably presented him at being legitimately good at that job. Then it made sense, the Peter principle at work - he was promoted to the level of his own incompetence. Michael Scott is good at sales, and the company tried to reward his good work with a promotion, which ended up landing him in a management role that he was wholly unsuited for.

At that point, both sides lost. Michael was put in a job where he didn't really get to do what he enjoyed, and the company essentially traded one of their best employees for one of their worst. But, it was difficult to change. Putting him back in a sales position would be seen as a demotion and those hurt feelings make it hard to actually bring yourself to say as his boss, and hard for him to go back to the way things were. That relationship may not recover, though the fact remains, taking him out of management and back in the sales job would probably be better for everyone.

Well, I think this is what's happened with D. Like I said in public, Walter and Andrei are very strong programmers, but they're pretty bad at running D as a project. And while it might hurt feelings to say this, I think they need to shift their roles to once again align with their strengths for the good of the team as a whole, and Andrei's own feeling of enjoyment with his work.

What Adam is working on

Well, I got some more work on my game libraries, but this week, I was back to my web libraries, using them on a real-world side gig. Though, so far, I have barely used the new stuff! I kinda prefer doing it the old way... so far, the project is still young.

The one crazy thing I did was use dom.d's support for reading ASP-style <%= xxx %> tags, combined with jsvar.d's magic reflection reading, and script.d's interpreter to make a template thing.

1 <ul>
2 <for-each over="products" as="product">
3 	<li>
4 		<h3><%= product.name %></h3>
5 		<div><%= product.description %></div>
6 	</li>
7 </for-each>
8 </ul>
var context = var.emptyObject;
context.products = database.getProducts();
cgi.showTemplate("shop.html", context);

It is kinda cool that such a thing works, and I was able to implement it in ~20 lines of code... but I don't really love it and am not sure if I will pursue this any further. (The only reason I am doing this is one of the catches on using D was the client wanted to make sure it was all comprehensible to his PHP programmer too. So I am just seeing what I can do to write it in a similar style, but there are a LOT of other options to explore. So we'll see.)

In any case, I need to get going, I am at a day job meeting this week, so won't be on as much as I usually am. tty next week.

"Is there anything you can't do?"

"Yeah, I can't complete a project."

lol, kinda true.