{"action":"created","comment":{"url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/pulls/comments/125156494","pull_request_review_id":47524602,"id":125156494,"diff_hunk":"@@ -149,16 +149,59 @@ func main() {\n \n I was the least happy with how this code turned out. The serialisation stuff was difficult to do, especially in comparison to node. I also find the code to be much less succinct than either of the other languages. I expect this could be alleviated if I knew a few more libraries to help with these things. Its also important to note that this was my very first go program, whereas I have quite a bit of experience with both c# and client-side javascript.\n \n+## Rust (thanks[@Kazetsukai](https://github.com/lukemcgregor/basic-api/pull/2))\n+\n+I know absolutally nothing about rust (before today), so fun times. Rust is a functional language designed for performance.\n+\n+> Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. \n+\n+The rust example is 42 lines without content type negotiation (including the config files required). \n+\n+``` rust\n+#![feature(plugin)]\n+#![plugin(rocket_codegen)]\n+\n+extern crate rocket;\n+extern crate elementtree;\n+#[macro_use] extern crate rocket_contrib;\n+\n+use rocket::data::Data;\n+use rocket_contrib::{JSON, Value};\n+use elementtree::Element;\n+\n+#[get(\"/add/<x>/to/<y>\")]\n+fn add_json(x: i32, y: i32) -> JSON<Value> {\n+    JSON(json!({ \"sum\": (x+y) }))\n+}\n+\n+#[post(\"/add\", data = \"<numbers>\")]\n+fn add_xml(numbers: Data) -> String {\n+\tlet root = Element::from_reader(numbers.open()).unwrap();\n+\tlet sum : i32 = root.find_all(\"value\").map(|e| e.text().parse::<i32>().unwrap()).sum();\n+\n+\tlet mut result = Element::new(\"sum\");\n+\tresult.set_text(sum.to_string());\n+\n+\treturn result.to_string().unwrap();\n+}\n+\n+fn main() {\n+    rocket::ignite().mount(\"/\", routes![add_json, add_xml]).launch();\n+}\n+```\n+\n+I find looking a the code the JSON GET example is very elegant and simple, less so the XML POST example. The routing is also super cool, you decorate a function with its route information and then just pass a list of functions to the server. That is super sicinct. The performance of the rust service was also amazing being the fastest code example. However the service was not very stable, if I made more concurrent requests than there were cores on the machine the service went into some kind of deadlock, which is pretty poor. The tooling support was also much lower than for the other languages. I couldnt get a debugger to work at all, though there are some that are available. This means it wasnt launchable from VS Code. ","path":"_posts/2017-06-28-Comparing_apis_in_go_node_and_dotnet_core.md","position":61,"original_position":61,"commit_id":"dfbaceb1e54956f0213d8c0980d437684d27f2ee","original_commit_id":"dfbaceb1e54956f0213d8c0980d437684d27f2ee","user":{"login":"Kazetsukai","id":935494,"avatar_url":"https://avatars0.githubusercontent.com/u/935494?v=3","gravatar_id":"","url":"https://api.github.com/users/Kazetsukai","html_url":"https://github.com/Kazetsukai","followers_url":"https://api.github.com/users/Kazetsukai/followers","following_url":"https://api.github.com/users/Kazetsukai/following{/other_user}","gists_url":"https://api.github.com/users/Kazetsukai/gists{/gist_id}","starred_url":"https://api.github.com/users/Kazetsukai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kazetsukai/subscriptions","organizations_url":"https://api.github.com/users/Kazetsukai/orgs","repos_url":"https://api.github.com/users/Kazetsukai/repos","events_url":"https://api.github.com/users/Kazetsukai/events{/privacy}","received_events_url":"https://api.github.com/users/Kazetsukai/received_events","type":"User","site_admin":false},"body":"sicint -> succinct","created_at":"2017-07-01T07:18:17Z","updated_at":"2017-07-01T07:18:17Z","html_url":"https://github.com/lukemcgregor/lukemcgregor.github.io/pull/14#discussion_r125156494","pull_request_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/pulls/comments/125156494"},"html":{"href":"https://github.com/lukemcgregor/lukemcgregor.github.io/pull/14#discussion_r125156494"},"pull_request":{"href":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/pulls/14","id":128476151,"html_url":"https://github.com/lukemcgregor/lukemcgregor.github.io/pull/14","diff_url":"https://github.com/lukemcgregor/lukemcgregor.github.io/pull/14.diff","patch_url":"https://github.com/lukemcgregor/lukemcgregor.github.io/pull/14.patch","issue_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/issues/14","number":14,"state":"open","locked":false,"title":"Api comparison rust","user":{"login":"lukemcgregor","id":1284608,"avatar_url":"https://avatars0.githubusercontent.com/u/1284608?v=3","gravatar_id":"","url":"https://api.github.com/users/lukemcgregor","html_url":"https://github.com/lukemcgregor","followers_url":"https://api.github.com/users/lukemcgregor/followers","following_url":"https://api.github.com/users/lukemcgregor/following{/other_user}","gists_url":"https://api.github.com/users/lukemcgregor/gists{/gist_id}","starred_url":"https://api.github.com/users/lukemcgregor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukemcgregor/subscriptions","organizations_url":"https://api.github.com/users/lukemcgregor/orgs","repos_url":"https://api.github.com/users/lukemcgregor/repos","events_url":"https://api.github.com/users/lukemcgregor/events{/privacy}","received_events_url":"https://api.github.com/users/lukemcgregor/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-07-01T04:15:51Z","updated_at":"2017-07-01T07:18:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d5ca4fcdb322d1a12b68a897834511508c9dd98","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/pulls/14/commits","review_comments_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/pulls/14/comments","review_comment_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/issues/14/comments","statuses_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/statuses/dfbaceb1e54956f0213d8c0980d437684d27f2ee","head":{"label":"lukemcgregor:api-comparison-rust","ref":"api-comparison-rust","sha":"dfbaceb1e54956f0213d8c0980d437684d27f2ee","user":{"login":"lukemcgregor","id":1284608,"avatar_url":"https://avatars0.githubusercontent.com/u/1284608?v=3","gravatar_id":"","url":"https://api.github.com/users/lukemcgregor","html_url":"https://github.com/lukemcgregor","followers_url":"https://api.github.com/users/lukemcgregor/followers","following_url":"https://api.github.com/users/lukemcgregor/following{/other_user}","gists_url":"https://api.github.com/users/lukemcgregor/gists{/gist_id}","starred_url":"https://api.github.com/users/lukemcgregor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukemcgregor/subscriptions","organizations_url":"https://api.github.com/users/lukemcgregor/orgs","repos_url":"https://api.github.com/users/lukemcgregor/repos","events_url":"https://api.github.com/users/lukemcgregor/events{/privacy}","received_events_url":"https://api.github.com/users/lukemcgregor/received_events","type":"User","site_admin":false},"repo":{"id":88005016,"name":"lukemcgregor.github.io","full_name":"lukemcgregor/lukemcgregor.github.io","owner":{"login":"lukemcgregor","id":1284608,"avatar_url":"https://avatars0.githubusercontent.com/u/1284608?v=3","gravatar_id":"","url":"https://api.github.com/users/lukemcgregor","html_url":"https://github.com/lukemcgregor","followers_url":"https://api.github.com/users/lukemcgregor/followers","following_url":"https://api.github.com/users/lukemcgregor/following{/other_user}","gists_url":"https://api.github.com/users/lukemcgregor/gists{/gist_id}","starred_url":"https://api.github.com/users/lukemcgregor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukemcgregor/subscriptions","organizations_url":"https://api.github.com/users/lukemcgregor/orgs","repos_url":"https://api.github.com/users/lukemcgregor/repos","events_url":"https://api.github.com/users/lukemcgregor/events{/privacy}","received_events_url":"https://api.github.com/users/lukemcgregor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lukemcgregor/lukemcgregor.github.io","description":"Jekyll-Uno - a minimal, responsive theme for Jekyll based on Uno for Ghost","fork":true,"url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io","forks_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/forks","keys_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/teams","hooks_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/hooks","issue_events_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/issues/events{/number}","events_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/events","assignees_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/assignees{/user}","branches_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/branches{/branch}","tags_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/tags","blobs_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/statuses/{sha}","languages_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/languages","stargazers_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/stargazers","contributors_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/contributors","subscribers_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/subscribers","subscription_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/subscription","commits_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/contents/{+path}","compare_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/merges","archive_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/downloads","issues_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/issues{/number}","pulls_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/pulls{/number}","milestones_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/milestones{/number}","notifications_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/labels{/name}","releases_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/releases{/id}","deployments_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/deployments","created_at":"2017-04-12T03:18:44Z","updated_at":"2017-04-24T04:55:09Z","pushed_at":"2017-07-01T07:00:24Z","git_url":"git://github.com/lukemcgregor/lukemcgregor.github.io.git","ssh_url":"git@github.com:lukemcgregor/lukemcgregor.github.io.git","clone_url":"https://github.com/lukemcgregor/lukemcgregor.github.io.git","svn_url":"https://github.com/lukemcgregor/lukemcgregor.github.io","homepage":null,"size":6226,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"lukemcgregor:master","ref":"master","sha":"f3ef3ed11183453f97a8edf60a5134145fb013d6","user":{"login":"lukemcgregor","id":1284608,"avatar_url":"https://avatars0.githubusercontent.com/u/1284608?v=3","gravatar_id":"","url":"https://api.github.com/users/lukemcgregor","html_url":"https://github.com/lukemcgregor","followers_url":"https://api.github.com/users/lukemcgregor/followers","following_url":"https://api.github.com/users/lukemcgregor/following{/other_user}","gists_url":"https://api.github.com/users/lukemcgregor/gists{/gist_id}","starred_url":"https://api.github.com/users/lukemcgregor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukemcgregor/subscriptions","organizations_url":"https://api.github.com/users/lukemcgregor/orgs","repos_url":"https://api.github.com/users/lukemcgregor/repos","events_url":"https://api.github.com/users/lukemcgregor/events{/privacy}","received_events_url":"https://api.github.com/users/lukemcgregor/received_events","type":"User","site_admin":false},"repo":{"id":88005016,"name":"lukemcgregor.github.io","full_name":"lukemcgregor/lukemcgregor.github.io","owner":{"login":"lukemcgregor","id":1284608,"avatar_url":"https://avatars0.githubusercontent.com/u/1284608?v=3","gravatar_id":"","url":"https://api.github.com/users/lukemcgregor","html_url":"https://github.com/lukemcgregor","followers_url":"https://api.github.com/users/lukemcgregor/followers","following_url":"https://api.github.com/users/lukemcgregor/following{/other_user}","gists_url":"https://api.github.com/users/lukemcgregor/gists{/gist_id}","starred_url":"https://api.github.com/users/lukemcgregor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukemcgregor/subscriptions","organizations_url":"https://api.github.com/users/lukemcgregor/orgs","repos_url":"https://api.github.com/users/lukemcgregor/repos","events_url":"https://api.github.com/users/lukemcgregor/events{/privacy}","received_events_url":"https://api.github.com/users/lukemcgregor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lukemcgregor/lukemcgregor.github.io","description":"Jekyll-Uno - a minimal, responsive theme for Jekyll based on Uno for Ghost","fork":true,"url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io","forks_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/forks","keys_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/teams","hooks_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/hooks","issue_events_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/issues/events{/number}","events_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/events","assignees_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/assignees{/user}","branches_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/branches{/branch}","tags_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/tags","blobs_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/statuses/{sha}","languages_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/languages","stargazers_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/stargazers","contributors_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/contributors","subscribers_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/subscribers","subscription_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/subscription","commits_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/contents/{+path}","compare_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/merges","archive_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/downloads","issues_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/issues{/number}","pulls_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/pulls{/number}","milestones_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/milestones{/number}","notifications_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/labels{/name}","releases_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/releases{/id}","deployments_url":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/deployments","created_at":"2017-04-12T03:18:44Z","updated_at":"2017-04-24T04:55:09Z","pushed_at":"2017-07-01T07:00:24Z","git_url":"git://github.com/lukemcgregor/lukemcgregor.github.io.git","ssh_url":"git@github.com:lukemcgregor/lukemcgregor.github.io.git","clone_url":"https://github.com/lukemcgregor/lukemcgregor.github.io.git","svn_url":"https://github.com/lukemcgregor/lukemcgregor.github.io","homepage":null,"size":6226,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/pulls/14"},"html":{"href":"https://github.com/lukemcgregor/lukemcgregor.github.io/pull/14"},"issue":{"href":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/issues/14"},"comments":{"href":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/lukemcgregor/lukemcgregor.github.io/statuses/dfbaceb1e54956f0213d8c0980d437684d27f2ee"}}}}
{"actor":{"display_login":"Kazetsukai"}}