Jump to content

  • Log In with Google      Sign In   
  • Create Account


Anyone know of any Game Programming Chrestomathies?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 Tutorial Doctor   Members   -  Reputation: 1398

Like
0Likes
Like

Posted 17 May 2014 - 08:26 PM

 

 

In computer programming, a program chrestomathy is a collection of similar programs written in various programming languages, for the purpose of demonstrating differences in syntax, semantics and idioms for each language. This term is thought[according to whom?] to have been first used by Eric S. Raymond in the Retrocomputing Museum web site. It is used by analogy to a linguistic chrestomathy.

http://en.wikipedia.org/wiki/Chrestomathy

 

http://stackoverflow.com/questions/1527573/language-syntax-comparison

 

I have been thinking of making something like this myself, and today when looking up language syntax comparisons, I found out that there is actually a name for it. CHRESTOMATHY! 

 

The chrestomathies I found looking through Stack Overflow are not quite verbatim, but I guess that is how languages are? Perhaps there is always some interpretation going on? 

 

Check out this list for making a hello World Program.

 

And check out the various tasks that are collected for over 500 languages.

 

It would be nice if there were game chrestomathies, or perhaps it would be a nice thread on this site? It would probably have to be more than a thread, perhaps a whole new category.

 

I would only expect the top languages to be mentioned here, like C++, Lua, C#, Java, etc. 

 

Anyone know of any game programming related chrestomathies for C++ to Lua? Or perhaps from C++ to Java? 

 

I would like some for Lua to C++ particularly. 

 


They call me the Tutorial Doctor.


Sponsor:

#2 Stainless   Members   -  Reputation: 656

Like
0Likes
Like

Posted 18 May 2014 - 06:10 AM

oh god, another buzz word smile.png

 

a simple search using none buzz words gives this

 

http://en.wikipedia.org/wiki/Comparison_of_programming_languages_(syntax)



#3 Bacterius   Crossbones+   -  Reputation: 8157

Like
0Likes
Like

Posted 18 May 2014 - 07:21 AM

Gotta say, I never heard that word in my life. Anyway, rosettacode is the website I usually hit on google when I need a quick code recipe. I think it does its thing well. What would be specific enough to qualify as game development related?

 


The chrestomathies I found looking through Stack Overflow are not quite verbatim, but I guess that is how languages are? Perhaps there is always some interpretation going on? 

 

Yes, one could say some things are lost in translation. If all languages looked exactly the same, they would all be the same. And there are of course often multiple ways of writing the same program, all equally valid and efficient, code is to a large extent influenced by the developer, you can sometimes recognize the author just by reading the code if you know him well enough (and I don't just mean style, also the way the program logic as a whole flows).


The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis


#4 Tutorial Doctor   Members   -  Reputation: 1398

Like
0Likes
Like

Posted 18 May 2014 - 11:45 AM

oh god, another buzz word :)
 
a simple search using none buzz words gives this
 
http://en.wikipedia.org/wiki/Comparison_of_programming_languages_(syntax)


Yeah, I saw that one, which actually lead me to he links I posted.

But I am talking about things like rosetacode where you have a tic tac toe game in several languages, as a comparison to see how the same game might be done across multiple languages.

I had been thinking about writing good pseudocode and just filling in, but this idea seems better.

For instance, a game loop loos different across languages. A simple GUI could be sort of translated to another.

That is the word I am looking for, some type of translation key.

I have actually been doing something similar for Python and Lua.

They call me the Tutorial Doctor.


#5 Stainless   Members   -  Reputation: 656

Like
0Likes
Like

Posted 19 May 2014 - 01:55 AM

What we used to do in the old days was write a macro file, this became a sort of programming language in it's own rite and solved a lot of platform issues.

 

so we could have something like this 

    cpy r0,#1
    cpy r1,#2
    add r1,r0
    cpy r1,r0

then we could create a macro file for each processor defining the cpy and add macros and we didn't have to port the code from 6502 to z80 or 68000 to 8086 

 

This grew into a language called VP, a sophisticated assembler like language with it's own assembler which created processor dependant assembler as output.

 

(this eventually grew into a byte code based system which was translated into native machine code at load time giving ultimate platform independence, but that's another story)

 

Maybe it would be interesting to do the same here.

 

You could design a language and write an app that output translated this into c/c++,lua, python, whatever 

 

If you wrote it in javascript you could do it all in a web page.

 

Just a thought to get you going smile.png


Edited by Stainless, 19 May 2014 - 01:56 AM.


#6 Aardvajk   Crossbones+   -  Reputation: 5268

Like
0Likes
Like

Posted 19 May 2014 - 02:53 AM

This presupposes that there is one "right" way to do the thing in question, or at least one specific "general" case. There are lots of different ways to write the same game loop in a given language. Which one should be provided as the "translation" from another language?

 

I fail to see the usefulness of this as anything other than a curiosity. Sounds like an attempt to cut learning corners to me.



#7 Tutorial Doctor   Members   -  Reputation: 1398

Like
0Likes
Like

Posted 19 May 2014 - 07:43 AM

The usefulness is if you started a game in one language, and wanted to adapt it to another, you could do so faster, or at least get a head start.

It would get too complicated where APIs are concerned perhaps.

The tic tac toe example is almost a good example of what I am thinking of, except that there could have been a better translation.


Edited by Tutorial Doctor, 19 May 2014 - 01:37 PM.

They call me the Tutorial Doctor.


#8 Aardvajk   Crossbones+   -  Reputation: 5268

Like
2Likes
Like

Posted 19 May 2014 - 08:45 AM


The usefulness is if you started a game in one language, and wanted to adapt it to another, you could do so faster, or at least get a head start.

 

How? By taking each bit of your game, finding the equivalent bit on an online chrystanthamum or whatever its called, looking up the translation then copying that into your new game?

 

Sounds far easier to just, you know, learn the new language to me.



#9 Tutorial Doctor   Members   -  Reputation: 1398

Like
0Likes
Like

Posted 19 May 2014 - 10:35 AM

The ideal way would be a translator actually, similar to what Stainless presented.

But I would use it as a basis, for example, making a simple GUI, then take that and expand it. So I would still have to know the new language anyhow. Nowhere is that being avoided with a chrestomathy.

They call me the Tutorial Doctor.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS