Skip to content

Networking module and JSON conversion functions - #21

Merged
ali77gh merged 4 commits into
ali77gh:devfrom
rouzbehsbz:feat/http
Dec 2, 2025
Merged

Networking module and JSON conversion functions#21
ali77gh merged 4 commits into
ali77gh:devfrom
rouzbehsbz:feat/http

Conversation

@rouzbehsbz

Copy link
Copy Markdown
Contributor

Introduces the initial version of the net module for the Chap language. It currently supports only the http_get function, with native TLS, HTTP/1.1, and HTTP/2 support, as well as custom headers. The function signature is:

$url [string], $headers [map] -> http get

Here’s a simple example:

"https://dummyjson.com/test" -> http get -> from json

For ease of use with popular REST APIs, two new type-conversion functions have also been added to the Chap language, from_json, which converts a JSON string into Chap-supported data types and to_json, which performs the reverse conversion.

Known issues

  • Chap does not support null values yet, so they are currently converted to the string "null".
  • Chap’s integer type is 32-bit, so any number larger than this range will cause an overflow.
  • No support for the WASM runtime at the moment.

@ali77gh
ali77gh merged commit 822a478 into ali77gh:dev Dec 2, 2025
2 checks passed
@ali77gh

ali77gh commented Dec 2, 2025

Copy link
Copy Markdown
Owner

Genius piece of code🤝

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants