{"id":133,"date":"2006-10-02T19:05:42","date_gmt":"2006-10-02T23:05:42","guid":{"rendered":"http:\/\/www.rakkar.org\/blog\/?p=133"},"modified":"2006-10-02T19:05:42","modified_gmt":"2006-10-02T23:05:42","slug":"the-perfect-scripting-language-2","status":"publish","type":"post","link":"https:\/\/rakkar.org\/blog\/index.php\/2006\/10\/02\/the-perfect-scripting-language-2\/","title":{"rendered":"The perfect scripting language"},"content":{"rendered":"<p>\t\t\t\tIn general I don&#8217;t like scripting languages.  But you have to admit it&#8217;s much faster to iterate changes in a scripting language than C++.  Here&#8217;s a simplified list of pros and cons:<\/p>\n<p>Pros of C\/C++:<br \/>\nFast execution<br \/>\nCompiler helps you find errors<br \/>\nFull access to the engine.<\/p>\n<p>Pros of Scripting:<br \/>\nFast iteration<br \/>\nEasy for users to modify<\/p>\n<p>Conversely:<\/p>\n<p>Cons of C++:<br \/>\nSlow iteration<br \/>\nHard for users to modify<\/p>\n<p>Cons of scripting:<br \/>\nSlow execution<br \/>\nError prone<br \/>\nAccess limited to exposed interfaces<\/p>\n<p>It&#8217;s true that any language which can be interpreted can be compiled, and any language which can be compiled can be interpreted.  So how&#8217;s this for an idea:<br \/>\nYour scripting language is C or C++ (why invent a new language?) which is interpreted and has full access to all your other code.  Obviously your script can only call into your engine, and not vice-versa, but this is the only limitation.<\/p>\n<p>Since it&#8217;s a script, it is valid and reasonable to hardcode numbers into the script..  You can tweak these numbers and change the script while the game is running to play around with settings.<\/p>\n<p>When you are ready to ship a build, switch your flag to compile rather than interpret the scripts.  Or, if you wish user mods, just leave it interpreted.<\/p>\n<p>This is one use of a script system that makes sense to me and I&#8217;d fully support in a game project.<\/p>\n<p>Note: there is a library called  <a href=\"http:\/\/www.angelcode.com\/angelscript\/\">AngelScript<\/a> but I&#8217;m not sure if it&#8217;s capable of doing everything I outlined here.  If so, let me know!\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In general I don&#8217;t like scripting languages. But you have to admit it&#8217;s much faster to iterate changes in a scripting language than C++. Here&#8217;s a simplified list of pros and cons: Pros of C\/C++: Fast execution Compiler helps you find errors Full access to the engine. Pros of Scripting: Fast iteration Easy for users [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/133"}],"collection":[{"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=133"}],"version-history":[{"count":0,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/133\/revisions"}],"wp:attachment":[{"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rakkar.org\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}