Nice slides, very simple and elegant.
This reminds me of when I started with D. I found a lot of these 'details'
unload quite some burden I had with C++ and made programming that much more
enjoyable.
On 5/5/11 10:18 PM, Andrei Alexandrescu wrote:
On 5/5/11 9:04 PM, Walter Bright wrote:
The slides: http://www.slideshare.net/dcacm/patterns-of-human-error
A review:
http://computopics.dcacm.org/2011/05/04/review-dcacm-patterns-of-human-error-with-walter-bright/
Anyone want to reddit this?
Walter:
The slides: http://www.slideshare.net/dcacm/patterns-of-human-error
Nice. Please put your PDFs everywhere but Slideshare. I'd love a simple link to
just the PDF, thank you very much (Slideshare requires Flash, JavaScript, other
things, and the flash viever doesn't allow me copypaste
Is that a typo on page 31?
= should be =
maybe = should be
I guess that further drives the point though. :)
Andrej Mitrovic:
I guess that further drives the point though. :)
Yup .I didn't see it.
Bye,
bearophile
On 5/6/2011 8:13 AM, Andrej Mitrovic wrote:
Is that a typo on page 31?
= should be =
maybe= should be
I guess that further drives the point though. :)
You're right. Good catch.
On 5/6/2011 1:46 PM, Brad Roberts wrote:
That was the first error I caught.. since I've seen you use it as a common
error and reason to use foreach() style loops before.
Interestingly, nobody saw all 5 bugs.
Walter:
Interestingly, nobody saw all 5 bugs.
You show this as a bug:
typedef long T;
But did you meant to write this?
typedef long long T;
With this change the C lint finds this bug too.
Bye,
bearophile
I still giggle at the long long name. Good thing there are no floats
floats and char chars.
On 2011-05-05 23:21, Brad Roberts wrote:
On Thu, 5 May 2011, Ulrik Mikaelsson wrote:
Just some quick thoughts;
* Could some kind of benchmarking be integrated to track performance
aspects, especially find regressions? Perhaps a bit high on the
utility/work-scale?
Could? Yes.
Am I going to?
It discusses D too a lot, praising it for its (deprecated) scope classes too!
:-)
http://www.slideshare.net/eplawless/exception-safety-and-garbage-collection-and-some-other-stuff
http://www.reddit.com/r/programming/comments/h5fn7/exception_safety_garbage_collection_and_some/
Bye,
bearophile
On 03/05/2011 11:18, bearophile wrote:
I was away.
This is D code adapted from a blog post about C language:
http://eli.thegreenplace.net/2011/05/02/the-context-sensitivity-of-c%E2%80%99s-grammar-revisited/
On 05/05/2011 20:19, Walter Bright wrote:
In case not everyone knows about this, Brad Roberts conceived,
implemented, set up and maintains an automated tester that watches
github for checkins, and when there's something new it does a complete
build of dmd and phobos, then runs the test suite on
bearophile wrote:
Through Reddit I've seen another document that shows common little bugs in
C/C++ code found by a static analysis tool. The bugs shown seem to be real,
from real software:
http://www.slideshare.net/Andrey_Karpov/add2011-en
From the slides I have selected seven of the bugs,
bearophile wrote:
I was away.
This is D code adapted from a blog post about C language:
http://eli.thegreenplace.net/2011/05/02/the-context-sensitivity-of-
c%E2%80%99s-grammar-revisited/
http://www.reddit.com/r/programming/comments/h23h3/the_context_sensitivity_of_cs_grammar_revisited/
Bruno Medeiros, Software Engineer:
This is why there are code conventions that have different rules for
naming variables/fields and types, so you don't confuse them...
Walter has just shown slides in D.announce that explain why sometimes code
conventions aren't enough :-)
Bye,
bearophile
Don:
I would say that disallowing it would _always_ lead to clearer code.
OK. It's in Bugzilla since some time:
http://d.puremagic.com/issues/show_bug.cgi?id=5409
(But if we want to disallow something then we have to list exactly what syntax
are not allowed.)
Making #7 an error would break
Jacob Carlborg d...@me.com wrote in message
news:iq0653$5fh$1...@digitalmars.com...
On 2011-05-05 23:21, Brad Roberts wrote:
On Thu, 5 May 2011, Ulrik Mikaelsson wrote:
* 1280x1024 is too small for seeing the results. Could the view
perhaps be made slightly more compact? (Especially since
Hello all,
It's been a while since I've worked with D, but I'm coming back to it now since
it has 64 bit support for Windows, Linux and Mac. I'm developing on
64 bit Ubuntu. Here's the output of uname -a:
Linux jetty 2.6.32-31-generic #61-Ubuntu SMP Fri Apr 8 18:25:51 UTC 2011 x86_64
GNU/Linux
Through Reddit I've seen another document that shows common little bugs in
C/C++
code found by a static analysis tool. The bugs shown seem to be real, from real
software:
http://www.slideshare.net/Andrey_Karpov/add2011-en
From the slides I have selected seven of the bugs, here translated to
Brian Myers tarkawebf...@gmail.com wrote in message
news:iq1if2$2d6g$1...@digitalmars.com...
Hello all,
It's been a while since I've worked with D, but I'm coming back to it now
since it has 64 bit support for Windows, Linux and Mac.
For linux. 64 on Win/Mac is still to come.
Timon Gehr wrote:
- Bug #4 is probably easy to find, but in D is less common, because you
usually
use foreach, or for with local index variable (that D doesn't allow you to
redefine). Once in a while that kind of code is correct, maybe.
This is already disallowed (deprecated).
Oh, it is
Robert Jacques wrote:
On Tue, 03 May 2011 08:20:42 -0400, Bruno Medeiros
brunodomedeiros+spam@com.gmail wrote:
On 27/04/2011 22:20, Timon Gehr wrote:
Quiz: What does the following code compute?
import std.stdio;
import core.exception;
void main(){
int a,b;
int[int] aa;
scanf(%d
Timon Gehr:
The problem is that generated/CTFE'd code might produce that kind of
redundancy.
Right.
Proving that two sub-expressions are equivalent is a hard task.
A simple equivalence is enough here: the code with normalized whitespace. Those
tools are probably doing something not much
On 6/05/11 9:50 AM, bearophile wrote:
It discusses D too a lot, praising it for its (deprecated) scope classes too!
:-)
http://www.slideshare.net/eplawless/exception-safety-and-garbage-collection-and-some-other-stuff
put dmd.conf in the same directory as dmd.
Brian Myers Wrote:
Hello all,
dmd generates 64 bit only for Linux, GDC should work though.
What is the error when you compile with dmd?
The error you are getting from ld is saying that you have no main function.
You know you can/should put your libraries in /usr/local/lib and your source
Hello all,
It's been a while since I've worked with D, but I'm coming back to it now
since it has 64 bit support for Windows, Linux and Mac. I'm developing on
64 bit Ubuntu. Here's the output of uname -a:
Linux jetty 2.6.32-31-generic #61-Ubuntu SMP Fri Apr 8 18:25:51 UTC 2011
x86_64
Timon Gehr:
The problem is that generated/CTFE'd code might produce that kind of
redundancy.
Right.
Proving that two sub-expressions are equivalent is a hard task.
A simple equivalence is enough here: the code with normalized whitespace.
Those
tools are probably doing something not
Timon Gehr:
I think it might be a
good idea though. However, having this feature means requiring one AST
compare for
every boolean operator.
You are worried about compilation time. I think the feature we're talking about
just tests the equivalence of the then/else clauses.
Clang has a
Purely out of curiosity (as in I personally have no pressing need for
it), what are the main roadblocks to DMD supporting 64-bit on Mac OS and
FreeBSD? I understand that on Windows we'd need a new linker, etc, but
IIUC FreeBSD and Mac OS use GCC like Linux does.
Just a reminder in case you didn't know, but there is a beta list (dmd-beta)
for posting and discussing beta releases of dmd prior to actual releases. It's
not a particularly active list, since we only get betas every couple of months
or so, but if you want to check out beta releases of dmd,
Here's a quick weblink:
http://news.gmane.org/gmane.comp.lang.d.dmd.beta/cutoff=624
On 5/6/2011 9:58 PM, dsimcha wrote:
Purely out of curiosity (as in I personally have no pressing need for it),
what are the main roadblocks to DMD
supporting 64-bit on Mac OS and FreeBSD? I understand that on Windows we'd
need a new linker, etc, but IIUC FreeBSD and
Mac OS use GCC like
On 5/6/2011 9:58 PM, dsimcha wrote:
Purely out of curiosity (as in I personally have no pressing need for it), what
are the main roadblocks to DMD supporting 64-bit on Mac OS and FreeBSD? I
understand that on Windows we'd need a new linker, etc, but IIUC FreeBSD and Mac
OS use GCC like Linux
Is this bug, or is it as supposed to be? I'm not sure...
code
interface TmpI(T) {
void func(T);
}
class TmpC {}
class TmpC2 : TmpC {}
class Tmp : TmpI!TmpC2 {
void func(TmpI!TmpC) {};
}
void main(string[] args) {
auto inst = new Tmp;
inst.func(new Tmp);
}
/code
Error: function
Testing out a new binding I knocked up for a C library. One of the
functions takes a struct by value. It looks somewhat like this:
struct S {}
struct Color
{
float r,g,b,a;
}
extern C void function(S* s, Color color, int x, int y, in char*) draw_text;
Now, there is another function that
On Thu, 05 May 2011 17:03:51 -0400, Nrgyzer nrgy...@gmail.com wrote:
Hey guys,
I'm trying to call toHash() in a class which receives an interface
class as input param. But I always get Error: no property 'toHash'
for type
My code looks like:
module iFBlock;
private {
import
On Fri, 06 May 2011 03:39:31 -0400, Mariusz Gliwiński
alienballa...@gmail.com wrote:
Is this bug, or is it as supposed to be? I'm not sure...
code
interface TmpI(T) {
void func(T);
}
class TmpC {}
class TmpC2 : TmpC {}
class Tmp : TmpI!TmpC2 {
void func(TmpI!TmpC) {};
Here is
On Fri, 06 May 2011 05:56:17 -0400, Mike Parker aldac...@gmail.com wrote:
Testing out a new binding I knocked up for a C library. One of the
functions takes a struct by value. It looks somewhat like this:
struct S {}
struct Color
{
float r,g,b,a;
}
extern C void function(S* s, Color
Steven Schveighoffer Wrote:
On Fri, 06 May 2011 03:39:31 -0400, Mariusz GliwiÅski
alienballa...@gmail.com wrote:
Is this bug, or is it as supposed to be? I'm not sure...
code
interface TmpI(T) {
void func(T);
}
class TmpC {}
class TmpC2 : TmpC {}
class Tmp :
On 2011-05-06 11:56, Mike Parker wrote:
Testing out a new binding I knocked up for a C library. One of the
functions takes a struct by value. It looks somewhat like this:
struct S {}
struct Color
{
float r,g,b,a;
}
extern C void function(S* s, Color color, int x, int y, in char*)
draw_text;
On Fri, 06 May 2011 08:49:44 -0400, Jason House
jason.james.ho...@gmail.com wrote:
Steven Schveighoffer Wrote:
On Fri, 06 May 2011 03:39:31 -0400, Mariusz Gliwiński
alienballa...@gmail.com wrote:
Is this bug, or is it as supposed to be? I'm not sure...
code
interface TmpI(T) {
On 5/6/2011 9:19 PM, Steven Schveighoffer wrote:
On Fri, 06 May 2011 05:56:17 -0400, Mike Parker aldac...@gmail.com wrote:
Testing out a new binding I knocked up for a C library. One of the
functions takes a struct by value. It looks somewhat like this:
struct S {}
struct Color
{
float
On 5/6/2011 10:23 PM, Steven Schveighoffer wrote:
On Fri, 06 May 2011 09:16:02 -0400, Jacob Carlborg d...@me.com wrote:
On 2011-05-06 11:56, Mike Parker wrote:
Testing out a new binding I knocked up for a C library. One of the
functions takes a struct by value. It looks somewhat like this:
Mike Parker:
Testing out a new binding I knocked up for a C library. One of the
functions takes a struct by value. It looks somewhat like this:
struct S {}
struct Color
{
float r,g,b,a;
}
extern C void function(S* s, Color color, int x, int y, in char*) draw_text;
My suggestion
On 2011-05-06 15:23, Steven Schveighoffer wrote:
On Fri, 06 May 2011 09:16:02 -0400, Jacob Carlborg d...@me.com wrote:
On 2011-05-06 11:56, Mike Parker wrote:
Testing out a new binding I knocked up for a C library. One of the
functions takes a struct by value. It looks somewhat like this:
On 2011-05-06 11:56, Mike Parker wrote:
Testing out a new binding I knocked up for a C library. One of the
functions takes a struct by value. It looks somewhat like this:
struct S {}
struct Color
{
float r,g,b,a;
}
extern C void function(S* s, Color color, int x, int y, in char*)
draw_text;
On 06/05/2011 19:40, Jacob Carlborg wrote:
No, D implicitly casts string literals to zero-terminated const(char)*.
That part is fine.
-Steve
Since when?
Since const was introduced, before then they implicitly casted to char*
instead. And that has been the case since early D1.
--
Robert
== Auszug aus Steven Schveighoffer (schvei...@yahoo.com)'s Artikel
On Thu, 05 May 2011 17:03:51 -0400, Nrgyzer nrgy...@gmail.com
wrote:
Hey guys,
I'm trying to call toHash() in a class which receives an interface
class as input param. But I always get Error: no property
'toHash'
for
On 5/6/11, Jacob Carlborg d...@me.com wrote:
On 2011-05-06 11:56, Mike Parker wrote:
Testing out a new binding I knocked up for a C library. One of the
functions takes a struct by value. It looks somewhat like this:
struct S {}
struct Color
{
float r,g,b,a;
}
extern C void function(S*
Nick Sabalausky a@a.a wrote in message
news:ipf5pg$j80$1...@digitalmars.com...
Spacen Jasset spacenjas...@yahoo.co.uk wrote in message
news:ipe1ar$1e1f$1...@digitalmars.com...
I don't know about any of that. All I say is software was built on Centos
3 and it runs on the then company I was
http://d.puremagic.com/issues/show_bug.cgi?id=5931
kenn...@gmail.com changed:
What|Removed |Added
CC||kenn...@gmail.com
--- Comment #2
http://d.puremagic.com/issues/show_bug.cgi?id=5932
Don clugd...@yahoo.com.au changed:
What|Removed |Added
CC||clugd...@yahoo.com.au
---
http://d.puremagic.com/issues/show_bug.cgi?id=5907
Don clugd...@yahoo.com.au changed:
What|Removed |Added
Status|NEW |RESOLVED
http://d.puremagic.com/issues/show_bug.cgi?id=1330
Don clugd...@yahoo.com.au changed:
What|Removed |Added
CC||andrej.mitrov...@gmail.com
http://d.puremagic.com/issues/show_bug.cgi?id=5760
Don clugd...@yahoo.com.au changed:
What|Removed |Added
Status|NEW |RESOLVED
http://d.puremagic.com/issues/show_bug.cgi?id=5867
kenn...@gmail.com changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|
http://d.puremagic.com/issues/show_bug.cgi?id=4865
kenn...@gmail.com changed:
What|Removed |Added
CC||kenn...@gmail.com
--- Comment #1
http://d.puremagic.com/issues/show_bug.cgi?id=4865
kenn...@gmail.com changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|
http://d.puremagic.com/issues/show_bug.cgi?id=4040
kenn...@gmail.com changed:
What|Removed |Added
CC||samu...@voliacable.com
--- Comment
http://d.puremagic.com/issues/show_bug.cgi?id=5933
Summary: Cannot retrieve the return type of an auto-return
member function
Product: D
Version: D2
Platform: Other
OS/Version: Mac OS X
Status: NEW
http://d.puremagic.com/issues/show_bug.cgi?id=5891
--- Comment #3 from kenn...@gmail.com 2011-05-06 02:21:58 PDT ---
(In reply to comment #2)
Of course the DMD bug should be fixed but Iota is too important to fail, so
this specific case has been worked around:
http://d.puremagic.com/issues/show_bug.cgi?id=5258
bearophile_h...@eml.cc changed:
What|Removed |Added
Severity|normal |regression
--- Comment #1
http://d.puremagic.com/issues/show_bug.cgi?id=5258
--- Comment #2 from Don clugd...@yahoo.com.au 2011-05-06 04:09:57 PDT ---
This is a pseudo-regression: it was never doing what it was supposed to. The
test case happened to give the correct results on a previous version, but only
because one
http://d.puremagic.com/issues/show_bug.cgi?id=5810
Don clugd...@yahoo.com.au changed:
What|Removed |Added
Keywords||diagnostic
http://d.puremagic.com/issues/show_bug.cgi?id=5934
Summary: Finite recursive templates are not allowed
Product: D
Version: D2
Platform: x86_64
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
http://d.puremagic.com/issues/show_bug.cgi?id=5935
Summary: Non-tuple iteration with std.range.zip
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: patch
Severity: enhancement
http://d.puremagic.com/issues/show_bug.cgi?id=5934
--- Comment #1 from Maksim Zholudev maxim...@gmail.com 2011-05-06 07:55:47
PDT ---
The following code works, but such workarounds are annoying:
--
struct Foo
{
auto opUnary(string op)()
if(op == -)
{
return
http://d.puremagic.com/issues/show_bug.cgi?id=3869
Maksim Zholudev maxim...@gmail.com changed:
What|Removed |Added
CC||maxim...@gmail.com
http://d.puremagic.com/issues/show_bug.cgi?id=5934
Maksim Zholudev maxim...@gmail.com changed:
What|Removed |Added
Status|NEW |RESOLVED
http://d.puremagic.com/issues/show_bug.cgi?id=5936
Summary: DMD Segfault when forward-referencing pure auto-return
member function with parameter.
Product: D
Version: D2
Platform: Other
OS/Version: Mac OS X
Status:
http://d.puremagic.com/issues/show_bug.cgi?id=4968
--- Comment #2 from Kenji Hara k.hara...@gmail.com 2011-05-06 09:21:13 PDT ---
Created an attachment (id=964)
test patch
This patch only fix comment#1 case, but not support more cases (array,
function, delegate, etc.)
--
Configure issuemail:
http://d.puremagic.com/issues/show_bug.cgi?id=5935
kenn...@gmail.com changed:
What|Removed |Added
CC||kenn...@gmail.com
--- Comment #1
http://d.puremagic.com/issues/show_bug.cgi?id=5409
--- Comment #1 from bearophile_h...@eml.cc 2011-05-06 10:14:02 PDT ---
Don seems to agree in catching this bug statically:
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.Darticle_id=135741
http://d.puremagic.com/issues/show_bug.cgi?id=5930
Sean Kelly s...@invisibleduck.org changed:
What|Removed |Added
Status|NEW |ASSIGNED
http://d.puremagic.com/issues/show_bug.cgi?id=5872
Sean Kelly s...@invisibleduck.org changed:
What|Removed |Added
Status|NEW |ASSIGNED
http://d.puremagic.com/issues/show_bug.cgi?id=5935
Andrei Alexandrescu and...@metalanguage.com changed:
What|Removed |Added
CC|
http://d.puremagic.com/issues/show_bug.cgi?id=5872
--- Comment #2 from kenn...@gmail.com 2011-05-06 11:21:47 PDT ---
(In reply to comment #1)
I'll take care of core.demangle. core.sys.* and core.stdc.* are interfaces
for
C libraries and I'd expect the user to refer to the documentation for
http://d.puremagic.com/issues/show_bug.cgi?id=5935
--- Comment #4 from kenn...@gmail.com 2011-05-06 11:26:58 PDT ---
(In reply to comment #3)
I'm worried about this development. Before long we could get to the point
where
a lot of ranges get bloated to support two iteration methods because
http://d.puremagic.com/issues/show_bug.cgi?id=5872
Jacob Carlborg d...@me.com changed:
What|Removed |Added
CC||d...@me.com
--- Comment
http://d.puremagic.com/issues/show_bug.cgi?id=5931
Christopher the Magnificent ultimatemacfana...@gmail.com changed:
What|Removed |Added
Summary|keyword new insists on
http://d.puremagic.com/issues/show_bug.cgi?id=5931
--- Comment #4 from kenn...@gmail.com 2011-05-06 12:47:28 PDT ---
(In reply to comment #3)
*Shouldn't* post-blit be invokable by calling File(file)? Wouldn't this be
a
desirable behavior?
Sorry, got distracted by the 'this.file = new
http://d.puremagic.com/issues/show_bug.cgi?id=5931
--- Comment #5 from kenn...@gmail.com 2011-05-06 12:48:43 PDT ---
(In reply to comment #4)
(In reply to comment #3)
[snip]
At the line above marked DOESN'T WORK, the compiler refuses to allocate a
new
default-initialized File struct.
http://d.puremagic.com/issues/show_bug.cgi?id=5937
Summary: Problem with map!delegate(iota(floating point))
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: wrong-code
Severity: normal
http://d.puremagic.com/issues/show_bug.cgi?id=5937
--- Comment #1 from bearophile_h...@eml.cc 2011-05-06 15:18:27 PDT ---
A better example for the second (bar) case, the problem seems in iota():
import std.range, std.algorithm;
void main() {
auto range2a = iota(1, 5, 1);
int
http://d.puremagic.com/issues/show_bug.cgi?id=5490
--- Comment #12 from Iain Buclaw ibuc...@ubuntu.com 2011-05-06 16:10:49 PDT
---
GCC-4.6 offers two new warning switches to catch redundant code:
-Wunused-but-set-parameter and -Wunused-but-set-variable
--
Configure issuemail:
http://d.puremagic.com/issues/show_bug.cgi?id=4968
Kenji Hara k.hara...@gmail.com changed:
What|Removed |Added
Attachment #964 is|0 |1
obsolete|
http://d.puremagic.com/issues/show_bug.cgi?id=5938
Summary: ICE ztc\symbol.c 1043
Product: D
Version: D2
Platform: Other
OS/Version: Windows
Status: NEW
Keywords: ice-on-valid-code
Severity: regression
http://d.puremagic.com/issues/show_bug.cgi?id=5939
Summary: Cannot copy std.algorithm.map
Product: D
Version: D2
Platform: Other
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: regression
http://d.puremagic.com/issues/show_bug.cgi?id=5940
Summary: Cannot create arrays of std.algorithm.map
Product: D
Version: D2
Platform: Other
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
91 matches
Mail list logo