AaronK

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • in reply to: Any multiplayer networking module available? #14752

    AaronK
    Participant

    Thanks. Unfortnately I don’t have to time to make up a network stack for it. I might have to look at Unity again.

    Cheers

    in reply to: Translation hanging with nested struct templates #8063

    AaronK
    Participant

    Thanks for the reply @cocon. I’m very familiar with OO and C++ (I do it for a job), my concern is the potential danger when tying ref/value semantics to the declaration of a type. As I outlined above there’s some potentially very dangerous issues that can arise and I feel the code is less easy to reason about (You need to get back to the declaration). The latter can be solved in some part with a great IDE but TED isn’t there yet.

    In your example above, the reasoning is only clearer because you’ve essentially used a variant of Hungarian notation by adding Struct to the type name. I think this is bad form in and of itself, however if the functions were generics, you wouldn’t see that even.

    [/crayon]

    Does completely different things if the ‘t’ passed in was a struct or class. The compiler at present can’t help either as it’s OK to use either struct or class.

    I’ve probably belaboured the point 🙂

    in reply to: Translation hanging with nested struct templates #8062

    AaronK
    Participant

    In my experience, the fact that the code for a struct instance and class instance looks identical, but behaves differently is potentially dangerous. C++ has it too of course (Although it provides some protection with non reassignment of references) but finding the solution is fast (Look at the function signature) as opposed to having to go to the declaration.

    If I had

    [/crayon]

    This is contrived of course but what happens on function end? Is a changed or not? My understanding is that a is NOT changed in the caller if it’s a struct, but if it’s a class it is. This is compounded more by the fact that if you later change from struct to class (Maybe you want to extend from something), the program behaves completely differently and you’d likely have to refactor a lot of code. Now there might be solutions in Monkey that solve these issues, I’m still really new to it, but when I see by value/ref based on struct/class it raises some red flags 🙂

    Without knowing the internals I’m not sure how having it user specified would cause too many problems, it’s just moving the issue from the declaration to the called function which I think is where a user would want to specify certain behaviour. Sure you’d have to have some qualifiers in some case, but maybe making the default case be “by reference” you could reduce the need for it immensely. For instance if everything was by ref by default, potentially one keyword could be used for the other cases

    [/crayon]

    If you hated ByValue maybe if function signature has () that means “construct a new one” as in

    [/crayon]

    Anyway, not trying to be a dick just trying to provide some feedback based on concerns about proneness to errors with the way it currently is.

    Cheers

    in reply to: Translation hanging with nested struct templates #8051

    AaronK
    Participant

    Gotcha.

    Question. Was there a reason structs are by-value and classes are by-reference as opposed to allowing the user to specify? I find the former is more error prone because the ref/value semantics is not localised; you need to go to the declaration or documentation to find out what it would be and remember it. Having it user specified would make it clear at the point of definition.

    I also noticed that there is a Ptr keyword which might solve my problem however I’m not sure how to get the address of an object to set it.

    in reply to: Translation hanging with nested struct templates #8021

    AaronK
    Participant

    Hi Mark, not sure what you mean. My minimal code was what I needed; that is, nested template structs.

    in reply to: Does monkey have macros? #8017

    AaronK
    Participant

    @cocon I just need macros to wrap code so I can do something like this

    REQUIRES(DoSomething() = false) and have the code portion both checked and put into an exception to help with error tracking.

    Basically if you look at any C++ UNIT testing framework like Catch etc, then I want that sort of functionality.

    in reply to: Translation hanging with nested struct templates #7975

    AaronK
    Participant

    Just to add, if Jim<> was declared as a class, it would build fine.

    in reply to: What's the way to derive from structs #7966

    AaronK
    Participant

    Seems like a lot of restrictions to avoid type slicing; something common in another languages (Especially C/++).

    The way structs are is trading one “issue” for another. That is, you have to continually look at the declaration of your types to check whether they are by value or ref which I don’t think should ever have to be the case; code should be self documenting. It’s also now forcing people who want to use virtual functions to have by ref (And effectively heap allocated objects) which is taking away their control over performance.

    I actually wonder if it would have been better for Monkey (and c++ to be honest), to just not allow assignment that causes slicing. I’m having trouble right now, thinking of a single use case where I have ever needed to do this. i.e. It’s always been mistake.

    in reply to: What's the way to derive from structs #7958

    AaronK
    Participant

    Thanks, extends is what what I wanted to do; I just needed to add some member functions to Vec2i

    I don’t see the logic of not allowing extends on a Struct – it seems pretty arbitrary. If there’s nothing virtual, no need for a virtual function table so no overhead.

    One thing I’ve found as I’ve gotten into Monkey2 a bit more is that documentation is really lacking. Or maybe it’s the search function in the docs that doesn’t work well. Either way I often can’t find what I’m after

    in reply to: What's the way to derive from structs #7951

    AaronK
    Participant

    But I have it as a struct so I can have value semantics given the bizarre choice to have structs by value and classes by ref?!?!?!

    in reply to: Initialising array of Aliases give error. #7545

    AaronK
    Participant

    I can only find 1.1.01 in the files. Is there a beta section somewhere where I can get the latest?

    in reply to: Playniax news #7544

    AaronK
    Participant

    Cool, can’t wait to see what you’re doing

    in reply to: Ted2Go IDE #7509

    AaronK
    Participant

    First, great work on Ted for Monkey 2. One small thing I’d like is to have the key mappings fixed on OSX. I have to use CTRL-C to copy and SPLAT-V to paste.

    in reply to: Playniax news #7508

    AaronK
    Participant

    Is this editor a thing we can buy/get?

    in reply to: Playniax news #7464

    AaronK
    Participant

    Holy Smoke. So I come back to look at Monkey 2 and find Pyro 2 is free!? I have to say that’s a very generous thing to do.

    I see in this thread there’s a particle editor and some sort of Pyro editor. However I can’t see those for sale or such on your itch.io site. Are they available yet?

     

    Thanks

    Aaron

Viewing 15 posts - 1 through 15 (of 16 total)