gravity
gravity copied to clipboard
Http support
I'm not sure if http support is better implemented built-in or through a library, but it's a generally useful feature.
I took a stab at handling get requests (super ugly, just got an mvp going)
https://github.com/jamesalbert/gravity/commit/2695e5b24bd663e0957598c21472006d19ab737f
Are there already plans to implement something like this? If not, with some feedback, is this something that can be added to the project?
There was someone planning to work on passing features from a single-header socket library to Gravity.
Fortunately, making a wrapper for a library towards Gravity is not that difficult - but it does involve reading through the various headers, since not all functions are labeled very well (take the marry_* functions and macros for instance, which do array handling).
But for that, you do get a very low-level access to Gravity and values, reducing the layers of abstractions quite some and making access to the wrapper itself quite fast.
I was looking into Swig, but trying to write a wrapper generator using Swig is all but easy unfortunately...
@IngwiePhoenix is there a wrapper on github I can use for reference? I tried looking, but gravitational spams the search + it seems there are still open issues for module support
https://github.com/marcobambini/gravity/blob/master/src/optionals/gravity_env.c https://github.com/marcobambini/gravity/blob/master/src/optionals/gravity_env.h
This is one that I contributed. In general, you can find some good examples within the optionals folder.
Oh, I saw those. That's what I modeled my changes off of
And yes - module support is in fact still missing. But with module support, people mean something like this:
import x from "y";
var x = require("y");
But you can still add functions to Gravity just fine.
think my link was poorly placed, fixed it