Discussion:
DConf 2013 keynote
Nick Sabalausky
2013-05-09 21:32:18 UTC
Permalink
On Thu, 09 May 2013 10:26:46 -0400
With all this focus on technicalities, we forgot to discuss the
gist of it: what did you guys think of the talk?
That should better go in the digitalmars.D group though...
Very good talk! And good production quality, too. This would be a
great thing to point people towards to introduce them to D.

And Walter does a good job on stage. *Never* comes across as
pretentious, or cocky or full-of-...various things...like *cough*a
certain former Apple leader*cough* always did. (Minor nit: Forgot to
mention Mono-D on the last question, though.)

I love the D-like line on the first slide. Kind of a strange API being
used ;), but quintessentially D syntax. Cute :) The "100 lines of
boilerplate" bit was great too. Made me cheer even though no one else
was around.

I don't know whether it's something still under wraps or if I just need
to wait for Manu's presentation video, but I'd love to hear about how
Remedy is, or is planning to, use D. I've complained on occasion about
some of the directions a lot of the game industry has been going, but
Remedy is one developer I've always respected (Max Payne is fantastic,
I have both of them, and I remember enjoying Death Rally back in
the day - anxious to try the new one, too.) Besides, how can anything
born out of Future Crew not be awesome? :)

Maybe I overlooked this somewhere on dconf.org, but just out of
curiosity, about how many attendees did the whole conference have?
Steven Schveighoffer
2013-05-09 21:36:25 UTC
Permalink
On Thu, 09 May 2013 17:32:18 -0400, Nick Sabalausky
Post by Nick Sabalausky
I don't know whether it's something still under wraps or if I just need
to wait for Manu's presentation video, but I'd love to hear about how
Remedy is, or is planning to, use D.
You will hear. Was one of my favorites.

-Steve
Andrei Alexandrescu
2013-05-10 01:48:09 UTC
Permalink
Post by Nick Sabalausky
Maybe I overlooked this somewhere on dconf.org, but just out of
curiosity, about how many attendees did the whole conference have?
60.

Andrei
Andrej Mitrovic
2013-05-10 10:15:59 UTC
Permalink
Post by Nick Sabalausky
On Thu, 09 May 2013 10:26:46 -0400
With all this focus on technicalities, we forgot to discuss the
gist of it: what did you guys think of the talk?
I liked the talk very much, although I preferred the 2007 talk where
both of you presented the talk together and allowed questions to be
asked during the presentation. Still I'm looking forward to the other
more technical presentations.

P.S. it seems the #dconf hashtag is being hijacked by another conference now:
https://twitter.com/GetApp/status/332770427296419841
deadalnix
2013-05-10 11:09:32 UTC
Permalink
Post by Nick Sabalausky
On Thu, 09 May 2013 10:26:46 -0400
With all this focus on technicalities, we forgot to discuss
the
gist of it: what did you guys think of the talk?
That should better go in the digitalmars.D group though...
Very good talk! And good production quality, too. This would be a
great thing to point people towards to introduce them to D.
First good talk. Some tweaking can be done to make it better.

One of them is the plane metaphor. I now know that Walter is a
big fan of plane (and he knows quite a lot about that !) but the
problem is that the point is very subjective (the plane want to
fly).

I'm sure the plane idea can be kept, but must be presented in a
more factual/less subjective manner.

I'll go through the talk once again if I find time to do it and
get more details.
H. S. Teoh
2013-05-10 14:51:52 UTC
Permalink
On Fri, May 10, 2013 at 01:09:32PM +0200, deadalnix wrote:
[...]
Post by deadalnix
First good talk. Some tweaking can be done to make it better.
One of them is the plane metaphor. I now know that Walter is a big
fan of plane (and he knows quite a lot about that !) but the problem
is that the point is very subjective (the plane want to fly).
I'm sure the plane idea can be kept, but must be presented in a more
factual/less subjective manner.
But the thing is, what constitutes "good code" *is* a subjective matter.
How do you define "good code"? Mathematically speaking, anything that
maps input into output correctly is equivalent, so a beautifully-written
piece-of-art code is no better, by this definition, than an IOCCC entry
that does exactly the same thing. But we'd never regard an IOCCC entry
as "beautiful code" by any stretch of the term (even if you were the
author -- I was, once, and it's exactly how Walter describes it: yes it
works, yes there were quite a few ingenious hacks in it, and yes it got
me the dubious honor of my code being featured on ioccc.org, but
afterwards I really just wanted to hide it away somewhere, sweep it
under the rug, etc.).

It's even more subjective when it comes to language design.
Mathematically speaking, the most beautiful language is the most concise
and expressive (and hence the most powerful). By that standard, we
should be programming with Lambda calculus -- after all, every
computation can be expressed by Lambda calculus, so why clutter the
language with redundant constructs? But clearly that's not what we're
doing here. The thing is, we're trying to map our human mental concepts
onto programming space in the nicest possible ways (rather than taking a
purely objective, mathematical approach, i.e., Lambda calculus or Turing
machines), and mental concepts, by definition, are subjective.


T
--
Be in denial for long enough, and one day you'll deny yourself of things you wish you hadn't.
Walter Bright
2013-05-10 18:49:42 UTC
Permalink
One of them is the plane metaphor. I now know that Walter is a big fan of plane
(and he knows quite a lot about that !) but the problem is that the point is
very subjective (the plane want to fly).
It's not that subjective. An airplane that "wants to fly" is well known among
airplane designers and pilots. All you have to do is point it down the runway
and open the throttle. It will take off and fly straight and level without any
hands on the controls. An airplane can also endure grevious damage, and still fly.

A helicopter, on the other hand, wants to crash. It requires constant active
efforts to keep it in the air, and if much of anything goes wrong, it will crash
and kill you.

Have you ever driven a high performance car that "wants to go"? I have. The car
clearly isn't happy being driven slowly and gently. It's only happy when your
right foot is mashed all the way down :-)
skeptical
2013-05-11 06:32:28 UTC
Permalink
In article <kmjfg9$31e9$1 at digitalmars.com>, newshound2 at digitalmars.com says...
Post by Walter Bright
One of them is the plane metaphor. I now know that Walter is a big fan of plane
(and he knows quite a lot about that !) but the problem is that the point is
very subjective (the plane want to fly).
It's not that subjective. An airplane that "wants to fly" is well known among
airplane designers and pilots. All you have to do is point it down the runway
and open the throttle. It will take off and fly straight and level without any
hands on the controls. An airplane can also endure grevious damage, and still fly.
Perhaps an airplane engineer could explain it better than a flunky language
engineer?
Post by Walter Bright
A helicopter, on the other hand, wants to crash. It requires constant active
efforts to keep it in the air, and if much of anything goes wrong, it will crash
and kill you.
Consider, for a moment, Walter, that you are amongst those who know more than
you about pretty much you would dare expound upon. How is that different from
being the conceptual monk of the frictional "d programming language"?

Think before you answer, for the wheel of woe, may be prescribed to give you
"more time to think about it".
Post by Walter Bright
Have you ever driven a high performance car that "wants to go"?
Have you ever kissed a girl?
Post by Walter Bright
I have.
"Isn't that special", "Mr. Language Engineer". You're not a language engineer
Walter, are you? Don't let me "pigeonhole" you though, if you want to be other
than what I "assess" you "are".
Post by Walter Bright
The car
clearly isn't happy being driven slowly and gently. It's only happy when your
right foot is mashed all the way down :-)
Oh yeah, Walt, "we're" all over that: ooooo, ahhhh, you are so "knowledgeable".

(Aside: this is text forum and text is a paltry means of communication SOMETIMES
(TBD when). I mean no disrespect to those afflicted with handicaps of any kind.
I have some too. I don't patronize anyone. OK, a little, but not at expense of
others. And you "programmers" are going to be literal about that... "I can't
even lose to win!", said... who said that?)

****

Walt, is not engineering aircraft of any kind, I would assume. Are you? Then who
the f cares here about your jetliner company stint? That would be called in
"professional circles": name dropping. Walter: put up or shut up. (Just kiddin'
ya, Waldo (oops, I meant "Walt(er)"). I know you in-depth. I'm not picking on
you, e.g., but "they" will think I am, hmm?

Walter, are you autistic? (Shush people, let him answer).
Ali Çehreli
2013-05-11 06:39:13 UTC
Permalink
On 05/10/2013 11:32 PM, skeptical wrote:

Yay! Our troll is back! :)

\|||/
(o o)
,----ooO--(_)-------.
| Please |
| don't feed the |
| TROLLs ! |
'--------------Ooo--'
|__|__|
|| ||
ooO Ooo

Ali
Daniel Murphy
2013-05-10 20:12:11 UTC
Permalink
"deadalnix" <deadalnix at gmail.com> wrote in message
Post by deadalnix
First good talk. Some tweaking can be done to make it better.
One of them is the plane metaphor. I now know that Walter is a big fan of
plane (and he knows quite a lot about that !) but the problem is that the
point is very subjective (the plane want to fly).
I'm sure the plane idea can be kept, but must be presented in a more
factual/less subjective manner.
Forget planes, this code quite obviously wants to fly!
http://www.ioccc.org/1998/banks.c
Jonathan M Davis
2013-05-10 23:10:26 UTC
Permalink
Post by Daniel Murphy
Forget planes, this code quite obviously wants to fly!
http://www.ioccc.org/1998/banks.c
LOL. Gotta love that.

- Jonathan M Davis
Dmitry Olshansky
2013-05-10 12:35:06 UTC
Permalink
Post by Nick Sabalausky
On Thu, 09 May 2013 10:26:46 -0400
With all this focus on technicalities, we forgot to discuss the
gist of it: what did you guys think of the talk?
That should better go in the digitalmars.D group though...
Very good talk! And good production quality, too. This would be a
great thing to point people towards to introduce them to D.
Indeed and I can actually hear questions :)
BTW these were quite interesting in their own right like "if there is a
way to cleanly manipulate carry bit within the language".
Post by Nick Sabalausky
And Walter does a good job on stage. *Never* comes across as
pretentious, or cocky or full-of-...various things...like *cough*a
certain former Apple leader*cough* always did. (Minor nit: Forgot to
mention Mono-D on the last question, though.)
I loved the warm informal atmosphere here, too bad I've been stuck with
visa approval at the last moment. The idea to smuggle myself in some
crate of rice doesn't seem half-bad now ;)
--
Dmitry Olshansky
RAFFI
2013-05-12 09:54:02 UTC
Permalink
Post by Dmitry Olshansky
Post by Nick Sabalausky
On Thu, 09 May 2013 10:26:46 -0400
With all this focus on technicalities, we forgot to discuss
the
gist of it: what did you guys think of the talk?
That should better go in the digitalmars.D group though...
Very good talk! And good production quality, too. This would
be a
great thing to point people towards to introduce them to D.
Indeed and I can actually hear questions :)
BTW these were quite interesting in their own right like "if
there is a way to cleanly manipulate carry bit within the
language".
Post by Nick Sabalausky
And Walter does a good job on stage. *Never* comes across as
pretentious, or cocky or full-of-...various things...like
*cough*a
Forgot to
mention Mono-D on the last question, though.)
I loved the warm informal atmosphere here, too bad I've been
stuck with visa approval at the last moment. The idea to
smuggle myself in some crate of rice doesn't seem half-bad now
;)
RAFFI
2013-05-12 09:56:31 UTC
Permalink
RAFFI CHOWDHURY
British Airways Direct Umrah flights Non-stop
Depart: BA 133 10MAY LHRJED-2150 0715
Return: BA 132 18MAY JEDLHR-0855 1300

Cheap Flights to Jeddah
British Airways Direct Umrah flights Non-stop
Depart: BA 133 10MAY LHRJED-2150 0715
Return: BA 132 25MAY JEDLHR-0855 1300

Cheap Flights to Jeddah
British Airways Direct Umrah flights Non-stop
Depart: BA 133 17MAY LHRJED-2150 0715
Return: BA 132 25MAY JEDLHR-0855 1300

Cheap Flights to Jeddah
British Airways Direct Umrah flights Non-stop
Depart: BA 133 17MAY LHRJED-2150 0715
Return: BA 132 31MAY JEDLHR-0855 130
Cheap Flights to Jeddah
British Airways Direct Umrah flights Non-stop
Depart: BA 133 24MAY LHRJED-2150 0715
Return: BA 132 01JUN JEDLHR-0855 1300

Cheap Flights to Jeddah
British Airways Direct Umrah flights Non-stop
Depart: BA 133 25MAY LHRJED-2150 0715
Return: BA 132 03JUN JEDLHR-0855 1300

Cheap Flights to Jeddah
British Airways Direct Umrah flights Non-stop
Depart: BA 133 26MAY LHRJED-2150 0715
Return: BA 132 05JUN JEDLHR-0855 1300

Cheap Flights to Jeddah
British Airways Direct Umrah flights Non-stop
Depart: BA 133 31MAY LHRJED-2150 0715
Return: BA 132 15JUN JEDLHR-0855 1300

Cheap Flights to Jeddah
British Airways Direct Umrah flights Non-stop
Depart: BA 133 07JUN LHRJED-2150 0715
Return: BA 132 15JUN JEDLHR-0855 1300
RAFFI
2013-05-12 09:59:08 UTC
Permalink
Cheap Flights to Jeddah fr ?150 + tax
Find direct flights to Jeddah at rock-bottom prices try Islam
Freedom today!
Many of our consolidated Umrah airfares are substantially less
than the lowest published fare purchased directly from airlines.
Most of our airfares are block airlines tickets, bought in bulk
at wholesale prices then resold to you at huge discounts. Fly in
style and comfort with British Airways, the most reliable and
flights are on time - Halal meals served on all Hajj and Umrah
flights. Generous baggage allowance of 46kg (2 pieces) and cabin
size hand luggage plus 10 litres Zamzam water on return flight.
Terminal 5?s efficiency has made the airline more punctual and
more reliable, also prayer room provided in terminal 5 to change
Ihram. Heathrow connecting flights are available from Aberdeen,
Edinburgh, Glasgow, Manchester and Newcastle to Jeddah.
Cheap Flights to Jeddah
British Airways Direct Umrah flights Non-stop
Depart: BA 133 19APR LHRJED-2150 0715
Return: BA 132 27APR JEDLHR-0855 1300

Cheap Flights to Jeddah
British Airways Direct Umrah flights Non-stop
Depart: BA 133 19APR LHRJED-2150 0715
Return: BA 132 04MAY JEDLHR-0855 1300

Cheap Flights to Jeddah
British Airways Direct Umrah flights Non-stop
Depart: BA 133 26APR LHRJED-2150 0715
Return: BA 132 04MAY JEDLHR-0855 1300

Cheap Flights to Jeddah
British Airways Direct Umrah flights Non-stop
Depart: BA 133 26APR LHRJED-2150 0715
Return: BA 132 11MAY JEDLHR-0855 1300

Cheap Flights to Jeddah
British Airways Direct Umrah flights Non-stop
Depart: BA 133 03MAY LHRJED-2150 0715
Return: BA 132 11MAY JEDLHR-0855 1300

Cheap Flights to Jeddah
British Airways Direct Umrah flights Non-stop
Depart: BA 133 03MAY LHRJED-2150 0715
Return: BA 132 18MAY JEDLHR-0855 1300

Cheap Flights to Jeddah
British Airways Direct Umrah flights Non-stop
Depart: BA 133 10MAY LHRJED-2150 0715
Return: BA 132 18MAY JEDLHR-0855 1300

Cheap Flights to Jeddah
British Airways Direct Umrah flights Non-stop
Depart: BA 133 10MAY LHRJED-2150 0715
Return: BA 132 25MAY JEDLHR-0855 1300

Cheap Flights to Jeddah
British Airways Direct Umrah flights Non-stop
Depart: BA 133 17MAY LHRJED-2150 0715
RAFFI
2013-05-12 10:00:41 UTC
Permalink
RAFFI CHOWDURY


Islam Freedom division of Holy Makkah
34 Green Street
London
E7 8BZ
Main Tel: 0203 432 9692 / 0207 112 8819
Tech Tel: 0208 472 5593
Main Fax: 0208 552 1600
Main Email: sales at islamfreedom.com
Online: Send us a request


Islam Freedom division of Holy Makkah
548 Coventry Road
Small Heath
Birmingham
B10 0UN
Main Tel: 0121 285 0044
Main Fax: 0121 773 7717
Main Email: sales at islamfreedom.com
Online: Send us a request
H. S. Teoh
2013-05-10 14:29:20 UTC
Permalink
Post by Nick Sabalausky
On Thu, 09 May 2013 10:26:46 -0400
With all this focus on technicalities, we forgot to discuss the
gist of it: what did you guys think of the talk?
That should better go in the digitalmars.D group though...
Very good talk! And good production quality, too. This would be a
great thing to point people towards to introduce them to D.
+1. I listened to the talk yesterday... it was awesome! Can't wait for
the other videos to be put up.

One tiny nitpick, though. In the example about sorting lines in a file,
there was a syntax error in the code (missing '.' and the end of the
first/second line). I know, I know ... but it was distracting me from
what Walter was saying, my brain keeps going "but there's a syntax
error! Is he going to talk about the syntax error? It's a syntax
error!..." :-P


[...]
Post by Nick Sabalausky
I love the D-like line on the first slide. Kind of a strange API being
used ;), but quintessentially D syntax. Cute :) The "100 lines of
boilerplate" bit was great too. Made me cheer even though no one else
was around.
[...]

Yeah, pretty much sums up how I feel about IDEs. But OTOH, the question
at the end from the professor/lecturer proves that the majority of
today's coders expect IDEs. I would vote for better education, but you
can't deny the need for IDEs to at least smooth the transition from
other languages.

In any case, I totally agree that if a language *needs* an IDE in order
to cope with the amount of required boilerplate, then something is
clearly very, very wrong at a fundamental level. I guess that's why I'm
a D fan. :)


T
--
Food and laptops don't mix.
Andrej Mitrovic
2013-05-10 18:56:01 UTC
Permalink
Post by H. S. Teoh
One tiny nitpick, though. In the example about sorting lines in a file,
there was a syntax error in the code (missing '.' and the end of the
first/second line).
Walter already used these slides for a previous talk where the missing
dot was mentioned during the talk. He probably just forgot to update
the pdf. :)

Actually that previous talk was a little bit more descriptive in what
the code does (and people kept asking questions too). I'm not sure
exactly what talk it was, maybe it was on nwcpp..
Paulo Pinto
2013-05-10 14:57:22 UTC
Permalink
Post by Andrej Mitrovic
Post by Nick Sabalausky
On Thu, 09 May 2013 10:26:46 -0400
With all this focus on technicalities, we forgot to discuss the
gist of it: what did you guys think of the talk?
I liked the talk very much, although I preferred the 2007 talk where
both of you presented the talk together and allowed questions to be
asked during the presentation. Still I'm looking forward to the other
more technical presentations.
https://twitter.com/GetApp/status/332770427296419841
I found that presentation the other day by accident. Quite interesting.

--
Paulo
Paulo Pinto
2013-05-10 15:06:22 UTC
Permalink
Post by H. S. Teoh
Yeah, pretty much sums up how I feel about IDEs. But OTOH, the question
at the end from the professor/lecturer proves that the majority of
today's coders expect IDEs. I would vote for better education, but you
can't deny the need for IDEs to at least smooth the transition from
other languages.
I grew up with IDEs, the first being Turbo Pascal 3.0 foloowed by quite
many variations, including Smalltalk and Lisp environments.

Then I got my first contact with UNIX in 1994 with Xenix, followed by
DG/UX. It was a shock! It felt to me as if I was still in 1970 using the
original UNIX.
Post by H. S. Teoh
In any case, I totally agree that if a language *needs* an IDE in order
to cope with the amount of required boilerplate, then something is
clearly very, very wrong at a fundamental level. I guess that's why I'm
a D fan. :)
T
I think the same of any language that needs any form of tooling to make
it better. For example, C requires lint+MISRA C to give the language the
safety I get out of the box with D, Extended Pascal, Modula-2, Ada and
similar.

--
Paulo
Jonathan M Davis
2013-05-10 17:57:46 UTC
Permalink
Post by Nick Sabalausky
On Thu, 09 May 2013 10:26:46 -0400
With all this focus on technicalities, we forgot to discuss the
gist of it: what did you guys think of the talk?
That should better go in the digitalmars.D group though...
Very good talk! And good production quality, too. This would be a
great thing to point people towards to introduce them to D.
Indeed.
Post by Nick Sabalausky
And Walter does a good job on stage. *Never* comes across as
pretentious, or cocky or full-of-...various things...like *cough*a
certain former Apple leader*cough* always did.
Walter may be very stubborn and opinionated, but he definitely isn't
pretentious.

- Jonathan M Davis
sk
2013-05-10 19:55:57 UTC
Permalink
Post by H. S. Teoh
In any case, I totally agree that if a language *needs* an IDE
in order to cope with the amount of required boilerplate, then
something is clearly very, very wrong at a fundamental level.
May be this is true for expert or professional programmers. But
for people like me who only use D occasionally an IDE is a must.

IDE mainly helps me in reducing the amount of things I need to
memorize or remember like API, building tool names, command
syntaxes, etc. This is very important as my main profession is
not programming.

I think lack of IDEs will prevent many beginners from trying out
a new language. Especially after getting spoiled with IDEs like
netbeans, visual studio etc.

Currently using DIDE, not perfect but better than nothing.
VisualD seems to have good reviews but I cannot install it as it
requires admin privileges.

All the above will still be true even for a "perfect" programming
language.
Nick Sabalausky
2013-05-10 20:53:08 UTC
Permalink
On Fri, 10 May 2013 21:55:57 +0200
Post by sk
Post by H. S. Teoh
In any case, I totally agree that if a language *needs* an IDE
in order to cope with the amount of required boilerplate, then
something is clearly very, very wrong at a fundamental level.
May be this is true for expert or professional programmers. But
for people like me who only use D occasionally an IDE is a must.
IDE mainly helps me in reducing the amount of things I need to
memorize or remember like API, building tool names, command
syntaxes, etc. This is very important as my main profession is
not programming.
I think lack of IDEs will prevent many beginners from trying out
a new language. Especially after getting spoiled with IDEs like
netbeans, visual studio etc.
Currently using DIDE, not perfect but better than nothing.
VisualD seems to have good reviews but I cannot install it as it
requires admin privileges.
All the above will still be true even for a "perfect" programming
language.
While that's all true, none of it really contradicts what was said. Ie,
that "The IDE can auto-generate boilerplate" is a very poor excuse for a
language to lack ways of minimizing the need for boilerplate in the
first place.
sk
2013-05-10 21:25:15 UTC
Permalink
Ah, makes sense, sorry for the misunderstanding.
H. S. Teoh
2013-05-10 21:31:00 UTC
Permalink
Post by H. S. Teoh
In any case, I totally agree that if a language *needs* an IDE in
order to cope with the amount of required boilerplate, then
something is clearly very, very wrong at a fundamental level.
May be this is true for expert or professional programmers. But for
people like me who only use D occasionally an IDE is a must.
My point was that while an IDE is helpful (e.g. for people who aren't
professional programmers, just want to get the job done, etc.), a
language should not *depend* on an IDE to insert boilerplate. I concede
that IDEs are helpful and needed for newbies and non-professional
programmers, but the *language* itself should be usable without one.
Requiring one because otherwise the amount of required boilerplate would
be unmanagable, is a symptom that there is something wrong with the
language's design.


[...]
I think lack of IDEs will prevent many beginners from trying out a
new language. Especially after getting spoiled with IDEs like
netbeans, visual studio etc.
[...]

Agreed. But my point was that the language shouldn't *depend* on an IDE
in order to be usable. If a language requires an IDE because you need to
insert 100 lines of boilerplate in every program you write, then one has
to wonder, why not make those 100 lines *implicit*? They are not
conveying anything useful about the program, because they will be
identical (or mostly identical) every single time. The fact that the
language did *not* make it implicit then begs the question of what went
wrong in its design that you have to repeatedly specify what should
already be obvious to the language/compiler.

As they say in information theory: it is the stuff that stands out, that
is different from the rest, that carries the most information. The stuff
that's pretty much repeated every single time conveys very little
information. This is why newspaper headings tend to leave out very
common words like "the", "a", "is", etc., because these words take up
space but convey little to no additional information -- you can drop
them and still get the gist of what the headlines are saying.

A good programming language is one where the code says all the important
things, and leaves out most of the unimportant or obvious things. It's
just like Walter said in the talk: the file-reading function without
scope guards was full of goto's and error-checking, stuff that pretty
much is (or should be) done everywhere. It clutters the code and
obscures the salient points. It's a headline with all the "the"'s,
"a"'s, "is"'s. In contrast, the version with scope guards can be read
sequentially -- all the peripheral if's and goto's are nicely abstracted
away, leaving only the salient points of the code: allocate a buffer,
read the data, return the data. A glance at the code immediately tells
you its key points. No distracting sidelines of error-checking, goto's,
labels, or any of that nonsense.

In contrast, consider a language like C. The *correct* way of writing C
code is something like this:

int myfunc(struct A *a, struct B *b, struct C *c) {
/* Boilerplate: to avoid slip-ups with uninitialized
* pointers, must always set them to NULL. */
void *buf = NULL;
struct D *d = NULL;

/* Boilerplate: check for NULL pointers */
if (!a || !b || !c)
/* Boilerplate: everybody and their neighbour's
* dog defines their own set of macros for
* return values; how do you remember which one
* goes with which function(s)? */
return INVALID_ARGS_ERROR;

buf = malloc(some_size);

/* Boilerplate: must check NULL return from malloc,
* every single time. */
if (!buf)
return MEMORY_ERROR;

/* Boilerplate: every function call must be wrapped in
* an if-goto, because the function may have returned an
* error. */
if (anotherfunc(a, buf) != OK)
goto ERROR;

/* And yes, technically, you need to do this for things
* like printf too! Guess how many C coders do this?
* That's right, nobody does. It's wrong, and leads to
* hilarious problems when stdout isn't pointing to what
* the programmer thought it was. Or not-so-hilarious,
* if stdout was closed and a database handle was
* reopened and reused stdout's file descriptor
* number...
*/
if (printf("Hello, world!\n") != 0)
goto ERROR;

/* More boilerplate */
if ((d = create_instance_of_d()) == NULL)
goto ERROR;

/* Now our boilerplate needs to use a different goto
* label, 'cos now we have to cleanup d, whereas we
* didn't need to before! Can you imagine the hilarity
* after 20 people change this code later on in the
* project's life, and one of them forgets the fact that
* after this point a different goto label is needed? */
if (yetanotherfunc(b, d) != OK)
goto ERROR2;

if (yesmoreboilerplate(c, buf) != OK)
goto ERROR2;

/* Finally, success! */

/* Um... not just yet, need more boilerplate: cleanup
* after ourselves */
free(d);
free(buf);

/* Sigh... about time we got done */
return OK;

/* Caveat: the order of labels must be the *reverse* of
* the order they appear in the code, to ensure things
* are destroyed in the right order. Don't laugh -- I've
* seen "enterprise" code that gets this wrong. */
ERROR2:
/* Problem: by this point in the code, do you remember
* that d was supposed to be freed? */
free(d);
ERROR:
/* Or buf? */
free(buf);

/* Problem: what if the caller forgets to check our
* return code? Or checks it against the wrong set of
* error macros? */
return ERROR_CODE;

/* Hope and pray the program won't crash when it gets
* back to the caller who forgets to check for error
* codes and just barges ahead blindly. */
}

Note how much boilerplate is necessary to make the code work
*correctly*. (Yes I know you can merge the error and non-error returns
by checking for NULL in *buf and *d, thereby getting rid of the
duplicated calls to free(), but that doesn't get rid of the problem,
just dresses it differently.) The most obvious way to write this code
leaks memory and doesn't handle errors. In fact, the above code
actually isn't good enough: printf sets errno, and to *really* get the
code right, you should be checking and possibly propagating, the value
of errno after the printf call fails. Yes, more boilerplate. Lots more.
Every single time you call a system function.

This is one of the things I can't stand about C. Seriously, C coders
should use an IDE to get basic things like this right, even if most of
them are too macho to admit it.

This is what I mean when the language is basically unusable without an
IDE. Yes, IDEs can help adoption of a language, and I don't dispute
that, but when code in that language cannot be written correctly without
an IDE (or at least, not easily), then something is horribly, horribly
wrong with that language.

(The D version of the above function, by contrast, is vastly more
readable and maintainable on almost every count, and requires no IDE to
get it right.)


T
--
"640K ought to be enough" -- Bill G., 1984. "The Internet is not a primary goal for PC usage" -- Bill G., 1995. "Linux has no impact on Microsoft's strategy" -- Bill G., 1999.
Jonathan M Davis
2013-05-10 23:04:31 UTC
Permalink
Post by H. S. Teoh
As they say in information theory: it is the stuff that stands out, that
is different from the rest, that carries the most information. The stuff
that's pretty much repeated every single time conveys very little
information.
This is an excellent way of looking at language design (and program design for
that matter).

- Jonathan M Davis
Walter Bright
2013-05-10 23:06:26 UTC
Permalink
Post by Jonathan M Davis
Post by H. S. Teoh
As they say in information theory: it is the stuff that stands out, that
is different from the rest, that carries the most information. The stuff
that's pretty much repeated every single time conveys very little
information.
This is an excellent way of looking at language design (and program design for
that matter).
I agree. Wish I'd thought of it!
Nick Sabalausky
2013-05-12 03:59:44 UTC
Permalink
On Fri, 10 May 2013 19:04:31 -0400
Post by Jonathan M Davis
Post by H. S. Teoh
As they say in information theory: it is the stuff that stands out,
that is different from the rest, that carries the most information.
The stuff that's pretty much repeated every single time conveys
very little information.
This is an excellent way of looking at language design (and program
design for that matter).
Not to mention data compression ;)
Jonathan M Davis
2013-05-12 04:02:57 UTC
Permalink
Post by Nick Sabalausky
On Fri, 10 May 2013 19:04:31 -0400
Post by Jonathan M Davis
Post by H. S. Teoh
As they say in information theory: it is the stuff that stands out,
that is different from the rest, that carries the most information.
The stuff that's pretty much repeated every single time conveys
very little information.
This is an excellent way of looking at language design (and program
design for that matter).
Not to mention data compression ;)
LOL. Yes. That's pretty much what you have to look at in data compression by
definition - that and finding ways to make more of the data which is different
the same without losing too much information or quality (at least with lossy
compression).

- Jonathan M Davis
Timon Gehr
2013-05-12 12:16:18 UTC
Permalink
Post by Nick Sabalausky
On Fri, 10 May 2013 19:04:31 -0400
Post by Jonathan M Davis
Post by H. S. Teoh
As they say in information theory: it is the stuff that stands out,
that is different from the rest, that carries the most information.
The stuff that's pretty much repeated every single time conveys
very little information.
This is an excellent way of looking at language design (and program
design for that matter).
Not to mention data compression ;)
A program is a compressed representation of its possible executions.
Nick Sabalausky
2013-05-12 19:38:59 UTC
Permalink
On Sun, 12 May 2013 14:16:18 +0200
Post by Timon Gehr
Post by Nick Sabalausky
On Fri, 10 May 2013 19:04:31 -0400
Post by Jonathan M Davis
Post by H. S. Teoh
As they say in information theory: it is the stuff that stands
out, that is different from the rest, that carries the most
information. The stuff that's pretty much repeated every single
time conveys very little information.
This is an excellent way of looking at language design (and program
design for that matter).
Not to mention data compression ;)
A program is a compressed representation of its possible executions.
Indeed. And generally with an absolutely enormous compression ratio -
often even infinite (when there's infinite possible executions). Or
at least "effectively infinite" even if not truly infinite in a strict
mathematical sense, simply due to finite memory.
Walter Bright
2013-05-10 22:02:12 UTC
Permalink
Post by H. S. Teoh
Note how much boilerplate is necessary to make the code work
*correctly*.
It's worse than that. Experience shows that this rat's nest style of code often
is incorrect because it is both complex and never tested. While D doesn't make
it more testable, at least it makes it simple, and hence more likely to be correct.
H. S. Teoh
2013-05-10 23:27:43 UTC
Permalink
Post by Walter Bright
Post by H. S. Teoh
Note how much boilerplate is necessary to make the code work
*correctly*.
It's worse than that. Experience shows that this rat's nest style of
code often is incorrect because it is both complex and never tested.
Yeah, some of those if's are very difficult to trigger, and usually
nested so deep in the call tree that most people just don't bother
trying to trigger it. Besides, the lack of built-in unittests in C means
that even if somebody *did* test it at one point, it's very unlikely
that the 15 people who came along later and modified the code will
repeat the same test. And even if they did, it was probably not a
*thorough* test...

Once I was trying to track down a baffling bug that causes a daemon to
suddenly stop responding for no discernible reason. We spent many hours
trying to figure out what went wrong, but didn't get very far. The
first clue we found was that kill -11 didn't do anything. Now, we have a
segfault handler that writes the stacktrace to a log when the daemon
segfaults, you see, and when debugging we often deliberately use kill
-11 to segfault the daemon then look at the log to find out what it was
doing at the time of the signal. This usually worked, but not this
time. The signal seemed to be completely ignored. Only kill -9 is
capable of making the stuck process go away. At first we thought it was
a stray call to signal() or sigaction() that removed the stack trace
handler, but closer inspection suggested that this was not the case.

It turns out that this mysterious "stuck" state was caused by the stack
trace code -- but not in any of the usual ways. In order to produce the
trace, it uses fprintf to write info to the log, and fprintf in turn
calls malloc at various points to allocate the necessary buffers to do
that. Now, if for some reason free() segfaults (e.g., you pass in an
illegal pointer), then libc is still holding the internal malloc mutex
lock when the OS sends the SEGV to the process, so when the stack trace
handler then calls fprintf, which in turn calls malloc, it deadlocks.
Further SIGSEGV's won't help, since it only makes the deadlock worse.

All of this came about because we had overlooked the POSIX spec that
certain functions are unsafe to call inside signal-handler context. But
then again... who hasn't?! (Hands up, those of you who knew that fprintf
has undefined behaviour inside a signal handler. Yeah, I thought so.)
Eventually we had to rewrite the stack trace handler to only use write()
to a pre-opened socket to a logging daemon, since otherwise it was
impossible to actually write the stack trace anywhere without risking
undefined behaviour.

And none of this has even begun to address the original bug of why
free() was passed an illegal pointer in the first place. Isn't it fun
when most of the time you spend debugging is actually to fix the
error-handler rather than the actual bug?
Post by Walter Bright
While D doesn't make it more testable, at least it makes it simple,
and hence more likely to be correct.
It makes a big difference when the language itself supports certain
constructs like exceptions or scope guards. Scope guards cut away almost
all of the boilerplate cruft in the equivalent C if-and-goto construct,
making the attached statement so simple that it's most likely correct,
as you said. It also eliminates the need to sprinkle various parts of
that code across 2 or 3 different places in an overly-long function with
unclear execution path, that in C is almost guaranteed to become buggy
after passing through the grubby hands of the next 5 unfortunate coders
assigned to work on the code.

And while the scope guard itself may be buggy (DMD bug, say), it does
get tested very often -- every D program that uses it constitutes a test
case -- so any such bugs are quickly noticed and weeded out.

Seriously, D has so spoiled me I can't stand programming in another
language these days. :-P


T
--
EMACS = Extremely Massive And Cumbersome System
Walter Bright
2013-05-11 00:09:18 UTC
Permalink
Post by H. S. Teoh
Seriously, D has so spoiled me I can't stand programming in another
language these days. :-P
Me too. Sometimes it makes it hard to work on the dmd front end!
H. S. Teoh
2013-05-11 00:14:01 UTC
Permalink
Post by Walter Bright
Post by H. S. Teoh
Seriously, D has so spoiled me I can't stand programming in another
language these days. :-P
Me too. Sometimes it makes it hard to work on the dmd front end!
Now, *that* is not a good thing at all! When are we going to start
moving towards bootstrapping D? Did any conclusions ever come of that
discussion some time ago about how this might impact GDC/LDC?


T
--
When solving a problem, take care that you do not become part of the problem.
Jonathan M Davis
2013-05-11 01:41:07 UTC
Permalink
Post by H. S. Teoh
Post by Walter Bright
Post by H. S. Teoh
Seriously, D has so spoiled me I can't stand programming in another
language these days. :-P
Me too. Sometimes it makes it hard to work on the dmd front end!
Now, *that* is not a good thing at all! When are we going to start
moving towards bootstrapping D? Did any conclusions ever come of that
discussion some time ago about how this might impact GDC/LDC?
Daniel Murphy (yebblies) has an automated C++ to D converted for the front-end
that he's been working on (which won't work on general C++ code but works on
the front-end's code), and he's been making pull requests to dmd to adjust the
code so that it's more easily converted. So, once he's done with that, it'll
be trivial to have the same compiler in both C++ and D (with all of the
changes going in the C++ code), and we can maintain it that way until we're
ready to go pure D. And after that, we can start refactoring the D code and
take advantage of what D can do.

- Jonathan M Davis
H. S. Teoh
2013-05-11 02:01:49 UTC
Permalink
Post by Jonathan M Davis
Post by H. S. Teoh
Post by Walter Bright
Post by H. S. Teoh
Seriously, D has so spoiled me I can't stand programming in another
language these days. :-P
Me too. Sometimes it makes it hard to work on the dmd front end!
Now, *that* is not a good thing at all! When are we going to start
moving towards bootstrapping D? Did any conclusions ever come of
that discussion some time ago about how this might impact GDC/LDC?
Daniel Murphy (yebblies) has an automated C++ to D converted for the
front-end that he's been working on (which won't work on general C++
code but works on the front-end's code), and he's been making pull
requests to dmd to adjust the code so that it's more easily converted.
So, once he's done with that, it'll be trivial to have the same
compiler in both C++ and D (with all of the changes going in the C++
code), and we can maintain it that way until we're ready to go pure D.
And after that, we can start refactoring the D code and take advantage
of what D can do.
[...]

Excellent!!

What about GDC/LDC though? Or are we hoping that the GCC (LDC)
maintainers will be willing to accept a bootstrapping D compiler by the
time we're ready to go pure D?


T
--
In theory, there is no difference between theory and practice.
Daniel Murphy
2013-05-11 06:49:15 UTC
Permalink
"H. S. Teoh" <hsteoh at quickfur.ath.cx> wrote in message
Post by H. S. Teoh
Excellent!!
What about GDC/LDC though? Or are we hoping that the GCC (LDC)
maintainers will be willing to accept a bootstrapping D compiler by the
time we're ready to go pure D?
The GDC/LDC maintainers are onboard. It is at least theoretically ok to
have a frontend written in a language other than C/C++.

We also aren't going pure D, just the frontend. The backend and glue layer
will still be in C++.
Andrei Alexandrescu
2013-05-11 13:30:03 UTC
Permalink
"H. S. Teoh"<hsteoh at quickfur.ath.cx> wrote in message
Post by H. S. Teoh
Excellent!!
What about GDC/LDC though? Or are we hoping that the GCC (LDC)
maintainers will be willing to accept a bootstrapping D compiler by the
time we're ready to go pure D?
The GDC/LDC maintainers are onboard.
Walter and I are also on board.

Andrei
Iain Buclaw
2013-05-11 14:42:26 UTC
Permalink
On May 11, 2013 2:30 PM, "Andrei Alexandrescu" <
Post by Andrei Alexandrescu
"H. S. Teoh"<hsteoh at quickfur.ath.cx> wrote in message
Post by H. S. Teoh
Excellent!!
What about GDC/LDC though? Or are we hoping that the GCC (LDC)
maintainers will be willing to accept a bootstrapping D compiler by the
time we're ready to go pure D?
The GDC/LDC maintainers are onboard.
Walter and I are also on board.
Andrei
If the flurry of activity from myself, David and Daniel isn't a clear
sign. We are all on the same page.

Regards
--
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130511/fefc1fc0/attachment.html>
David Nadlinger
2013-05-11 16:12:51 UTC
Permalink
Post by Iain Buclaw
On May 11, 2013 2:30 PM, "Andrei Alexandrescu" <
Post by Andrei Alexandrescu
"H. S. Teoh"<hsteoh at quickfur.ath.cx> wrote in message
Post by H. S. Teoh
Excellent!!
What about GDC/LDC though? Or are we hoping that the GCC
(LDC)
maintainers will be willing to accept a bootstrapping D
compiler by the
time we're ready to go pure D?
The GDC/LDC maintainers are onboard.
Walter and I are also on board.
Andrei
If the flurry of activity from myself, David and Daniel isn't a
clear
sign. We are all on the same page.
We are indeed.

As far as LDC goes, upstream issues aren't a potential source of
trouble, as we are not an official LLVM project anyway.

GDC is likely to be more of an issue in this regard, but I'll
leave it to Iain to judge that.

David
skeptical
2013-05-11 07:44:12 UTC
Permalink
In article <mailman.1186.1368236482.4724.digitalmars-d at puremagic.com>,
jmdavisProg at gmx.com says...
Post by Jonathan M Davis
Post by H. S. Teoh
Post by Walter Bright
Post by H. S. Teoh
Seriously, D has so spoiled me I can't stand programming in another
language these days. :-P
Me too. Sometimes it makes it hard to work on the dmd front end!
Now, *that* is not a good thing at all! When are we going to start
moving towards bootstrapping D? Did any conclusions ever come of that
discussion some time ago about how this might impact GDC/LDC?
Daniel Murphy (yebblies) has an automated C++ to D converted for the front-end
that he's been working on (which won't work on general C++ code but works on
the front-end's code), and he's been making pull requests to dmd to adjust the
code so that it's more easily converted. So, once he's done with that, it'll
be trivial to have the same compiler in both C++ and D (with all of the
changes going in the C++ code), and we can maintain it that way until we're
ready to go pure D. And after that, we can start refactoring the D code and
take advantage of what D can do.
- Jonathan M Davis
What's your point?
Flamaros
2013-05-11 00:41:59 UTC
Permalink
Post by Walter Bright
Post by H. S. Teoh
Seriously, D has so spoiled me I can't stand programming in
another
language these days. :-P
Me too. Sometimes it makes it hard to work on the dmd front end!
More I work with D, less I want to work with C++.
Using D is just as funny as I found Java, but with a greater
potential and global control of what we do. A lot of things are
just as simple as they need and can be.

Sometimes C++ give me hives, it's so error prone and an
under-productive language for the actual industry needs, that
certainly why Google created the Go.
We border probably unconscious when we use the C + + for certain
uses. I am curious to know which languages Google uses for their
car without a driver.
H. S. Teoh
2013-05-11 01:59:23 UTC
Permalink
On Sat, May 11, 2013 at 02:41:59AM +0200, Flamaros wrote:
[...]
Post by Flamaros
More I work with D, less I want to work with C++.
Yup. I think that applies to a lot of us here. :)
Post by Flamaros
Using D is just as funny as I found Java, but with a greater
potential and global control of what we do. A lot of things are just
as simple as they need and can be.
I don't know about you, but I find that Java can be very straitjacketed
and verbose sometimes. I mean...

// Java
class MyLameProgram {
public static void main(String[] args) throws IOException
{ ... }
}

Really?! In D, we just write:

// D
void main(string[] args) { ... }

And then:

// Java
BufferedReader reader = new BufferedReader(new FileReader(args[0]));
System.out.println("Hello world!");

Seriously? In D we just write:

// D
auto lines = stdin.byLine();
writeln("Hello world!");

Talk about signal-to-noise ratio.

And don't get me started on all those BlahBlahBlahClassWrapper's and
BlahBlahBlahClassWrapperFactoryWrapper's. Ugh. And Integer vs. int, and
other such atrocities. What, built-in atomic types are defective so we
need to wrap them in classes now? Flawed language design, anybody?

