digitalmars.D - John-Carmack quotes the D programming language
- Guillaume Chatelet (2/2) Apr 27 2012 A very good article by John-Carmack about purity
- David Nadlinger (5/7) Apr 27 2012 So all that Twitter spamming finally led to something? :P
- Nick Sabalausky (6/8) Apr 27 2012 Yea, that is good.
- SomeDude (7/19) Apr 27 2012 Plus, he is extremely down to earth when tackling problems. He
- deadalnix (3/5) Apr 27 2012 The drawTriangle example is a very good example of why weak purity is
- so (5/7) Apr 27 2012 Just a glance AND my eyes managed to parse "axilmar" in thousands
- bearophile (24/33) Apr 27 2012 Is this what he is talking about?
- David Nadlinger (9/27) Apr 27 2012 No, he is referring to the call site of the function which
- SomeDude (7/9) Apr 28 2012 Someone mentioned Fabrice Bellard on the reddit thread.
A very good article by John-Carmack about purity http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/
Apr 27 2012
On Friday, 27 April 2012 at 07:26:52 UTC, Guillaume Chatelet wrote:A very good article by John-Carmack about purity http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/So all that Twitter spamming finally led to something? :P SCNR, David
Apr 27 2012
"Guillaume Chatelet" <chatelet.guillaume gmail.com> wrote in message news:llzwwxmdgnwydqcyfznn forum.dlang.org...A very good article by John-Carmack about purity http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/Yea, that is good. Sometimes I agree with Carmack, and sometimes I don't, but he's always fascinating to listen to, and I'm always impressed by his intelligence and clairity-of-thought on complex matters.
Apr 27 2012
On Friday, 27 April 2012 at 08:21:07 UTC, Nick Sabalausky wrote:"Guillaume Chatelet" <chatelet.guillaume gmail.com> wrote in message news:llzwwxmdgnwydqcyfznn forum.dlang.org...Plus, he is extremely down to earth when tackling problems. He has been rather conservative when coming to programming languages, so if he talks about issues like purity, he probably has studied and practiced them well enough to feel authorized to talk about them. And I bet he started to look at it because of he need for multithreaded programming.A very good article by John-Carmack about purity http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/Yea, that is good. Sometimes I agree with Carmack, and sometimes I don't, but he's always fascinating to listen to, and I'm always impressed by his intelligence and clairity-of-thought on complex matters.
Apr 27 2012
Le 27/04/2012 09:26, Guillaume Chatelet a écrit :A very good article by John-Carmack about purity http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/The drawTriangle example is a very good example of why weak purity is good. D have made a very good move here.
Apr 27 2012
On Friday, 27 April 2012 at 07:26:52 UTC, Guillaume Chatelet wrote:A very good article by John-Carmack about purity http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/Just a glance AND my eyes managed to parse "axilmar" in thousands of words. I better get some fresh air.
Apr 27 2012
Guillaume Chatelet:A very good article by John-Carmack about purity http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/Returning everything by value is the natural functional programming style, but relying on compilers to always perform return value optimization can be hazardous to performance, so passing reference parameter for output of complex data structures is often justifiable, but it has the unfortunate effect of preventing you from declaring the returned value as const to enforce single assignment.<Is this what he is talking about? class Foo { int x; } const(Foo) bar() pure { auto f = new Foo; f.x = 1; return f; } void main() pure {} ---------------------- Regarding D purity I have asked for another little improvements: http://d.puremagic.com/issues/show_bug.cgi?id=7994 It's related to this other example: import std.string: text; string foo() { return text(1); } void main() pure { enum s = foo(); // currently an error } Bye, bearophile
Apr 27 2012
On Friday, 27 April 2012 at 14:51:01 UTC, bearophile wrote:John Carmack:No, he is referring to the call site of the function which returns something by ref, where you can't declare the »target« const: --- /* const */ Foo foo; initializeFoo(foo); --- DavidReturning everything by value is the natural functional programming style, but relying on compilers to always perform return value optimization can be hazardous to performance, so passing reference parameter for output of complex data structures is often justifiable, but it has the unfortunate effect of preventing you from declaring the returned value as const to enforce single assignment.<Is this what he is talking about? class Foo { int x; } const(Foo) bar() pure { auto f = new Foo; f.x = 1; return f; } void main() pure {}
Apr 27 2012
On Friday, 27 April 2012 at 07:26:52 UTC, Guillaume Chatelet wrote:A very good article by John-Carmack about purity http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/Someone mentioned Fabrice Bellard on the reddit thread. I just noticed that F. Bellard had a link to (the old) D prog language homepage from his own tcc page http://bellard.org/tcc/ I so wish a genius like him came here and give some help on the compiler... that would be so awesome. :)
Apr 28 2012