From: Brendan Hansen Date: Fri, 25 Mar 2022 17:49:00 +0000 (-0500) Subject: cleanup X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=191535ca93d4f54c67e914aac208b93748eaac1f;p=onyx.git cleanup --- diff --git a/http_test.onyx b/http_test.onyx deleted file mode 100644 index ea920fc4..00000000 --- a/http_test.onyx +++ /dev/null @@ -1,38 +0,0 @@ -#load "core/std" -#load "modules/http/module" -#load "modules/json/module" - -use package core -http :: package http - -main :: (args) => { - conn, err := http.connect("http://api.weatherapi.com"); - if err != .None { - println(err); - os.exit(1); - } - defer conn->close(); - - w1 := alloc.heap.get_watermark(); - f1 := alloc.heap.get_freed_size(); - - alloc.heap.auto() { - res := conn->get("/v1/current.json", .[ - .{ "key", "59c2510355ba48d299b173546222103" }, - .{ "q", http.urlencode("Sioux Falls, SD") }, - ]); - - j_data := res->json(); - - curr := j_data.root["current"]; - printf("It is {.1} degrees outside in {}, but it feels like {.1}.\n", - curr["temp_f"]->as_float(), - j_data.root["location"]["name"]->as_str(), - curr["feelslike_f"]->as_float()); - } - - w2 := alloc.heap.get_watermark(); - f2 := alloc.heap.get_freed_size(); - - printf("Leaked: {}\n", (w2 - f2) - (w1 - f1)); -} diff --git a/modules/README.md b/modules/README.md new file mode 100644 index 00000000..21c1c8d5 --- /dev/null +++ b/modules/README.md @@ -0,0 +1,8 @@ +# Modules + +These are the modules that current ship with the compiler, but are not +part of the "core" libraries. In the far-future, these modules will be +obtained from a dedicated package manager shipped with the compiler, +and will be downloaded from a central repository. It seems too ambious +to do that work right now, so I am holding off on starting that process +until I have other people producing code and libraries for Onyx.