I find D superior to Java in just about every possible way. Except
perhaps for the GC. *That* one needs a bit of work to get us up to
standard. :-P
Post by Flamaros
Sometimes C++ give me hives, it's so error prone and an
under-productive language for the actual industry needs, that
certainly why Google created the Go.
Surprisingly enough, before I found D, I actually considered ditching
C++ for C. I only stayed with C++ because it has certain niceties, like
exceptions, (and no need to keep typing 'struct' everywhere on a type
that's blatantly obviously a struct) that in C is a royal pain in the
neck. C++ is just over-complex, and its complexity in different areas
interact badly with each other, making it an utter nightmare to work
with beyond trivial textbook examples. OO programming in C++ is so
nasty, it's laughable -- if I wanted OO, Java would be far superior. I
found that C++ is only tolerable when I use it as "C with classes". Its
OO features suck.

At my day job, we actually migrated from C++ back to C, because the
person (people?) who wrote the original C++ framework overengineered the
whole thing, to the point that making a single function call involves up
to 6 layers of abstraction (in one case involving fread and fwrite of
function parameters, and *then* serialization/deserialization across an
RPC link). Eventually 80% of that elaborate framework was never used,
because the guy who wrote it left the project, and nobody else
understood it. Everyone just hacked their way around it, resulting an a
gigantic mess that had who knows how many bugs just lurking beneath the
surface, waiting to be exposed by a completely unrelated change
elsewhere in the code. (There were some *dtors* that were doing useful
work and had side-effects... talk about OO gone wrong.)

We were so traumatized by the experience that the team lead put his foot
down and said, "no more C++, we're going back to C". My then-supervisor
had perhaps one of the happiest days of his employment here
mass-deleting all the subdirectories containing the C++ code, after the
new C-based infrastructure was ready for use. (My only regret was that
there are still modules written in C++ lying around. They still suffer
from the same issues, albeit to a smaller scale. At least the pain is
below the tolerable threshold now.)

Of course, C has own its share of nasty gotchas and pain, but, believe
it or not, it's actually better than our experience of C++, in spite of
C++ being supposedly the successor to C. If I only had a say in these
things, I would switch to D in an instant, no questions asked. Sigh. D
may still have its wrinkles to be worked out, but it's far, far superior
in comparison.
Post by Flamaros
We border probably unconscious when we use the C + + for certain
uses. I am curious to know which languages Google uses for their car
without a driver.
If the automated car is running on C++ code, I'd be very, very careful
*not* to own one. Or, if I had to, I'd willingly shell out a fortune for
my life insurance. :-P (Hey, I might even consider becoming an insurance
agent, it'd be good money!) ;-)


T
--
Everybody talks about it, but nobody does anything about it! -- Mark Twain
Flamaros
2013-05-11 02:52:31 UTC
Permalink
Post by H. S. Teoh
[...]
Post by Flamaros
More I work with D, less I want to work with C++.
Yup. I think that applies to a lot of us here. :)
Post by Flamaros
Using D is just as funny as I found Java, but with a greater
potential and global control of what we do. A lot of things
are just
as simple as they need and can be.
I don't know about you, but I find that Java can be very
straitjacketed
and verbose sometimes. I mean...
// Java
class MyLameProgram {
public static void main(String[] args) throws IOException
{ ... }
}
// D
void main(string[] args) { ... }
// Java
BufferedReader reader = new BufferedReader(new
FileReader(args[0]));
System.out.println("Hello world!");
// D
auto lines = stdin.byLine();
writeln("Hello world!");
Talk about signal-to-noise ratio.
And don't get me started on all those
BlahBlahBlahClassWrapper's and
BlahBlahBlahClassWrapperFactoryWrapper's. Ugh. And Integer vs.
int, and
other such atrocities. What, built-in atomic types are
defective so we
need to wrap them in classes now? Flawed language design,
anybody?
I find D superior to Java in just about every possible way.
Except
perhaps for the GC. *That* one needs a bit of work to get us up
to
standard. :-P
Post by Flamaros
Sometimes C++ give me hives, it's so error prone and an
under-productive language for the actual industry needs, that
certainly why Google created the Go.
Surprisingly enough, before I found D, I actually considered
ditching
C++ for C. I only stayed with C++ because it has certain
niceties, like
exceptions, (and no need to keep typing 'struct' everywhere on
a type
that's blatantly obviously a struct) that in C is a royal pain
in the
neck. C++ is just over-complex, and its complexity in different
areas
interact badly with each other, making it an utter nightmare to
work
with beyond trivial textbook examples. OO programming in C++ is
so
nasty, it's laughable -- if I wanted OO, Java would be far
superior. I
found that C++ is only tolerable when I use it as "C with
classes". Its
OO features suck.
At my day job, we actually migrated from C++ back to C, because
the
person (people?) who wrote the original C++ framework
overengineered the
whole thing, to the point that making a single function call
involves up
to 6 layers of abstraction (in one case involving fread and
fwrite of
function parameters, and *then* serialization/deserialization
across an
RPC link). Eventually 80% of that elaborate framework was never
used,
because the guy who wrote it left the project, and nobody else
understood it. Everyone just hacked their way around it,
resulting an a
gigantic mess that had who knows how many bugs just lurking
beneath the
surface, waiting to be exposed by a completely unrelated change
elsewhere in the code. (There were some *dtors* that were doing
useful
work and had side-effects... talk about OO gone wrong.)
We were so traumatized by the experience that the team lead put
his foot
down and said, "no more C++, we're going back to C". My
then-supervisor
had perhaps one of the happiest days of his employment here
mass-deleting all the subdirectories containing the C++ code,
after the
new C-based infrastructure was ready for use. (My only regret
was that
there are still modules written in C++ lying around. They
still suffer
from the same issues, albeit to a smaller scale. At least the
pain is
below the tolerable threshold now.)
Of course, C has own its share of nasty gotchas and pain, but,
believe
it or not, it's actually better than our experience of C++, in
spite of
C++ being supposedly the successor to C. If I only had a say in
these
things, I would switch to D in an instant, no questions asked.
Sigh. D
may still have its wrinkles to be worked out, but it's far, far
superior
in comparison.
Post by Flamaros
We border probably unconscious when we use the C + + for
certain
uses. I am curious to know which languages Google uses for
their car
without a driver.
If the automated car is running on C++ code, I'd be very, very
careful
*not* to own one. Or, if I had to, I'd willingly shell out a
fortune for
my life insurance. :-P (Hey, I might even consider becoming an
insurance
agent, it'd be good money!) ;-)
T
I work something like 6 month with Java on a Web server, and the
pair with Eclipse is nice. Having tools like Unitests well
integrated or auto-fix suggestion is really great, but that true
Java just can't leave with a good IDE to generate verbose code.
Java is also provide with a great Framework and majority of
libraries are well licensed that help a lot to be productive.

Personally I can't be ok with a language that put performances on
the side, and never allow to access the hardware, but before D a
choice had to be done on which language is better for our future
project.

For me D joins best of two worlds : productivity and
effectiveness. This without any other tool than the compiler.
H. S. Teoh
2013-05-11 04:45:06 UTC
Permalink
On Sat, May 11, 2013 at 04:52:31AM +0200, Flamaros wrote:
[...]
Post by Flamaros
I work something like 6 month with Java on a Web server, and the
pair with Eclipse is nice. Having tools like Unitests well
integrated or auto-fix suggestion is really great, but that true
Java just can't leave with a good IDE to generate verbose code. Java
is also provide with a great Framework and majority of libraries are
well licensed that help a lot to be productive.
One advantage Java has is widespread adoption and corporate support,
which made it possible to have an extensive standard library (and many
more 3rd party libraries) that can pretty much do anything you want --
you just have to put the pieces together. So in that sense you can get
the job done "faster", because you don't have to keep reinventing the
wheel. D isn't quite there yet, though that should get better once more
people adopt D.

In terms of expressive power within the language itself, though, I think
D is far better.
Post by Flamaros
Personally I can't be ok with a language that put performances on
the side, and never allow to access the hardware, but before D a
choice had to be done on which language is better for our future
project.
Right, and D is still in development, which makes certain PTBs nervous
about adoption, even if it is actually already production-ready for most
common tasks. But that can only improve as we continue refining the
language.
Post by Flamaros
For me D joins best of two worlds : productivity and effectiveness.
This without any other tool than the compiler.
Yes, which is why I love D so much. All I need is a text editor and the
compiler, and I can do everything. Even unittesting and coverage are all
integrated. No need for external tools, no need to install a whole bunch
of support software, all the essentials are bundled with the compiler.
How much more compelling can it get?


T
--
"640K ought to be enough" -- Bill G., 1984.
"The Internet is not a primary goal for PC usage" -- Bill G., 1995.
"Linux has no impact on Microsoft's strategy" -- Bill G., 1999.
skeptical
2013-05-11 07:44:11 UTC
Permalink
In article <mailman.1190.1368247615.4724.digitalmars-d at puremagic.com>,
hsteoh at quickfur.ath.cx says...
Post by H. S. Teoh
Right, and D is still in development
No, it isn't. I think it left that when Walter made it a Stallman project.
Jeff Nowakowski
2013-05-11 20:07:12 UTC
Permalink
Post by H. S. Teoh
Yes, which is why I love D so much. All I need is a text editor and the
compiler, and I can do everything. Even unittesting and coverage are all
integrated. No need for external tools, no need to install a whole bunch
of support software, all the essentials are bundled with the compiler.
How much more compelling can it get?
I can get by with a hammer and nails too, but if I was a professional
roofer I'd be an idiot not to use a nail gun. That's the problem with
all this focus on boilerplate. An IDE does so much more to make you
productive in any language, especially one that has static types.
Walter Bright
2013-05-11 21:06:26 UTC
Permalink
I can get by with a hammer and nails too, but if I was a professional roofer I'd
be an idiot not to use a nail gun. That's the problem with all this focus on
boilerplate. An IDE does so much more to make you productive in any language,
especially one that has static types.
I didn't say an IDE was bad for D, I only said that if you need an IDE to
generate boilerplate for you, then there's something wrong with the language.

IDE's have lots of other valuable uses.
Diggory
2013-05-11 22:11:24 UTC
Permalink
Post by Walter Bright
I didn't say an IDE was bad for D, I only said that if you need
an IDE to generate boilerplate for you, then there's something
wrong with the language.
IDE's have lots of other valuable uses.
There is one case of generating boilerplate code which can hardly
be avoided and would at least partially solve a problem that
keeps coming up in one form or another:

For every new language feature that uses some form of attributes
(ie. almost all of them) there is the problem of how
automatically the attributes are applied, generally with these
possibilities:

- The attribute is a purely internal concept used and deduced by
the compiler. This has the problem that unless these attributes
are in some way stored in the .di file the compiler has now way
to determine them when it cannot see the code. It also leaks
implementation details into the interface.

- The attribute is explicitly defined but inferred in some cases
by the compiler.
This has the problem that it's now not obvious whether the
attribute can be inferred or not, there are more rules to know
about when automatic deduction is done, and there will still be
many cases where the attributes cannot be safely inferred without
leaking implementation detail, but the programmer forgets to add
them.

- The attribute is explicitly defined but is inferred when "auto"
is present.
This has the problem that there's no good way to finely tune
which attributes "auto" should infer, and no way to un-set
attributes. When "auto" is used on methods for use by external
code it is again leaking implementation detail.

None of these are very satisfactory. A good solution should make
it clear to the programmer which attributes are applied, make it
easy to apply all the attributes which can be inferred but also
easy to then change them, and not change when the implementation
changes.

An IDE command which automatically infers all the attributes
would seem to be the only way to solve this well. Unfortunately
it doesn't exist yet... Anyway it would be worthwhile deciding on
a consistent way to handle attributes as the number of them
increase, and it would be worth making sure that whatever way is
chosen is compatible with such a potential IDE feature.

Another option would be to add an attribute called "default" or
something like that, and have the compiler issue a message if it
finds a function with no attributes that tells the programmer
what attributes the function COULD have so it's a reminder to
either add them, or put "default" after it.
Dicebot
2013-05-12 09:00:03 UTC
Permalink
...
That provokes another argument about attribute inference,
off-topic one :) Must resist!
deadalnix
2013-05-12 05:57:49 UTC
Permalink
Post by Walter Bright
Post by Jeff Nowakowski
I can get by with a hammer and nails too, but if I was a
professional roofer I'd
be an idiot not to use a nail gun. That's the problem with all this focus on
boilerplate. An IDE does so much more to make you productive
in any language,
especially one that has static types.
I didn't say an IDE was bad for D, I only said that if you need
an IDE to generate boilerplate for you, then there's something
wrong with the language.
I keep repeating myself, but this is true, unless the boilerplate
is here for the very reason of IDE integration.

Stupid inexpressive language are easier to write tools for, this
is the very reason why java have such a great tooling.
Post by Walter Bright
IDE's have lots of other valuable uses.
Walter Bright
2013-05-12 08:40:10 UTC
Permalink
Stupid inexpressive language are easier to write tools for, this is the very
reason why java have such a great tooling.
You run the risk of having a write-only language if the expressivity is in the
tools rather than the language.
deadalnix
2013-05-12 08:42:27 UTC
Permalink
Post by Walter Bright
Post by deadalnix
Stupid inexpressive language are easier to write tools for,
this is the very
reason why java have such a great tooling.
You run the risk of having a write-only language if the
expressivity is in the tools rather than the language.
Tools don't have to show you what is in the text file. That is
the beauty of it. IntelliJ for instance, don't show java source
code as it is in the source.
Walter Bright
2013-05-12 08:53:59 UTC
Permalink
Post by Walter Bright
Stupid inexpressive language are easier to write tools for, this is the very
reason why java have such a great tooling.
You run the risk of having a write-only language if the expressivity is in the
tools rather than the language.
Tools don't have to show you what is in the text file. That is the beauty of it.
IntelliJ for instance, don't show java source code as it is in the source.
I.e. you've invented another language that has Java as its output so the user
never sees Java because Java is not presentable to users.
deadalnix
2013-05-12 09:32:20 UTC
Permalink
Post by Walter Bright
Post by Walter Bright
Post by deadalnix
Stupid inexpressive language are easier to write tools for,
this is the very
reason why java have such a great tooling.
You run the risk of having a write-only language if the
expressivity is in the
tools rather than the language.
Tools don't have to show you what is in the text file. That is the beauty of it.
IntelliJ for instance, don't show java source code as it is in the source.
I.e. you've invented another language that has Java as its
output so the user never sees Java because Java is not
presentable to users.
What is presented to the user isn't a text format anymore.
Andrei Alexandrescu
2013-05-12 13:04:28 UTC
Permalink
Post by deadalnix
Post by Walter Bright
Post by Walter Bright
Stupid inexpressive language are easier to write tools for, this is the very
reason why java have such a great tooling.
You run the risk of having a write-only language if the expressivity is in the
tools rather than the language.
Tools don't have to show you what is in the text file. That is the beauty of it.
IntelliJ for instance, don't show java source code as it is in the source.
I.e. you've invented another language that has Java as its output so
the user never sees Java because Java is not presentable to users.
What is presented to the user isn't a text format anymore.
Looks like text to me. http://www.jetbrains.com/idea/. Did I look at the
wrong product?

Andrei
deadalnix
2013-05-12 13:14:33 UTC
Permalink
Post by Andrei Alexandrescu
Looks like text to me. http://www.jetbrains.com/idea/. Did I
look at the wrong product?
Yes, it is text based, but you can do many manipulation you can't
do with a regular text presentation.

This is text++
Iain Buclaw
2013-05-12 15:31:27 UTC
Permalink
Looks like text to me. http://www.jetbrains.com/idea/**. Did I look at
the wrong product?
Yes, it is text based, but you can do many manipulation you can't do with
a regular text presentation.
This is text++
Looks like *shivers* ASP....
--
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130512/80e1bc26/attachment-0001.html>
Walter Bright
2013-05-12 18:09:59 UTC
Permalink
Post by deadalnix
Post by Walter Bright
Post by Walter Bright
Stupid inexpressive language are easier to write tools for, this is the very
reason why java have such a great tooling.
You run the risk of having a write-only language if the expressivity is in the
tools rather than the language.
Tools don't have to show you what is in the text file. That is the beauty of it.
IntelliJ for instance, don't show java source code as it is in the source.
I.e. you've invented another language that has Java as its output so the user
never sees Java because Java is not presentable to users.
What is presented to the user isn't a text format anymore.
I think that is irrelevant to my point. A language doesn't have to be text based.
deadalnix
2013-05-12 18:42:20 UTC
Permalink
Post by Walter Bright
I think that is irrelevant to my point. A language doesn't have to be text based.
Textual format have proven theur usefullness again and again.
Programming languages, json, xml, even dark stuff like LLVM IR
have a textual representation. This is easier to debug.

In that regard, if you consider IntelliJ, java has become a
textual representation. It is important as the compiler would be
much harder to create otherwize.
Diggory
2013-05-12 19:11:33 UTC
Permalink
Post by deadalnix
Post by Walter Bright
I think that is irrelevant to my point. A language doesn't
have to be text based.
Textual format have proven theur usefullness again and again.
Programming languages, json, xml, even dark stuff like LLVM IR
have a textual representation. This is easier to debug.
In that regard, if you consider IntelliJ, java has become a
textual representation. It is important as the compiler would
be much harder to create otherwize.
Languages have been stored textually yes, and that is clearly
beneficial, but editing code even in fairly basic editors is far
beyond simple text editing.

Automatic indentation, symbol selection, symbol renaming, symbol
navigation, code folding, auto-completion, quick info,
intellisense, syntax highlighting, etc. mean that editing code is
far closer to editing a complex tree-like data structure than
editing text, even displaying it is not the same, and that's how
it should be for maximum productivity. Conceptually we think
about code in a way much closer to an AST than a bunch of lines
of text.

Joke or not, I would amend "real programmers use notepad" to
"real programmers *should be able* to use notepad".
Jeff Nowakowski
2013-05-12 16:42:40 UTC
Permalink
Post by Walter Bright
I didn't say an IDE was bad for D, I only said that if you need an IDE
to generate boilerplate for you, then there's something wrong with the
language.
IDE's have lots of other valuable uses.
Two points. One, the person I responded to (and quoted in my reply)
said, "Yes, which is why I love D so much. All I need is a text editor
and the compiler, and I can do everything."

Second, in the Q&A session of your talk, you said, "I'm sorely tempted
to say that real men don't use IDEs..." The fixation on boilerplate as
to why people "need" IDEs is just a symptom of the more general sentiment.
Walter Bright
2013-05-12 18:08:26 UTC
Permalink
Second, in the Q&A session of your talk, you said, "I'm sorely tempted to say
that real men don't use IDEs..."
Yes, but I said that as a joke.
The fixation on boilerplate as to why people
"need" IDEs is just a symptom of the more general sentiment.
No, the sentiment was that an IDE was not the solution to a language's deficiencies.
Jeff Nowakowski
2013-05-12 19:57:51 UTC
Permalink
Post by Walter Bright
Second, in the Q&A session of your talk, you said, "I'm sorely tempted to say
that real men don't use IDEs..."
Yes, but I said that as a joke.
It was said jokingly, but I have very little doubt it conveyed your true
feelings. You have a history of brushing off concerns about IDEs by
relying on a remark from David B. Held that Java needs an IDE to
generate boilerplate, which I will say to the contrary is one of the
lower priority reasons of why I find IDEs so useful for Java.

Do you use an IDE? Have you even tried one in the past 10 years?
Post by Walter Bright
No, the sentiment was that an IDE was not the solution to a language's deficiencies.
That's fine, but when somebody asks you about D support for IDEs,
"joking" about "real men" not needing one doesn't inspire confidence you
actually understand the value. Maybe in your next keynote you can talk
about how D has first-class support for IDEs, much like you did for unit
tests.

One way to get first-class support is to make the compiler amenable to
being used as a library, something that's been suggested before. I'd be
happy to be told I'm out of date, and this support is already in the
works or at least on the radar.
Iain Buclaw
2013-05-13 11:10:35 UTC
Permalink
Post by Walter Bright
Second, in the Q&A session of your talk, you said, "I'm sorely tempted to say
that real men don't use IDEs..."
Yes, but I said that as a joke.
As we all know that real men use vim. :o)
--
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130513/e44a4a82/attachment.html>
Nick Sabalausky
2013-05-12 03:57:59 UTC
Permalink
On Fri, 10 May 2013 21:45:06 -0700
Post by H. S. Teoh
Yes, which is why I love D so much. All I need is a text editor and
the compiler, and I can do everything. Even unittesting and coverage
are all integrated. No need for external tools, no need to install a
whole bunch of support software, all the essentials are bundled with
the compiler. How much more compelling can it get?
The nicest thing of all, IMO, about not strictly needing all that
support software is that basic things like
editing/navigating/opening/closing code is always and forever 100%
unobstructed by things like startup delays and keyboard input lag which
have no business existing on the rocket-engined supercomputers we now
call "a PC".
Juan Manuel Cabo
2013-05-12 16:35:25 UTC
Permalink
Post by Nick Sabalausky
The nicest thing of all, IMO, about not strictly needing all
that
support software is that basic things like
editing/navigating/opening/closing code is always and forever
100%
unobstructed by things like startup delays and keyboard input
lag which
have no business existing on the rocket-engined supercomputers
we now
call "a PC".
I'm using a little known IDE for D known as Poseidon:
http://www.dsource.org/projects/poseidon/wiki/Screenshots
it is very fast, loads very quickly, and the editor is very
responsive. The keyword autocompletion is mostly broken in D2 but
I can live without it. It is a bit sad that it has gone
unmantained for more than a year.

These are the things that I cannot live without for my big D2
project:
- Syntax highlighting.
- Tree like structure for navigating all the many source
files of my project.
- Search in multiple files.
- Debugging (breakpoints, step by step, go to line that
crashed). It suprisingly still works in Poseidon.
- Can go to file/line when double-clicking on compiler error.
- Compile/run/debug just by hitting SHIFT-F5, and other keys.
- No need for a makefile. It feeds all source files
(hundreds) and libraries to dmd.

For smaller D projects I use Vim/makefiles though.

Again, I'm a bit sad that it has gone unmantained for so long,
but it's totally usable still. This is the faster IDE that I've
found.

--jm
Nick Sabalausky
2013-05-12 19:31:37 UTC
Permalink
On Sun, 12 May 2013 18:35:25 +0200
Post by Juan Manuel Cabo
Post by Nick Sabalausky
The nicest thing of all, IMO, about not strictly needing all
that
support software is that basic things like
editing/navigating/opening/closing code is always and forever 100%
unobstructed by things like startup delays and keyboard input lag which
have no business existing on the rocket-engined supercomputers we now
call "a PC".
http://www.dsource.org/projects/poseidon/wiki/Screenshots
it is very fast, loads very quickly, and the editor is very
responsive. The keyword autocompletion is mostly broken in D2 but
I can live without it. It is a bit sad that it has gone
unmantained for more than a year.
Looks interesting. Now that you mention it, I do seem to recall hearing
about it back then. Personally, I've been a huge fan of Programmer's
Notepad 2 <http://www.pnotepad.org/>. My #1 complaint about it though
is that it's Windows-only. I want to switch to Linux for my primary
system, but the lack of PN2 is one of the roadblocks (there are other
roadblocks, though).
Post by Juan Manuel Cabo
These are the things that I cannot live without for my big D2
- Syntax highlighting.
- Search in multiple files.
- Can go to file/line when double-clicking on compiler error.
- Compile/run/debug just by hitting SHIFT-F5, and other keys.
Yea, PN2 has all of that. Essential stuff IMO too.
Post by Juan Manuel Cabo
- Tree like structure for navigating all the many source
files of my project.
PN2 has that for files, although it looks like Poseidon goes another
step further and puts funcs/classes/etc into the tree, too. I heavily
use PN2's FF-like QuickFind for that sort of thing. Obviously not as
good, but it gets me where I'm going ;)
Post by Juan Manuel Cabo
- Debugging (breakpoints, step by step, go to line that
crashed). It suprisingly still works in Poseidon.
Yea, that's something PN2 doesn't have. (Un)Luckily for me, I've spent
a lot of time in the past on things where I didn't have a debugger
available (one time my only debugging aid was a single LED! Royal
PITA!), so I've gotten so accustomed to printf debugging that I find I
usually prefer it.

Debuggers are great, I'd never deny that, but one thing I love about
printf-style is you can trivially go back-and-forth in time just by
scrolling. Debuggers only give you one time-slice at a time, and can
usually only progress forwards.

Of course, printf-style debugging really needs a language that compiles
fast. Fine for D, but it's no so fun with C/C++.
Post by Juan Manuel Cabo
- No need for a makefile. It feeds all source files
(hundreds) and libraries to dmd.
I used to swear by Visual Studio (until it got bloated, somewhere
around one of the earlier .NET versions) and I loved the whole
approach of "no makefiles, just feed all the project files to the
compiler".

But these days I prefer RDMD-style approaches ("pass the one main
source file to a cmdline tool and it figures out the rest") because
they're trivially scriptable and don't cause a specific editor (or any
editor at all) to become a build requirement. I find that especially
important for OSS and cross-platform projects.

Ever dealt with automated building of a multi-part project that
included building a Visual Studio project or (worse) a Flash project as
just one part of the overall process? Blech. It's awful.
Post by Juan Manuel Cabo
For smaller D projects I use Vim/makefiles though.
Again, I'm a bit sad that it has gone unmantained for so long,
but it's totally usable still. This is the faster IDE that I've
found.
--jm
Jacob Carlborg
2013-05-13 06:52:47 UTC
Permalink
Post by Nick Sabalausky
Looks interesting. Now that you mention it, I do seem to recall hearing
about it back then. Personally, I've been a huge fan of Programmer's
Notepad 2 <http://www.pnotepad.org/>. My #1 complaint about it though
is that it's Windows-only. I want to switch to Linux for my primary
system, but the lack of PN2 is one of the roadblocks (there are other
roadblocks, though).
Take a look at Sublime Text. It's ridicules fast and cross platform. The
only problem is that it's not free. You can download it for free and
dismiss a dialog popping up once in a while.

http://www.sublimetext.com/
Post by Nick Sabalausky
But these days I prefer RDMD-style approaches ("pass the one main
source file to a cmdline tool and it figures out the rest") because
they're trivially scriptable and don't cause a specific editor (or any
editor at all) to become a build requirement. I find that especially
important for OSS and cross-platform projects.
The problem here is when you need to use a couple of compiler switches.
You need a file to put that in, usually a shell script. Unfortunately
that doesn't work on Windows. So you need to duplicate that file for
Windows.
--
/Jacob Carlborg
Dmitry S
2013-05-13 14:19:09 UTC
Permalink
I know some folks who use Sublime Text and love it.
Post by Nick Sabalausky
Looks interesting. Now that you mention it, I do seem to recall hearing
Post by Nick Sabalausky
about it back then. Personally, I've been a huge fan of Programmer's
Notepad 2 <http://www.pnotepad.org/>. My #1 complaint about it though
is that it's Windows-only. I want to switch to Linux for my primary
system, but the lack of PN2 is one of the roadblocks (there are other
roadblocks, though).
Take a look at Sublime Text. It's ridicules fast and cross platform. The
only problem is that it's not free. You can download it for free and
dismiss a dialog popping up once in a while.
http://www.sublimetext.com/
But these days I prefer RDMD-style approaches ("pass the one main
Post by Nick Sabalausky
source file to a cmdline tool and it figures out the rest") because
they're trivially scriptable and don't cause a specific editor (or any
editor at all) to become a build requirement. I find that especially
important for OSS and cross-platform projects.
The problem here is when you need to use a couple of compiler switches.
You need a file to put that in, usually a shell script. Unfortunately that
doesn't work on Windows. So you need to duplicate that file for Windows.
--
/Jacob Carlborg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130513/1541336e/attachment.html>
Matt Soucy
2013-05-13 15:54:07 UTC
Permalink
Post by Dmitry S
I know some folks who use Sublime Text and love it.
Post by Nick Sabalausky
Looks interesting. Now that you mention it, I do seem to recall hearing
Post by Nick Sabalausky
about it back then. Personally, I've been a huge fan of Programmer's
Notepad 2 <http://www.pnotepad.org/>. My #1 complaint about it though
is that it's Windows-only. I want to switch to Linux for my primary
system, but the lack of PN2 is one of the roadblocks (there are other
roadblocks, though).
Take a look at Sublime Text. It's ridicules fast and cross platform. The
only problem is that it's not free. You can download it for free and
dismiss a dialog popping up once in a while.
http://www.sublimetext.com/
But these days I prefer RDMD-style approaches ("pass the one main
Post by Nick Sabalausky
source file to a cmdline tool and it figures out the rest") because
they're trivially scriptable and don't cause a specific editor (or any
editor at all) to become a build requirement. I find that especially
important for OSS and cross-platform projects.
The problem here is when you need to use a couple of compiler switches.
You need a file to put that in, usually a shell script. Unfortunately that
doesn't work on Windows. So you need to duplicate that file for Windows.
--
/Jacob Carlborg
It's really nice, even with the nagware, which isn't even that bad. It
only pops up something like every 50 times you save. Even better, it has
built in support for Makefiles within a project, and it's fairly
straightforward to work with other build systems. (I have a simple DUB
one working)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130513/8c41c723/attachment-0001.pgp>
Nick Sabalausky
2013-05-13 21:52:20 UTC
Permalink
On Mon, 13 May 2013 08:52:47 +0200
Post by Jacob Carlborg
Post by Nick Sabalausky
Looks interesting. Now that you mention it, I do seem to recall
hearing about it back then. Personally, I've been a huge fan of
Programmer's Notepad 2 <http://www.pnotepad.org/>. My #1 complaint
about it though is that it's Windows-only. I want to switch to
Linux for my primary system, but the lack of PN2 is one of the
roadblocks (there are other roadblocks, though).
Take a look at Sublime Text. It's ridicules fast and cross platform.
The only problem is that it's not free. You can download it for free
and dismiss a dialog popping up once in a while.
http://www.sublimetext.com/
Hmm, yea I've looked at that before. There's some nice things about it,
but honestly, I can't stand non-native UIs (both looks and behavior).
Plus the settings don't seem to work (tried changing one, saved,
restarted, and it had no effect), and the text seems a little blurry,
and I'm kind of uneasy about relying on closed-source for something I
rely on as much as a text editor. Don't like being completely at some
company's mercy for any changes/fixes I may need.
Post by Jacob Carlborg
Post by Nick Sabalausky
But these days I prefer RDMD-style approaches ("pass the one main
source file to a cmdline tool and it figures out the rest") because
they're trivially scriptable and don't cause a specific editor (or
any editor at all) to become a build requirement. I find that
especially important for OSS and cross-platform projects.
The problem here is when you need to use a couple of compiler
switches.
That's not a true problem at all. Nobody ever said RDMD, or anything
else like it, can't be invoked from another tool to provide whatever
additional functionality is needed. In fact, such things already
exist. But try adding on functionality using IDE-based build tools
as a building block - *and* then make it work for anyone who uses a
different editor.
Post by Jacob Carlborg
You need a file to put that in, usually a shell script.
Unfortunately that doesn't work on Windows. So you need to duplicate
that file for Windows.
If all you're doing is passing a few switches to a DMD/RDMD call,
then having both BAT and shell is absolutely trivial. I do it all the
time myself:

1. Replace the shebang line with @echo off
2. Replace "$@" with %*
3. If you invoke anything in the current dir, remove the prefixed ./
(or change it to .\)

Done. If you need anything fancier than that (like handling steps that
fail, or really any actual logic at all), then shell scripting is
probably not the best idea anyway - even if you don't care about
Windows at all. Just use a shell one-liner to invoke the real script.

*Or* you can just use (or create) any other compiler-invoking, or
RDMD-invoking, tool that provides whatever functionality your project
happens to need.

IDE-driven building is great...*if* it happens to already provide
everything you need (otherwise you might be pretty much screwed - and
yes, I've run into such problems before) *AND* you happen to be working
in isolation with nobody else ever needing to build your code.
Jacob Carlborg
2013-05-14 06:46:29 UTC
Permalink
Post by Nick Sabalausky
Hmm, yea I've looked at that before. There's some nice things about it,
but honestly, I can't stand non-native UIs (both looks and behavior).
Plus the settings don't seem to work (tried changing one, saved,
restarted, and it had no effect), and the text seems a little blurry,
and I'm kind of uneasy about relying on closed-source for something I
rely on as much as a text editor. Don't like being completely at some
company's mercy for any changes/fixes I may need.
There are two kind of settings. System wide settings and user settings.
I don't know if that had something to do with it. Don't know about the
text, it looks good on Mac OS X.
Post by Nick Sabalausky
That's not a true problem at all. Nobody ever said RDMD, or anything
else like it, can't be invoked from another tool to provide whatever
additional functionality is needed. In fact, such things already
exist. But try adding on functionality using IDE-based build tools
as a building block - *and* then make it work for anyone who uses a
different editor.
If I would use an IDE I would prefer it to invoke a build tool/rdmd,
just because of this. I don't want to lock someone in, to force them use
a specific editor/IDE.
Post by Nick Sabalausky
If all you're doing is passing a few switches to a DMD/RDMD call,
then having both BAT and shell is absolutely trivial. I do it all the
3. If you invoke anything in the current dir, remove the prefixed ./
(or change it to .\)
But there's still two files that needs to be maintained. Then you need
some linker switches, which are system specific. I'm not that
comfortable with the linker on Windows so I'm not sure I always get the
flags correctly. That's why I really would like to have a build tool
that handles this. It should have a system independent way of specifying
common flags, like which libraries to link with.
--
/Jacob Carlborg
Nick Sabalausky
2013-05-14 18:51:37 UTC
Permalink
On Tue, 14 May 2013 08:46:29 +0200
Post by Jacob Carlborg
Post by Nick Sabalausky
Hmm, yea I've looked at that before. There's some nice things about
it, but honestly, I can't stand non-native UIs (both looks and
behavior). Plus the settings don't seem to work (tried changing
one, saved, restarted, and it had no effect), and the text seems a
little blurry, and I'm kind of uneasy about relying on
closed-source for something I rely on as much as a text editor.
Don't like being completely at some company's mercy for any
changes/fixes I may need.
There are two kind of settings. System wide settings and user
settings. I don't know if that had something to do with it.
Hmm, yea, I don't know. I first opened the user settings, saw
it was nothing more than a blank configuration file (aside from an empty
JSON object) and didn't deal with it further. Then I went to the
"default" settings, changed "remember_open_files" from true to false,
saved, exited, checked task manager to make sure it wasn't still
running, started it again, and it auto-opened the default settings file.

I did grab the "portable install" version of it, maybe it's just broken
in that? Or maybe it's just that one setting that doesn't work. I
don't know, I haven't investigated further.
Post by Jacob Carlborg
Don't
know about the text, it looks good on Mac OS X.
It's possible that one could have just been my imagination, maybe
because of its default color scheme being lower-contrast than I'm used
to, or because it's bold and I'm used to non-bold. I dunno. OTOH, I
have noticed Apple seems to like heavy anti-aliasing (or at least
heavier than I like), so maybe you're just used to it ;)
Post by Jacob Carlborg
Post by Nick Sabalausky
If all you're doing is passing a few switches to a DMD/RDMD call,
then having both BAT and shell is absolutely trivial. I do it all
3. If you invoke anything in the current dir, remove the prefixed ./
(or change it to .\)
But there's still two files that needs to be maintained.
True, but they're very small, few in number, and updated in lockstep.
So it's entirely feasable and nowhere near as painful as, say, C/C++
headers.

But that said, yea, I'd also certainly prefer only having one file to
update.
Post by Jacob Carlborg
Then you
need some linker switches, which are system specific. I'm not that
comfortable with the linker on Windows so I'm not sure I always get
the flags correctly. That's why I really would like to have a build
tool that handles this. It should have a system independent way of
specifying common flags, like which libraries to link with.
Yea, I agree. (Although that's orthogonal to "IDE-based building" vs
"CLI-based building": In either case, having to specify
linker-specific switches manually is bad, and having it nicely
abstracted (when possible) is good.)
Kapps
2013-05-15 03:45:06 UTC
Permalink
Post by Nick Sabalausky
On Mon, 13 May 2013 08:52:47 +0200
Post by Jacob Carlborg
Take a look at Sublime Text. It's ridicules fast and cross
platform.
The only problem is that it's not free. You can download it
for free
and dismiss a dialog popping up once in a while.
http://www.sublimetext.com/
Hmm, yea I've looked at that before. There's some nice things
about it,
but honestly, I can't stand non-native UIs (both looks and
behavior).
Plus the settings don't seem to work (tried changing one, saved,
restarted, and it had no effect), and the text seems a little
blurry,
and I'm kind of uneasy about relying on closed-source for
something I
rely on as much as a text editor. Don't like being completely
at some
company's mercy for any changes/fixes I may need.
Are you using a higher DPI? If so, you'd want to disable DPI
scaling (32-bit version only, Rightclick -> Properties ->
Compatability) and just increase the font size. Otherwise, it'll
be rendering text at a lower resolution and appear blurry and
ugly.

Jacob Carlborg
2013-05-13 06:54:40 UTC
Permalink
Post by Juan Manuel Cabo
http://www.dsource.org/projects/poseidon/wiki/Screenshots
it is very fast, loads very quickly, and the editor is very responsive.
The keyword autocompletion is mostly broken in D2 but I can live without
it. It is a bit sad that it has gone unmantained for more than a year.
- Syntax highlighting.
- Tree like structure for navigating all the many source files of
my project.
- Search in multiple files.
- Debugging (breakpoints, step by step, go to line that crashed).
It suprisingly still works in Poseidon.
- Can go to file/line when double-clicking on compiler error.
- Compile/run/debug just by hitting SHIFT-F5, and other keys.
- No need for a makefile. It feeds all source files (hundreds) and
libraries to dmd.
I can do that with TextMate, except the debugging.
--
/Jacob Carlborg
skeptical
2013-05-11 07:44:07 UTC
Permalink
In article <dfhhywqaszpeetgpfonb at forum.dlang.org>, flamaros.xavier at gmail.com
says...
Post by Flamaros
Post by Walter Bright
Post by H. S. Teoh
Seriously, D has so spoiled me I can't stand programming in
another
language these days. :-P
Me too. Sometimes it makes it hard to work on the dmd front end!
More I work with D, less I want to work with C++.
Using D is just as funny as I found Java, but with a greater
potential and global control of what we do. A lot of things are
just as simple as they need and can be.
Sometimes C++ give me hives, it's so error prone and an
under-productive language for the actual industry needs, that
certainly why Google created the Go.
You are side-stepping the fact that D was not a consideration for Google. If C++
is a failure there, then isn't D a double failure?
skeptical
2013-05-11 07:44:08 UTC
Permalink
In article <dfhhywqaszpeetgpfonb at forum.dlang.org>, flamaros.xavier at gmail.com
says...
Post by Flamaros
We border probably unconscious when we use the C + + for certain
uses.
It is no curiosity to me. But I'm not part of your "we".
skeptical
2013-05-11 07:44:09 UTC
Permalink
In article <mailman.1187.1368237672.4724.digitalmars-d at puremagic.com>,
hsteoh at quickfur.ath.cx says...
Post by H. S. Teoh
[...]
Post by Flamaros
More I work with D, less I want to work with C++.
Yup. I think that applies to a lot of us here. :)
Wankers.
Post by H. S. Teoh
I find D superior to Java in just about every possible way.
But you are not saying anything, because that is like sayint that you find gay
sex superior to heterosexual sex in every possible way.

