June 10, 2022
On Friday, 10 June 2022 at 22:44:25 UTC, forkit wrote:
> On Friday, 10 June 2022 at 20:59:38 UTC, mw wrote:
>> [...
> [...]

Betterc++
June 10, 2022
On Friday, 10 June 2022 at 20:59:38 UTC, mw wrote:
> I still feel puzzled:
>
> D is supposed to be a better OO language (read: encapsulation, separation of concerns), and DMD is developed by a number of highly capable very experienced D developers (read: not ordinary programmers), how come DMD is in such a terrible state as if it's done by some average Joel (above)?
>
> No offense, I am just puzzled by this software engineering myth.

Its a above average compiler, its just that the average languge on a scale to 1-10 is maybe 2
June 10, 2022

On Friday, 10 June 2022 at 23:13:22 UTC, monkyyy wrote:

>

Its a above average compiler, its just that the average languge on a scale to 1-10 is maybe 2

Unrelated, you can implement a good model in a spartan language like C and end up with high quality on every level. It takes more discipline, that's all.

Few people are good at designing architectures. Most good archirctures build on the experience from other architectures: you need to study the work of others before you write a single line of code. Or write many compilers with different strategies.

If you go DIY and focus heavily on performance then the architecture will not be able to take on novel new features without a significant toll on the code base. At some point you'll be deadlocked into a backlog of bugs to fix.

June 10, 2022
On Fri, Jun 10, 2022 at 10:44:25PM +0000, forkit via Digitalmars-d wrote:
> On Friday, 10 June 2022 at 20:59:38 UTC, mw wrote:
[...]
> > D is supposed to be a better OO language (read: encapsulation,
> > separation of concerns), [...]
[...]
> Nonsense. D .. a better OO langauge??

This makes me chuckle.  So the OO bandwagon is still alive and tooting, after all these years.


[...]
> The D module is designed to encourage shared mutability. There are no means to specifiy, let alone verify and enforce, encapasulated object invariants.  They have no 'boundary' inside a D module - by that I mean, any other code in the same module can transgress any boundary that has been specified.

Interesting. By the same logic, any code in the same class in, say, Java, can "transgress any boundary" and omg modify shared state touched by other code in that class -- oh the horrors!

The only pertinent difference, really, is the size of the unit of encapsulation in which this is permitted to happen.  For any non-trivial code to work at all, it has to interact with other code *somehow*. One part of the program has to share data with another part of the program, otherwise it might as well do nothing at all.

One may, of course, disagree with the chosen unit of encapsulation, but that's all there is to it, a difference in units. It isn't as though the universe is in danger of imploding as soon as shared state leaks beyond the boundaries of a(n) {expression, function body, class, module, thread, etc.}.  It's a matter of balancing between risk and bureacracy: the larger the unit, the higher the risk; but the smaller the scope, the more the bureacracy (when you need to cross boundaries).  I think almost all of us agree that there has to be *some* unit of encapsulation, we just disagree on what that unit should be.


[...]
> Co-operative mutability, is a major source of bugs - always has been, always will be (cause it makes it so difficult to reason about code).
> 
> Mutable state subverts encapsulation, makes it more difficult to reason about code, and makes it difficult to scale 'correct' code.
[...]

This sounds like a sales pitch for Haskell. :-P  The logical conclusion of the above line of reasoning is to eliminate mutable state altogether, and for that, Haskell perfectly fits the bill.


T

-- 
If it tastes good, it's probably bad for you.
June 10, 2022
On Fri, Jun 10, 2022 at 11:13:22PM +0000, monkyyy via Digitalmars-d wrote:
> On Friday, 10 June 2022 at 20:59:38 UTC, mw wrote:
> > I still feel puzzled:
> > 
> > D is supposed to be a better OO language (read: encapsulation,
> > separation of concerns), and DMD is developed by a number of highly
> > capable very experienced D developers (read: not ordinary
> > programmers), how come DMD is in such a terrible state as if it's
> > done by some average Joel (above)?
> > 
> > No offense, I am just puzzled by this software engineering myth.
> 
> Its a above average compiler, its just that the average languge on a scale to 1-10 is maybe 2

Wow, you're optimistic.  After having worked with "enterprise" code for the last how-many decades, I would rate 99% of non-trivial codebases out there somewhere between 0 to 1 on a scale of 1-10.

If you think dmd is bad, wait till you see the code of an "enterprise" compiler for an "enterprise" language. I guarantee you, you will need therapy afterwards. :-P  To this day I still suffer PTSD from having once attempted to read glibc source code...


T

-- 
Give a man a fish, and he eats once. Teach a man to fish, and he will sit forever.
June 10, 2022

On Friday, 10 June 2022 at 23:36:48 UTC, H. S. Teoh wrote:

>

On Fri, Jun 10, 2022 at 10:44:25PM +0000, forkit via Digitalmars-d wrote:

>

On Friday, 10 June 2022 at 20:59:38 UTC, mw wrote:
[...]

>

D is supposed to be a better OO language (read: encapsulation,
separation of concerns), [...]
[...]
Nonsense. D .. a better OO langauge??

This makes me chuckle. So the OO bandwagon is still alive and tooting, after all these years.

Friday... Drunk? What other modelling paradigm than OO would be suitable? Certainly not ER?

Or maybe you think modelling is a waste of time? Let's just jump in and write code!

Most open source sofware suffers badly from this attitude. D is no exception, of course. It is universal: modelling is boring and hard, coding is fun and easy, let's code!!

June 10, 2022
> The answer is very simple: historical baggage.

OK, that explains.


On Friday, 10 June 2022 at 23:09:57 UTC, monkyyy wrote:
> On Friday, 10 June 2022 at 22:44:25 UTC, forkit wrote:
>
> Betterc++

Yeah, that's what I mean, better than C++, that's where D get started.

And I guess D's module stuff coming from Java's package idea: all the classes/files in the same directory are supposed to be closely related, so the access control (private/protected) is relaxed. IIRC, Walter also produced a Java compiler in the early Java 1.0 days before he started D.


Sometimes, completely rewrite is the only way to solve the problem. I know one of the mega cap tech company completely rewrite their whole infrastructure at least 3 times. Each time with the lesson learned from the previous version.


But, given D’s small community size, not sure if this is feasible.

Just wondering if someone want to start from scratch writing a completely new D front-end.
June 11, 2022
On Friday, 10 June 2022 at 23:41:58 UTC, H. S. Teoh wrote:

> code for the last how-many decades, I would rate 99% of non-trivial codebases out there somewhere between 0 to 1 on a scale of 1-10.
>
> If you think dmd is bad, wait till you see the code of an "enterprise" compiler for an "enterprise" language. I guarantee you, you will need therapy afterwards. :-P  To this day I still suffer PTSD from having once attempted to read glibc source code...
>
>
> T

I feel allot of language dev is academic, and enterprise grade code is worse then academica, also averages that include extermes on a linear scale bias upward
June 11, 2022
On Friday, 10 June 2022 at 23:36:48 UTC, H. S. Teoh wrote:
>

In OOP, the primary unit of scope/encapsulation is the class.

I'm not aware of there being different views on this matter - but happy to be enlightened.

That is the basis on which I reject the assertion that D is a better OO language.

btw. I'm not a proponent of Java, as some have suggested ;-)

So using Java to rebutt my argument, is pointless ;-)

But I do think, programming language of the future need to default to immutability and memory safety. One should have of course, the option, to opt-out where that is needed and appropriate.

The problem with D, is that it set out to be a betterC, perhaps even a betterC++.

But when one sets out to design a better motorcycle, you don't end up with a motorcycle at all. You end up with something completely different.

The advantage of a motorcycle, is you can just jump on it a zoom off...... and of course, you have the rush of being in control of your own fate..

That's the advantage of the motorcycle. Safety issues were never a primary consideration - otherwise you wouldn't be on that motorcycle.

So designing a better C or C++ is a futile effort, that results in some strange hybrid of things.. that don't see to really go all that well together.

I don't want a seat-belt on my motorcycle.

I don't want the seat-belts taken out of my car either.

June 10, 2022
On Sat, Jun 11, 2022 at 12:08:26AM +0000, monkyyy via Digitalmars-d wrote:
> On Friday, 10 June 2022 at 23:41:58 UTC, H. S. Teoh wrote:
> > [...] I would rate 99% of non-trivial codebases out there somewhere between 0 to 1 on a scale of 1-10.
> > 
> > If you think dmd is bad, wait till you see the code of an "enterprise" compiler for an "enterprise" language. I guarantee you, you will need therapy afterwards. :-P  To this day I still suffer PTSD from having once attempted to read glibc source code...
[...]
> I feel allot of language dev is academic, and enterprise grade code is worse then academica, also averages that include extermes on a linear scale bias upward

IMO, in spite of all its flaws and dark corners, D strikes a good balance between "academic" design and pragmatic enterprise-style code.


T

-- 
Why do conspiracy theories always come from the same people??