Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 25 Mar 2003
Offline Last Active Mar 11 2013 12:21 AM

Posts I've Made

In Topic: So who is still around these days?

25 September 2011 - 03:52 PM

I (CoffeeMug/kill - man that was a long time ago) haven't signed in in years, though I've been occasionally typing gamedev.net into the address bar recently. Hi!

In Topic: Scheme and Common Lisp

17 January 2010 - 01:43 AM

Original post by cache_hit
Honestly, just use Haskell.

Haskell and Common Lisp are totally different beasts, and IMO both are well worth learning. I don't use either in my daily work anymore, but each one has made me a better programmer, in different ways.

Haskell forces you to learn what functional programming really is about at its core (the whole lambda calculus and typed lambda calculus business, along with currying, higher order functions, and all that good stuff). It also forces you to learn how to deal with state properly, and how to think of code in terms of data and operations on that data (instead of objects).

Common Lisp teaches totally different things. It teaches you how to think of code and data interchangeably, and how to think of and perform compile time programming for really useful things. It teaches you what truly dynamic programs are like (arguably beyond any other language available today). It also teaches you amazing things about software development with the meta-object protocol stuff, and how to think of OOP in terms of multimethods.

I don't have specific advice, just meta-advice. It's really not that hard - it's only hard because it's foreign. Keep at it, and after a while it will become second nature. Remember that if something seems "stupid", it's because of the unfamiliarity. Some really smart people have spent many years to make this stuff happen, so don't just brush it off.

The time investment is well worth it but ultimately these aren't "holy" topics, it's just knowledge. In retrospect I'm not sure if this is a better investment of time than learning, say, statistics, or *really* understanding calculus (as in reading Newton's and Leibniz's original papers), or working your way through The Road To Reality (I still haven't done these three things, they're on my New Year's resolutions list for the next three years). But hey, you gotta start somewhere...

In Topic: C++ template metaprogramming question

02 December 2009 - 10:42 PM

I'm a bit of a lisper at heart, so I was hoping to use C++ templates to feed my lisp macro frenzy - I wanted the compiler to generate some code for me. I ended up doing something similar, but not exactly what I described here - I still get compile time resolution, but the syntax for using it is a bit ugly. It's not worth going over the solution.

I was implementing a small object allocator system, and I wanted a class that would create a pool for each small object type I need (instead of creating the pools manually). So saying something like allocator.malloc<foo_t>() would add the code for a pool of foo_t objects. I didn't want to do it at runtime for performance reasons.

Thanks to everyone for your help!

In Topic: C++ template metaprogramming question

27 November 2009 - 01:33 AM

Well, in my current implementation I don't use any RTTI or string comparisons (it's all hashed integers), and that's what gives me poor performance.

Could you give an example of what you mean by using macros? I'm not quite sure what you're referring to (I thought of using macros, but couldn't figure out a good way).

In Topic: C++ template metaprogramming question

27 November 2009 - 01:05 AM

I've already done this with a hash table, but unfortunately a runtime lookup decreases performance by a factor of three, and this is a performance critical piece. I could force people to code these things manually, but it would be really really nice to find an automatic solution.