skn3

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 57 total)
  • Author
    Posts
  • in reply to: Ted2Go IDE #5097

    skn3
    Participant

    nerobot, you the bomb!

    in reply to: Playniax news #5082

    skn3
    Participant

    feature creep, always feature creep 😉

    in reply to: Ted2Go IDE #5078

    skn3
    Participant

    Been working with ted2go more today. A suggestion:

    Can auto complete lists be sorted by a combination of casing, length and distance/popularity?

    casing
    If I type Item then the list should prioritise ItemBlah over itemBlah

    length
    If i type appl then the list should prioritise apple over AppleColor

    distance/usage (not as important as casing and length)
    The list should try and sort by number popularity of keyword and also the closest recent usage of keyword. So for example if i define a Local variable, then autocomplete should favour this over variables further away in the file.

    in reply to: Maximised WindowFlag #5069

    skn3
    Participant

    Given a quick test, seems like it doesn’t redraw properly on startup when the flag is set. I have just a black screen. I have to manually find a gadget in the dark (mojox) that will trigger the redraw. It looks like if you set a smaller window size then the actual maximised sized, then this is where it does not redraw properly.

    Also noticed there is no way to capture when the maximised state in the Window class. Would be nice to get a .Maximized and .Minimized Property on Window.

    This works:

    [/crayon]

    Could we have new events to wrap the SDL ones too:

    [/crayon]

    There doesn’t seem to be a way to capture these without modifying mojo. Would it be possible to add a RawEvent:Void() callback to the app class? So we can hook into all SDL events, even ones not captured into mojo?

    in reply to: Maximised WindowFlag #5038

    skn3
    Participant

    winner thanks 😀

    in reply to: Ted2Go IDE #5023

    skn3
    Participant

    Liking ted2go so far, good work!

    Can I suggest switching the icons to something a bit more monochrome (and modern looking) to fit with the solid color theme of ted2?
    http://fontawesome.io/icons/

    Handy tool here for converting to png:
    http://fa2png.io/r/font-awesome/

    in reply to: mojox, events need to run on new fiber #4853

    skn3
    Participant

    winner! so let me tell you some more about promises!

    lol

    [/crayon]

    I dunno, but this just pleases me.

    in reply to: mojox, events need to run on new fiber #4851

    skn3
    Participant

    I think the benefit of promises cant really be shown in just one small snippet. For promises to be useful, everything has to be promises. So fetching from database, a promise. Creating an object, promise. Everything a promise. Then you can just encapsulate all your routines as promises. You can flow them together without really thinking. You can have one catch to rule them all as well. Regardless of which library the promise lives.

    But pretty much your correct. Promises are are to *fix* javascript lack of async/fiber. They were also introduced to solve the problem of a nested nightmare of callbacks.

    However javascript does have async/await on the horizon https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function it’s just not fully mainstream yet. I get the impression they are implementing this to *fix* the issues that promises brought with it.

    But yeah going off topic a little. I agree with tyou, mx2 should not go the promise route. The async/await using fibers/futures is much nicer!

    in reply to: mojox, events need to run on new fiber #4847

    skn3
    Participant

    Well how about something like this:

    [/crayon]

    I can create modular promises that can perform async operations, and then have one final destination for catching exceptions.

    async and await are nice, but at the same time promises do have their merits. They fall down when you need to pass around more information then just one thing. You either have to contain the data in the parent closure, or build objects by passing it down the .then() chain. Its also possible to use Promise.all([]) and then build your object at the end. The .then() of Promise.all([]) receives an array with each promises result.

    in reply to: mojox, events need to run on new fiber #4841

    skn3
    Participant

    Well clearly myn is a fugly LOL! I was trying to make it a self contained pattern, also similar to javascript with the commands passed to the callback/promise.

    Anyway, I just tried your version and this works a charm. My example modified to yours:

    [/crayon]

    So your correct about the theory. Once you start pushing around those async operations you have to keep doing so.

    I have had most experience using Promises in Javascript. With those you fire off a ton of operations which signal to the promise when they are complete. Like so:

    [/crayon]

    The awesomeness is you can keep returning new promises from your promise, or your .then() to chain together functionality into you callbacks. So you can break your code up into say, fetchUser(), generateImage(), updateCounters(), etc and have each return a promise. You can then piece together complex tasks and receive your result back in a chain of .then()’s.

    There is also Promise.All([]) which fires off a list of promises at once, and then() is called once all have finished.

    But anyway…

    in reply to: mojox, events need to run on new fiber #4839

    skn3
    Participant

    I removed my code above as was getting it to work. And here is the finished result 😀

    [/crayon]
    in reply to: mojox, events need to run on new fiber #4837

    skn3
    Participant

    .

    in reply to: mojox, events need to run on new fiber #4836

    skn3
    Participant

    When I was writing the previous reply, trying to ponder the ramifications of the Async suggestion, I did burn a few thousand braincells in the process! So yeah thats gonna be a long trip down the rabbit hole if you go that route!

    The mojox thing does sound like a decent stop gap, as your not gonna break anything core in monkey2.

    .

    in reply to: mojox, events need to run on new fiber #4828

    skn3
    Participant

    Yeah the JS editor is a pain in the ass when adding code! Is there a markdown plugin for wordpress? Would be nice to use that instead! (https://en.support.wordpress.com/markdown/)

    Well I guess everything would have to be on a fiber. Anything else and you are always going to find a scenario where this may happen?

    Could we potentially tag our functions/lambdas as async, which indicates their calling mechanism? So it could be used like so:

    [/crayon]

    or

    [/crayon]

    I am surprised that emscripten doesn’t support fibers. future versions of JS will have generators, which are similar… https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*

    in reply to: mojox, events need to run on new fiber #4824

    skn3
    Participant

    I created a small util function:

    [/crayon]

    Which is used like:

    [/crayon]

    It doesn’t work. Now it fails to build with

    C:/dev/projects/monkey1/conveyor/tools/itemMaker/itemMaker.buildv1.0.91/windows_debug/src/itemMaker_classes_2utils.cpp:192:27: error: declaration of ‘t_std_fiber_Fiber l_func’ shadows a parameter

    t_std_fiber_Fiber(l_func);

    If I change it to the follow, then it works:

    [/crayon]

    But this does seem a bit cludge!

Viewing 15 posts - 16 through 30 (of 57 total)