gcmartijn

Forum Replies Created

Viewing 13 posts - 61 through 73 (of 73 total)
  • Author
    Posts
  • in reply to: Structs and the GC #2532

    gcmartijn
    Participant

    I try to visualize it and learn by mx2 codes.
    And found this text about a array with struct

     
    <div class=”post-text”>

    struct

    An array of values v encoded by a struct (value type) looks like this in memory:

    vvvv

    class

    An array of values v encoded by a class (reference type) look like this:

    pppp

    ..v..v…v.v..

    where p are the this pointers, or references, which point to the actual values v on the heap. The dots indicate other objects that may be interspersed on the heap. In the case of reference types you need to reference v via the corresponding p, in the case of value types you can get the value directly via its offset in the array.

    </div>

    in reply to: Structs and the GC #2522

    gcmartijn
    Participant

    I don’t see it yet haha, I know the point about a reference and non reference.

    So a struct don’t cost memory because it will reset after a loop, and will use only memory when it is used by me inside a loop ?

    While a Class Field is used from the beginning till the end of the program.

     

    Look at this not working example

    Normally I want to keep a postion X and Y and update this every loop.
    Is it better/faster to keep it in a struct.

     

    Can I say, A Struct acts just a Local but you can store Fields inside them.
    It is only using memory when you declare them, and it is resetting after a loop.

    If you want to use a variable in multiple classes then maybe you can make a global struct.
    And maybe the struct will use memory if a function is using the global struct, but mostly not.

    in reply to: Structs and the GC #2501

    gcmartijn
    Participant

    Would be cool if someone explain the need about structs.
    When do you need them and are the a lot faster then a class ?

    With my background using C# and python,monkey1,javascript,nodejs I never needed them.

    http://monkey2.monkey-x.com/language-reference/

    To declare a struct:

    Struct Identifier

    [/crayon]

    End

    A struct can contain consts, globals, fields, methods, functions and other user defined types.

    Structs are similar to classes, but differ in several important ways:

    • A struct is a ‘value type’, whereas a class is a ‘reference type’. This means that when you assign a struct to a variable, pass a struct to a function or return a struct from a function, the entire struct is copied in the process.     —– what does this mean ?
    • Stucts are statically typed, whereas classes are dynamically typed.
    • Struct methods cannot be virtual.
    • A struct cannot extend anything.
    in reply to: Drop in Activity fragmentation is bad. #2487

    gcmartijn
    Participant

    Feng shui

    @amon

    I total agree with you except I do need a little more then just program.
    For example that correct nice font in the editor, or that background color and syntax color.

    These things make it (for me) more fun to program.

    But at the root level, its the idea of making (program) that thing you want.
    (using a good documentation / forum with feedback)

    in reply to: Delta Timing Vs Fixed Rate Logic Vs Timer #2364

    gcmartijn
    Participant

    Example please, is it slow Device proof ?

    I want to try something new, a fresh start using mx2.

    But as you can see I had some trouble with getting the most important thing oke, fps.

    is the way mx2 handle a render/update setframerate the same ?

    in reply to: Delta Timing Vs Fixed Rate Logic Vs Timer #2354

    gcmartijn
    Participant

    I hope that someone create (maybe mark) a good tutorial about

    deltatime / framerate / oprender / update in MX2

    A year ago I was using this for Monkey1 but I don’t know what now the best use is using MX2

    https://github.com/Regal-Internet-Brothers/deltatime

    Some tests using deltatime with huge ‘strange’ things

    http://www.monkey-x.com/Community/posts.php?topic=9918&post=107293&view=all#107293

    in reply to: Ted21 progress #2170

    gcmartijn
    Participant

    I’m new at using git, and now i’m wondering what will happen with the modified files by AdamStrange.

    Is he using the latest ted source using pull , and can he / access to upload/overwrite the official Ted source ?

    Or will this be a source at his git only, so there are now two versions about ted ?
    This would be weird because Mark is the ‘boss’ about Ted and can make fast changes.
    When he make a change , then the other ted is not oke anymore.

    Or will this live as a fork within the official source ?

    in reply to: Ted2 (request) & website (bug) #1594

    gcmartijn
    Participant

    yep working

    in reply to: stylesheet update #687

    gcmartijn
    Participant

    * coming

    I forget to say

    .tree-leaf .tree-leaf-text {
    /* margin-left: 8px; */
    /* line-height: 2em; */
    }

    so its only:
    .tree-leaf .tree-expando.expanded {}
    .tree-leaf .tree-leaf-text {}
    .tree-leaf .tree-expando {
    color: #9B4DCA;
    cursor: pointer;
    float: left;
    }

    in reply to: OSX monkey2 Can’t find gcc #684

    gcmartijn
    Participant

    Ah I see now, I had many files inside a directory and din’t see that there was already a monkey2 (very old one)

    now its working oke.

    I see that TED2 is not alive anymore in this release, you can’t do everything once 🙂

    in reply to: OSX monkey2 Can’t find gcc #662

    gcmartijn
    Participant

    “/Users/gcmartijn/Downloads/monkey2/bin/mx2cc_macos” makeapp -target=Desktop -config=Debug “/Users/gcmartijn/Downloads/monkey2-master/tests/monkey/classes.monkey2”

    MX2CC monkey2 compiler V0.001

    sh: tmp.txt: Permission denied

    Can’t find gcc – please install gcc tools or update your bin/env.txt file

    Done.

     

    no still the same problem.
    Its just to let you know about this.

    ***** Rebuilding modules *****

    MX2CC V0.002

    ***** Making module ‘monkey’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/monkey/monkey.buildv002/desktop_release_macos/monkey.a

    ***** Making module ‘libc’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/libc/libc.buildv002/desktop_release_macos/libc.a

    ***** Making module ‘miniz’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/miniz/miniz.buildv002/desktop_release_macos/miniz.a

    ***** Making module ‘hoedown’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/hoedown/hoedown.buildv002/desktop_release_macos/hoedown.a

    ***** Making module ‘stb-image’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/stb-image/stb-image.buildv002/desktop_release_macos/stb-image.a

    ***** Making module ‘stb-truetype’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/stb-truetype/stb-truetype.buildv002/desktop_release_macos/stb-truetype.a

    ***** Making module ‘std’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/std/std.buildv002/desktop_release_macos/std.a

    ***** Making module ‘gles20’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/gles20/gles20.buildv002/desktop_release_macos/gles20.a

    ***** Making module ‘sdl2’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/sdl2/sdl2.buildv002/desktop_release_macos/sdl2.a

    ***** Making module ‘sdl2-mixer’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/sdl2-mixer/sdl2-mixer.buildv002/desktop_release_macos/sdl2-mixer.a
    MX2CC V0.002

    ***** Making module ‘monkey’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/monkey/monkey.buildv002/desktop_debug_macos/monkey.a

    ***** Making module ‘libc’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/libc/libc.buildv002/desktop_debug_macos/libc.a

    ***** Making module ‘miniz’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/miniz/miniz.buildv002/desktop_debug_macos/miniz.a

    ***** Making module ‘hoedown’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/hoedown/hoedown.buildv002/desktop_debug_macos/hoedown.a

    ***** Making module ‘stb-image’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/stb-image/stb-image.buildv002/desktop_debug_macos/stb-image.a

    ***** Making module ‘stb-truetype’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/stb-truetype/stb-truetype.buildv002/desktop_debug_macos/stb-truetype.a

    ***** Making module ‘std’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/std/std.buildv002/desktop_debug_macos/std.a

    ***** Making module ‘gles20’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/gles20/gles20.buildv002/desktop_debug_macos/gles20.a

    ***** Making module ‘sdl2’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/sdl2/sdl2.buildv002/desktop_debug_macos/sdl2.a

    ***** Making module ‘sdl2-mixer’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Archiving /Users/gcmartijn/Downloads/monkey2-master/modules/sdl2-mixer/sdl2-mixer.buildv002/desktop_debug_macos/sdl2-mixer.a

    ***** Rebuilding mx2cc *****

    MX2CC V0.002

    ***** Building app ‘/Users/gcmartijn/Downloads/monkey2-master/src/mx2new/mx2cc.monkey2’ *****

    Parsing…
    Semanting…
    Translating…
    Compiling….
    Linking /Users/gcmartijn/Downloads/monkey2-master/src/mx2new/mx2cc.buildv002/desktop_release_macos/mx2cc.app/Contents/MacOS/mx2cc
    MX2CC V0.002
    Usage: mx2cc makeapp|makemods|makedocs [-run] [-clean] [-verbose] [-target=desktop|emscripten] [-config=debug|release] source|modules…
    MX2CC V0.002

    ***** Doccing module ‘monkey’ *****

    Parsing…
    Semanting…

    ***** Doccing module ‘libc’ *****

    Parsing…
    Semanting…

    ***** Doccing module ‘std’ *****

    Parsing…
    Semanting…
    gcmartijn:src gcmartijn$ “/Users/gcmartijn/Downloads/monkey2/bin/mx2cc_macos” makeapp -target=Desktop -config=Debug “/Users/gcmartijn/Downloads/monkey2-master/tests/monkey/classes.monkey2”

    MX2CC monkey2 compiler V0.001
    sh: tmp.txt: Permission denied
    Can’t find gcc – please install gcc tools or update your bin/env.txt file

    in reply to: OSX monkey2 Can’t find gcc #661

    gcmartijn
    Participant

    I thought everyone uses a release, found here:

    https://github.com/blitz-research/monkey2/releases

     

    Going to download this now

    https://github.com/blitz-research/monkey2/archive/master.zip

    maybe its better to delete that release version to keep only one download link.

    in reply to: Hot Pink! #657

    gcmartijn
    Participant

    Its readable and fresh 😉 keep it for now

Viewing 13 posts - 61 through 73 (of 73 total)