Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

Comment You know what's sad? (Score 1) 1

The reason IE8 is the only browser that can crack the clues is because they're using server-side user agent sniffing. A quick fiddle with the User Agent Switcher addon in Firefox fixes that.

But you know the most pathetic part? The site doesn't work properly with IE8, requiring the user to explicitly disable compatibility mode first.

Comment Re:D is nice, but... (Score 1) 404

Programming in D is nice, but the situation is a bit annoying.

1. Tango vs Phobos. Phobos is the official standard library, but it seems most use Tango. Phobos is also pretty low level compared to Tango.

This is somewhat alleviated in D2 via a shared core runtime. The problem is more or less that which library you use is based on the task at hand, and personal choice. There have been numerous attempts to merge them, or kill one off, and they've never succeeded because people don't want to give up the library they (legitimately, for their circumstances) see as better.

For D1, your best bet is probably to give Tango + Tangobos (which is Phobos implemented on top of Tango) a shot. For D2, there are efforts to fix the situation.

2. The reference compiler dmd is 32bit only, gdc is outdated and abandoned, and ldc is still alpha status and has missing features. Ldc is quite promising though.

Yeah; I think LDC is the future of D. We'll just have to be patient. :)

3. D2 is maybe the biggest issue. It has very useful features, such as partial C++ compatibility, but D2 is a moving target and practically no library supports it. It's also unknown when or if ever D2 will become stable. I haven't seen much discussion about it in the newsgroup either.

That's because it's not finished. You can't complain that an experimental version that changes on a regular basis doesn't have library support.

As for when D2 will be finished, I deeply suspect it will be like it was with D1: Walter and the community will get fed up with it as a moving target, draw a line in the sand and *boom* finished; let's start on D3.

Comment Re:High performance of C++ equal to D??? (Score 1) 404

http://www.digitalmars.com/d/1.0/memory.html#stackclass - Objects in D are not always allocated on the heap.

No, but making it an attribute of the class where they are allocated makes no sense at all. A general-purpose class cannot be defined to use stack allocation, and because D doesn't support multiple inheritance I can't mix the trait in without reimplementing it for each class I want to use that way.

In fact, you can force a class to be scope allocated by putting "scope" at the front of the class declaration. This doesn't remove the requirement for 'scope' at the allocating statement; merely makes it mandatory.

Note that you cannot use this to give a class value semantics; if you could, you would open the door to the slicing problem. By making it a property of the allocating context, you avoid that.

Comment Re:High performance of C++ equal to D??? (Score 1) 404

But the syntax is all wrong. It's easy to forget that an object is allocated as 'scope', because the syntax is the same as in heap allocation.

And the template system is D is exactly the same as in C++. The differences are superficial, only in syntax. D's templates is a Turing complete system, just like in C++.

I guess that means the differences between C++ and assembler are superficial, only in syntax. After all, anything you can compute in C++ you can compute in assembler.

Ease of use is definitely overrated.

Comment Re:High performance of C++ equal to D??? (Score 1) 404

As you already say, if you are very concerned about performance in a situation with lots of small objects you can use structs. Simply ignoring structs because you are too lazy to use them does not make D slow. With a bit of experience and a few rules of thumb it's not hard to choose.

But structs do not have the same treatment as classes.

Your point is... what, exactly? They're for completely different purposes; of course they're treated differently. Otherwise, we'd only have classes or structs, not both.

I think maybe you're talking about what is called "scope" now. It allocates the memory for the class on the stack. Yeh, it doesn't cover every possible use case of by-value classes, but it can be a nice optimization.

And a heck of lot difficult to spot. At least, in C++, it's obvious what is a pointer and what it is not.

This is a valid concern, but I can't see what this has to do with the particular quoted part of the gp's post. He's pointing out that scope is useful, and you're complaining about not being able to tell if an arbitrary identifier has value or reference semantics. Huh?

That said, just because something doesn't have a star out the front in C++ doesn't mean it's a value type; I've seen some truly terrifying abuses of operator overloading. At least in D, it's trivial to find out: stick in a pragma(msg, whatIs!(x)) and bob's your uncle (note: whatIs is not in the standard library, but I've written similar templates before without much trouble.)

Yes you use structs when you want an efficient aggregate value type. Classes and structs have different semantics in D. It's pretty easy to choose once you get the hang of it. If you are likely to want to put virtual functions on the thing, make it a class. If you want to pass lots of them around by value, make it a struct. If you can count on your fingers how many instances you will have, make it a class -- the hit from allocation won't matter. There is some gray area in-between, granted, but in practice it's usually pretty clear, and the benefit is that you do completely eliminate the slicing problem by going this route. If you really can't decide you can also write the guts as a mixin and them mix them into both a class and a struct wrapper. Or just write it primarily as a struct, and aggregate that struct inside a class. The use cases that are left after all that are pretty insignificant.

Why do all that? no thanks. C++ is much better in this regard.

Yeah, why bother designing your program before you write it? After all, maybe you want to make your 16-byte vectors into classes, or turn GUI widgets into value structs!

Honestly, I'm amazed every time I see this argument. Let's try it from the other direction: Java seems to do pretty well without "plain old data" structs; clearly, you don't need structs to write a program. If you really don't want to have to engage your brain, just pretend structs don't exist.

D's template system has gone far beyond C++'s.

Nope. It hasn't.

It's even far beyond what C++0x is going to be.

Nope, it isn't.

Alias template parameters

C++ has typedef.

Yeah, so this combined with the 'auto' comment before lead me to believe you don't actually know what you're talking about.

Tell me, how do you typedef a function in C++? Or a string value?

template mixins

Mixins are bad from a design standpoint.

I personally think you're wrong, but that's an opinion and not a valid argument. :)

static if

C++ can do it with templates.

template isLowerAlpha(char c)
{
static if( 97 <= c || c <= 122 )
const isLowerAlpha = true;
else
isLowerAlpha = false;
}

And I can get even more complex from there. Maybe you could match D in terms of ability (which I doubt,) but you can't argue that it's anywhere near as intuitive or simple.

a host of compile-time introspection facilities, the ability to run regular functions at compile-time

And introduce big complications in the code.

C++ is just one giant complication. Hell, programming is complicated. First of all, introspection is invaluable; it means you can write templated types and functions that actually know about their type parameters. CTFE (compile time function evaluation) is also brilliant because it means you can move computations into the compile step. Yes, it adds complexity to the code, but the difference is minimal. Especially when the alternative is to either write and manually choose between a shitload of marginally different templates in the first case, and just moving that complexity to runtime in the second.

type tuples

Boost provides them.

Really? So Boost can do this, then?

template dump(Ts...)(Ts values)
{
foreach( i,value ; values )
writefln("values[%d] = %s", i, value);
}

Note that the above code expands at compile-time, and works for an arbitrary number of arguments.

D metaprogramming is to C++ metaprogramming as C++ OOP is to OOP in C. It takes a technique that the previous language begrudgingly permitted and turns it into one that is actually supported by the language.

Nope. The C++ and D template type system are exactly the same.

I wasn't aware there was a special type system for regular code and templates in C++. I know there isn't in D. But saying the type systems in D and C++ are the same is just wrong: transitive const, immutability, sharing (coming soon).

In fact, if you ask Walter, all the template tricks in D are done using the C++'s Turing complete template system.

So I assume you could, with Walter's permission, post both your question and his response somewhere? Unless, of course, you're psychic.

You strike me as one of the C++ programmers who irrationally hates D because it's trying to improve upon and replace your favourite language, but you haven't spent enough time using D to actually be able to make an informed choice. That, or your knowledge of it is so out of date that it's no longer applicable.

You're more than welcome to your choice, of course. Just don't go around spreading FUD about D, please.

Comment Re:Runtime design (Score 1) 404

If I had to guess, I'd say it's because that would involve introducing another function call between D and C. Currently, a lot of the C library functions exposed in D are just extern(C) declarations, so code is calling them directly. Placing a C wrapper around those calls would slow things down (and Walter doesn't like slow.)

Incidentally, there's a tool Walter wrote called htod which actually runs a C or C++ header through the C++ compiler and then converts the internal AST into a D header. Sadly, it runs it through the DigitalMars compiler, and DMC doesn't run on mac. :P

Input Devices

Avoiding Wasted Time With Prince of Persia 507

Zonk pointed out an interesting video presentation by Shamus Young on the importance of the new Prince of Persia, calling it the most innovative game of 2008. Young brings up the fact that many of today's games punish failure by wasting the player's time; being sent back to a check point, the beginning of a level, or sometimes even further. This cuts into the amount of time players have to enjoy the meat of the game — the current challenge they have to overcome. Unfortunately, as Young notes, modern controllers are designed for players who have been gaming since they were kids, and have evolved to be more complicated to operate than an automobile. The combination of these factors therefore limits or prevents the interest of new players; a problem Prince of Persia has addressed well through intuitive controls and the lack of punitive time sinks.
The Courts

RIAA Sues 19-Year-Old Transplant Patient 663

NewYorkCountryLawyer writes "Just when you think they've reached rock bottom, it seems the RIAA always finds room to sink a little lower. This time they've sued an innocent, 19-year-old transplant patient, hospitalized with pancreatitis and needing islet cell transplants. Although the young Pittsburgh lady claims that she did not infringe any copyrights, she failed to answer the complaint in time, and a default judgment was taken against her. A Pittsburgh area lawyer has stated that he will represent her pro bono and make a motion to open up the default."
Censorship

Nation-Wide Internet Censorship Proposed For Australia 424

sparky1240 writes "While Americans are currently fighting the net-neutrality wars, spare a thought for the poor Australians — The Australian government wants to implement a nation-wide 'filtering' scheme to keep everyone safe from the nasties on the internet, with no way of opting out: 'Under the government's $125.8 million Plan for Cyber-Safety, users can switch between two blacklists which block content inappropriate for children, and a separate list which blocks illegal material. ... According to preliminary trials, the best Internet content filters would incorrectly block about 10,000 Web pages from one million."
Communications

Interplanetary Internet Tested In Space 124

Anonymous Coward writes "After Vint Cerf planned the Interplanetary Internet, there's a press release saying that the Interplanetary Internet is now being tested in space, using the Bundle Protocol developed by the Delay-Tolerant Networking Research Group. There's a conference paper with details on the testing too. These guys were previously the first to test IPv6 in space. Now they've found something with even fewer users than IPv6 to play with!"
Microsoft

Microsoft Blesses LGPL, Joins Apache Foundation 425

Penguinisto writes "According to a somewhat jaw-dropping story in The Register, it appears that Microsoft has performed a trifecta of geek-scaring feats: They have joined the Apache Software Foundation as a Platinum member(at $100K USD a year), submitted LGPL-licensed patches for ADOdb, and have pledged to expand their Open Specifications Promise by adding to the list more than 100 protocols for interoperability between its Windows Server and the Windows client. While I sincerely doubt they'll release Vista under a GPL license anytime soon, this is certainly an unexpected series of moves on their part, and could possibly lead to more OSS (as opposed to 'Shared Source') interactivity between what is arguably Linux' greatest adversary and the Open Source community." (We mentioned the announced support for the Apache Foundation earlier today, as well.)

Comment Re:The most likely reason (Score 5, Informative) 936

I'm a network admin for an ISP, and we've been recommending UPSs for the frequent-reboot routers that our customers have. We've found that routers (especially Linksys) have a real problem with power fluctuations that most other systems and devices don't notice. A decent line-conditioning UPS might solve your problems, but a cheap one will suffice.

Also, could be the device is running out of memory, if your ISP is changing the properties of your connection a lot, or you might have a duplex issue causing a lot of retransmissions. . .

Just a couple of thoughts :)

The Courts

Submission + - Judge bars RIAA prez from testifying in P2P case (arstechnica.com) 3

Eskimo Joe writes: A federal judge surprised observers in the Captiol v Thomas file-sharing trial today by barring RIAA president Cary Sherman from testifying. 'After a brief recess this afternoon, plaintiffs' counsel Richard Gabriel and defendant's counsel David Toder made their cases before the judge as to the relevance of Sherman's testimony. Toder argued that Sherman's testimony was not relevant to the question at hand, the fact of whether Thomas was liable for copyright infringement. Gabriel said that Sherman would be able to tell the jury why this case was significant, and more importantly, describe the harm the RIAA believes piracy has caused to the music industry. "I don't want to turn this case into a soap box for the recording industry," Toder argued in response.' Testimony wrapped up today with closing arguments expected Thursday morning.

Slashdot Top Deals

Happiness is twin floppies.

Working...