Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 7

Author Topic: What programming language?  (Read 17871 times)

mistinshadows

  • Bay Watcher
    • View Profile
What programming language?
« on: May 12, 2010, 04:54:41 am »

I am curious what programming language Toady is using to make Dwarf Fortress.  Apologies if this should be obvious, but I know next to nothing about programming languages (though I'm working to change that!)
Logged

lordnincompoop

  • Bay Watcher
  • Allusionist
    • View Profile
Re: What programming language?
« Reply #1 on: May 12, 2010, 04:55:38 am »

Used to be C, but now it's C++.

Popular language.
Logged

mistinshadows

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #2 on: May 12, 2010, 04:57:51 am »

Excellent, thank you!  I just started classes in C++, and was wondering if this was made with it.  Gives me hope for my own creative ideas! :)
Logged

Baughn

  • Noble Phantasm
  • The Haruhiist
  • Hiss
    • View Profile
Re: What programming language?
« Reply #3 on: May 12, 2010, 08:10:13 am »

Just for the record, his choice of C++ has more or less crippled the project. I mean, it works, but.. well, it's not exactly helping.

Try Haskell. :P

Oh, and it was never written in C.
Logged
C++ makes baby Cthulhu weep. Why settle for the lesser horror?

Urist McDepravity

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #4 on: May 12, 2010, 08:16:43 am »

Try Haskell. :P
Haskell (or any other FP language) is not something you would use for program if you want to ever finish it.
C++ has many drawbacks, but its most popular language, and proved to be sufficient for most applications.

As for own research projects, which are not planned to be released, I'd go with Python for speed and agility of development.
Runs for cover due to imminent languages flamewar
Logged

Baughn

  • Noble Phantasm
  • The Haruhiist
  • Hiss
    • View Profile
Re: What programming language?
« Reply #5 on: May 12, 2010, 08:20:13 am »

Huh, I guess the distributed filesystem (MSc thesis) I'm writing in Haskell.. is a figment of my imagination?  :o
Logged
C++ makes baby Cthulhu weep. Why settle for the lesser horror?

Sphalerite

  • Bay Watcher
    • View Profile
    • Drew's Robots and stuff
Re: What programming language?
« Reply #6 on: May 12, 2010, 08:25:07 am »

Python is a wonderful language for easy development, and my first choice of programming languages these days, but as it's run-time interpreted rather than compiled I doubt you could ever get something as processor-heavy as Dwarf Fortress to run at an acceptable speed.  Maybe if you isolated some of the more CPU-heavy tasks like pathfinding and water physics into compiled C libraries you could make it work.
Logged
Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction.

Ninjabob

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #7 on: May 12, 2010, 08:26:12 am »

Try Haskell. :P
Haskell (or any other FP language) is not something you would use for program if you want to ever finish it.
C++ has many drawbacks, but its most popular language, and proved to be sufficient for most applications.

As for own research projects, which are not planned to be released, I'd go with Python for speed and agility of development.
Runs for cover due to imminent languages flamewar

How come whenever this kind of thread pops up everyone is so eager to "defend" their own language and sometimes bash other languages?

Anyway, one can make great programs in almost any programming language. What really makes the difference is the determination of the programmer. What decides the programming language to use can be more or less random, like "I've always programmed in C so I'll keep doing that", or it can be because of said languages strong points (eg. lisp for AI, PHP for webpages).

In the end, programming language has much less to say than the programmer himself/herself.
Logged

Dave Mongoose

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #8 on: May 12, 2010, 08:29:16 am »

Just for the record, his choice of C++ has more or less crippled the project. I mean, it works, but.. well, it's not exactly helping.

Try Haskell. :P

Oh, and it was never written in C.

  • Core10, OO CODE UPDATE, Completed: Update all of the major code objects to C++.
C++ is the language of choice for almost all game development... why do you say it has crippled the project? For a complex system like this with lots of different object interactions, I would think it's the ideal language.

I'd agree with Urist McD: Haskell is a good language for prototyping and it's very elegant once you get your head around it... but for a complex system it would be a nightmare. A distributed filesystem has a (relatively) simple flow compared with Dwarf Fortress.

Language choice should be informed by what you're using it for, not just what you like/know how to program in.
Logged

Urist McDepravity

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #9 on: May 12, 2010, 08:30:24 am »

Huh, I guess the distributed filesystem (MSc thesis) I'm writing in Haskell.. is a figment of my imagination?  :o
Code for thesis == something you write as PoC, which will not be maintained or developed to the stage of 'ready' product.
Logged

zwei

  • Bay Watcher
  • [ECHO][MENDING]
    • View Profile
    • Fate of Heroes
Re: What programming language?
« Reply #10 on: May 12, 2010, 08:35:27 am »

FP languages most certainly ARE used in big projects (phoned lately to someone? ever wondered in what language call-routing was implemented?). It is just that they are not really thing of trendy kids but rather serious gentlemen (who will refrain from using it if it is not apropriate).

Problem is that people try to transalte oop/imperative code-monkey experience to fp. It certainly sounds like headache if you ever saw bigger project. It is something that actually needs experience on big FP project before you can assess it.

Mfbrew

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #11 on: May 12, 2010, 09:08:32 am »

Strengths of C++:
- TONS of code examples out there. If you don't specify a language in a google search, you'll probably get results relevant to C++
- The majority of experienced programmers understand it enough to get by, regardless of whether or not they like it
- One of the fastest among the languages commonly used today for game and app dev
- Great cross-platform support on a huge variety of systems, old and new, without having to install extra crap
- Supports legacy C code

Downsides:
- Has some weirdness as a result of supporting legacy C code
- It was built back when you had to conserve memory and be economical, so some of the ways of doing things seem overly OCD for people programming for today's gaming machines
- Lacks some of the built-in libraries of newer languages
- Not as easy or fast to deploy programs as if you use a language specialized for the task at hand 


 
Logged

huhu

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #12 on: May 12, 2010, 09:15:32 am »

Yeah, I know I'm probably degenerating this into a pointless argument, but I'm tired of reading "Python can't be used for large projects" every turn, stated as a tried and proved truth. easiest way to find out about some more notable Python projects is here: http://www.python.org/about/quotes/

Youtube and EVE Online are a couple notable examples of large Python projects.
Logged

Dave Mongoose

  • Bay Watcher
    • View Profile
Re: What programming language?
« Reply #13 on: May 12, 2010, 10:07:55 am »

Yeah, I know I'm probably degenerating this into a pointless argument, but I'm tired of reading "Python can't be used for large projects" every turn, stated as a tried and proved truth. easiest way to find out about some more notable Python projects is here: http://www.python.org/about/quotes/

Youtube and EVE Online are a couple notable examples of large Python projects.

EVE Online uses Python, but it is not entirely written in Python. There is nothing wrong with Python for large projects, but it is an interpreted language so it relies on an interpreter which will be written in another language.
Logged

Baughn

  • Noble Phantasm
  • The Haruhiist
  • Hiss
    • View Profile
Re: What programming language?
« Reply #14 on: May 12, 2010, 10:11:53 am »

I'm not developing it just as PoC; I intend to use it myself, so I'll develop it at least to the point where it's stable for that. As an open-source project, it might even get developed further.

So.. C++. The reason I say it's "crippled" the project (okay, that may have been a slight exaggeration) is mainly because it invites a highly interdependent style of programming. Although you can make objects independent in some senses, your code still usually ends up highly dependent on a certain order of operations.

In other words, parallelizing it becomes much harder. Impossible, for large projects, and we all know DF could do with some of that.That's a general problem with imperative languages, though, not just C++.

On the other hand, there's still plenty of low-hanging optimization fruit that wouldn't involve multithreading.. it might be fine.
Logged
C++ makes baby Cthulhu weep. Why settle for the lesser horror?
Pages: [1] 2 3 ... 7