×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

The D Language Progresses

michael posted more than 11 years ago | from the lots-of-letters-left dept.

Programming 526

xsniper writes "D made its debut here on Slashdot in August 2001. Since then, many new features have been implemented, to include: operator overloading and slew of additional functionalities. It was featured as a cover story for the February 2002 issue of Dr. Dobb's Journal, and has been ported to the UNIX environment. I encourage programmers to revisit the specs to see how Walter Bright has addressed their concerns. A copy of the compiler is also available for testing. I'm sure some would be surprised by the achievements made thus far."

cancel ×
This is a preview of your comment

No Comment Title Entered

Anonymous Coward 1 minute ago

No Comment Entered

526 comments

Steelers suck! (-1, Offtopic)

Reikk (534266) | more than 11 years ago | (#5065269)

The fucking crybabies blew it again!
HAHAHAHHAHAHAHAHAHA
Cowher sucks ass, big chinned motherfucker

Re:Steelers suck! (-1, Offtopic)

Anonymous Coward | more than 11 years ago | (#5065271)

Do they call you the Customizer?

Re:Steelers suck! (-1, Offtopic)

Reikk (534266) | more than 11 years ago | (#5065283)

Btw, first post. I am the king. Dedicated to next year's superbowl champions, the Cleveland Browns.

Re:Steelers suck! (-1, Offtopic)

Anonymous Coward | more than 11 years ago | (#5065375)


They blew it but they made it further than the Browns, who where they were by fucking luck anyway. Browns would have left at halftime against TN.

I'd have rather lost to the Browns than the Titans tho, fucking white trash redneck coach. Only coach in the NFL who lives in a trailer park.

Re:Steelers suck! (1, Offtopic)

The Bungi (221687) | more than 11 years ago | (#5065455)

Only coach in the NFL who lives in a trailer park

Wow. It must be exciting to have an NFL coach as a neighbor!

Re:Steelers suck! (0)

Anonymous Coward | more than 11 years ago | (#5065484)


Somewhat. At least they don't allow niggers or faggots to live here. Bungi = Bunghole + nigger. Queer.

first logged in post (-1, Offtopic)

mstyne (133363) | more than 11 years ago | (#5065270)

yeah you know it unf

Re:first logged in post (-1, Offtopic)

Anonymous Coward | more than 11 years ago | (#5065275)

should we call that the flip?

Re:first logged in post (-1, Troll)

Anonymous Coward | more than 11 years ago | (#5065281)

You lose; please don't try again.

YOU WIN IT (-1, Offtopic)

Anonymous Coward | more than 11 years ago | (#5065297)

actually he was the first to claim it so HE WIN IT

A WINNER IS YOU

AC Gets First Post! (-1, Offtopic)

Anonymous Coward | more than 11 years ago | (#5065274)

Hah!

More importantly... (-1, Offtopic)

Anonymous Coward | more than 11 years ago | (#5065278)

E A G L E S - Eagles!

Re:More importantly... (-1, Offtopic)

Anonymous Coward | more than 11 years ago | (#5065370)

I second that!!

Fly Eagles fly, on the road to victory.
Fight Eagles fight, score a touchdown 1,2,3.
Hit 'em low, hit 'em high, and watch our Eagles fly.
Fly Eagles fly, on the road to victory!
E*A*G*L*E*S - Eagles!

FP (-1, Offtopic)

Anonymous Coward | more than 11 years ago | (#5065288)

Wow, nice banner on opend.org - I'll be sure not to use that language.

What is D? (5, Informative)

Anonymous Coward | more than 11 years ago | (#5065294)

What is D?
D is a general purpose systems and applications programming language. It is a higher level language than C++, but retains the ability to write high performance code and interface directly with the operating system API's and with hardware. D is well suited to writing medium to large scale million line programs with teams of developers. D is easy to learn, provides many capabilities to aid the programmer, and is well suited to aggressive compiler optimization technology.
D is not a scripting language, nor an interpreted language. It doesn't come with a VM, a religion, or an overriding philosophy. It's a practical language for practical programmers who need to get the job done quickly, reliably, and leave behind maintainable, easy to understand code.

D is the culmination of decades of experience implementing compilers for many diverse languages, and attempting to construct large projects using those languages. D draws inspiration from those other languages (most especially C++) and tempers it with experience and real world practicality.

Why D?
Why, indeed. Who needs another programming language?
The software industry has come a long way since the C language was invented. Many new concepts were added to the language with C++, but backwards compatibility with C was maintained, including compatibility with nearly all the weaknesses of the original design. There have been many attempts to fix those weaknesses, but the compatibility issue frustrates it. Meanwhile, both C and C++ undergo a constant accretion of new features. These new features must be carefully fitted into the existing structure without requiring rewriting old code. The end result is very complicated - the C standard is nearly 500 pages, and the C++ standard is about 750 pages! The reality of the C++ compiler business is that few compilers effectively implement the entire standard.

C++ programmers tend to program in particular islands of the language, i.e. getting very proficient using certain features while avoiding other feature sets. While the code is portable from compiler to compiler, it can be hard to port it from programmer to programmer. A great strength of C++ is that it can support many radically different styles of programming - but in long term use, the overlapping and contradictory styles are a hindrance.

It's frustrating that such a powerful language does not do basic things like resizing arrays and concatenating strings. Yes, C++ does provide the meta programming ability to implement resizable arrays and strings like the vector type in the STL. Such fundamental features, however, ought to be part of the language. Can the power and capability of C++ be extracted, redesigned, and recast into a language that is simple, orthogonal, and practical? Can it all be put into a package that is easy for compiler writers to correctly implement, and which enables compilers to efficiently generate aggressively optimized code?

Modern compiler technology has progressed to the point where language features for the purpose of compensating for primitive compiler technology can be omitted. (An example of this would be the 'register' keyword in C, a more subtle example is the macro preprocessor in C.) We can rely on modern compiler optimization technology to not need language features necessary to get acceptable code quality out of primitive compilers.

D aims to reduce software development costs by at least 10% by adding in proven productivity enhancing features and by adjusting language features so that common, time-consuming bugs are eliminated from the start.

Re:What is D? (5, Insightful)

-strix- (154910) | more than 11 years ago | (#5065335)

I understand the goal of D, but personally I like the idea in C and C++ where the base laguage is simple (especially C) and all the complicated stuff is in libraries. It makes it easy to get started with the language and learn the more powerful stuff as its needed. It seems to be the goal of D to toss a bunch of stuff in the language itself and let the programmer sort it out. I could imagine it being a real pain for a new programmer to learn a language like that.

Re:What is D? (-1, Troll)

Anonymous Coward | more than 11 years ago | (#5065383)

That's great and all. But I disagree. Here's why: your argument is too terse.

Re:What is D? (-1, Offtopic)

Anonymous Coward | more than 11 years ago | (#5065397)

you're one to talk, terseboy

Re:What is D? (0)

Anonymous Coward | more than 11 years ago | (#5065403)

me?

Re:What is D? (0)

Anonymous Coward | more than 11 years ago | (#5065406)

y?

Re:What is D? (0)

Anonymous Coward | more than 11 years ago | (#5065392)

So it wasn't a joke?! I remember reading the Dr. Dobb's article and noticing that Walter never mentioned Java. Well, no big deal you say, Microsoft never mentioned Java when they were touting C#, but they have a market to capture. So what is this language about other than being a non-interpreted Java?

Re:What is D? (0)

Anonymous Coward | more than 11 years ago | (#5065437)

Java isn't interpreted. It's compiled to bytecode classes. Then those classes are pre-compiled to native code when run.

But whatever that's just pedantic. "Being a non-interpreted Java" would be an interesting enough feature on its own, except that GCC provides a java compiler that does just that.

Re:What is D? (1)

ObviousGuy (578567) | more than 11 years ago | (#5065475)

Java isn't interpreted. It's compiled to bytecode classes. Then those classes are pre-compiled to native code when run.

You are really talking about a specific VM when you say such a thing. It is widely known that Java VMs do not have to turn anything into machine code as a prerequisite to running Java code. It is specific implementations of the Java VM that compile everything to native code before running.

Several VMs do not compile the bytecode at all and simply run the program from an internal command tree. Several other VMs only compile frequently-used code regions into native code. Others turn the whole shebang into a giant binary executable before running.

It all depends on the VM. You can't really make such broad statements.

Re:What is D? (0)

Anonymous Coward | more than 11 years ago | (#5065394)

D sounds like a complicated Java but without as much power. There's a reason people still use C today, even though it designed with the computers of 30 years ago in mind. In an industry where the technology doubles every 18 months, for a language to last 30 years is an accomplishment.

It's also important to remember that as more ``features'' are added to languages, more overhead and complexity are added as well. I can't think of any new low level languages that have come about lately, only scripting languages and high level languages. We aren't so far removed from the processor yet that we can forget it exists.

Re:What is D? (0, Offtopic)

$$$$$exyGal (638164) | more than 11 years ago | (#5065433)

I only know one thing about D. It sure isn't my cup size! Haha! That's all for tonight folks, I'm outta here.

--naked [slashdot.org]

D? (0)

Anonymous Coward | more than 11 years ago | (#5065304)

I thought the next one was supposed to be called P. First came B, then came C, in the order BCPL, which was an older language.

Shouldn't it be 'E'? (4, Funny)

aerojad (594561) | more than 11 years ago | (#5065305)

Before C came B, before B came A, and after C came C++, ++ meaning +1, or in other words, D. So if the next language is D does C++ become C 1/2? or C.5? ...someone had to sacrifice the karma to say it

Is this a setup? (0)

Anonymous Coward | more than 11 years ago | (#5065317)

The next one is obviously DD.

Of course not (5, Funny)

autopr0n (534291) | more than 11 years ago | (#5065318)

The next language should be named C+=2!

Re:Of course not (0)

Anonymous Coward | more than 11 years ago | (#5065414)

nah it will be: (C++)++

And of course the creators will make sure that's valid code in their new language.

That's a good way to design languages I guess .. come up with a name, and then make sure the name compiles....................

Re:Of course not (1, Funny)

Anonymous Coward | more than 11 years ago | (#5065426)

Why would they do that? ++C++ is good enough for government work.

Re:Of course not (2)

T-Kir (597145) | more than 11 years ago | (#5065462)

Nooooooo!

Until the language becomes more popular and depending on the stability, etc.. it should be C/=0 !!

But then again, it could have been called E, but that letter on it's own might have evoked images of a certain little pill... remember Intel upheld it's PC (political correctness, not personal computer) brigade when they decided to "re-number" the 666Mhz P3 chip as being 667Mhz (AFAIK) so you can never tell with companies these days.

Oh well, at least *nix creators had a sense of humour when creating commands so that you could "finger user" ;-)

Re:Shouldn't it be 'E'? (2)

NoMoreNicksLeft (516230) | more than 11 years ago | (#5065344)

Thought there already was an E, for the amiga. A scripting language or something?

Off-topic: C.5 sounds cool. When I design a C knockoff language with ill-considered features, I think I will call it this, with your permission. There aren't nearly enough C-based programming languages that use C in the name, if you ask me. C/C++/ObjC/C# and the best of all, C.5!

Re:Shouldn't it be 'E'? (2, Funny)

bolverk (31238) | more than 11 years ago | (#5065409)

Actually, the Camel book says that it all started with BCPL.

The next language was simply B, and after that, C. No-one knows whether the idea was that C came after B in the alphabet or that it came after B in "BCPL", but C++ dodged the issue with a neat play on the auto-increment operator.

Perl takes up the last two letters and settles the issue. There should be no-more BCPL derivatives! :)

Re:Shouldn't it be 'E'? (new language idea!) (0)

Anonymous Coward | more than 11 years ago | (#5065421)

Hello World in "porn":

10. Jizz "Legs Spread!";

Re:Shouldn't it be 'E'? (5, Funny)

tfinniga (555989) | more than 11 years ago | (#5065457)

Actually, C++ is being post-incremented, so this iteration C++ is the same as c, but next time around it'll be great!

Re:Shouldn't it be 'E'? (1)

AvitarX (172628) | more than 11 years ago | (#5065492)

That's really funny 'cause it's true.
Probably the must insightful thing on slashdot ever.

Uh... NO! (2, Redundant)

kzinti (9651) | more than 11 years ago | (#5065489)

C++, ++ meaning +1, or in other words, D

Since when does the ++ operator increment the variable name and not its value? Duh?

--Jim

*sigh* the diffrence between editor and submitter. (-1, Offtopic)

autopr0n (534291) | more than 11 years ago | (#5065306)

From the intro page [digitalmars.com] of the D programming language specs: "It seems to me that most of the "new" programming languages fall into one of two categories: Those from academia with radical new paradigms and those from large corporations with a focus on RAD and the web. Maybe its time for a new language born out of practical experience implementing compilers." -- Michael

The quote is attributed to "Micheal" but in actuality Michael the slashdot ed wrote not a single word of the original post, rather it was the submitter, dereferenced.

WHY is it that no one seems to realize that Editors do not write even the little blurbs, aside from inserting a few sentences once in a while.

Re:*sigh* the diffrence between editor and submitt (2, Insightful)

silvaran (214334) | more than 11 years ago | (#5065331)

Probably because no one gives a flying fuck at a rolling donut.

(Stephen King, Nightmares and Dreamscapes).

Mod up (0)

Anonymous Coward | more than 11 years ago | (#5065449)

THe nazis got im.

Language overloading... (3, Interesting)

ObviousGuy (578567) | more than 11 years ago | (#5065320)

The D language is a language looking for a niche. It needs a pretty hefty runtime to support all the features that it exposes. It duplicates so many features of C++ that it's indistinguishable at first glance. And it is far from complete.

They could have saved themselves the trouble and waited for Microsoft to implement C# (which is lightyears ahead of D as far as implementation goes).

What is D? (2, Insightful)

Jason1729 (561790) | more than 11 years ago | (#5065321)

From the article, it sounds like it's C++ with the spec tightened up. If that's true, isn't this just another C++ compiler and not a new language?

Even the sample program looks like it will run in and C++ compiler, so where is D different?

Jason
ProfQuotes [profquotes.com]

Re:What is D? (2, Interesting)

pstemari (579210) | more than 11 years ago | (#5065464)

Plenty of differences, bringing across a number of restrictions from Java: No MI, No auto (i.e. stack-based) objects, etc.

Of course, eliminating auto objects means that the metaphor of resource allocation is initialization carries the same fatal flaw as Java--resources will not be released until the GC runs, and the GC doesn't know about anything like file handle limits, critical hardware resources, database transactions, and the like.

This is a life-saver! (5, Funny)

Quaoar (614366) | more than 11 years ago | (#5065322)

Now I can just tell my mom that my grade in computer programming is actually just the name of the course...she'll never suspect!

Great YAPL (0, Troll)

Anonymous Coward | more than 11 years ago | (#5065325)

yet another programming language.

I'm not holding my breath.

I can see it now ... (5, Funny)

sunwukong (412560) | more than 11 years ago | (#5065326)

Me: Boss, I think building our app with the D language will put us a step ahead of our competitors!

Boss: "D?" What happened to C? Or that other one, C++, that you're always harping about?

Me: Well, D is a further refinement of C++, and ...

Boss: Weren't you just telling me that "J" language was supposed to be the next big thing? Isn't J further along than D?

Me: Yes and no ...

Boss: And if only want to make small changes, is a "+" higher than a "#"?

[suddenly, a shot rang out]

And tomorrow.. (0)

Anonymous Coward | more than 11 years ago | (#5065328)

D LANGUAGE RELEASED

Does D work with with .net? (2, Funny)

Anonymous Coward | more than 11 years ago | (#5065334)

If not, it's obsolete already.

I'm ready for F! (0)

Anonymous Coward | more than 11 years ago | (#5065336)

I've already got the grades for it.

almost up my alley.. (5, Funny)

gothamNY (473289) | more than 11 years ago | (#5065338)

As soon as they get to F, which I am intimately familiar with, I might pick it up..

MOD PARENT DOWN!!!, -1 Redundant (0)

Anonymous Coward | more than 11 years ago | (#5065343)

Re:almost up my alley.. (0)

Anonymous Coward | more than 11 years ago | (#5065381)

"F" is already a language--a simplified version of Fortran 90.

Contracts (4, Informative)

The Bungi (221687) | more than 11 years ago | (#5065347)

Nice to see contracts [digitalmars.com] were added to D. They are one of the cooler things in Eiffel. And I'd wish they would have added them to C#.

And of course, generics [digitalmars.com] .

Now all it needs is some community support and ECMA goodness. I think it has a good chance of being widely used.

ECMA goodness? (0)

Anonymous Coward | more than 11 years ago | (#5065417)

I don't see what adding Javascript support to the language will help.

Re:ECMA goodness? (2)

The Bungi (221687) | more than 11 years ago | (#5065427)

Uhhh... ECMA doesn't just do JavaScript. I meant registering the language with ECMA so it can become standardized.

Re:ECMA goodness? (0)

Anonymous Coward | more than 11 years ago | (#5065435)

I don't understand how Javascript fits into this equation at all. It seems to me that trying to graft ECMAScript onto D is a huge hack.

Golly (2, Insightful)

xagon7 (530399) | more than 11 years ago | (#5065350)

Aside from the garbage collector and foreward declarations..

1. interfaces instead of multiple inheritance

2. Cross platform (somewhat at the moment)

3. compiled and the ability to go down to assembly

4. use of try..finally and try..except exception handling. ...damn ...smells like Object Pascal (Delphi) to me..except with "{" instead of "begin"

A Religion (5, Interesting)

bahwi (43111) | more than 11 years ago | (#5065353)

"It doesn't come with a VM, a religion, or an overriding philosophy."

Not a religion? Neither was C. Neither was Java. Neither was C++. Neither was vi. Neither was Emacs. I think we all know where this is going and that that statement should be considered pure FUD. And a new language covered in FUD is not a good thing, even if it look like a good thing(tm).

KILL HIM!!!! (1)

DAldredge (2353) | more than 11 years ago | (#5065366)

EMACS not a religion?

It has most, if not all, the qualities of a religion. :->

Blasphemer!! (4, Funny)

Billly Gates (198444) | more than 11 years ago | (#5065454)

VIM is the one true editor you pagan!

EMACS= Emacs Makes A Computer run Slow. Didn't they teach you that in seminary!

VIM is the one true religion grrr editor because its just an editor and does not conflict with the way unix does things.

May you burn in the utmost pits of hell for your statement of such blashpemic purporations.

Re:A Religion (0)

Anonymous Coward | more than 11 years ago | (#5065378)

just wait until D becomes popular among a small sect of users. it will become a religion. See, languages don't "come" with religions, their users create a religion.

I can just see the snobbish comments on slashdot:

"Well, you wouldn't have that problem if you used D"

"...and that's how you solve that C++ template problem. Of course, since I use D, I don't have to deal with it."

"Just use an interface. Oh wait! C doesn't have design-by-contract. I was thinking of D, my bad."

Whatever.

Re:A Religion (2)

The Bungi (221687) | more than 11 years ago | (#5065379)

And a new language covered in FUD is not a good thing

My memory fails me at the moment... I can't recall a language that doesn't have an associated Jihad, Syntax Crusaders, Grammar Flame Corps and a comp.lang.?.advocacy or similar Usenet newsgroup.

I think what he means is that he's not trying to fight anyone, he's not hyping it and he's not interested in any of those things.

But as with most languages, eventually it will gain a following and corresponding showdowns at the Usenet Corral. I think there's a Murphy Axiom that covers this.

Java sans VM? (1)

Dougthebug (625695) | more than 11 years ago | (#5065356)

I took a look at the sample code on the page and have too say it looks alot like Java too me. If it can do everything it says it can then cool, maybe I'll play around with it. But untill some large corperation adopts it and makes it a standard I don't think I'll have the motivation to really learn it.

Re:Java sans VM? (1, Informative)

Anonymous Coward | more than 11 years ago | (#5065446)

From the D faq:

Why should I use D instead of Java? D is distinct from Java in purpose, philosophy and reality. Here are some of the ways, in no particular order:
D has Design by Contract.
D has unit testing.
D has lightweight arrays.
D has lightweight objects.
D has enumerated types.
D has typedefs.
D has function delegates.
D has inline assembler.
D has direct access to hardware I/O ports.
D has a considerably smaller executable size (no VM needed).
D has out and inout function parameters, i.e. functions can return multiple values.
D has code execution speed that is as fast or faster than C.
D has direct support of all C types.
D has support for complex and imaginary floating point types, ASCII, unsigned types, etc.
D has arrays of bits.
D has associative arrays.
D supports direct interfacing to C and operating system APIs.
D has version control as part of the language.
Debug D programs with common, existing C debuggers.
D has a minimal learning curve for C programmers.
D has turn-offable array bounds checking.
D has support for assert()s and debug statements, and other tunable runtime error checking.
D has no need for external C functions.
D's full library source means complete control over generated app.
D's floating point is the best available on the target machine.
D has strings implemented as arrays, not objects.
D does not do dynamic class loading.
D works with your other existing dev tools (make, linkers, debuggers, etc.)
Java is designed to be write once, run everywhere. D is designed for writing efficient native system apps. Although D and Java share the notion that garbage collection is good and multiple inheritance is bad , their different design goals mean the languages have very different feels.

Re:Java sans VM? (1)

WetCat (558132) | more than 11 years ago | (#5065469)

Looks promising... but
On my opinion, garbage collection is generally bad, but probably it's because i spent a lot
of time on projects in which real time was important...
The language should allow both GC and non-GC
style of programming.
That's it. Then you'll be able to polish
the critical real-time sections and turn off
GC for them and leave GC for other parts
for which the execution times are non-essential.

Re:Java sans VM? (0)

Anonymous Coward | more than 11 years ago | (#5065498)

Actually, you can disable garbage collection in D for parts of your code that you need to run faster. Additionally, the GC can be replaced with a different sort if need be.

Doubles are good... (2)

cperciva (102828) | more than 11 years ago | (#5065359)

now where are the library functions?

One of the changes since the last time we heard about D is the addition of floats and doubles (32 bit and 64 bit floating-point types, respectively) in addition to the "extended" type (as much precision as available). This is absolutely a Good Thing -- extra precision can be just as bad as insufficient precision, and adding these types allows people to ensure that they're using the right precision.

It would have been really nice to see the same thing for the math library functions; as it is, the only sin function is an extended -> extended function. IEEE doesn't require determinism on transcendental functions the way it does for arithmetic functions (which, I'm guessing, is why it isn't provided here), but there are times when it would be quite helpful.

Remember, there are times when getting the right wrong answer is more important than getting the right answer.

The grade the inventor got for the language? (0)

Anonymous Coward | more than 11 years ago | (#5065371)

Legend has it that C was named after the grade that Brian Kerighan and Dennis Ritchie got for it after they submitted an early spec as a project for a programming languages course.

Is it the same for the 'D' language, I wonder? =)

Re:The grade the inventor got for the language? (-1, Troll)

Anonymous Coward | more than 11 years ago | (#5065401)

Actually C was named after their favorite sexual organ: CLIT

D is named after its creator's favorite organ: DICK

I'm personally holding out for T.

HA HA HA

Re:The grade the inventor got for the language? (0)

Anonymous Coward | more than 11 years ago | (#5065418)

I'm personally holding out for T.

Testicles?

no value classes == no go (4, Insightful)

g4dget (579145) | more than 11 years ago | (#5065373)

Creating object instances on the stack. In D, all class objects are by reference. This eliminates the need for copy constructors, assignment operators, complex destructor semantics, and interactions with exception handling stack unwinding. Memory resources get freed by the garbage collector, other resources are freed by try-finally blocks.

The reason why C++ is so popular nowadays for numerical, engineering, graphics, and scientific applications is that it supports value classes: classes allocated on the stack, passed around by copying, and represented without any additional overhead. They are used for things like points, points with small coordinate ranges, vectors, 3D rotation matrixes, rectangles, and lots of other types. I don't believe any systems or applications language for which efficiency is a consideration can do without them.

Why the creators of D think that providing value classes is a problem, I don't understand. Sure, C++ fell all over itself with initializers, but lots of other languages have managed just fine. Pascal has value classes, and so does C#. JavaGrande recognized the lack of value classes as one of the biggest deficiencies in the Java language.

And it's not something a compiler can just optimize automatically, no matter how good it is: the use of value classes has user visible effects on interfaces and data structures.

Re:no value classes == no go (0)

Anonymous Coward | more than 11 years ago | (#5065393)

That's what structs are for. It's cleaner to separate structs (data) and classes (objects). In my opinion.

Re:no value classes == no go (1)

ergo98 (9391) | more than 11 years ago | (#5065445)

Structs and classes are the same thing in C++ apart from the fact that the default visibility of structs are public, whereas classes are private.

Man I miss C++: I've been so caught up in database and higher level language stuff. C++ is definitely my favourite language.

Re:no value classes == no go (0)

Anonymous Coward | more than 11 years ago | (#5065483)

wow, you crystallized my thoughts exactly.

Re:no value classes == no go (0)

Anonymous Coward | more than 11 years ago | (#5065415)

The reason why C++ is so popular nowadays for numerical, engineering, graphics, and scientific applications is that it supports value classes: classes allocated on the stack, passed around by copying, and represented without any additional overhead.
You think that all that stuff you mentioned doesn't have overhead? C++ just hides all the overhead, which may or may not be the best for your application. If you use C, at least you know what's going on behind the scenes. If you're going to use C++ for the above mentioned reasons, you'd might as well use Java.

Re:no value classes == no go (2)

Anonymous Brave Guy (457657) | more than 11 years ago | (#5065482)

You think that all that stuff you mentioned doesn't have overhead? C++ just hides all the overhead, which may or may not be the best for your application.

No. In C++, calling a non-virtual method involves no indirection. In languages such as Java, calling any method involves at least one level of indirection, and if you're calling that method all the time but it doesn't actually get overridden in derived classes, that's a potential performance killer.

What about structs? (2)

Ghoser777 (113623) | more than 11 years ago | (#5065488)

I don't know much about D, but if it supports structs, isn't that essentially the same thing as a value class (save the instance methods and such)?

I personally prefer passing pointers instead of having to remember if the object is being copied behind the scenes or is the original object because I used an ampersand (pass by reference). If I wanted to make a copy, I'd call the "copy" instance method and poof, one has a copy. If I'm worried about my objects being changed, then just make the object immutable.

But that's just me,
F-bacher

so it's like.. (0)

russellh (547685) | more than 11 years ago | (#5065382)

so it's like C++ but without the stuff that gives compiler writers keyboard indentations on their foreheads.

It must be said... (-1)

SlashdotTroll (581611) | more than 11 years ago | (#5065411)


I earned an F in C...

an F in C#

an F in D

I was verry depressed...until I read about MCSE credentials. I got one in less than 1 month of school and only taking "tests" on weekends for only 2 hours. I received my Microsoft certification and was pleased by my success.

I learned HMTL as I tested for my MCSE credentials. Find me, in Yahoo! Personals!

THANKYOU MICROSOFT!

Thou shalt use objective-C (4, Interesting)

jpt.d (444929) | more than 11 years ago | (#5065422)

Maybe off topic, but 'yet another language'? Where c++ may do too much: Templates Operator Overloading Go back to a simpler time... then giveth objective C! It has the 'named' parameters (in its own way), arbitrary message handling (methods to everybody else), hell even a traceback! Not even java has operator overloading, there maybe a reason.... (reduce ambiguity?) We need simpler languages, not progressively 'general purpose' languages... a 'CISC' language vs. 'RISC' lange... Objective C is just that... simple.

So it's... Java. (-1)

Seth Morabito (2273) | more than 11 years ago | (#5065432)

I fail to see how this language is significantly different than Java, except for the addition of templates. Apparently, if you call your runtime a VM, you're bad, and if you call it a runtime, you're good!

Re:So it's... Java. (2)

The Bungi (221687) | more than 11 years ago | (#5065447)

Every time someone comes up with a new GC'ed language that has C-ish syntax and a VM someone has to say it's a Java rip-off. Look at the specs, understand the differences, give it a rest.

The difference between a runtime and VM (2, Insightful)

ObviousGuy (578567) | more than 11 years ago | (#5065452)

A runtime is a binary library that exports certain functions. The Win32 and glibc runtimes are a couple that Slashbots are probably somewhat familiar with. They have specialized routines that facilitate some kind action that the language itself does not directly support.

A VM is a completely different beast. It is a complete runtime environment for your program. Whereas a program that uses a runtime is typically compiled into machine code, a program that uses a VM is typically compiled at runtime from source (Perl) or parsed into memory from bytecode (Java).

It has become fashionable to call runtimes "VMs", especially in the Unix world where multiple APIs are supported on the same kernel, but it is a misnomer. (You'd expect the pedantry that is so prominent in the Unix culture to correct this, but I digress.)

D Language (0)

Anonymous Coward | more than 11 years ago | (#5065440)

A
B
C
[D]
E
F

Almost there! Only two more innovations and the developers will finally have run out of alphabetic excuse for their shitty software...oh wait.

D has already been taken... (1)

fidget42 (538823) | more than 11 years ago | (#5065451)

TeleSoft/Alsys/Aonix have had, for quite some time, a language called D that is used to describe the operation of events and manage dialogs (D = dialog) in TeleUSE. Its been around for 10 years, so so.

D Language from early 80's (5, Interesting)

MichaelCrawford (610140) | more than 11 years ago | (#5065463)

A friend of mine at CalTech named Mike Roberts created a language called D when he was in high school, because his parents wouldn't shell out for a BASIC compiler for his DOS PC. We were both in the high school class of '82 so this would have been around '81 or so.

Unfortunately, his original D compiler was written in BASIC, which he ran interpreted, so compilation was slow. In order to speed up the interpreter, he used the sort of "source code compression" that is illustrated at Chuck's Power Koding [wpi.edu] - removing any unnecessary spaces, using long source lines and having as few actual lines as possible.

(This kind of ancient interpreter didn't use byte codes - if you looped ten times, you'd parse the loop's source code ten times!)

We suggested that he rewrite his D compiler in D so he could get it to compile faster. He decided to do that, and worked really hard at it but got it working after some time.

As a complication he improved the language, but it meant that his old compiler wouldn't compile the newer kind of D code. I think what he did was make two revisions of the D-written compiler, one written in the old syntax that would understand the new, but could be compiled by the BASIC version and then an update that was written in the new D that could compile itself.

It was a sort of mix of Pascal but with lots of convenient stuff like BASIC string handling mixed in. I don't think the language would have made any computer scientists happy - D was designed to suit Mike's personal style.

He used it at first to write an Adventure-style game (a text adventure) that he and another friend designed.

Later he wrote a text-adventure compiler, where he could write a specification file for a text adventure, process it, and an executable file for a text adventure would be generated.

He didn't have to get a real summer job because he was selling these generated games to game software publishers!

Mike was an amazing programmer. He taught me a lot of what I knew about C and x86 assembly early on.

This was all on 640 kb 8088 DOS PC's that were outfitted with whizzy 10 MB hard drives. The students in the computational physics lab were expected to use the hard drives only during class, and to store their personal files on floppy when we weren't actively working at the PC's.

So his D language compiler would fit on a floppy. The old 5 1/4" inch kind, that really flopped. I think they stored 360kb.

I wonder whether we would all be better off if programmers designed their own personal languages just to suit their own personal styles. Yes, there would be portability problems but wouldn't we be more productive?

I got my own chance to hack a whacky compiler. This was a team effort though and I was just a contributor. Star Sapphire Common Lisp [webweasel.com] manages to run a complete common lisp environment with MicroEmacs on a 640kb DOS 8088 PC.

The way it does that is by swapping to an 8 MB backing store file. But the 8088 doesn't have an MMU, you say? That's right - we operated the virtual memory manually, by writing C code that would explicitly get or put each lisp cons from or into the VM system with a function call.

It made it ... interesting ... to operate on complicated data structures. I designed the implementation of the lisp scoping rules, among other things.

Oh yeah, and I was the source code control system and project manager. We didn't have a network - networks were way too expensive in 1986. What I did was wait until late when all the other programmers went home, copy the changes off all their machines onto floppy, integrate them on one machine and then copy the new release onto everyone's PC.

Kids these days. Don't know when ya got it good.

No more excuses! (0)

Anonymous Coward | more than 11 years ago | (#5065473)

"Not having the right programming language" is a poor excuse.

It isn't the programming language, it's all the shortcomings of developers that cause software to be poor. Only some will receive the TAO, it is upto those few to write it down into software. Linux has the TAO. GNU HURD is waiting for the TAO. Microsoft's .NET is trying to mimick the TAO, but there can be only one and it will be evident, through their failures, that they lack the TAO.

In freedom, you don't find the TAO, the TAO finds you!

Quote from Dilbert (4, Funny)

SAN1701 (537455) | more than 11 years ago | (#5065474)

As I recall...

Dilbert: No! C is not the grade of the project. It's the programming language I'll use on it.

PHB: (After a few seconds) OK. But why don't you program at least with B?

The evolution of languages (5, Interesting)

DarthWiggle (537589) | more than 11 years ago | (#5065476)

You know, I've spent a lot of time thinking about the proliferation of languages. We have Assembly. We have C. We have C++. We have Java. We have Cold Fusion, PHP, and ASP.NET. We even have iHTML or whatever that bastard offspring of HTML was called.

What's the purpose of creating entirely new languages? Is a new language even entirely new, or is it an evolution of older languages incorporating new concepts and methodologies? Or is the creation of a new language just a way of leaving a mark? Or, even worse, is it a manifestation of that damnable desire to start from scratch every time? (I'm afflicted by it... most coders I know are afflicted by it...)

Here's what I'd like to know, in my limited knowledge of languages: What languages out there are truly modular? Are there any languages that encompass basic logic principles and which are then able to be augmented by blackboxed modules? So, if you had a language that needed string concatenation, you could whip up a string concatenation module that would then become part of the language.

Now, I'm walking a semantic line here, because you can presumably do all that by writing header files, includes, classes, etc. that contain new logic within the structure of the language. But what I mean is a language that by its nature is abstracted and modular, even to the point where the syntax of, say, control structures could be modified in a module?

And, if the answer to my question is "Well, hell, you can do that in C!" then why do we need to bother writing a new language? Is it just to keep things fresh and interesting?

It just seems that with all the many languages I've learned and used, there's very little that I can think of that one language can do that another language can't. Where doing something in one language is harder than in another because the structure of the language makes it awkward, maybe that points to a language that needs to be made obsolete.

I guess the root question I'm asking is: Are there any truly novel languages out there, or are they all just variations on a common theme, with shared shortcomings and much duplication of effort?

Be gentle. :)

STOP Whinging about "YA Programming Lang" (0)

Anonymous Coward | more than 11 years ago | (#5065480)

Go to this page and take a look for yourself how many programming languages are in use today. Stop whinging about the "no need" for another language. It's almost as bad as those groups who run around telling other people what not to do even though they do what they do in their own corner of the world and don't bother anyone.

http://directory.google.com/Top/Computers/Progra mm ing/Languages/

ABC ABEL Ada ADL Aleph Algol 60 Algol 68 APL AppleScript ASP Assembly Awk BASIC Befunge BETA Bigwig Bistro Blue Brainfuck C C++ C-sharp Caml Cecil CHILL Clarion Clean Clipper CLU Cobol CobolScript Cocoa Comparison and Review Compiled Component Pascal Concurrent Constraint Curl D Database Dataflow Declarative Delphi Directories DOS Batch Dylan E Eiffel ElastiC Erlang Euphoria Forth Fortran Frontier Functional Garbage Collected Goedel Hardware Description Haskell History HTML HTMLScript HyperCard ICI Icon IDL Imperative Intercal Interface Interpreted Java JavaScript LabVIEW Lagoona Language-OS Hybrids Leda Limbo Lisp Logic-based Logo Lua m4 Markup MATLAB Mercury Miranda Miva ML Modula-2 Modula-3 Multiparadigm Mumps Oberon Obfuscated Object-Oriented Objective-C Objective Caml Obliq Occam Open Source Oz Parallel Pascal Perl PHP Pike PL PL-SQL Pliant POP-11 Postscript PowerBuilder Procedural Prograph Prolog Proteus Prototype-based Python REBOL Reflective Regular Expressions Rexx Rigal RPG Ruby S-Lang SAS Sather Scheme Scripting Self SETL SGML Simula Sisal Smalltalk Snobol Specification SQL Squeak T3X Tcl-Tk Tempo TOM TRAC Turing UML VBA
VBScript Verilog VHDL Visual Visual Basic Visual DialogScript Visual FoxPro Water Wirth XML XOTcl YAFL Yorick

The 'g' in 'whinge' (0)

Anonymous Coward | more than 11 years ago | (#5065487)

How does one pronounce that word?

winj?

wain?

'whinging' is pronounced:

win JING?

WAIN ing?
Load More Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...