Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

Let's Code in D

Name: Anonymous 2012-02-02 9:08

Hey /prog/, why aren't you writing D, God's gift to programmers? Let's get this ball rolling.

import std.stdio;

template factorial(int n)
{
    const factorial = n * factorial!(n-1);
}

template factorial(int n : 1)
{
    const factorial = 1;
}

void main(string[] argv)
{
   writeln(factorial!(10));
}

Name: Anonymous 2012-02-02 9:13

Wat?
C# looks more practical.

Name: Anonymous 2012-02-02 11:27

>>1
C++ template syntax is better.

Name: Anonymous 2012-02-02 11:28

also:
>D
GC
GC is shit.

Name: Anonymous 2012-02-02 11:55

>>1
And that's what we get for pissing off jahwe with all the jew threads.

Name: Anonymous 2012-02-02 12:11

>>3
It's also more buggy. C++ templates. The only fucking thing on the planet where the same fucking code won't link during the build.

Name: Anonymous 2012-02-02 12:12

>>3
But of course you would only know this if you worked as a computer programmer for a living.

Name: Anonymous 2012-02-02 12:36

Gambit-C is better.

Name: Anonymous 2012-02-02 12:39

Go is the only relevant and well-designed higher-level C-like language. This thread serves no purpose.

Name: Anonymous 2012-02-02 12:51

why aren't you writing D, God's gift to programmers
D is a slightly better language than sepples but still horrible. If I can choose any language, even an unpopular one, why the hell would I choose D over haskell, ruby, scala, ocaml, lisp or anything else that is actually pleasant to use?

Name: Anonymous 2012-02-02 13:14

>>10
>Native compiled code (for you kids, that means it's faster than your toy interpreted languages)
>Clean syntax
>Statically typed with type inference
>Astronomically better template syntax than other C++-alikes
>Combines the power of C++ template metaprogramming with compile-time reflection utilities
>Out-of-the-box support for contract programming
>Support for purely functional programming
>Vastly improved and simplified OOP

I could go on... but why don't you check it out for yourself?
http://www.d-programming-language.org

Name: Anonymous 2012-02-02 13:35

>>11
It's pure shit. Not as bad as Haskell or Lisp, but it's shit.

Name: Anonymous 2012-02-02 13:36

I'll give it a try someday. I hate what C++ has become.

Name: Anonymous 2012-02-02 13:41

>>11

Native compiled code
You do realize only 2 of the 5 languages I mentioned don't compile to native code? And it's not like they're the only languages better than D.


Clean syntax
trololol
C syntax (not that nice to begin with) with all kinds of crap bolted on, you call that clean?


Statically typed with type inference
3 of the languages I mentioned have far superior type inference.


c++ vs D
Comparing to sepples makes no sense. Sepples is used because it's ubiquitous, not because it's a good language. If you want to replace it with an unpopular language you have to compete with other unpopular alternatives.


Out-of-the-box support for contract programming
Oh ye, Eiffel is also better than D, thanks for reminding me.


Support for purely functional programming
I say lisp, haskell, scala, ocaml and lisp are better than D and your counter argument is functional programming support. Are you fucking kidding me?


Vastly improved and simplified OOP
Improved OO? Any new OO language that doesn't adhere to the uniform access principle can suck my ass.

Name: Anonymous 2012-02-02 13:48

>>14
Learn D, and begin your ascension to The Truth.

Name: Anonymous 2012-02-02 13:58

Name: Anonymous 2012-02-02 14:01

>>16
What the hell are you talking about. The point is they can be compiled. Also having an interpreter is a huge advantage, not a disadvantage you enormous faggot.

Name: Anonymous 2012-02-02 14:02

>>17
just learn d bro. you wont understand until you learn d.

Name: Anonymous 2012-02-02 14:06

D is fucking shit, and so are Lisp and Haskell.

Name: Anonymous 2012-02-02 14:22

>>18
If I didn't care about the overhead of a garbage collector, I'd use a higher-level language.

Name: Anonymous 2012-02-02 14:23

>>20
gc can be turned off entirely bro. this isnt java.

Name: Anonymous 2012-02-02 14:34

>>14
The point is that D is as ubiquitous as C++, while being both more powerful, and just as fast.

Name: Anonymous 2012-02-02 14:41

D is as ubiquitous as C++
That's not how it works. You can't just make stuff up.

Name: Anonymous 2012-02-02 15:38

>>23
You're right, I didn't say that correctly. D is *designed* to be as ubiquitous as C++, meaning that anywhere you use C++, you can use D instead and have just as powerful (if not more so) tools at your disposal.

That's exactly what C++ has going for it. It's fast, and it can do anything. D is fast, it can do everything C++ can, and it grossly simplifies or cleans up some places in C++ where things can get really ugly. Nobody LIKES writing something like std::vector<std::shared_pointer<int*>> vec = std::vector<std::shared_pointer<int*>> (); (which in D, assuming shared_pointer and vector are classes, would be auto vec = Vector!(shared_pointer!(int*))).

Name: Anonymous 2012-02-02 15:42

>>24

what do the !s mean

Name: Anonymous 2012-02-02 15:43

>>25
They specify the template arguments. So std::vector<int> is equivalent to D's Vector!(int).

Name: Anonymous 2012-02-02 15:50

ONE WORD C++11 THREAD OVER

Name: Anonymous 2012-02-02 15:50

I've been thinking about trying out D. We'll see. Also,

Can I #define?
Are there pointers?

Name: Anonymous 2012-02-02 16:31

Frst of all, templates are disgusting; get some real data structures. Second of all Haskell is fast. Not C fast but god damn it laughs at Erlang and Java and other higher-level languages, not to mention pieces of shit like Python and Ruby. God damn.

Name: Anonymous 2012-02-02 16:32

>>29
Haskell is fucking shit.

Name: Anonymous 2012-02-02 17:02

>>30
What's the matter chief? Are monads a bit too much for you?

Name: Anonymous 2012-02-02 17:17

>>1
does D supports Roles ? ( i.e. class composition)
has D compilers for solaris, bsd and unix?

Name: Anonymous 2012-02-02 17:17

>>31
too much of pointless intellectual masturbation they are

Name: Anonymous 2012-02-02 17:19

>>24
"Ubiquitous" means that it is everywhere (i.e., immensely popular), not that it can do everything (maybe you're confusing it with "omnipotent").

Name: Anonymous 2012-02-02 21:17

>>33
mental midget.

Name: Anonymous 2012-02-02 23:31

>>33
2deep4u

Name: Anonymous 2012-02-02 23:42

>>32
Roles are interfaces. D supports interfaces.

>>34
No confusion. I meant what I said. D is designed to be ubiquitous, i.e., designed to be popular and used by a large number of different people with different views on how to write software.

Name: Anonymous 2012-02-03 0:31

>>37
Roles are interfaces.
No, they're not.

Name: Anonymous 2012-02-03 4:45

>>33
This is programming. Math should have a big part, and it does so very nicely in Haskell.

Name: Anonymous 2012-02-03 5:16

designed to be popular and used by a large number of different people
I assumed you were confused because this means absolutely nothing. Almost every language is "designed to be popular".
It's only relevant whether they are popular, which D is not by any stretch of the imagination.

Name: Anonymous 2012-02-03 6:12

Name: Anonymous 2012-02-03 8:10

>>40
It means absolutely everything. C++ was also designed to be used by many different types of people; it was designed to be everything to everyone; it was designed to be ubiquitous, to be everywhere and used for everything. D follows this same philosophy and design; hence, it is designed to be ubiquitous.

Name: Anonymous 2012-02-03 8:22

>>40
Almost every language is "designed to be popular".
Except Lisp and Haskell, which are designed to be unusable shit.

Name: Anonymous 2012-02-03 18:39

>>33
This is programming. Math should have a big part, and it does so very nicely in Haskell.

Don't change these.
Name: Email:
Entire Thread Thread List