Next release!

Monkey Archive Forums/Monkey Discussion/Next release!

marksibly(Posted 2011) [#1]
Hi,

Apologies if I've been a bit low profile lately, but I've been working, honest!

The next release is almost together, I mainly just want to give it a good thrashing on all targets first so hopefully early next week.

Anyway, features coming include:

* Interfaces! These have proven 'challenging' to add for some targets and are currently a little limited as I want to get what's there working as solidly as possible before adding more. There is no support for generic interfaces (which really requires more generic features to be useful anyway) and classes that implement an interface must implement all interface methods in the implementing class. You should really be able to leave it up to derived classes to implement some/all interface methods, but Flash doesn't like this. Also, interfaces can only contain consts and methods. But they seem to be working well and are a cool feature that I think many C++ coders such as myself have missed out on due to all the 'avoid multiple inheritance at all costs' hysteria!

* SetColor for images on all targets. On HTML5, the process is a little involved: 1) The image is drawn to a dummy canvas; 2) Image data is read from the canvas; 3) Image data is modulated by RGB; 4) Image data is written to canvas; 5) Canvas is drawn; Whew! But it actually works reasonably well, and hopefully canvas will get something like a globalCompositeColor one day. But in general, if you're doing something targetted at html5, it might be an idea to avoid SetColored images - ie: only draw images with color=255,255,255.

* HTML/Flash apps will expect documents to be served from a 'real' server - ie: no more running web apps from file://. To make this a bit less painless, I've written a little localhost:// mini-server so that the process of running an html5 app from Monk is roughly the same. I know this wont please everyone, but if we want to get the most from web apps (getImageData;Ajax;WebSockets;localStorage etc all require/prefer app to be running from a domain) it's just something that needs to be done.

* Android apps now work on API level 3 or higher. Note that multitouch isn't available until API 7 so if you're app depends on it you may want to set minSdkVersion=7 in the manifest.


dopeyrulz(Posted 2011) [#2]
Nice - from reading the little snippets on the forums, got the felling that a few new things were in the pipeline. Look forward to taking a look.


degac(Posted 2011) [#3]
Hi,nice to read future updates.

Only a question about SetColor and HTML5

But in general, if you're doing something targetted at html5, it might be an idea to avoid SetColored images - ie: only draw images with color=255,255,255.


Does this mean that if Trans find a SetColor command in HTML5 this is translated in all the process you described (create a canvas, read data...) or simply it's skipped IF color=255,255,255? Otherwise it will be a costly process I presume.
Or simply better dont' use SetColor (in target=HTML5) if we 1) dont' need it 2) dont' want speed reduction?

Thanks


Sammy(Posted 2011) [#4]
Many thanks Mark, I've never used interfaces (not a C coder) but they sound interesting! ;)


slenkar(Posted 2011) [#5]
do you think interfaces will help to create a serialization system?


ziggy(Posted 2011) [#6]
Great news!


Neuro(Posted 2011) [#7]
Thanks for the update Mark :)!


xzess(Posted 2011) [#8]
Thanks man :)


Raz(Posted 2011) [#9]
Yay :) Sounds good.

What is an 'interface' though?


Sledge(Posted 2011) [#10]
To make this a bit less painless...


Er... :D


Samah(Posted 2011) [#11]
do you think interfaces will help to create a serialization system?

I was actually hoping to take a look at this and include it as a diddy module. Without reflection, it's still a bit tricky. We'll see how it turns out. :)


Skn3(Posted 2011) [#12]
Good news :)


Samah(Posted 2011) [#13]
Mark, any word on when we'll see generic typecasting?


Tibit(Posted 2011) [#14]
So awesome with Interfaces, did not expect them so soon! Wee :)

They do have potential, but I know from own experience that they certainly do not make sense until you have used them in the right context!

SetColor, using webserver seems really neat too, good work as always :)

classes that implement an interface must implement all interface methods in the implementing class
I feel like this is quite expected, isn't it ambiguous if a Class that implements IRenderable does not implement all methods? How would I know if a specific IRenderable object lacks an implementation of a certain method in the interface? What happens when I call it, will an empty method be called?

On almost the same topic,

In Monkey atm when you override an method in a sub-class it's a silent process, I'd prefer that to override I must specify that the method Extends a base method using a Keyword.

If not, it's very simple to miss-type a method name, and get no indication of that typo until you realize run-time the reason something is not happening as expected.

Assume I type OnCraete, then everything will run fine. An optional "I'm intending to Override a method"-Command would be neat. But that is now solved as a sideeffect of the current Interface Implementation, which I like! :)


JaviCervera(Posted 2011) [#15]
Interfaces are great, and SetColor for images has been #1 on my wishlist since the first day! :D


marksibly(Posted 2011) [#16]
Hi,

> Mark, any word on when we'll see generic typecasting?

Not sure - at the moment it'd be hard because, like Java, all generic classes are 'erased' into a single concrete class.

This means that at runtime there is only one list class, one map class etc, so dynamically casting to List<Actor> isn't really possible since there is no List<Actor> at runtime.

You could do a form of 'static' casting, where the compiler assumes you know what you're doing, and this is what Java apparently does. But I don't really like the sound of that at all - and for what I suspect you guys want casting for, it wouldn't be enough anyway, right?

To properly fix this, the compiler really needs to generate instances of each template class so it's got something to cast to at runtime.

At which point, things start looking a lot more like C#/C++ than Java so I'm gonna research alternatives before doing anything on this front.