Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Ingwie Phoenix
@ingwiephoenix:ingwie.io
[m]
Might incentivise @marcobambini to implement module importing while merging said PR! ;)
Ingwie Phoenix
@ingwiephoenix:ingwie.io
[m]
hm... fair. I'll see what i can do. ^^
Sarah
@SarahIsWeird
hey :D i'm working on a C bridge right now. if i load my class into the VM, would #include'd files also be able to call my stuff?
Sarah
@SarahIsWeird
I believe i've read somewhere in the docs that including is basically copypasting the included file into the main file.. if so, it should work. is that true, tho?
Sarah
@SarahIsWeird
Doesn't matter anymore btw xd
william behrens
@WilliamBehrens_gitlab
has anyone started work on a proper project system/pm for gravity?
Ingwie Phoenix
@ingwiephoenix:ingwie.io
[m]
Nope, not yet
I am still pretty deep into trying to generate wrappers for C in V
Looking for a C parser that can generate a symbol table... not so easy, unfortunately.
There is SWIG, but that chunky boi needs some portwork. Their CMake script is intensely broken, too...
And, to generate wrappers, it needs a whole host of files to be installed - so, it is technically portable, but ...also not really. I would love a single executable solution. After that, I want to see if I can use Gravity from V by leveraging it's features and possibly doing something there - eventually going as far as to see if I can implement the system.import/pm feature within gravity...because by that point, I'll be memorizing the entire API again. Right now, I have basically forgotten all of it. x.x
william behrens
@WilliamBehrens_gitlab
how do I execute an external command?
I thought it was System.exec but that doesn't seem to to work
william behrens
@WilliamBehrens_gitlab
Is multilevel inheritance supported in gravity?
william behrens
@WilliamBehrens_gitlab
Are interface style classes supported?
william behrens
@WilliamBehrens_gitlab
image.png
I need help with this code snippet
Mike King
@MikeRKing
hi folks
image.png
Just chiming in to say I've found Gravity very useful and am currently working on a project which takes a gravity file and turns it into a native executable, which I will be extending as time goes on, but above is a screenshot of it in action
Mike King
@MikeRKing
It leverages a C++ compiler (g++ in linux, and will be shipped with a portable one for Windows), and the tool handles everything from generating code, to linking required libraries making a single portable executable for the output. My aim is to create 'modules' in the form of linkable static libraries which will only be linked when they're required, and it will then hopefully be seen as a good development environment for hobbyists or people who want to knock up applications quickly and deploy them wherever with as little dependencies as possible
Mike King
@MikeRKing

image.png

super seems to only work with functions rather than variables, and since I don't see a way to add constructors/destructors to classes, try creating an init function in the TestPackage class which calls upon a setter function maybe?

Mike King
@MikeRKing
I beg your pardon, having a function called init() in the class would act as the constructor which gets called upon the instantiation, so you could have super.SetAuthor("William") in the init() function, and in the base class have a setter in the form of a function
william behrens
@WilliamBehrens_gitlab
ok @MikeRKing also that sounds really cool, I really like swift and enjoy that gravity can basically act as a more foss version of that, I'm currently trying to work on a build system/package manager that's called quark while focusing on keeping it as minimal as possible for the end user(trying to avoid messes like npm or pip)
Mike King
@MikeRKing

ok @MikeRKing also that sounds really cool, I really like swift and enjoy that gravity can basically act as a more foss version of that, I'm currently trying to work on a build system/package manager that's called quark while focusing on keeping it as minimal as possible for the end user(trying to avoid messes like npm or pip)

I agree entirely, @WilliamBehrens_gitlab . There seems to be a nice balance between simplicity and capability. Quark does sound good. I'm currently at the stage of thinking the best way to have my compiler handle what libraries to include. A library being simply a static lib of methods and functions that get registered into the VM, and any dependencies (also in the form of static libs). My thought is since there will be a standard library of include files, I might have to fork gravity to allow for a way to add a macro similar to the #include one, but one specifically to instruct the compiler to link a library, and then the user can just include one of the standard files which contains externs, the macro as well as any other relevant declarations - I suppose like a header

Sarah
@SarahIsWeird
@WilliamBehrens_gitlab i started, but i have uni stuff to do so dev is kinda slow.
The idea was that a module would return something - may that be a function or a class, which would be included. That would avoid cluttering the global namespace and takes off a lot of work off the parser (and frankly the devs of the package manager)
Kinda like lua does it.
william behrens
@WilliamBehrens_gitlab
what's the difference between classes and structs in gravity, or is there none?
Sarah
@SarahIsWeird
Structs are something now. Sadly marco doesn't update the docs anymore, and i'm not good enough to read that kinda source code..
william behrens
@WilliamBehrens_gitlab
wait so who's in charge of the docs? no one?
Sarah
@SarahIsWeird
Wait did my second message go through? Gitter is so weird
Honestly, no idea. There's not a lot of activity around here.
Sarah
@SarahIsWeird
They are public though, so i guess we could sit down and improve them. Meant to do that for a while now...
Mike King
@MikeRKing
I'll sit down later and update the docs for structs/classes
Mike King
@MikeRKing
Marco Bambini
@marcobambini
Hi guys, I’ll try to be more active in this chat
Struct support is not completed. It is parsed but not enforced at runtime
A Struct is copied by value while a Class is copied by ref
Sarah
@SarahIsWeird
Hi guys, I’ll try to be more active in this chat
It's fine :)
william behrens
@WilliamBehrens_gitlab
so I have the main project definition file here https://gitlab.com/WilliamBehrens/quark/-/blob/master/src/quark/src/quark.gravity and a test file here https://gitlab.com/WilliamBehrens/quark/-/blob/master/src/quark/tests/demo/package.gravity (not the cleanest I know) but the issue I'm having it that running the package.gravity file I get RUNTIME ERROR: Unable to find _name in superclass Package
wait :P I just realized that member variables in gravity are private by default
still think that should have worked though?
william behrens
@WilliamBehrens_gitlab
what's the proper way to execute shell tasks in gravity? I thought it was System.exec but that doesn't seem to work anymore
Mike King
@MikeRKing
Another little milestone met with the project I'm working on. A demonstration of on-demand functionality - only linking to the output executable what is needed by the user's project, including any dependencies required by that dependency...
image.png
And pretty console colours
Marco Bambini
@marcobambini
@MikeRKing it seems a very cool project!
Mike King
@MikeRKing
It's slowly getting there!