Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
tDwtp
@tDwtp
good good
thats working fine, i guess macos will be the same. It usually makes it easier anyway
Sarah
@SarahIsWeird
please don't use an executable as a library...
tDwtp
@tDwtp
Not as a library. @SarahIsWeird it 's going to be plug-in based. It's doable
tDwtp
@tDwtp
BTW. We then should not export loading mechanisms. This can cause hard to detect errors. Indirect loading, while still being possible, is not recommended. They would need to do a Gravity-function instead of a C-function call (unless they know what they are doing.
tDwtp
@tDwtp
@marcobambini either you have not had the time, or i guess thats still wrong? If you have some more tips for me just post them on #373 also for cleaner includes (in C) i want you to have a look at #368 and the gravity_common.h header It might make sense to but the typdefs for gravity_vm and some others (just a basic typedef struct name_s name_t; hiding the types would be best, maybe an 'internal' header like gravity_type.hto gain access inside te gravity_*.c files?)
Marco Bambini
@marcobambini
Thanks @tDwtp, I just merged #368. I need more time to analyze #373.
tDwtp
@tDwtp
omg my spelling
RyhonDev
@RyhonDev_twitter
Are there any bindings to gravity other than the Go one? I've tried all the binding generators and they all threw errors
tDwtp
@tDwtp
@RyhonDev_twitter could you be a bit more specific on which generators. I have a feeling PySide is one of them?
tDwtp
@tDwtp
@marcobambini any progress?
Árnilsen Arthur
@arnilsenarthur_twitter
Hello people
tDwtp
@tDwtp
@marcobambini I will improve the documentation of the C side first... so I will do some testing with my "executable includes the library" approach. I have an import function semantic ready to be implemented and i have some time on my hand
The Gravity side will get a technical documentation as well. Both will have a Lua style approach
also I need to expand the documentation html file for this (to allow definition lists)
shangtsung1
@shangtsung1
What's the best way of passing a cpp object to a gravity scripts function ?
Marco Bambini
@marcobambini
shangtsung1
@shangtsung1
:)
shangtsung1
@shangtsung1
is there an example for using loadfile_callback ?
shangtsung1
@shangtsung1
ive added it to the delegate, and it gets called, but crashes the app when i return the char* of the file.
const char* script_loadfile_callback(const char *file, size_t *size, uint32_t *fileid, void *xdata, bool *is_static){
        return script_read(std::string(file));
    }
script read just returns the contents of a file as a char*, a printf shows its not the issue.
tDwtp
@tDwtp
@shangtsung1 idk whether it will help, but check out my fork
or just use file_read(const char*, size_t*) inside gravity_utils
is it uploaded anywhere (repo or somewhere where i can take a look?)
shangtsung1
@shangtsung1
nah, im only toying around at this stage, ill have a look at your fork
shangtsung1
@shangtsung1
im guessing gravity expects me to set that size parameter?
tDwtp
@tDwtp
yes its a pointer for a reason
shangtsung1
@shangtsung1
    const char* script_loadfile_callback(const char *file, size_t *size, uint32_t *fileid, void *xdata, bool *is_static){
        std::ifstream input_file((file));
        if (!input_file.is_open()) {
            return NULL;
        }
        std::string content = std::string((std::istreambuf_iterator<char>(input_file)), std::istreambuf_iterator<char>());
        const char* a = content.c_str();
        printf("\n<%s>\n",a);
        *size = strlen(a);
        return a;
    }
I'm pretty novice at c, but that code is printing out in the console
<func testFunction(){
    return true;
}>
Unrecognized token
Unrecognized token
tDwtp
@tDwtp
Did you add a main function?
shangtsung1
@shangtsung1
that should be irrelevent.
im not getting to the vm stage. thats still in the compilation stage.
tDwtp
@tDwtp
Check if it's the terminating 0 at the end of the string?
(I doubt but whatever)
yves gerey
@GereyYves_twitter

[please excuse the long message, meant for the official forum -- which I didn't find!]

Bonjour, Noob here!

I'd like to port a lightweight language to a Z80-based computer older than you (the Amstrad CPC 6128), and to CP/M as well if there is interest.

  • Sub-goal: porting the vm.
  • Main-goal: having the whole toolchain on the native machine (no cross-compilation)
    More context here.

Gravity is a very interesting candidate regarding the VM: small, so easy to cross-compile for early tests, and easy to rewrite in assembler for performances.

My first questions are:

  • Is there already related work? (my google-fu wasn't strong enough)
  • Is anyone interested to work on that with me? (I'm an outgoing introvert, according to my dog). Following Erdòs, I believe that programming is the perfect social activity for asocials (ok, just kidding, I don't mean to reinforce stereotypes).
3 replies
Sarah
@SarahIsWeird
@marcobambini sorry if this sounds abrasive, but is gravity considered dead? I check in from time to time, and I nearly never see any updates, especially considering that the package manager is on the table since like, three or four years ago.
Sarah
@SarahIsWeird
It's totally fine if you don't see any point in working on gravity anymore, or even for a few months/years, but a clear message would be helpful, especially since if we know it's not abandonware, we could actually start working on a solution for packages. (which btw, definitely needs better coordination. as it stands, there will be a lot of different ecosystems)
Marco Bambini
@marcobambini
@SarahIsWeird I want to assure all of you that Gravity is far from dead. I'd like to find out a nice solution for the package manager but so far nothing really fit the gravity-style I'd like to have. Starting from next year I plan to dedicate more time on the Gravity project.
2 replies
Sarah
@SarahIsWeird
Thank you for the clarification. :D It's nice to have an answer ^^
I'm currently working on a proof-of-concept, which would probably work better than the ones before it, since I actually took the time to study the capabilities exposed by the compiler and the VM.
Marco Bambini
@marcobambini
Thanks @SarahIsWeird, please share your proof-of-concept when you'll be ready.
Sarah
@SarahIsWeird
Sure thing :D
Epsola
@Epsola
Is there any future in this project? looks dead.
Epsola
@Epsola
Was been considered it for a video game, but there doesn't appear to be any real support on this project despite it looking very good on the surface.
Marco Bambini
@marcobambini
Gravity is not dead. There is another game engine that is using Gravity and I promptly fixed all the reported issues in few days: https://github.com/marcobambini/gravity/issues?q=is%3Aissue+author%3Auntoldengine
Epsola
@Epsola
Good to know. What's Gravity like performance wise? Has there been any comparisons between say Wren or AngelScript?
Ingwie Phoenix
@ingwiephoenix:ingwie.io
[m]
There has - but it is heavily outdated...
Never got around to re-run the bench.
let alone updating all the languages in here.
That said, looking at the repo's bench.cc is quite obviously for Windows as DWORD and shlwapi.h are used. Oh well.
Chon
@chonwhite
Is it possible to get the current method name in C/C++ callback function?