Bei der Gruppe, für die Sie eine Mitteilung verfassen, handelt es sich um eine Usenet-Gruppe. Wenn Sie in dieser Gruppe Nachrichten posten, ist Ihre E-Mail-Adresse für jeden im Internet sichtbar
> I'm curious in the last 15 years (while I've been away) how many > attempts to port Empire to java have there been, and did anyone get > very far...
> 80,000 lines of code is daunting. plnsub.c alone is 1282 lines of > very dense code...
> Buster, > ruler of children
When Java was new and just available in the browsers, I wrote an emp_client-equivalent Java client that could be served from the same machine as the emp_server, and worked in an emergency. I think I lightly modded some mud client. A couple years later someone (maybe a CCCPer) wrote a graphical Java client with parsing and tools, but I don't think it was finished or released.
Java is so 90's though, it may make a retro comeback. Web 2.0 Javascript if you're still stuck in 2000, and if you live in the Now, ActionScript!!!
-harmless (decades back now and still using C and Perl)
> khstev...@gmail.com writes: > > I'm curious in the last 15 years (while I've been away) how many > > attempts to port Empire to java have there been, and did anyone get > > very far...
> I don't know of any.
> > 80,000 lines of code is daunting. plnsub.c alone is 1282 lines of > > very dense code...
> 62 kSLOC (source lines of code, i.e. not counting comments and such), > plus some 4 kSLOC of code we don't maintain (mainly autoconf > boilerplate). Down from 75 kSLOC at 3.1.24, 66 kSLOC at 4.0.0, 68 > kSLOC at 4.2.0.
> The code is old-fashioned, idiomatic C. Doesn't translate easily to > Java. Even harder if you want idiomatic Java, not some unmaintainable > crap that only a Java compiler can grok.
> > Buster, > > ruler of children
> Welcome back!
I hear you. I think if it were ported, it would need to be idiomatic Java. The code's pretty hard to read right now. It's like a bucket of highly polished ball-bearings. Each code snippit is highly optimized for minimal footprint. But obviously the memory, disk, and CPU constraints that existed at the time Empire was written have long since departed. Bitmaps are way cool, but way hard to read.
It's tough to justify such an effort since we already have a perfectly functioning Empire server, and supposedly at the end of this Herculean effort, you'd be right back where you started. But I could see someone crazy like myself doing it just purely as a labour of love. I love Java and I love Empire. It would open up the source code to a whole new generation of programmers who don't understand all that C voodoo. And it could potentially open up Empire to a new generation of clients (Flex, AJAX, SOAP, etc.)
For 64,000 lines of code, I wonder how many hours it would take to translate each 1000 lines into Java. Including debugging, testing, iterative framework refactoring, I could imagine something in the neighbourhood of 40 hours per 1000 lines of code. If I had 2 hours a night to work on it, that would add up to...3.5 years. Hmm. That's a lot of dedication. I'm not sure I have that much love for Empire. It would be fun though...
> Java is so 90's though, it may make a retro comeback. Web 2.0 > Javascript if you're still stuck in 2000, and if you live in the Now, > ActionScript!!!
I've been working at a software consultancy for the past number of years, and every large organization I go into does the majority of their software development in Java. For enterprise software development, it is the dominant programming language right now.
> On Oct 9, 3:23 am, Markus Armbruster <arm...@pond.sub.org> wrote: > > khstev...@gmail.com writes: > > > I'm curious in the last 15 years (while I've been away) how many > > > attempts to port Empire to java have there been, and did anyone get > > > very far...
> > I don't know of any.
> > > 80,000 lines of code is daunting. plnsub.c alone is 1282 lines of > > > very dense code...
> > 62 kSLOC (source lines of code, i.e. not counting comments and such), > > plus some 4 kSLOC of code we don't maintain (mainly autoconf > > boilerplate). Down from 75 kSLOC at 3.1.24, 66 kSLOC at 4.0.0, 68 > > kSLOC at 4.2.0.
<snip a bit>
> For 64,000 lines of code, I wonder how many hours it would take to > translate each 1000 lines into Java. Including debugging, testing, > iterative framework refactoring, I could imagine something in the > neighbourhood of 40 hours per 1000 lines of code. If I had 2 hours a > night to work on it, that would add up to...3.5 years. Hmm. That's a > lot of dedication. I'm not sure I have that much love for Empire. It > would be fun though...
> Ken
One data point based on a real world example: For a 60K line code base porting from 16-bit windows to 32-bit, 3 man months. And for the three man team involved it did scale. Larger teams would no doubt run into the Mythical Man Month problem.
Some rough math, if we recon the number of hours in a work year at 2000, as is commonly done, 3 months works out to 500 hours. That's about 8,3 hours per 1000. Call it one day, which agrees pretty closely with what I estimate I can rewrite in a day ( for a code base I'm very familiar with ), though not at that pace for an extended period.
But that's working full time and represents a port, not a rewrite to another language, with a team experienced with the codebase. Anybody have a handle on what sort of factor to multply that by for a rewrite to another language?
That said I'd suggest first rewriting it in up to date C, removing all the clever optimizations that were needed back then but which have been overtaken by Moore's Law and make the code hard to read. ( I'm a firm believer in the K.I.S.S. principle. )
> > On Oct 9, 3:23 am, Markus Armbruster <arm...@pond.sub.org> wrote: > >> khstev...@gmail.com writes: > >> > I'm curious in the last 15 years (while I've been away) how many > >> > attempts to port Empire to java have there been, and did anyone get > >> > very far...
> >> I don't know of any.
> >> > 80,000 lines of code is daunting. plnsub.c alone is 1282 lines of > >> > very dense code...
> >> 62 kSLOC (source lines of code, i.e. not counting comments and such), > >> plus some 4 kSLOC of code we don't maintain (mainly autoconf > >> boilerplate). Down from 75 kSLOC at 3.1.24, 66 kSLOC at 4.0.0, 68 > >> kSLOC at 4.2.0.
> >> The code is old-fashioned, idiomatic C. Doesn't translate easily to > >> Java. Even harder if you want idiomatic Java, not some unmaintainable > >> crap that only a Java compiler can grok.
> >> > Buster, > >> > ruler of children
> >> Welcome back!
> > I hear you. I think if it were ported, it would need to be idiomatic > > Java. The code's pretty hard to read right now. It's like a bucket > > of highly polished ball-bearings. Each code snippit is highly > > optimized for minimal footprint. But obviously the memory, disk, and > > CPU constraints that existed at the time Empire was written have long > > since departed. Bitmaps are way cool, but way hard to read.
> Yes, times changed, and if we'd rewrite Empire from scratch, we'd > likely do it differently. But programming language and data > structures would be the smallest part of that difference. More below.
> > It's tough to justify such an effort since we already have a perfectly > > functioning Empire server, and supposedly at the end of this Herculean > > effort, you'd be right back where you started.
> One, we don't have a perfectly functioning server. We have one that's > good enough to run games. It might even be better than it was > throughout most of its history (we've put quite a bit of effort into > that). Nevertheless, we find and fix bugs all the time.
> Two, a port to another language would *not* place you right back where > you started. You'd pick up a big bundle of *new* bugs on the way. > Happens every single time a non-trivial program is rewritten. Unless > a program is terminally rotten, maintaining it is almost always easier > and safer than rewriting.
> That doesn't mean a rewrite project is doomed to failure. I'm just > pointing out risks and costs. The benefits of rewriting may outweigh > them. Or not.
> > But I could see > > someone crazy like myself doing it just purely as a labour of love. I > > love Java and I love Empire. It would open up the source code to a > > whole new generation of programmers who don't understand all that C > > voodoo.
> Bah, those grasshoppers should just learn C. An education in software > is not complete without understanding of how stuff works down at the > dirty level, and C exposes you to that.
> > And it could potentially open up Empire to a new generation > > of clients (Flex, AJAX, SOAP, etc.)
> These are just tools, and they'd help you less than you might think. > To get fundamentally better clients, we need a more client-friendly > protocol, and that needs to be designed into the server from the > ground up. How you send stuff over the network is implementation > detail. Tools to help with that can help you realize the potential of > your protocol more easily, but that's that. They can't help you fix > the protocol.
> > For 64,000 lines of code, I wonder how many hours it would take to > > translate each 1000 lines into Java. Including debugging, testing, > > iterative framework refactoring, I could imagine something in the > > neighbourhood of 40 hours per 1000 lines of code. If I had 2 hours a > > night to work on it, that would add up to...3.5 years. Hmm. That's a > > lot of dedication. I'm not sure I have that much love for Empire. It > > would be fun though...
> > Ken
> If you (or anybody else) embark on rewriting Empire, the first step is > to forget about tools and think about structure. Step back and > *design*.
Totally agree.
> The basic design of the server is sound[*], but dated. I'm not > talking about details like bitmaps here. I'm talking about truly > fundamental things like storage, concurrency and keeping logic and > presentation separate. I could elaborate, if anybody's interested.
> That said I'd suggest first rewriting it in up to date C, removing all the > clever optimizations > that were needed back then but which have been overtaken by Moore's Law > and > make > the code hard to read. ( I'm a firm believer in the K.I.S.S. principle. )
There is nothing preventing this from happening to make it more manageable, portable and translatable. If we cannot coordinate incrementals steps such as this, we will never get enough momentum to rewrite the whole server. The same is true of the structural deficiencies Markus indicated were in the server. It could occur as more of an evolution.
> khstev...@gmail.com writes: > >> Java is so 90's though, it may make a retro comeback. Web 2.0 > >> Javascript if you're still stuck in 2000, and if you live in the Now, > >> ActionScript!!!
> > I've been working at a software consultancy for the past number of > > years, and every large organization I go into does the majority of > > their software development in Java. For enterprise software > > development, it is the dominant programming language right now.
> In my subjective and unfair opinion, Java is a conventional, > unexciting, exceedingly verbose language with an annoying > I-know-what's-good-for-you attitude. That may well be precisely what > enterprise software development needs (not my department, I really > have no idea), but for my own entertainment, and that's a good part of > what Empire hacking is for me, no thanks.
> [...] a programming language should, above all, be malleable. A > programming language is for thinking of programs, not for > expressing programs you've already thought of. It should be a > pencil, not a pen. [...] We need a language that lets us > scribble and smudge and smear, not a language where you have to > sit with a teacup of types balanced on your knee and make polite > conversation with a strict old aunt of a compiler.
I agree that Java is a pain compared with C. I see primarily two differences between the two languages. 1) C is a dying arcane language, that only elite programmers can safely code in. Java is a living language, growing by the thousands every year. 2) Java is a social language. I can walk up to a huge, complex system written in Java and within a couple of hours understand it and safely enhance it. C was not designed with social goals--it was designed to be efficient.
20 years ago we'd be arguing about how the C compiler is a strict old aunt compared to the scribbles of assembly language...
Empire would have a better chance of survival if it were written in a language that future coders could support. And there's no question in my mind that Java code is far more flexible and maintainable than a brittle old language like C.
That being said, I agree with Tom that at this point, incremental improvements are more worthwhile than rewrite attempts.
I have done C/C++ to java ports before but never ones from C this old.
I have converted parts of various games that are email based to java but I don't have the patience anymore to complete it. I have converted our core product from C/C++ to java. Once I realized that you can actually make static functions it didn't go too badly.
I suppose what I am saying is I would be willing to help in either writing a socket based server to communicate with or mass conversion of C code to Java. I am not willing to lead the project or be responsible for completing it.
John Beer Trader Production Supervisor and Diplomat children
PS Next time I am choosing the race name Buster :P
Skull Crushers or Bier of Doom. Now those are empire names. Too bad Bier of Doom won't fit the next game theme.
Snarrf Ruler of Rulers. You know the one with centimeters on them. Or inches for the luddites.