Admit it: you're a wanker.
Post by H. S. Teoh
Surprisingly enough, before I found D, I actually considered ditching
C++ for C. I only stayed with C++ because it has certain niceties, like
exceptions,
Explain that "nicety" or shut up? You wouldn't know an "exception", if you
caught a venereal disease from it. (But you did, and want to spread it around?!)
Post by H. S. Teoh
C++ is just over-complex, and its complexity in different areas
interact badly with each other, making it an utter nightmare to work
with beyond trivial textbook examples.
You were suggesting that D is better? Why you and not Walter or his "supporter"
Andrei? Do they really need you to evangelize the awesome powers of healing of
D?
Post by H. S. Teoh
OO programming in C++ is so
nasty, it's laughable
OO? Show your guage ("bitch").
Post by H. S. Teoh
-- if I wanted OO, Java would be far superior.
"surely". Kids get to post on the internet and be addressed as within all of the
knowledgebase, but ya know what, that dick-wanking period is over. Not because I
say it is, but because that is what it is. YOU, adolescent (not that there
aren't exceptions to every "rule", but that that there usually aren't (save for
society rules and government rules)).
Post by H. S. Teoh
I
found that C++ is only tolerable when I use it as "C with classes". Its
OO features suck.
I hear that.
Post by H. S. Teoh
At my day job,
I've tried that. I gave up years ago, but, well, I don't know.
Post by H. S. Teoh
we
That's surely it: I'm not a "we". Surely that's it. It is, isn't it. It's like
that movie.
Nick Sabalausky
2013-05-12 03:47:03 UTC
Permalink
On Fri, 10 May 2013 18:59:23 -0700
"H. S. Teoh" <hsteoh at quickfur.ath.cx> wrote:
[...snip Java vs D samples...]
Post by H. S. Teoh
Talk about signal-to-noise ratio.
And don't get me started on all those BlahBlahBlahClassWrapper's and
BlahBlahBlahClassWrapperFactoryWrapper's. Ugh. And Integer vs. int,
and other such atrocities. What, built-in atomic types are defective
so we need to wrap them in classes now? Flawed language design,
anybody?
I find D superior to Java in just about every possible way. Except
[..snip..]
Post by H. S. Teoh
Post by Flamaros
Sometimes C++ give me hives, it's so error prone and an
under-productive language for the actual industry needs, that
certainly why Google created the Go.
Surprisingly enough, before I found D, I actually considered ditching
C++ for C. I only stayed with C++ because it has certain niceties,
like exceptions, (and no need to keep typing 'struct' everywhere on a
type that's blatantly obviously a struct) that in C is a royal pain
in the neck. C++ is just over-complex, and its complexity in
different areas interact badly with each other, making it an utter
nightmare to work with beyond trivial textbook examples. OO
programming in C++ is so nasty, it's laughable -- if I wanted OO,
Java would be far superior.
Yea. Somewhere close to 10 years ago, it was precisely the nightmarish
combination of C++ and Java that pushed me to do some language
searching which led me to (an early) D.

Learning Java taught me all the reasons to hate C++, but then Java also
went and threw away the *good* things about C/C++, too. As those
were the languages I needed to use the most, the constant "Which hell
do I want? Hell A or Hell B?" damn near soured me on programming in
general.

Then C# and D came along and made programmer life tolerable again ;)
I've since gotten tired of C# too, though. The limitations of its
generics, and MS's continued disinterest in fixing them, finally drove
me to ditch it forever. D by contrast has only gotten better with age.
Post by H. S. Teoh
I found that C++ is only tolerable when I
use it as "C with classes".
That's always been my strategy with C++. Originally because I didn't
know any of its fancier stuff, and now because I just don't want to
deal with any of its "frills".

Funny thing: I absolutely can't stand highly dynamic languages, period,
but after re-introducing myself to C/C++ on a project last year, I'm
understanding much better why so many game devs are so big on Lua.
Daniel Murphy
2013-05-11 05:35:26 UTC
Permalink
"H. S. Teoh" <hsteoh at quickfur.ath.cx> wrote in message
Post by H. S. Teoh
Now, *that* is not a good thing at all! When are we going to start
moving towards bootstrapping D? Did any conclusions ever come of that
discussion some time ago about how this might impact GDC/LDC?
We already are! Check out pull requests tagged with [DDMD].
skeptical
2013-05-11 07:44:05 UTC
Permalink
In article <kmk27g$p9j$1 at digitalmars.com>, newshound2 at digitalmars.com says...
Post by Walter Bright
Post by H. S. Teoh
Seriously, D has so spoiled me I can't stand programming in another
language these days. :-P
Me too. Sometimes it makes it hard to work on the dmd front end!
One's own dick is nirvana? It has relevance: no disease if you don't already
have one. I'm not saying "stick your dick into the ocean (of communicable
disease (and aside, did y'all know that 1 out of 4 people have herpes, a disease
that cannot be cured? And that is probably optimistic: cuz if you're relying on
statistics, you're probably in a statistical group where herpes is guaranteed
and other diseases are too: HIV, etc.)).

