Results 1 to 10 of 24

Thread: about RUST

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    about RUST Programming Language

    Hi Petr,
    i refer to your project in https://github.com/petrSchreiber/Cal...from-ThinBASIC
    when you have time only and if possible to add to the test_lib.tbasic and lib.rs how to pass an array of numbers, and an array of strings, and an array of UDT from thinbasic to Rust DLL and to get it back to thinbasic
    the reason is that i want to test the rust dll speed in my example http://www.thinbasic.com/community/s...-as-FreeBasic)
    and to compare its speed with the freebasic DLL i have used in that example and to the Oxygen module you have used there. of course after increasing the Simpson figure points to thousands so to notice the timings.

    the UDTs can be :
    Type TBGL_TRGB
        r As Byte
        g As Byte
        b As Byte
      End Type
       
      Type TBGL_TVECTOR3F
        x As Single
        y As Single
        z As Single
      end type
    
    or as you like more suitable
    Thanks
    Last edited by primo; 19-07-2018 at 20:55.

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732
    Hi Primo,

    sure thing, I am happy you find it interesting.

    I will work on it today afternoon and will notify you here once ready


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732
    Hi Primo,

    I think I have it for you I also did a minor cleanup of the whole repository and made it possible to use thinBasic strings without need to convert them to unicode first.

    Please have a look here for new ThinBASIC definition:
    https://github.com/petrSchreiber/Cal...lib.tbasic#L32

    ...and calling code:
    https://github.com/petrSchreiber/Cal...ib.tbasic#L110

    ...and here for the Rust code being called:
    https://github.com/petrSchreiber/Cal...fined_types.rs


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4
    you are so generous Petr to provide such a detailed code, which without i will never be able to send UDT array to Rust.
    i have applied the instructions in README.md: cargo build --release, then i have found the rust_interop.dll in the Release folder. and after running the test_lib.tbasic it display the output in magnificent glory:
    rust_tb2.PNG
    but when i press a key to exit the program, the windows 7/x64 display a pop up: thinbasic has stopped to working ...windows is collecting....
    your previous package does not display this message.
    amazingly with the same DLL thinbasic does not display the error in windows xp/32
    Thank you again, tomorrow i will try to run the Simpson figure generator using the Rust DLL according to the info and code you have provided.
    Last edited by primo; 21-07-2018 at 07:28.

  5. #5
    Hi Petr
    just now i have found that the msg "thinbasic.exe has stopped working" happened only when we want to exit by pressing a key, but there is no error msg when we close the program from the 'X'
    this is in windows 7/x64 with thinbasic V1.10.5.0

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732
    Hi Primo,

    the root cause was mistake on my side - I passed array of two elements, but told Rust it is 10 element array.
    Try now, I am pretty confident it will resolve the issue


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Members who have read this thread: 1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •