OT - Best language for SDL

C++ supposedly has “object oriented ability”. For a single language to use, I don’t know. I personally use a mix of ANSI C and Lua. This is very nice to do as Lua is built to extend and script C programs. I do all the logic and prototyping in Lua, and the library/SDL interfacing and core code in C. Lua is nice and small too, the whole runtime (including compiler) is 95kb. Good luck.

Hi,

this is always a type of subject that leads to flame wars.

The best language to use with SDL is C, the reason being that it is the
language used to write SDL itself, so you don’t need any extra knowledge.

Now if you think about programmer productivity, then by far there are better
option as C (personal opinion you are free to another opinion :slight_smile: ).

I could name what I think are better languages to interface with SDL, but
you should at least have the following points covered:

  • High level enough to let you focus on algorithms and what you are trying
    to do, instead of writing infrastructure code;
  • Fast enough for the type of applications you want to write. Not everyone
    needs to write the successor of Crysis;
  • Easy to bind to SDL or other libraries with C like APIs;
  • With a good community for the type of applications you are writing–
    Paulo

On Wed, Nov 18, 2009 at 8:28 AM, apefish wrote:

C++ supposedly has “object oriented ability”. For a single language to
use, I don’t know. I personally use a mix of ANSI C and Lua. This is very
nice to do as Lua is built to extend and script C programs. I do all the
logic and prototyping in Lua, and the library/SDL interfacing and core code
in C. Lua is nice and small too, the whole runtime (including compiler) is
95kb. Good luck.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Let me suggest that the best language for SDL is the one that you plan
on using without SDL. If you are already really good at a language,
then stick to that one. If you are interested in a certain employer
and you know what language they use, then that’d be a good choice too.
If you’re just starting out with no idea, then Paulo is right on:
This often leads to long, unresolved arguments. In fact, I’d suggest
Googling for some of those arguments and read them instead of starting
new ones :). I’m sure there are hundreds of such threads on GameDev
and DaniWeb.

Jonny DOn Wed, Nov 18, 2009 at 3:18 AM, Paulo Pinto wrote:

Hi,

this is always a type of subject that leads to flame wars.

The best language to use with SDL is C, the reason being that it is the
language used to write SDL itself, so you don’t need any extra knowledge.

Now if you think about programmer productivity, then by far there are better
option as C (personal opinion you are free to another opinion :slight_smile: ).

I could name what I think are better languages to interface with SDL, but
you should at least have the following points covered:

  • High level enough to let you focus on algorithms and what you are trying
    to do, instead of writing infrastructure code;
  • Fast enough for the type of applications you want to write. Not everyone
    needs to write the successor of Crysis;
  • Easy to bind to SDL or other libraries with C like APIs;
  • With a good community for the type of applications you are writing


Paulo

On Wed, Nov 18, 2009 at 8:28 AM, apefish wrote:

C++ supposedly has “object oriented ability”. For a single language to
use, I don’t know. I personally use a mix of ANSI C and Lua. This is very
nice to do as Lua is built to extend and script C programs. I do all the
logic and prototyping in Lua, and the library/SDL interfacing and core code
in C. Lua is nice and small too, the whole runtime (including compiler) is
95kb. Good luck.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Let me suggest that the best language for SDL is the one that you plan
on using without SDL. ?If you are already really good at a language,
then stick to that one.

That is the best advice on this subject that it is possible to give.

If you are interested in a certain employer
and you know what language they use, then that’d be a good choice too.

Yep, second best possible advice on the subject.

?If you’re just starting out with no idea, then Paulo is right on:
This often leads to long, unresolved arguments. ?In fact, I’d suggest
Googling for some of those arguments and read them instead of starting
new ones :). ?I’m sure there are hundreds of such threads on GameDev
and DaniWeb.

Yep, one more time. It is always a good idea to put your question into
google before you ask a mailing list.

Yeah, I know I just post nothing but “Yes, I agree with that”, but it
is meant more along the lines of

RIGHT %%((^ ON!

So, since the best, second best, and third best possible responses
have been posted and seconded I suggest we move on and drop the rest
of this discussion.

Bob Pendleton

P.S.

I first saw this particular flame war start up back 1981 on ArpaNet,
way before there even was an Internet. And you know what? The old
timers, the guys who had been on ArpaNet since like 1972 had already
seen it so many times they were already bored of the subject.On Wed, Nov 18, 2009 at 7:14 AM, Jonathan Dearborn wrote:

Jonny D

On Wed, Nov 18, 2009 at 3:18 AM, Paulo Pinto wrote:

Hi,

this is always a type of subject that leads to flame wars.

The best language to use with SDL is C, the reason being that it is the
language used to write SDL itself, so you don’t need any extra knowledge.

Now if you think about programmer productivity, then by far there are better
option as C (personal opinion you are free to another opinion :slight_smile: ).

I could name what I think are better languages to interface with SDL, but
you should at least have the following points covered:

  • High level enough to let you focus on algorithms and what you are trying
    to do, instead of writing infrastructure code;
  • Fast enough for the type of applications you want to write. Not everyone
    needs to write the successor of Crysis;
  • Easy to bind to SDL or other libraries with C like APIs;
  • With a good community for the type of applications you are writing


Paulo

On Wed, Nov 18, 2009 at 8:28 AM, apefish wrote:

C++ supposedly has “object oriented ability”. For a single language to
use, I don’t know. I personally use a mix of ANSI C and Lua. This is very
nice to do as Lua is built to extend and script C programs. I do all the
logic and prototyping in Lua, and the library/SDL interfacing and core code
in C. Lua is nice and small too, the whole runtime (including compiler) is
95kb. Good luck.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------

Thanks, Bob ;)On Wed, Nov 18, 2009 at 11:19 AM, Bob Pendleton wrote:

On Wed, Nov 18, 2009 at 7:14 AM, Jonathan Dearborn <@Jonathan_Dearborn> wrote:

Let me suggest that the best language for SDL is the one that you plan
on using without SDL. ?If you are already really good at a language,
then stick to that one.

That is the best advice on this subject that it is possible to give.

If you are interested in a certain employer
and you know what language they use, then that’d be a good choice too.

Yep, second best possible advice on the subject.

?If you’re just starting out with no idea, then Paulo is right on:
This often leads to long, unresolved arguments. ?In fact, I’d suggest
Googling for some of those arguments and read them instead of starting
new ones :). ?I’m sure there are hundreds of such threads on GameDev
and DaniWeb.

Yep, one more time. It is always a good idea to put your question into
google before you ask a mailing list.

Yeah, I know I just post nothing but “Yes, I agree with that”, but it
is meant more along the lines of

RIGHT %%((^ ON!

So, since the best, second best, and third best possible responses
have been posted and seconded I suggest we move on and drop the rest
of this discussion.

Bob Pendleton

P.S.

I first saw this particular flame war start up back 1981 on ArpaNet,
way before there even was an Internet. And you know what? The old
timers, the guys who had been on ArpaNet since like 1972 had already
seen it so many times they were already bored of the subject.

Jonny D

On Wed, Nov 18, 2009 at 3:18 AM, Paulo Pinto wrote:

Hi,

this is always a type of subject that leads to flame wars.

The best language to use with SDL is C, the reason being that it is the
language used to write SDL itself, so you don’t need any extra knowledge.

Now if you think about programmer productivity, then by far there are better
option as C (personal opinion you are free to another opinion :slight_smile: ).

I could name what I think are better languages to interface with SDL, but
you should at least have the following points covered:

  • High level enough to let you focus on algorithms and what you are trying
    to do, instead of writing infrastructure code;
  • Fast enough for the type of applications you want to write. Not everyone
    needs to write the successor of Crysis;
  • Easy to bind to SDL or other libraries with C like APIs;
  • With a good community for the type of applications you are writing


Paulo

On Wed, Nov 18, 2009 at 8:28 AM, apefish wrote:

C++ supposedly has “object oriented ability”. For a single language to
use, I don’t know. I personally use a mix of ANSI C and Lua. This is very
nice to do as Lua is built to extend and script C programs. I do all the
logic and prototyping in Lua, and the library/SDL interfacing and core code
in C. Lua is nice and small too, the whole runtime (including compiler) is
95kb. Good luck.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

MBrening wrote:

So my question is is there a sweet spot with the trade off? I’ve more experience with C, but the code quickly becomes to large and difficult to find bugs.

Now entire operating systems have been written in C, so this is not really a property of C per se, but perhaps of a C programmer? [Shocked]

I think you answer your own question and you know it:

So most likely I can stick with C and just try to find a better method of programming (a bunch of small libs instead of one huge program for instance)

Working in a new language may give you a new perspective on how you work in your old one – you mentioned python. I’m not very familiar with python altho I have used it a wee bit to do gimp-fu scripting. If I remember correctly, python object notation is fairly standard, like object.method or object->method. Notice this resembles C struct notation. Try and apply your knowledge of OO in C, it is a useful paradigm. You do not need full blown classes, etc. to do that.

I think the “unmanagable” aspect of C is not so much that the code is so long, as that the minimal syntax can make things a little too “freeform” if you do not set some ground rules for yourself. For example, break your functions up whenever you see more than 20 lines – in fact, break them up as much as you can. They tend to become more generisized and reusable this way, because they are each performing a specific task rather than a one off “procedural” sequence. Lots of little general purpose functions and typedef’ed structs will give you the ease and elegance you know from python, while also keeping you in touch with that low level power.

Hello,

IMHO … the best language is: http://www.the-better-idea.com/DviewSDL.htm

Regards

–Armin______________________________________________________
GRATIS f?r alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de

apefish wrote:

C++ supposedly has “object oriented ability”. For a single language to
use, I don’t know.

There are a whole pile of questions that you could ask yourself:

Let’s go through an example. A game written in Common Lisp using SDL bindings
runs at higher risk of failing than straight C: The social stigma of using an
"AI language"; little support in the market; the absence of a striving developer
community; run-time overhead. All issues that need to be sorted out. Where are
you going to find people competent enough to be experienced with Lisp[1] and
game programming? Will you be able to afford them? How stable is the binding?
How much of that console’s 64 megs of RAM will be eaten up by the run-time
system? Can you interface with the console’s OS? If so, how fast?

If it’s written in C++, are you competent enough to face the many pitfalls of
C++? C++ is much more popular than Lisp and thus you’ll have a higher chance of
finding competent people closer to you[3]. Being backwards compatible has its
advantages. Even with Java you’re almost guaranteed to find a semi-competent
programmer almost as soon as you put up the ad. Yet that isn’t to say that you
mustn’t write your game in Common Lisp. If you are sure enough of your
abilities, do exactly that[2].

If you are a startup game firm, you should write in a language that gives a
competitive advantage over other firms. Cycles are cheap (although they seem to
become more expensive lately), other programmers and your time isn’t. Yet you
need to take into account future machine architecture. You will need to be able
to parallelize your future game. Is your language up to par? Games also aren’t
maintained beyond a certain amount of time. It becomes too costly and revenues
drop quickly.

To what target platforms will you expand? Is your language supported properly on
all? Is SDL supported on it? Is the combination supported on it? The last thing
you want to waste your precious time on is hunting down a bug that hasn’t gotten
anything to do with your actual game. Is your platform restricted by the
manufacturer? Apple’s iPhone is limited to C#. What about others?

You can keep going on like this of course. I wouldn’t call it fun to answer
these questions, but if you want to succeed you’ll need to answer hard questions
truthfully and competently.

[1] Seems like a rant against Lisp. Its not. :slight_smile:
[2]
http://web.archive.org/web/20070127022728/http://lists.midnightryder.com/pipermail/sweng-gamedev-midnightryder.com/2005-August/003804.html
[3] I’m not saying that higher popularity implies more competent people. The
chance of finding somebody with more experience trying to make a buck is higher
than somebody who has just discovered Lisp.

Speaking of popular languages and programmer competence…

I’ve recently started using SDL from Javascript.

Disadvantages:

  • the average Javascript hacker
    – not very good
    – not performance-savvy
  • prototypal inheritance
    – feels clumsy compared to class-oriented OOP (IMHO)
    – multiple inheritance feels a little clumsy as it’s not really supported
  • dynamically typed (IMHO static-typing is better for most games)
  • per-sample A/V operations not really performance-practical right
    now, even with JIT

Advantages:

  • With the right programming abstractions, your work can run on
    jslibs or GPSEE using SDL, or it can run on The Web with the new HTML5
    canvas.
  • Lots of people know Javascript
  • Spidermonkey has pretty good JIT performance
    – applies well to game-typical exercises like “for each(var a in
    gameElements) a.x+=a.vx”
  • Garbage collection
  • Lots of very unrestricted Javascript libraries floating around out there
  • Big players like Google contributing more every day
  • Duck-typing
    – Spend less time trying to break down your game’s elements into a
    careful class hierarchyOn Thu, Nov 19, 2009 at 10:55 AM, Chris Eineke wrote:

[3] I’m not saying that higher popularity implies more competent people. The
chance of finding somebody with more experience trying to make a buck is higher
than somebody who has just discovered Lisp.


http://codebad.com/

Your mail shows already a trend that is going on nowadays, although slowly.

Without entering into flame wars type of email.

I used to teach C++ as a senior student several years ago, then I spent a
few years
doing C/Tcl development and a few more doing C++ with HPC and
telecomunications
systems.

Nowadays I am using mostly Java together with a few scripting languages on
the job,
but privately I tend to dabble in a quite a few managed languages (C#,
Scala, F#, Haskell),
depending which library I am playing with.

And you know what for most of the stuff I do, all of them are fast enough.
Sure C and C++
still can beat them in what concerns maximum speed, but I care more about my
productivity.

Some studios are slowly following this tendency by using C# or Java to
create their game
creation tools, while the engine itself is still coded in C, C++ with a few
bits of assembly.

Have you seen how many languages I have spoken about?

Even if you happen to work just with one language, you should learn about
what the others
have to offer. It will improve your skills.

Lets say you plan to use just C all your life.

Knowing about OOP will make you make know better how to structure your code.

Knowing about functional programming will allow you to use algorithms that
are more
multi-threading friendly, specially if used together with C extensions
similar to what Apple
just introduced.

Be open minded and not be afraid to try out new stuff.–
Paulo

On Thu, Nov 19, 2009 at 7:26 PM, Donny Viszneki <donny.viszneki at gmail.com>wrote:

On Thu, Nov 19, 2009 at 10:55 AM, Chris Eineke wrote:

[3] I’m not saying that higher popularity implies more competent people.
The
chance of finding somebody with more experience trying to make a buck is
higher
than somebody who has just discovered Lisp.

Speaking of popular languages and programmer competence…

I’ve recently started using SDL from Javascript.

Disadvantages:

  • the average Javascript hacker
    – not very good
    – not performance-savvy
  • prototypal inheritance
    – feels clumsy compared to class-oriented OOP (IMHO)
    – multiple inheritance feels a little clumsy as it’s not really supported
  • dynamically typed (IMHO static-typing is better for most games)
  • per-sample A/V operations not really performance-practical right
    now, even with JIT

Advantages:

  • With the right programming abstractions, your work can run on
    jslibs or GPSEE using SDL, or it can run on The Web with the new HTML5
    canvas.
  • Lots of people know Javascript
  • Spidermonkey has pretty good JIT performance
    – applies well to game-typical exercises like “for each(var a in
    gameElements) a.x+=a.vx”
  • Garbage collection
  • Lots of very unrestricted Javascript libraries floating around out there
  • Big players like Google contributing more every day
  • Duck-typing
    – Spend less time trying to break down your game’s elements into a
    careful class hierarchy


http://codebad.com/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


,"".
FJ—L]
J | LJ
| _
–.
J_
___/F
J_____F

( thats a large C in ascii art )

___ a poem about coding ___

Written in 2009
By Neil White


every language has its place

depending on your interface

fin.


English(american dialect). Since most of the SDL symbols are in
English, with things like Color missing Us.

  • you can stop rolling your eyes now, and move on to shaking your head.On Wed, Nov 18, 2009 at 8:28 AM, apefish wrote:

C++ supposedly has “object oriented ability”. For a single language to use,
I don’t know. I personally use a mix of ANSI C and Lua. This is very nice to
do as Lua is built to extend and script C programs. I do all the logic and
prototyping in Lua, and the library/SDL interfacing and core code in C. Lua
is nice and small too, the whole runtime (including compiler) is 95kb. Good
luck.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org