You too, huh? Sounds like a study is appropriate for "your" group.
skeptical
2013-05-11 07:44:06 UTC
Permalink
In article <mailman.1184.1368231351.4724.digitalmars-d at puremagic.com>,
hsteoh at quickfur.ath.cx says...
Post by H. S. Teoh
Post by Walter Bright
Post by H. S. Teoh
Seriously, D has so spoiled me I can't stand programming in another
language these days. :-P
Me too. Sometimes it makes it hard to work on the dmd front end!
Now, *that* is not a good thing at all!
He was announcing that he is "hard and ready". So be it. But people, please
REQUIRE a RECENT STD test (like yesterday), and WAIT A YEAR before you have sex.
OK? It's a selfish request: if you all die from inter-combobulating, who will I
have to talk with?

(It's not too late, is it?)
skeptical
2013-05-11 07:44:04 UTC
Permalink
In article <kmjqp6$fdf$1 at digitalmars.com>, newshound2 at digitalmars.com says...
Post by Walter Bright
Post by H. S. Teoh
Note how much boilerplate is necessary to make the code work
*correctly*.
It's worse than that. Experience shows that this rat's nest style of code often
is incorrect because it is both complex and never tested. While D doesn't make
it more testable, at least it makes it simple, and hence more likely to be correct.
I quip shit like that in other NGs too. The thing is, I haven't given up: I
don't try to pickup the immature with expressions like "experience shows.. blah,
blah". You seem to have either conceded, confessed, or given up. I'm "a
management consultant", that is necessarily to say that if I blurt out stuff
that I refuse to give to those who would want to pay me for that, and I know
they will use it to their advantage against others when they don't have any
right to others' ... well, who does? Who has RIGHT to anyone else's labors,
efforts, time, knowledge...?

________

You have the lingo now? I mean, "D solves rat's nest style of complex code"...
thank god you were fired as an apprentice to being an airplane engineer!
deadalnix
2013-05-11 08:56:32 UTC
Permalink
Post by H. S. Teoh
It turns out that this mysterious "stuck" state was caused by
the stack
trace code -- but not in any of the usual ways. In order to
produce the
trace, it uses fprintf to write info to the log, and fprintf in
turn
calls malloc at various points to allocate the necessary
buffers to do
that. Now, if for some reason free() segfaults (e.g., you pass
in an
illegal pointer), then libc is still holding the internal
malloc mutex
lock when the OS sends the SEGV to the process, so when the
stack trace
handler then calls fprintf, which in turn calls malloc, it
deadlocks.
Further SIGSEGV's won't help, since it only makes the deadlock
worse.
This is the very reason why the NullPointerError handler build a
fake stack frame and hijack the EIP register in order to NOT do
that kind of stuff into the signal handler.

This is very confusing and must be put into some runtime code and
never used directly by users.
deadalnix
2013-05-11 08:45:21 UTC
Permalink
Post by sk
Post by H. S. Teoh
In any case, I totally agree that if a language *needs* an IDE
in order to cope with the amount of required boilerplate, then
something is clearly very, very wrong at a fundamental level.
May be this is true for expert or professional programmers. But
for people like me who only use D occasionally an IDE is a must.
IDE mainly helps me in reducing the amount of things I need to
memorize or remember like API, building tool names, command
syntaxes, etc. This is very important as my main profession is
not programming.
Especially since we aren't very good at API consistency.
sk
2013-05-13 16:19:34 UTC
Permalink
Thank you, nicely explained.
Loading...