Tuesday, June 29, 2010

About C / C++ / C#: One Week to go for Programming Contest 36

If you can't see this email, click here

About.com

C / C++ / C#

Fundamentals

Tips & Tools

Going Pro



From David Bolton, your Guide to C / C++ / C#
I was advised that since more people search for programming contests than programming challenges that I should call them contests. Contest 36 is due up in a few days (details below) but you've got until next Sunday evening to submit your entry as I'm away for a short break. Of course Contest 37 is now up as well, so if you've ever fancied writing a simple search engine... See you next week!

What Powers Farmville and Cafe World etc?
Along with memcached (a caching system written in C), these web games with hundreds of millions of plays each month use Membase. It's written in C for the main code and C++ for utilities, drivers etc, with some Python thrown into the mix. Membase is another datastore of the NoSQL family. After looking at Cassandra, Hbase, Redis, Mongo, Voldemort and Tokyo, they decided that there wasn't anything just right for them and so wrote Membase; investing 20 man years of effort into it. It was written originally for Linux but can be built on other platforms. Membase was designed for low latency and high throughput. Low latency means it returns data very quickly after the request. In an environment such as Farmville, which had 18 million Daily Average users in June 2010 (Source ), this is essential to have high performance that keeps players interested.

Open Source C Compilers
Given the relative simplicity of building a C compiler (compared to C++), it's not surprising that the web is almost awash with different C compilers. I've mentioned Tiny C Compiler (TCC) which generates code for Windows and 64 bit CPUs. If you want to get immersed in the world of compilers (I did back before games), TCC is probably a very good place to start as it supports much of the C99 standard. It's also very fast at compiling: 859,000 lines per second on a 2.4 Ghz Pentium 4; that's 9 x faster than GCC! The penalty for fast compilation speed (made possible by code generation in a single pass) is of course lesser optimizations but for learning it's ideal. But there are other C compilers out there as well, lcc and sdcc are two compilers both linked to on the TCC site. Both are retargetable compilers for Standard C. While lcc generates code for the ALPHA, SPARC, MIPS R3000, and Intel x86 and its successors, sdcc is for Intel 8051, Maxim 80DS390, Zilog Z80 and the Motorola 68HC08 based MCUs. If you really want to know how a C compiler works there's a complete tour of the version 3.6 source code in the book: A Retargetable C Compiler: Design and Implementation (Addison-Wesley, 1995, ISBN 0805316701, ISBN-13 9780805316704). It's still available. Good reading! If you're interested in free C compilers, the link below has a fair number...

Programming Contest 37 Published
Number 36 has a few days to go but as I'm away next weekend, it won't get marked until July 5th so still time to get your code in. In case you're wondering, I've started calling them contests rather than challenges because more people look for contest! This time, you are provided with a block of text, some 1,000 questions, each on its own line and ten search phrases. So your code has to search the question text for the search phrases and return relevant answers as fast as possible. Full details are provided on the contest page. Have fun!

Never Programmed Before? Start Here
Learn how to program computers as a living or just for recreational fun. Find out how to make a computer do what you want.

 


C / C++ / C# Ads
Featured Articles
Other Blogs You might find Interesting
Welcome to the C Area with Articles about C Programming
Welcome to the C++ Area with Articles about C++ Development
Welcome to the C Sharp Area with Articles about C Sharp Development
Learn about Commercial Software Development
All about Games Programming

 

More from About.com

Plan a Unique Vegas Wedding
The minister, music and champagne are just the beginning -- why not get married aboard a helicopter or have a pirate swing in to deliver your rings? Arrrr! More>



Join About.com's User Panel!
Share your opinions and help us make About.com more relevant, informative and enjoyable to use. More>




This newsletter is written by:
David Bolton
C / C++ / C# Guide
Email Me | My Blog | My Forum
 
Sign up for more free newsletters on your favorite topics
You are receiving this newsletter because you subscribed to the About C / C++ / C# newsletter. If you wish to change your email address or unsubscribe, please click here.

About respects your privacy: Our Privacy Policy

Contact Information:
249 West 17th Street
New York, NY, 10011

© 2010 About.com
 


Must Reads
Programming Challenges
About C, C++ and C#
C++ for Beginners
C++ Programming
Intro to OOP

Advertisement

No comments: