Welcome to GameHourz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Language rewrite - any success stories?

 
Goto page Previous  1, 2, 3, 4
   Game Forums (Home) -> Roguelike -> Development RSS
Next:  A new (?) movement style for multiplayer roguelik..  
Author Message
awhite

External


Since: Dec 03, 2007
Posts: 16



(Msg. 46) Posted: Thu Jan 31, 2008 5:57 am
Post subject: Re: Language rewrite - any success stories? [Login to view extended thread Info.]
Archived from groups: rec>games>roguelike>development (more info?)

On Wed, 30 Jan 2008 21:16:45 -0800, tbarta.TakeThisOut@gmail.com wrote:

> Not to downplay the advantages of a more "lightweight" language, but
> have you considered augmenting your C++ environment? Some things that I
> find make a big difference with C++ development:
> - precompiled headers: in an experiment with 5,000 SLOC for a
> raytracer (using gcc), this cut build times in half. If you're using
> Visual Studio, add in incremental linking and it's even faster.

VC++ appears to be a "faster" overall compiler than g++, as I recently
discovered.

> - proper dependency analysis. Visual Studio again handles this
> directly. If you're using GNU tools, you /definitely/ need a Makefile
> and either `makedepend` or `gcc -MM` to autogenerate dependencies from
> #includes. It really reduces the number of 'clean builds' you'll have
> to do, so any incremental compile-link phases take less than 1 second.
> - what text editor / IDE do you use for programming? In both vim and
> emacs, you can run make directly from within the editor, and they make
> it simple to step through build errors if any occurred. If you're using
> a real IDE, this is a moot point, I suppose.

That's not the issue. My environment (SlickEdit 11) handles this.

> - KISS. Do you really need accessors for everything? Adding the
> boilerplate get() and set() functions isn't very exciting, and it's more
> or less useless on small projects. I know it's OO heresy to advocate
> public members, but remember that the tool (C++) is there to serve you,
> not the other way around.

I think you missed the disclaimer that the code was a silly throw-away
example of idiomatic lisp (at least I hope so) vs idiomatic c++, not an
example of my real coding style.

> - Know your data structures. If you're talking about using a hash
> map to store properties, why not do that in C++? You have std::map,
> stdext::hash_map in Visual Studio, or __gnu__cxx::hash_map in GCC.

It was an example only, of a completely different project, purely to show
how lisp macros can reduce boilerplate.

For that matter, I'd use std::tr1::unordered_set<> rather than any non-
standard extensions.

> Yes. There are a few ways to reduce that:
> - use templates to reduce the number of times you have to write
> something.
> - avoid memory management in your application layer; if you need
> dynamic memory, hide it in a data structure. That way, your application
> layer ends up (almost) as clean as a higher-level language.

Duder, I'm not sure what your advice is trying to be. I know how to write
idiomatic RAII c++. That's not the issue. My issue is that *for my
purposes* compilation is very slow under g++.

I've just found out (and responded to Krice upthread) that VC++ *for my
purposes* is at least 3 times faster.


> The "rule of 3" (which I assume means assignment/copy constructor/
> destrucs easy to avoid if you use better member data structures,
> allowing the compiler-generated defaults to be sufficienttor) i. Take
> full advantage of the STL and boost.

I use a lot of boost. Boost is very template-heavy, which (under g++ at
least) seems to vastly increase compile times.


> Heck, if you're not planning on
> copying your data structures, there's no reason to even implement
> assignment/copy-ctor in the first place.

Well no, you don't have to *implement* them, but you absolutely should
*define* them - giving a link error rather than using the implicitly
generated versions.


> All in all, I think it's up to what you are most interested in
> exploring. If you want to play with inter-language bindings, do that.
> If you want to learn a new language, do that. If you want to learn your
> text editor and the arcane tricks of optimizing the GNU toolchain, do
> that. If you just want to finish your roguelike... do that, and just
> take a coffee break or go pee whenever it's time to compile.

My point wasn't supposed to be as much that compile times are long. If
compiles were a rare and wondrous thing, then an extra 30 seconds
wouldn't really matter that much.

But development in C++ (as someone else upthread pointed out) consists of
"edit / compile / fix typo / compile / fix typo / compile / run / edit"
ad nauseum. Interactive language development notifies you of typos/errors
immediately, and completely skips the compilation stage.

A

 >> Stay informed about: Language rewrite - any success stories? 
Back to top
Login to vote
Martin Read

External


Since: Mar 23, 2005
Posts: 552



(Msg. 47) Posted: Thu Jan 31, 2008 8:47 am
Post subject: Re: Language rewrite - any success stories? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

awhite <spudboy.DeleteThis@iinet.net.au> wrote:
>On Wed, 30 Jan 2008 21:16:45 -0800, tbarta.DeleteThis@gmail.com wrote:
>> Heck, if you're not planning on
>> copying your data structures, there's no reason to even implement
>> assignment/copy-ctor in the first place.
>
>Well no, you don't have to *implement* them, but you absolutely should
>*define* them - giving a link error rather than using the implicitly
>generated versions.

Define? Hell no. If you define them, you *won't* get link errors, you'll
get bugs. *Declare*? Sure, preferably as private members if you don't
want them to be usable.
--
\_\/_/ some girls wander by mistake into the mess that scalpels make
\ / are you the teachers of my heart? we teach old hearts to break
\/ --- Leonard Cohen, "Teachers"

 >> Stay informed about: Language rewrite - any success stories? 
Back to top
Login to vote
Timofei Shatrov

External


Since: Nov 22, 2004
Posts: 250



(Msg. 48) Posted: Thu Jan 31, 2008 9:20 am
Post subject: Re: Language rewrite - any success stories? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 31 Jan 2008 03:51:31 GMT, awhite <spudboy.DeleteThis@iinet.net.au> tried to confuse
everyone with this message:

>But the cmd.exe console is pretty annoying. Does anyone have a suggestion
>for an alternative? Something like gnome-console or konsole (or even rxvt
>or Eterm) would be great.
>

Well, KDE4 appears to be ported to Windows, so you can actually run Konsole...

--
|Don't believe this - you're not worthless ,gr---------.ru
|It's us against millions and we can't take them all... | ue il |
|But we can take them on! | @ma |
| (A Wilhelm Scream - The Rip) |______________|
 >> Stay informed about: Language rewrite - any success stories? 
Back to top
Login to vote
Kenneth 'Bessarion' Boyd

External


Since: Oct 18, 2007
Posts: 161



(Msg. 49) Posted: Thu Jan 31, 2008 9:24 am
Post subject: Re: Language rewrite - any success stories? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2008-01-31 06:57:58, awhite <spudboy.RemoveThis@iinet.net.au> wrote:

> On Wed, 30 Jan 2008 21:16:45 -0800, tbarta.RemoveThis@gmail.com wrote:
>
> > Not to downplay the advantages of a more "lightweight" language, but
> > have you considered augmenting your C++ environment? Some things that I
> > find make a big difference with C++ development:
> > - precompiled headers: in an experiment with 5,000 SLOC for a
> > raytracer (using gcc), this cut build times in half. If you're using
> > Visual Studio, add in incremental linking and it's even faster.
>
> VC++ appears to be a "faster" overall compiler than g++, as I recently
> discovered.

Yes. The problem is at least GCC's C library memory manager -- back when I was
researching why 4.2.x won't build with MingW32, I noticed that the GCC dev team
absolutely does not care about performance. (For 4.1.2 (?) they did not
immediately say they would revert out a new default C memory manager that
imposed a 3x speed hit on PowerPC.)

Also note that even a normal release build of GCC does error-checking on the
compilation process. If you're on a platform where you can build GCC, you can
completely disable this for a noticeable speed improvement.
 >> Stay informed about: Language rewrite - any success stories? 
Back to top
Login to vote
Risto Saarelma

External


Since: Apr 19, 2005
Posts: 65



(Msg. 50) Posted: Thu Jan 31, 2008 10:39 am
Post subject: Re: Language rewrite - any success stories? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2008-01-31, awhite <spudboy.DeleteThis@iinet.net.au> wrote:
> Getting used to the Windows keyboard shortcuts will take some time (on
> Linux I use SlickEdit set to Emacs keybindings), but it (VC++) looks like
> a pretty solid build environment.

There's no need to use the IDE if you just want the build system. You
can use a familiar text editor and use the msbuild command line build
tool.

--
Risto Saarelma
 >> Stay informed about: Language rewrite - any success stories? 
Back to top
Login to vote
Gerry Quinn

External


Since: Nov 06, 2006
Posts: 848



(Msg. 51) Posted: Thu Jan 31, 2008 2:45 pm
Post subject: Re: Language rewrite - any success stories? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <6d9b10e1-c48a-4c1b-bdae-a8f7d34d28e3
@c23g2000hsa.googlegroups.com>, rideau3.RemoveThis@gmail.com says...

> This may be partially due to the optimizer - as a benchmark, I
> recompiled a major code project I work on (54524 lines total, uses
> templates a lot, uses multiple threads, wxWidgets), with no
> optimization and debugging options, followed by "-g -O2", and the
> speed differences are absolutely staggering. The first compile
> (without) took 6 minutes on the dot. The second took 10 minutes 2
> seconds. I can't test -O3 due to some ridiculous template
> deficiencies. I haven't used VC08, but if I recall, the default is for
> VC to compile without optimizations.

For VC6 the default is to compile without optimisations in debug mode,
and with in release.

- Gerry Quinn
 >> Stay informed about: Language rewrite - any success stories? 
Back to top
Login to vote
Paul Murray

External


Since: Jan 18, 2005
Posts: 112



(Msg. 52) Posted: Fri Feb 01, 2008 11:20 am
Post subject: Re: Language rewrite - any success stories? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2008-01-31, awhite <spudboy RemoveThis @iinet.net.au> wrote:
>> Cygwin? It comes with all sorts of Unix utilities, too.
> No, the lack of a decent console (with scrollback, tab-key completion -
> which is a shell issue, I know - and multi-tabs) is what I'm getting at.

Once you've got cygwin, you can have bash, tcsh or whichever shell you want.
 >> Stay informed about: Language rewrite - any success stories? 
Back to top
Login to vote
Paul Murray

External


Since: Jan 18, 2005
Posts: 112



(Msg. 53) Posted: Fri Feb 01, 2008 11:23 am
Post subject: Re: Language rewrite - any success stories? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2008-01-31, awhite <spudboy DeleteThis @iinet.net.au> wrote:
> But development in C++ (as someone else upthread pointed out) consists of
> "edit / compile / fix typo / compile / fix typo / compile / run / edit"
> ad nauseum. Interactive language development notifies you of typos/errors
> immediately, and completely skips the compilation stage.

Have you tried Edit-and-Continue in VC++?
It allows you to make program changes on the fly without restarting the
program. It is limited (essentially you can't change any structure definitions,
only code, but it helps a lot.
 >> Stay informed about: Language rewrite - any success stories? 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
OO Planning (Preparing for Rewrite No. 1) - I'm preparing for my first rewrite (hmmph!), after my code is getting fairly spaghettish and some random stupid things are happening, its eatingway too much ram etc etc etc. But mostly, it can be attributed to a lack of planning (especially on the ..

The Key to Success - Lately I've been in a rut, of sorts. I never got any coding done. I knew what I wanted to do, but there was always something "fun" that I could have done instead. When you haven't done it for a while, programming seems pretty boring - like w...

Programming language Choices.... - I have set a goal of long range programming a RL as a "learn a language and relearn programming" Have a minor in CS, but have not programmed in about 4 years. I would prefer to do OO programming, but I must decide on which language I should l...

JustBASIC as roguelike programming language - I was hoping to get your thoughts on using JustBASIC for programming a Roguelike. Although I do have some knowledge of object-oriented programming (C in high school and VB in college), I don't have an innate understanding; I cannot 'think' in OOP terms....

7DRL: Invader - Well, I've talked myself into attempting a game for the 7DRL challenge. :-) Invader will be a sci-fi RL where the player is the planet's only hope of stopping a dread alien invasion ship. The character's base of operations will be their docked ship. ....
   Game Forums (Home) -> Roguelike -> Development All times are: Ekaterinburg, Islamabad, Karachi, Tashkent (change)
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]