Follow Slashdot blog updates by subscribing to our blog RSS feed

 



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.

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.
Censorship

Submission + - Burma Shuts Down Internet 3

Hugh Pickens writes: "MIT Technology Review reports that in the aftermath of pro-democracy protests, Burma's military rulers have physically disconnected their country from the internet:

Last week — after images of the beatings of Buddhist monks and the killing of a Japanese photographer leaked out via the Internet — Burma's military rulers took the ultimate step, apparently physically disconnecting primary telecommunications cables in two major cities, in a drastic effort to stop the flow of information from Burma to the rest of the world. It didn't completely work: some bloggers apparently used satellite links or cellular phone services to get information outside the country.
One Burmese blogger reported last week that "Myanmar main ISP has been shut down by so-called "maintenance reasons" and most of the telecommunication services have been cut off or tapped. ""
Power

Submission + - New Form of Matter Melds Lasers, Superconductors

sterlingda writes: ""Physicists at the University of Pittsburgh have demonstrated a new form of matter that melds the characteristics of lasers with those of the world's best electrical conductors — superconductors. The work introduces a new method of moving energy from one point to another as well as a low-energy means of producing a light beam like that from a laser. The new state is a solid filled with a collection of energy particles known as polaritons that have been trapped and slowed." The work is published in the May 18 issue of Science."
The Internet

Submission + - Novablade.com stolen, sold to highest bidder

hidingintheclosetwithaplatypus writes: Damien & Trisha Buchwald (previously) from Novablade.com have loosed the dogs of war after their registrar, Network Solutions, refused to allow them to renew or transfer their domain name and who have now sold it to another company to be auctioned off. Apparently the name's worth around US$16,000, and the Buchwalds are looking for help from anywhere they can get it.

We are infuriated, upset, and feel like we have had our very souls stolen from us and sold. This is a very disgusting, underhanded act that deserves justification.
Space

Submission + - Hawking Enjoys Zero-G Ride

user24 writes: "TimesOnline reports: "For more than 40 years, Stephen Hawking has studied the mysteries of the universe from his wheelchair. Last night, he broke free of his disability and indulged his passion for gravitational phenomena in a finely stage-managed operation 32,000 feet above the Atlantic.

"It was amazing," he said after he returned from his experience of weightlessness. "The zero-g bit was wonderful . . . I could have gone on and on. Space, here I come."""
Graphics

Submission + - DoHDR Photos signal the end of traditional images?

okinawa_hdr writes: "With the emergence of High Dynamic Range Photography and the wondrous images it can produce, what does the future hold for the future of digital imaging? Since HDR Photography can capture any amount of dynamic range, does this form of photography finally put the stake in the heart of film versus digital debate?"
Robotics

Submission + - New Prosthetic Arm Developed By DARPA Team

eldavojohn writes: "An international team lead by the Johns Hopkins University Applied Physics Laboratory & funded by DARPA has delivered their first prototype arm that is "the first fully integrated prosthetic arm that can be controlled naturally and provide sensory feedback, and allows for eight degrees of freedom." The big breakthrough here is that the team used residual nerves & Injectable MyoElectric Sensor (IMES) devices which measure muscle activity at the source verses surface electrodes on the skin. So the good news is that whether you lose your arm in a lightsaber duel or from pushing people around at the Mos Eisley Cantina, modern medicine can give you a hand ... er, arm."

Slashdot Top Deals

"I've seen it. It's rubbish." -- Marvin the Paranoid Android

Working...