Monkey V60 now available! [MONKEY NEWS]

Monkey Forums/Monkey Programming/Monkey V60 now available! [MONKEY NEWS]

marksibly(Posted 2012) [#1]
Hi,

Monkey V60 is now up, featuring faster debugger support and new exception handling commands!

Exceptions work pretty much the same as in most languages - use Try/Catch to create an exception handling block, and Throw to throw an exception object. Exception objects must extend the new built-in class Throwable. Finally is not currently supported.

Also, TedV1.3 is also now up, including simple find-in-files and several bug fixes. Ted is now available as a single zip containing macos/windows binaries and c++/Qt source code (mainly in case someone wants to try compiling it on Linux...).

Note that Ted still doesn't bring up help on F1 yet (you'll have to manually use the index). My next immediate mission is to improve the help system in Ted so stay tuned...


ziggy(Posted 2012) [#2]
The new Try/Catch thingy will be added to Jungle Ide ASAP. It involves modifing the internal parser and also creating a new version of the background compiler, and we're still finetuning a new Beta version with better support for overloading, so not sure if it'll take several days. Stay tuned.
Great news to have faster debugging


therevills(Posted 2012) [#3]
new exception handling commands

Samah is going to be happy ;)

Also, TedV1.3 is also now

Could you please also add drag and drop support.

And you might want to update the hyperlink in the Product updates page for Ted as it currently say:

Ted V1.3 for Windows XP SP3/Vista/7



Amon(Posted 2012) [#4]
Thanks, Mark! :)


Samah(Posted 2012) [#5]
...and new exception handling commands!

<3 <3 <3 <3 <3


Nobuyuki(Posted 2012) [#6]
Thanks for the TryCatch block stuff!!! This is going to be a really big deal and a boon for stuff like loading resources at runtime, and dealing with stuff like parsing errors from unexpected data.

I'm wondering, on that same track though, if we might also see a null coalescence operator coming out in the future to deal with some of those parsing issues before they need to be caught as an exception. Right now, at least, the exception handling blocks will go a long way toward dealing with some of the more common issues loading and parsing in data at runtime.


fsoft(Posted 2012) [#7]
Mark,

I cannot compile on linux, the file "ui_mainwindow.h" is missing.
Could you please post it somewhere?

Thanks


wiebow(Posted 2012) [#8]
Ohh. Try/Catch will help soo much. And I can really finish my unit testing module because of it! Thanks Mark.


marksibly(Posted 2012) [#9]
Hi,

> null coalescence operator

Never heard of it. Msdn comes up with this...

http://msdn.microsoft.com/en-us/library/ms173224.aspx

...which sounds like it only applies if there are nullable types, which I have heard of but Monkey doesn't have.

Can you provide a specific example of what you're after in pseudo Monkey code?

> I cannot compile on linux, the file "ui_mainwindow.h" is missing.

The ui_blah.h files aren't part of the source, they're generated by qmake (Qt's make program) and end up in the build dir along with all the .o files.

In fact, the src/Makefile's are probably generated by qmake too and probably shouldn't be in there. Not totally sure how it all works as I'm using Qt Creator which is gui goodness all the way, but I'm guessing you need to do something like:

qmake ted.pro
make release

However it works, I can delete the build dirs and rebuild the project in Qt creator and the ui_ .h files get magically rebuilt too.


Grey Alien(Posted 2012) [#10]
Great thanks for the find in files!


GfK(Posted 2012) [#11]
Monkey seems to be coming along really well now. Hoping to use it for my next game and that debugger will be invaluable as I'm still in therapy from converting an entire game's worth of Blitzmax code to Monkey without one.


Paul - Taiphoz(Posted 2012) [#12]
Woot nothing better than an update :)


GfK(Posted 2012) [#13]
Woot nothing better than an update :)
I can think of a couple of things, but updates are nice. :)


ziggy(Posted 2012) [#14]
Jungle Ide has been updated with support for the new Try/Catch blocks and some additional improvements. So, if you're using Jungle Ide, you should be good to use also latest Monkey compiler. (more info here: http://www.monkeycoder.co.nz/Community/post.php?topic=3052&post=31754 )


wiebow(Posted 2012) [#15]
Thanks Ziggy for the quick service!


ziggy(Posted 2012) [#16]
@wiebow: You're welcome... It's been a loooooong night :)


wiebow(Posted 2012) [#17]
I've updated my unit test module for 1.60. For those interested: http://code.google.com/p/mutated-monkey/downloads/list?saved=1&ts=1340459442

Or try the link in my sig.


golomp(Posted 2012) [#18]
Thank you Mark!


Paul - Taiphoz(Posted 2012) [#19]
is there an example of the try catch code in the help ?


slenkar(Posted 2012) [#20]
whats the difference between doing
if x=10
Print "yes"
else
Print "no"
Error "no"
endif

and using exceptions?


Thanks for 'find in files'

Also could the code explorer thing have those treeview expandable thingies for classes?(where the methods are shown when the class is expanded)


Sammy(Posted 2012) [#21]
Many thanks, really enjoying Ted BTW Mark.


Grey Alien(Posted 2012) [#22]
JungleIDE purchased! Looking forward to more monkey in the jungle.


wiebow(Posted 2012) [#23]
@Taiphoz: Yes, under Language Reference/Exceptions


ziggy(Posted 2012) [#24]
@Grey Alien: Welcome to Jungle Ide! :)
is there an example of the try catch code in the help ?

See here: http://blitz-wiki.appspot.com/Language_reference#exceptions


Grey Alien(Posted 2012) [#25]
lol @ "welcome to the jungle". Guns 'n' Roses I believe. Hey ziggy will you be adding the debug step forward/in etc buttons to the IDE? Perhaps they are already there and I'm just being dumb.


ziggy(Posted 2012) [#26]
They're there. Just when the code reaches a debug stop, the whole debug window appears with its buttons. There are not "global" buttons as you can be debugging two or more applications at a time. I could add a debug toolbar with the same buttons and just forward event to currently selected debuger, which would do the job too. If you truly miss it, just tell me and I'll add them too.
lol @ "welcome to the jungle". Guns 'n' Roses I believe.
Yes! Touché hehehe (I couldn't resist the easy joke...)

EDIT: By the way, while debugging, you can also use regular visual studio debug shortcuts Step: Shift+F8, Step Into F8, Step out Ctrl+Shift+F8, Kill application Ctrl+F7, Continue execution F7


Grey Alien(Posted 2012) [#27]
Ah I see, thanks I'll look out for them. OK sorry to derail Mark's thread.


Samah(Posted 2012) [#28]
@slenkar: whats the difference between doing

Calling Error() will kill the entire program. Using exceptions lets you catch and handle them yourself.


Darky(Posted 2012) [#29]
Any plans to implement auto completing to TED ? ( scintilla or other editcontrol ? ) i could help to do this ;) ...


greetz from germany


Paul - Taiphoz(Posted 2012) [#30]
Ted's source is in the download, have at it if you know how to add it. then send your source to mark, he might add it into the next build.


matty(Posted 2012) [#31]
I still don't understand the point of a try/catch routine...shouldn't we design our code such that error conditions are avoided? It sounds sloppy to me at the design stage?


muddy_shoes(Posted 2012) [#32]
shouldn't we design our code such that error conditions are avoided?


If you can, sure. How do you avoid an I/O error or a memory allocation failure though? How do you write a module that takes input at runtime and avoids all possibilities that the input contains errors? These things are out of the control of the code you're writing.

The sensible response to those errors is also often outside the scope of a code unit. Exceptions can be thrown up the tree and caught at a level that understands the context. For example a re-usable data reader/writer module can't know what the context of a request is. If a write fails it's only the requesting code that could understand to do something like inform the user, ignore and continue, retry with a different storage mechanism or whatever.


Gerry Quinn(Posted 2012) [#33]
Like a lot of fancy programming stuff, if you are just planning on creating a few Monkey applications you don't need to care about exceptions except when you are using libraries that use them, and then it will just change the details of the code you write.

For example, there's no real difference from your perspective whether a library operation gives a failure code or throws an exception, if you are going to deal with it then and there either way. It's just a change of syntax from your point of view.


fsoft(Posted 2012) [#34]
Hi Mark,

I succeded in compiling Ted for Linux :-)

The binary can be found here:

http://fabio.rotondo.it/ted-linux.tar.bz2

I compiled it using Ubuntu 11.04.

I only had to change the file "process.cpp" adding the following line:

#include <sys/wait.h>


needed by the
waitpid()
call.

Hope it will be useful to someone else :-)


Darky(Posted 2012) [#35]
Im too working on enchancing TED with autocomplete feature & some tools ( like a bit like purebasics japbe ) =) anyone interested to help ? then i will setup a cvs ;o) ?

Try Catch is nice... Monkey really is going to one of the best languages for my minds :D


Aman(Posted 2012) [#36]
How is the progress on the Metro target going?


Skn3(Posted 2012) [#37]
Nice update :D.


rebelas(Posted 2012) [#38]
I love Monkey, so far it has done whatever I wanted it to do!


golomp(Posted 2012) [#39]
I agree with you. If somebody need a function wich did'nt exist in Monkey,
he can create it in Java and easily include in Monkey Source Code.
It's really a big strength compared to other product on market.


matt(Posted 2012) [#40]
Some TED bug reports:

- unable to drag and drop monkey files onto the doc icon
- closing the browser side panel does not remove the tick from the menu, meaning you then need to choose the menu twice to get the side panel back


Nobuyuki(Posted 2012) [#41]
Can you provide a specific example of what you're after in pseudo Monkey code?



I may be thinking of this wrong, but one application could be something like this:

[monkeycode]
Local A:Image
Local B:Image
Local C:Image

Method OnCreate:Int()
'TryCatch method
Try
A = LoadImage("Default.png") 'Assume this always works
B = LoadImage("MaybeNothingHere.png")
C = LoadImage("DefinitelyNothingHere.png")
Catch
Try
B = A
C = B
Catch
C = A
End Try
End Try

'Null Coalesce kinda thing maybe....
A = LoadImage("Default.png") 'Assume this always works
B = AltLoading("MaybeNothingHere.png") ?? A
C = AltLoading("DefinitelyNothingHere.png") ?? B ?? A


End Method

Function AltLoading:Image(filename:String)
Local i:Image
Try
i = LoadImage(filename)
Return i
Catch
Return Null
End Try
End Function
[/monkeycode]

Just a little syntactic sugar in the vein of IIf() and the ternary operator, that's all, I suppose.

Edit: Upon reading http://monkeycoder.co.nz/Community/posts.php?topic=3098 , I realized that this may not be tenable anyway, since the most common type of exception that most people would want to catch are IO ones, and those apparently assert runtime errors, and are unrecoverable in Monkey by design...


Nobuyuki(Posted 2012) [#42]
Can you provide a specific example of what you're after in pseudo Monkey code?



I may be thinking of this wrong, but one application could be something like this:

[monkeycode]
Local A:Image
Local B:Image
Local C:Image

Method OnCreate:Int()
'TryCatch method
Try
A = LoadImage("Default.png") 'Assume this always works
B = LoadImage("MaybeNothingHere.png")
C = LoadImage("DefinitelyNothingHere.png")
Catch
Try
B = A
C = B
Catch
C = A
End Try
End Try

'Null Coalesce kinda thing maybe....
A = LoadImage("Default.png") 'Assume this always works
B = AltLoading("MaybeNothingHere.png") ?? A
C = AltLoading("DefinitelyNothingHere.png") ?? B ?? A


End Method

Function AltLoading:Image(filename:String)
Local i:Image
Try
i = LoadImage(filename)
Return i
Catch
Return Null
End Try
End Function
[/monkeycode]

Just a little syntactic sugar in the vein of IIf() and the ternary operator, that's all, I suppose.

Edit: Upon reading [url="http://monkeycoder.co.nz/Community/posts.php?topic=3098"]this thread[/url], I realized that this may not be tenable anyway, since the most common type of exception that most people would want to catch are IO ones, and those apparently assert runtime errors, and are unrecoverable in Monkey by design...


frank(Posted 2012) [#43]
For me this release doesn't work under Mac OS X Lion (10.7.2). V59 works fine.

Not working means; the editor crashes at startup.


slenkar(Posted 2012) [#44]
Are lists supposed to be able to contain NULLS?


Goodlookinguy(Posted 2012) [#45]
Are lists supposed to be able to contain NULLS?


Definitely. There's reasons for it here and there. I'm not going to write anything specific though.


Gerry Quinn(Posted 2012) [#46]
Just a suggestion for TED: block outdent is sorely needed ;-)


marksibly(Posted 2012) [#47]
Hi,

> Just a suggestion for TED: block outdent is sorely needed ;-)

Tab/Shift tab with a block of text selected allows you to indent/outdent (ie: tab/untab) the block. Is this what you mean?


slenkar(Posted 2012) [#48]
In TED
you know the code browser thingy on the right?

could you make class names bold or put the methods inside the classes in the treeview?
cos at the moment classes and methods are listed and they all look the same, so its hard to find a class


therevills(Posted 2012) [#49]
I've noticed when I copy and paste code from these forums into Ted, Ted doesnt keep the tab characters...


marksibly(Posted 2012) [#50]
Hi,

> could you make class names bold or put the methods inside the classes in the treeview?

This is working here, ie: classes are treeview nodes that contains members.

However, to do this and avoid parsing the entire program, ted takes the indent level into account so perhaps this is where it's going wrong - can you post some sample code that's not working?


slenkar(Posted 2012) [#51]
I cant open TED from this PC but I suspect its the indenting, I dont usually Indent unless there is a big complicated load of endif's and next's


Gerry Quinn(Posted 2012) [#52]
"Tab/Shift tab with a block of text selected allows you to indent/outdent (ie: tab/untab) the block. Is this what you mean?"

I amend my complaint: documentation is needed! ;-D

I did actually try Ctrl-[ and ] which IIRC MSVC uses. Never tried those. Anyway I guess since it's coded you will add it to the menu sometime when you get around to it. (For us WIMP guys, who don't like to waste neurons remembering stuff.)

By the way, with regard to the comment about class names, I correctly get class names with methods tabbed in, i.e. treeview. (I mostly only have one class per file anyway.)

Suggestions:

(1) If there are not a lot of classes/methods in the file, always make them all expanded by default. Saves a click, and the default non-expanded code window is not particularly useful if you only have one class (I load gamewnd.monkey and it tells me the file contains a class called GameWnd). Edit: this is even more annoying because the code window does not remember its state if you switch to another file.

(2) How about methods in bold (or with brackets after) and fields non-bold. Actually the more the merrier here for me, I would also not mind properties distinguished and perhaps private and public items. But those would involve parsing and some decisioms about colour or whatever, maybe sorting too would be nice: fields could be done without any significant parsing.

(3) An option for method signatures would be nice. What I'd like most of all would be some way you could expand a single method to its full signature. Then you could easily put in the correct parameters when calling it somewhere else. I realise the code window is narrow and having every method fully described would take too much real-estate. Maybe left-click on a method to jump to it, and right-click to expand it (any previously expanded method gets closed).

Anyhoo, just some ideas to make Ted better.


Gerry Quinn(Posted 2012) [#53]
Another idea for Ted code window: alphabetical ordering (perhaps as an option in case some people prefer everything to be in the same order as in the file).

This would really work great for me as in the absence of a const qualifier like in C++, I like to distinguish non-const methods (other than constructors, obviously) with an underline in front. But I think it would be helpful for most people. Others might prefer to keep methods in a particular logical order, though. But to see that, you can always just look at the file which is also open.


Samah(Posted 2012) [#54]
@marksibly: However, to do this and avoid parsing the entire program, ted takes the indent level into account so perhaps this is where it's going wrong...

loloollolo Python


siread(Posted 2012) [#55]
Noticed a bug in v60 with Flash. Changing tabs in a browser made my game unresponsive. Went back to v58 and it's fine again. Will investigate a bit further...


therevills(Posted 2012) [#56]
@siread, could it be similar to this bug: http://www.monkeycoder.co.nz/Community/posts.php?topic=3107


AaronK(Posted 2012) [#57]
OK I feel like an idiot for asking this but how can I debug in Ted? How can I set a breakpoint?

I'd also like to add, Mark, have you ever looked at trying to do targets for 3DS or Wii U etc?


slenkar(Posted 2012) [#58]
3DS doesnt allow just anyone to develop for it, you need a licence and there isnt an unofficial devkit either, same might apply for Wii U


Roger Lockerbie(Posted 2012) [#59]
@AAronK

DebugStop()

- Roger


Paul - Taiphoz(Posted 2012) [#60]
As I recall slenkar Nintendo wont give you a licence if you don't have a dedicated team and office space. their really anti-indie to be honest, something I hope they change in the future when they realize how profitable it would be for them and their game store to allow more people in.


siread(Posted 2012) [#61]
@therevills yes, that looks like the same thing.


Neuro(Posted 2012) [#62]
their really anti-indie to be honest, something I hope they change in the future when they realize how profitable it would be for them and their game store to allow more people in.

Actually they do allow indie gaming on their systems. They're just have a horrible way of doing it in their efforts to maintain "high quality". Your "company" can get approved (per basis) an official dev kit from them to build games for their Wiiware class of games. Only thing is that the dev kits pricing are not standardized, and is different for each company. And another downside is that they don't pay you a dime until you sell like 30k units or something so a lot of indie games developers end up never seeing their money.


AaronK(Posted 2012) [#63]
Thanks Roger! Also, how the hell didn't I know about Ted until a couple of days ago!?


Regarding Nintendo, it seems that they have changed a lot of their policies wrt the 3DS and Wii U which is why I brought it up. They seem to be a lot more interested in helping smaller developers, but I can't say this from any sort of first hand experience.


Sub_Zero(Posted 2012) [#64]
@MarkSibly: When (or if) will the official releases include a linux binary? (or is there an unofficial one?) Or will this consume too much of your time?

Also, where is byte, and byte[] ?

Looking forward to see more from the monkey community, this will be great.