{"action":"created","comment":{"url":"https://api.github.com/repos/emmalanguage/emma/pulls/comments/88630506","pull_request_review_id":9198562,"id":88630506,"diff_hunk":"@@ -0,0 +1,46 @@\n+/*\n+ * Copyright © 2014 TU Berlin (emma@dima.tu-berlin.de)\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.emmalanguage\n+package compiler\n+\n+import scala.language.experimental.macros\n+import scala.reflect.macros.blackbox\n+\n+class SparkMacro(val c: blackbox.Context) extends MacroCompiler {\n+\n+  def parallelizeImpl[T](e: c.Expr[T]): c.Expr[T] = {\n+    val res = parallelizePipeline(e)\n+    //c.warning(e.tree.pos, Core.prettyPrint(res))\n+    c.Expr[T](unTypeCheck(res))\n+  }\n+\n+  private lazy val parallelizePipeline: c.Expr[Any] => u.Tree =\n+    pipeline(typeCheck = false)(\n+      LibSupport.expand,\n+      Core.lift,\n+      Comprehension.combine,\n+      Backend.translateToDataflows(SparkAPI.rddModuleSymbol),\n+      Core.inlineLetExprs/*,\n+      Core.trampoline FIXME: unwrap the result from `TailRec`*/","path":"emma-spark/src/main/scala/org/emmalanguage/compiler/SparkMacro.scala","position":37,"original_position":37,"commit_id":"9054dfe05a3d3899c13b1a26202239f77fe6f42f","original_commit_id":"9054dfe05a3d3899c13b1a26202239f77fe6f42f","user":{"login":"joroKr21","id":2218841,"avatar_url":"https://avatars.githubusercontent.com/u/2218841?v=3","gravatar_id":"","url":"https://api.github.com/users/joroKr21","html_url":"https://github.com/joroKr21","followers_url":"https://api.github.com/users/joroKr21/followers","following_url":"https://api.github.com/users/joroKr21/following{/other_user}","gists_url":"https://api.github.com/users/joroKr21/gists{/gist_id}","starred_url":"https://api.github.com/users/joroKr21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joroKr21/subscriptions","organizations_url":"https://api.github.com/users/joroKr21/orgs","repos_url":"https://api.github.com/users/joroKr21/repos","events_url":"https://api.github.com/users/joroKr21/events{/privacy}","received_events_url":"https://api.github.com/users/joroKr21/received_events","type":"User","site_admin":false},"body":"This should work after merging #282 ","created_at":"2016-11-18T10:13:37Z","updated_at":"2016-11-18T10:13:37Z","html_url":"https://github.com/emmalanguage/emma/pull/278#discussion_r88630506","pull_request_url":"https://api.github.com/repos/emmalanguage/emma/pulls/278","_links":{"self":{"href":"https://api.github.com/repos/emmalanguage/emma/pulls/comments/88630506"},"html":{"href":"https://github.com/emmalanguage/emma/pull/278#discussion_r88630506"},"pull_request":{"href":"https://api.github.com/repos/emmalanguage/emma/pulls/278"}}},"pull_request":{"url":"https://api.github.com/repos/emmalanguage/emma/pulls/278","id":93985567,"html_url":"https://github.com/emmalanguage/emma/pull/278","diff_url":"https://github.com/emmalanguage/emma/pull/278.diff","patch_url":"https://github.com/emmalanguage/emma/pull/278.patch","issue_url":"https://api.github.com/repos/emmalanguage/emma/issues/278","number":278,"state":"open","locked":false,"title":"[EXAMPLES] Migrate some examples to the new compiler pipeline","user":{"login":"aalexandrov","id":1071946,"avatar_url":"https://avatars.githubusercontent.com/u/1071946?v=3","gravatar_id":"","url":"https://api.github.com/users/aalexandrov","html_url":"https://github.com/aalexandrov","followers_url":"https://api.github.com/users/aalexandrov/followers","following_url":"https://api.github.com/users/aalexandrov/following{/other_user}","gists_url":"https://api.github.com/users/aalexandrov/gists{/gist_id}","starred_url":"https://api.github.com/users/aalexandrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalexandrov/subscriptions","organizations_url":"https://api.github.com/users/aalexandrov/orgs","repos_url":"https://api.github.com/users/aalexandrov/repos","events_url":"https://api.github.com/users/aalexandrov/events{/privacy}","received_events_url":"https://api.github.com/users/aalexandrov/received_events","type":"User","site_admin":false},"body":"This PR adds a first stab for a macro-based translation based on the new compiler pipeline.\r\n\r\nThe macro is called `emma.onSpark` and is defined by the pipeline:\r\n\r\n```scala\r\nprivate lazy val parallelizePipeline: c.Expr[Any] => u.Tree =\r\n  pipeline(typeCheck = false)(\r\n    LibSupport.expand,\r\n    Core.lift,\r\n    Comprehension.combine,\r\n    Backend.translateToDataflows(SparkAPI.rddModuleSymbol),\r\n    Core.inlineLetExprs,\r\n    Core.trampoline\r\n  ).compose(_.tree)\r\n```\r\n\r\nI migrated the following examples and their tests based on that:\r\n    \r\n- `EnumerateTriangles`,\r\n- `TransitiveClosure`.\r\n- `NaiveBayes`,\r\n- `KMeans`,\r\n- `WordCount`.\r\n    \r\nThe test of `KMeans` is ignored at the moment because the produced program fails with an error due to join between a local and a parallel DataBag.\r\n\r\nA similar Macro can be added for Flink as well.","created_at":"2016-11-16T15:22:04Z","updated_at":"2016-11-18T10:13:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8b9b6987c54878f665ce231afd48992b8185820b","assignee":{"login":"ggevay","id":11377925,"avatar_url":"https://avatars.githubusercontent.com/u/11377925?v=3","gravatar_id":"","url":"https://api.github.com/users/ggevay","html_url":"https://github.com/ggevay","followers_url":"https://api.github.com/users/ggevay/followers","following_url":"https://api.github.com/users/ggevay/following{/other_user}","gists_url":"https://api.github.com/users/ggevay/gists{/gist_id}","starred_url":"https://api.github.com/users/ggevay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggevay/subscriptions","organizations_url":"https://api.github.com/users/ggevay/orgs","repos_url":"https://api.github.com/users/ggevay/repos","events_url":"https://api.github.com/users/ggevay/events{/privacy}","received_events_url":"https://api.github.com/users/ggevay/received_events","type":"User","site_admin":false},"assignees":[{"login":"ggevay","id":11377925,"avatar_url":"https://avatars.githubusercontent.com/u/11377925?v=3","gravatar_id":"","url":"https://api.github.com/users/ggevay","html_url":"https://github.com/ggevay","followers_url":"https://api.github.com/users/ggevay/followers","following_url":"https://api.github.com/users/ggevay/following{/other_user}","gists_url":"https://api.github.com/users/ggevay/gists{/gist_id}","starred_url":"https://api.github.com/users/ggevay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ggevay/subscriptions","organizations_url":"https://api.github.com/users/ggevay/orgs","repos_url":"https://api.github.com/users/ggevay/repos","events_url":"https://api.github.com/users/ggevay/events{/privacy}","received_events_url":"https://api.github.com/users/ggevay/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/emmalanguage/emma/milestones/40","html_url":"https://github.com/emmalanguage/emma/milestones/Nov%202016","labels_url":"https://api.github.com/repos/emmalanguage/emma/milestones/40/labels","id":1957589,"number":40,"title":"Nov 2016","description":"","creator":{"login":"aalexandrov","id":1071946,"avatar_url":"https://avatars.githubusercontent.com/u/1071946?v=3","gravatar_id":"","url":"https://api.github.com/users/aalexandrov","html_url":"https://github.com/aalexandrov","followers_url":"https://api.github.com/users/aalexandrov/followers","following_url":"https://api.github.com/users/aalexandrov/following{/other_user}","gists_url":"https://api.github.com/users/aalexandrov/gists{/gist_id}","starred_url":"https://api.github.com/users/aalexandrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalexandrov/subscriptions","organizations_url":"https://api.github.com/users/aalexandrov/orgs","repos_url":"https://api.github.com/users/aalexandrov/repos","events_url":"https://api.github.com/users/aalexandrov/events{/privacy}","received_events_url":"https://api.github.com/users/aalexandrov/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":13,"state":"open","created_at":"2016-08-23T10:02:43Z","updated_at":"2016-11-18T09:50:55Z","due_on":"2016-11-30T00:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/emmalanguage/emma/pulls/278/commits","review_comments_url":"https://api.github.com/repos/emmalanguage/emma/pulls/278/comments","review_comment_url":"https://api.github.com/repos/emmalanguage/emma/pulls/comments{/number}","comments_url":"https://api.github.com/repos/emmalanguage/emma/issues/278/comments","statuses_url":"https://api.github.com/repos/emmalanguage/emma/statuses/9054dfe05a3d3899c13b1a26202239f77fe6f42f","head":{"label":"aalexandrov:integration_tests","ref":"integration_tests","sha":"9054dfe05a3d3899c13b1a26202239f77fe6f42f","user":{"login":"aalexandrov","id":1071946,"avatar_url":"https://avatars.githubusercontent.com/u/1071946?v=3","gravatar_id":"","url":"https://api.github.com/users/aalexandrov","html_url":"https://github.com/aalexandrov","followers_url":"https://api.github.com/users/aalexandrov/followers","following_url":"https://api.github.com/users/aalexandrov/following{/other_user}","gists_url":"https://api.github.com/users/aalexandrov/gists{/gist_id}","starred_url":"https://api.github.com/users/aalexandrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalexandrov/subscriptions","organizations_url":"https://api.github.com/users/aalexandrov/orgs","repos_url":"https://api.github.com/users/aalexandrov/repos","events_url":"https://api.github.com/users/aalexandrov/events{/privacy}","received_events_url":"https://api.github.com/users/aalexandrov/received_events","type":"User","site_admin":false},"repo":{"id":62880932,"name":"emma","full_name":"aalexandrov/emma","owner":{"login":"aalexandrov","id":1071946,"avatar_url":"https://avatars.githubusercontent.com/u/1071946?v=3","gravatar_id":"","url":"https://api.github.com/users/aalexandrov","html_url":"https://github.com/aalexandrov","followers_url":"https://api.github.com/users/aalexandrov/followers","following_url":"https://api.github.com/users/aalexandrov/following{/other_user}","gists_url":"https://api.github.com/users/aalexandrov/gists{/gist_id}","starred_url":"https://api.github.com/users/aalexandrov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aalexandrov/subscriptions","organizations_url":"https://api.github.com/users/aalexandrov/orgs","repos_url":"https://api.github.com/users/aalexandrov/repos","events_url":"https://api.github.com/users/aalexandrov/events{/privacy}","received_events_url":"https://api.github.com/users/aalexandrov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aalexandrov/emma","description":"Implicit Parallelism for Scalable Data Analysis.","fork":true,"url":"https://api.github.com/repos/aalexandrov/emma","forks_url":"https://api.github.com/repos/aalexandrov/emma/forks","keys_url":"https://api.github.com/repos/aalexandrov/emma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aalexandrov/emma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aalexandrov/emma/teams","hooks_url":"https://api.github.com/repos/aalexandrov/emma/hooks","issue_events_url":"https://api.github.com/repos/aalexandrov/emma/issues/events{/number}","events_url":"https://api.github.com/repos/aalexandrov/emma/events","assignees_url":"https://api.github.com/repos/aalexandrov/emma/assignees{/user}","branches_url":"https://api.github.com/repos/aalexandrov/emma/branches{/branch}","tags_url":"https://api.github.com/repos/aalexandrov/emma/tags","blobs_url":"https://api.github.com/repos/aalexandrov/emma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aalexandrov/emma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aalexandrov/emma/git/refs{/sha}","trees_url":"https://api.github.com/repos/aalexandrov/emma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aalexandrov/emma/statuses/{sha}","languages_url":"https://api.github.com/repos/aalexandrov/emma/languages","stargazers_url":"https://api.github.com/repos/aalexandrov/emma/stargazers","contributors_url":"https://api.github.com/repos/aalexandrov/emma/contributors","subscribers_url":"https://api.github.com/repos/aalexandrov/emma/subscribers","subscription_url":"https://api.github.com/repos/aalexandrov/emma/subscription","commits_url":"https://api.github.com/repos/aalexandrov/emma/commits{/sha}","git_commits_url":"https://api.github.com/repos/aalexandrov/emma/git/commits{/sha}","comments_url":"https://api.github.com/repos/aalexandrov/emma/comments{/number}","issue_comment_url":"https://api.github.com/repos/aalexandrov/emma/issues/comments{/number}","contents_url":"https://api.github.com/repos/aalexandrov/emma/contents/{+path}","compare_url":"https://api.github.com/repos/aalexandrov/emma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aalexandrov/emma/merges","archive_url":"https://api.github.com/repos/aalexandrov/emma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aalexandrov/emma/downloads","issues_url":"https://api.github.com/repos/aalexandrov/emma/issues{/number}","pulls_url":"https://api.github.com/repos/aalexandrov/emma/pulls{/number}","milestones_url":"https://api.github.com/repos/aalexandrov/emma/milestones{/number}","notifications_url":"https://api.github.com/repos/aalexandrov/emma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aalexandrov/emma/labels{/name}","releases_url":"https://api.github.com/repos/aalexandrov/emma/releases{/id}","deployments_url":"https://api.github.com/repos/aalexandrov/emma/deployments","created_at":"2016-07-08T10:30:33Z","updated_at":"2016-07-12T06:40:34Z","pushed_at":"2016-11-18T00:11:03Z","git_url":"git://github.com/aalexandrov/emma.git","ssh_url":"git@github.com:aalexandrov/emma.git","clone_url":"https://github.com/aalexandrov/emma.git","svn_url":"https://github.com/aalexandrov/emma","homepage":"http://emma-language.org","size":7536,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"emmalanguage:newir","ref":"newir","sha":"69b340401f6d58704b08f4c566b9491afc8c086a","user":{"login":"emmalanguage","id":18483401,"avatar_url":"https://avatars.githubusercontent.com/u/18483401?v=3","gravatar_id":"","url":"https://api.github.com/users/emmalanguage","html_url":"https://github.com/emmalanguage","followers_url":"https://api.github.com/users/emmalanguage/followers","following_url":"https://api.github.com/users/emmalanguage/following{/other_user}","gists_url":"https://api.github.com/users/emmalanguage/gists{/gist_id}","starred_url":"https://api.github.com/users/emmalanguage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emmalanguage/subscriptions","organizations_url":"https://api.github.com/users/emmalanguage/orgs","repos_url":"https://api.github.com/users/emmalanguage/repos","events_url":"https://api.github.com/users/emmalanguage/events{/privacy}","received_events_url":"https://api.github.com/users/emmalanguage/received_events","type":"Organization","site_admin":false},"repo":{"id":17373846,"name":"emma","full_name":"emmalanguage/emma","owner":{"login":"emmalanguage","id":18483401,"avatar_url":"https://avatars.githubusercontent.com/u/18483401?v=3","gravatar_id":"","url":"https://api.github.com/users/emmalanguage","html_url":"https://github.com/emmalanguage","followers_url":"https://api.github.com/users/emmalanguage/followers","following_url":"https://api.github.com/users/emmalanguage/following{/other_user}","gists_url":"https://api.github.com/users/emmalanguage/gists{/gist_id}","starred_url":"https://api.github.com/users/emmalanguage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emmalanguage/subscriptions","organizations_url":"https://api.github.com/users/emmalanguage/orgs","repos_url":"https://api.github.com/users/emmalanguage/repos","events_url":"https://api.github.com/users/emmalanguage/events{/privacy}","received_events_url":"https://api.github.com/users/emmalanguage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/emmalanguage/emma","description":"Implicit Parallelism for Scalable Data Analysis.","fork":false,"url":"https://api.github.com/repos/emmalanguage/emma","forks_url":"https://api.github.com/repos/emmalanguage/emma/forks","keys_url":"https://api.github.com/repos/emmalanguage/emma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emmalanguage/emma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emmalanguage/emma/teams","hooks_url":"https://api.github.com/repos/emmalanguage/emma/hooks","issue_events_url":"https://api.github.com/repos/emmalanguage/emma/issues/events{/number}","events_url":"https://api.github.com/repos/emmalanguage/emma/events","assignees_url":"https://api.github.com/repos/emmalanguage/emma/assignees{/user}","branches_url":"https://api.github.com/repos/emmalanguage/emma/branches{/branch}","tags_url":"https://api.github.com/repos/emmalanguage/emma/tags","blobs_url":"https://api.github.com/repos/emmalanguage/emma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emmalanguage/emma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emmalanguage/emma/git/refs{/sha}","trees_url":"https://api.github.com/repos/emmalanguage/emma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emmalanguage/emma/statuses/{sha}","languages_url":"https://api.github.com/repos/emmalanguage/emma/languages","stargazers_url":"https://api.github.com/repos/emmalanguage/emma/stargazers","contributors_url":"https://api.github.com/repos/emmalanguage/emma/contributors","subscribers_url":"https://api.github.com/repos/emmalanguage/emma/subscribers","subscription_url":"https://api.github.com/repos/emmalanguage/emma/subscription","commits_url":"https://api.github.com/repos/emmalanguage/emma/commits{/sha}","git_commits_url":"https://api.github.com/repos/emmalanguage/emma/git/commits{/sha}","comments_url":"https://api.github.com/repos/emmalanguage/emma/comments{/number}","issue_comment_url":"https://api.github.com/repos/emmalanguage/emma/issues/comments{/number}","contents_url":"https://api.github.com/repos/emmalanguage/emma/contents/{+path}","compare_url":"https://api.github.com/repos/emmalanguage/emma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emmalanguage/emma/merges","archive_url":"https://api.github.com/repos/emmalanguage/emma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emmalanguage/emma/downloads","issues_url":"https://api.github.com/repos/emmalanguage/emma/issues{/number}","pulls_url":"https://api.github.com/repos/emmalanguage/emma/pulls{/number}","milestones_url":"https://api.github.com/repos/emmalanguage/emma/milestones{/number}","notifications_url":"https://api.github.com/repos/emmalanguage/emma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emmalanguage/emma/labels{/name}","releases_url":"https://api.github.com/repos/emmalanguage/emma/releases{/id}","deployments_url":"https://api.github.com/repos/emmalanguage/emma/deployments","created_at":"2014-03-03T17:30:30Z","updated_at":"2016-11-15T17:29:22Z","pushed_at":"2016-11-18T09:50:55Z","git_url":"git://github.com/emmalanguage/emma.git","ssh_url":"git@github.com:emmalanguage/emma.git","clone_url":"https://github.com/emmalanguage/emma.git","svn_url":"https://github.com/emmalanguage/emma","homepage":"http://emma-language.org","size":7808,"stargazers_count":9,"watchers_count":9,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":8,"mirror_url":null,"open_issues_count":51,"forks":8,"open_issues":51,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/emmalanguage/emma/pulls/278"},"html":{"href":"https://github.com/emmalanguage/emma/pull/278"},"issue":{"href":"https://api.github.com/repos/emmalanguage/emma/issues/278"},"comments":{"href":"https://api.github.com/repos/emmalanguage/emma/issues/278/comments"},"review_comments":{"href":"https://api.github.com/repos/emmalanguage/emma/pulls/278/comments"},"review_comment":{"href":"https://api.github.com/repos/emmalanguage/emma/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/emmalanguage/emma/pulls/278/commits"},"statuses":{"href":"https://api.github.com/repos/emmalanguage/emma/statuses/9054dfe05a3d3899c13b1a26202239f77fe6f42f"}}}}
{"actor":{"display_login":"joroKr21"}}