-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http library #334
Comments
Does not exist yet, sorry.. we've had plans to add one, but likely that should be based on a C++ http library that is small, robust and still featureful, and its hard to find such things. In particular, if you are expecting to support https, there is probably no such thing :) |
I've briefly looked into what Lobster http client can be based on. Observations:
|
Stuff like libcurl is positively gigantic. Making Lobster build 10x as long for http(s) support is not really an option. Zig is neat but wouldn't want to complicate the build system by involving another compiler. It really needs to be standalone C++ that can be added to the build system of the 6 platforms Lobster builds on. One option for these possibly gigantic features is to build it as a standalone dll/so, that can optionally be loaded into Lobster. So a lib that combines something like libcurl with some Lobster bindings. Or even keep the bindings in Lobster but just use the dll interface. That way users that don't need http(s) don't pay for it. |
I'd say the easiest way would be to precompile a static library and hook it up when building the program. The only requirement is to have ffi in the language. |
Zig can compile to C file, which can later be built without Zig. The $ time zig build-exe main.zig -ofmt=c -OReleaseSmall
0.99 real 1.10 user 0.09 sys
$ time clang main.c -w -Os -o main -lpthread
12.65 real 12.45 user 0.15 sys
$ ls -lh
-rwxr-xr-x 1 user user 725K … main*
-rw-r--r-- 1 user user 32M … main.c
-rw-r--r-- 1 user user 1.3K … main.zig
-rw-r--r-- 1 user user 150K … zig.h Direct compile, for comparison: $ time zig build-exe main.zig -OReleaseSmall
7.49 real 7.02 user 0.21 sys
$ ls -lh main
-rwxr-xr-x 1 user user 713K … main* (Removing optimization flags like |
Is there any http library, like pythons 'requests'?
I know it's an unfinished language, just wondering whether anything like that exists, didn't find mentions of such thing in the source code.
The text was updated successfully, but these errors were encountered: