[quote]Monkey works by translating Monkey code to one of a different number of languages at compile time - including C++, C#, Java, Javascript and Actionscript.[/quote]nope.
English
-
Concurrence established
-
What do you mean by nope? The way monkey works is by taking the code you write in monkey and then when you compile the game it'll translate the code to the native target you're writing it for. So if you want to make a game in HTML5 you would compile it in HTML5 and then it would translate the game into javascript. You don't have to do any of the work translating it.
-
as in "never ever touching anything that works like that because intermediate languages are the devil's work"
-
Well you should try it out first. Before thinking it's "the devil's work". And it doesn't work as an intermediate. It translate the monkey code into the NATIVE code for the platform you're coding for. So you can create an App or game for iOS, XNA, GLFW, Win/Mac, html5, and others all at the same time. So each one is optimized for the platform. There is no risk to it either. I say try it out for a bit before coming to the conclusion that it's bad. :)
-
I'm sure that this is a great system for those who prefer design work over the more tedious platform-specific coding, but for those who want maximally-effective code, it's not ideal. :\ [quote]So each one is optimized for the platform. [/quote]Looking at the JavaScript of the example game you linked to in the OP, I see quite a few bad practices: DOM0 event handlers (window.onwhatever). These is bad because it can cause problems if you attempt to use multiple scripts together. If they both bind to the same event on the same DOM node using the DOM0 properties, then one overwrites the other. Pollution of the global scope. Lots of CFG_WHATEVER variables. Lots of functions jammed into the global scope, that aren't encapsulated in a singleton or other container. Messy, messy, messy. Introduces the risk of variable collisions when outside code enters the picture, plus it'll pollute the UIs of many in-browser debuggers, such as Firebug. Lack of compatibility checks or graceful degradation. I'm seeing things like XMLHttpRequest being used without regard for browsers that might not support it. I could understand showing an error message, but not even checking for errors is just bad. General sloppiness. Direct use of "undefined" even though you can actually set a global variable with that name (use void 0 instead). Utterly useless functions like "dbg_object" and "new_bool_array". Redundant reinventions of the wheel in the form of functions like "string_replace" (use var.replace) and "string_startswith" (use var.indexOf). User agent string checks (no no no no NO!). References to paths on the hard drive of whoever wrote this code (hi, Matthew!). All that can be found in the first quarter of the <main.js> file. Mistakes like those aren't found in optimized code. In fact, reinventing the wheel instead of using native methods should [i]reduce[/i] performance.
-
Please note that Monkey is still fairly new. So everything isn't perfect. Also that most of the coding errors in the game it self is on my part for bad programming. not the program itself.
-
[quote]Please note that Monkey is still fairly new. So everything isn't perfect.[/quote]I know, and I tried not to be too hard on it by adding my first paragraph. [quote]Also that most of the coding errors in the game it self is on my part for bad programming. not the program itself.[/quote]The part I looked at was the first chunk of "main.js". I didn't see any game-specific script; it appeared to be the foundational code for whatever game engine Monkey runs off of. :\
-
Well everything is done at compile time. Which is why you don't see any game specific code.
-
Oh. I should look harder for the actual game-specific code when I have the time. The library code should be alterable by the Monkey developers at any time, so the game-specific code is gonna be the make-or-break stuff. I do find this all very interesting, by the way. Thanks for posting -- it's certainly a nice break from the rash of political threads hitting B.next.
-
Edited by Qwarr: 2/2/2013 5:53:25 AMYeah and I would share the src files with you if I wasn't planning on using them for a full game later. I do have small programs I could share if you're interested. And yeah I'm just trying to help get Monkey off the ground. The more support it gets the more updates that will come. Also another nice thing about monkey is you're able to add different targets that aren't with the default program. Meaning the PSP someone made a target for it so monkey will compile the code using the PSP framework. I'm not to good at explaining stuff just better at coding. Thanks for the comments so far. Edit: Also if you're interested you can join my group on bungie http://www.bungie.net/en-us/View/community/Groups/Detail?groupId=29437 or if you're on reddit you can subscribe to the subreddit on there. /r/monkey Neither have much on there but i'll be updating each when new content or news comes out. Or even games.
-
It definitely uses an intermediate language, that's exactly how it works. I've taken a browse through its spec, and aside from the flaws that usually come with intermediate compilation (primarily poor optimisation of code), I'm really not a fan of the rest of the language either. The syntax is based on BASIC, which is frankly antiquated and unsuitable both for learning to program as a beginner or using as an experienced programmer. I can understand the appeal of a platform that can produce binaries for just about every major platform from a single source but, speaking as someone more than a bit familiar with Java, WORA is never worth the overhead. Like, if you're at the point where you can seriously produce high-quality applications that would benefit from being pushed to multiple platforms, you're long past the point of learning how to program, so don't need the basicness of BASIC, and your apps would benefit massively from simply being written in the appropriate native language. After all, software production is about 90% engineering and 10% coding.