{"action":"created","comment":{"url":"https://api.github.com/repos/spoofax-shell/doc/pulls/comments/61405999","id":61405999,"diff_hunk":"@@ -1,5 +1,170 @@\n \\section{Read-Eval-Print Loops}\n-\\label{sec:read-eval-print}\n+\\label{sec:repl}\n+\n+Many programming languages come with an interactive environment. This\n+interactive environment is an interface to the programming language's execution\n+engine. One common form of such an environment is an interface in which\n+expressions in a programming language are typed by the user, after which the\n+results of that expression are printed back to the user. Such an environment is\n+called a Read-Eval-Print Loop (REPL), although many different names are known,\n+including but not limited to  \\textit{language shell},\n+\\textit{command-line interpreter} or \\textit{interactive interpreter}. There\n+are subtle differences between these names and the name REPL. These are,\n+however, mostly of semantic value. In this report the term REPL is chosen,\n+because it conveys the notion of such an interactive environment well.\n+\n+\\subsection{Origin of REPLs}\n+\\label{repl-origin}\n+The Lisp family of programming languages is believed to be amongst the\n+first programming languages offering such functionality~\\cite{Noyes92}. The name\n+REPL comes from the Lisp functions that implement a REPL's functionality:\n+\n+\\begin{enumerate}\n+  \\item The \\texttt{read} function takes a user's input, which often is just one\n+    or several expressions as opposed to a complete compilation unit. It then\n+    parses this input and creates an abstract syntax tree (AST).\n+  \\item The AST created in the previous step is then passed on to the\n+    \\texttt{eval} function, which evaluates it.\n+  \\item The result yielded by the previous function is then printed out to the\n+    user by the \\texttt{print} function.\n+  \\item After having printed the result, the environment needs to \\texttt{loop}\n+    back to the read state.\n+\\end{enumerate}\n+\n+Assuming the individual functions listed previously exist, a REPL can be created\n+in a single line of code simply by combining the functions:\n+\n+\\begin{lstlisting}[language=lisp]\n+(loop (print (eval (read))))\n+\\end{lstlisting}\n+\n+Part of the semantic differences between the different names for an interactive\n+programming environment is Lisp's homoiconicity. In Lisp, the structure of\n+expressions is represented directly in a data structure, resulting in the\n+ability to infer a program's or data object's state simply by reading its\n+textual representation. In Lisp REPLs, therefore, arbitrary data objects yielded\n+from a previous expression can be used as input to the next expression.\n+Homoiconicity is an unusual feature in modern programming languages not\n+belonging to the Lisp family, however, so interactive environments of these\n+programming languages often require additional hoops to read and evaluate\n+expressions. As said earlier, this difference is mostly semantic and therefore\n+this report uses the more general interpretation of the name REPL.\n+\n+\\subsection{Advantages of REPLs}\n+\\label{ssec:repl-advantages}\n+REPLs offer several advantages that make them an often requested feature.\n+Because of their nature, REPLs provide the ability to program interactively.\n+Programming interactively has multiple applications.\n+\n+When creating software solutions for an as of yet not well understood domain,\n+often it is not clear which data structures and algorithms are required. In such\n+cases, REPLs offer the ability to interactively develop and debug software\n+without having to apply the (oftentimes much slower) edit-compile-run-debug\n+development style. This kind of programming is called exploratory\n+programming~\\cite{Fritzson86}. Related to this kind of exploration, REPLs also\n+provide a means for fast prototyping and bottom up programming~\\cite{Graham93}.\n+\n+The explorative and interactive features of a REPL also make it an excellent\n+tool for programmers to learn a new programming language. REPLs are also\n+combined with what is called literate programming to offer notebooks or language\n+playgrounds, as discussed in~\\cref{sec:literate-programming}.\n+\n+\\subsection{Functionality}\n+\\label{sssec:repl-functionality}\n+\n+Every programming language providing a REPL has its own set of functionality.\n+However, a core set of functionalities can be identified that is shared between\n+all REPL implementations. To reach this core set of features, well-known REPLs","path":"research/02-repl.tex","position":78,"original_position":78,"commit_id":"88ec03815dcd3bee70ffd1e06763d9e32d619041","original_commit_id":"88ec03815dcd3bee70ffd1e06763d9e32d619041","user":{"login":"gfokkema","id":5970912,"avatar_url":"https://avatars.githubusercontent.com/u/5970912?v=3","gravatar_id":"","url":"https://api.github.com/users/gfokkema","html_url":"https://github.com/gfokkema","followers_url":"https://api.github.com/users/gfokkema/followers","following_url":"https://api.github.com/users/gfokkema/following{/other_user}","gists_url":"https://api.github.com/users/gfokkema/gists{/gist_id}","starred_url":"https://api.github.com/users/gfokkema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfokkema/subscriptions","organizations_url":"https://api.github.com/users/gfokkema/orgs","repos_url":"https://api.github.com/users/gfokkema/repos","events_url":"https://api.github.com/users/gfokkema/events{/privacy}","received_events_url":"https://api.github.com/users/gfokkema/received_events","type":"User","site_admin":false},"body":"> However, a core set of functionalities can be identified that is shared between all REPL implementations.\r\n\r\nto\r\n\r\n> However, a core set of functionalities, shared between all REPL implementations, can be identified.","created_at":"2016-04-28T10:32:51Z","updated_at":"2016-04-28T10:32:51Z","html_url":"https://github.com/spoofax-shell/doc/pull/9#discussion_r61405999","pull_request_url":"https://api.github.com/repos/spoofax-shell/doc/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/spoofax-shell/doc/pulls/comments/61405999"},"html":{"href":"https://github.com/spoofax-shell/doc/pull/9#discussion_r61405999"},"pull_request":{"href":"https://api.github.com/repos/spoofax-shell/doc/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/spoofax-shell/doc/pulls/9","id":68055149,"html_url":"https://github.com/spoofax-shell/doc/pull/9","diff_url":"https://github.com/spoofax-shell/doc/pull/9.diff","patch_url":"https://github.com/spoofax-shell/doc/pull/9.patch","issue_url":"https://api.github.com/repos/spoofax-shell/doc/issues/9","number":9,"state":"open","locked":false,"title":"[RFC] research: add `Read-Eval-Print Loop` section","user":{"login":"Unia","id":1260727,"avatar_url":"https://avatars.githubusercontent.com/u/1260727?v=3","gravatar_id":"","url":"https://api.github.com/users/Unia","html_url":"https://github.com/Unia","followers_url":"https://api.github.com/users/Unia/followers","following_url":"https://api.github.com/users/Unia/following{/other_user}","gists_url":"https://api.github.com/users/Unia/gists{/gist_id}","starred_url":"https://api.github.com/users/Unia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unia/subscriptions","organizations_url":"https://api.github.com/users/Unia/orgs","repos_url":"https://api.github.com/users/Unia/repos","events_url":"https://api.github.com/users/Unia/events{/privacy}","received_events_url":"https://api.github.com/users/Unia/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-27T13:42:34Z","updated_at":"2016-04-28T10:32:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"198158efee1d7ead2fb04620d6627c9d22ff232d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spoofax-shell/doc/pulls/9/commits","review_comments_url":"https://api.github.com/repos/spoofax-shell/doc/pulls/9/comments","review_comment_url":"https://api.github.com/repos/spoofax-shell/doc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spoofax-shell/doc/issues/9/comments","statuses_url":"https://api.github.com/repos/spoofax-shell/doc/statuses/88ec03815dcd3bee70ffd1e06763d9e32d619041","head":{"label":"spoofax-shell:what-is-a-repl","ref":"what-is-a-repl","sha":"88ec03815dcd3bee70ffd1e06763d9e32d619041","user":{"login":"spoofax-shell","id":18665559,"avatar_url":"https://avatars.githubusercontent.com/u/18665559?v=3","gravatar_id":"","url":"https://api.github.com/users/spoofax-shell","html_url":"https://github.com/spoofax-shell","followers_url":"https://api.github.com/users/spoofax-shell/followers","following_url":"https://api.github.com/users/spoofax-shell/following{/other_user}","gists_url":"https://api.github.com/users/spoofax-shell/gists{/gist_id}","starred_url":"https://api.github.com/users/spoofax-shell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spoofax-shell/subscriptions","organizations_url":"https://api.github.com/users/spoofax-shell/orgs","repos_url":"https://api.github.com/users/spoofax-shell/repos","events_url":"https://api.github.com/users/spoofax-shell/events{/privacy}","received_events_url":"https://api.github.com/users/spoofax-shell/received_events","type":"Organization","site_admin":false},"repo":{"id":56597361,"name":"doc","full_name":"spoofax-shell/doc","owner":{"login":"spoofax-shell","id":18665559,"avatar_url":"https://avatars.githubusercontent.com/u/18665559?v=3","gravatar_id":"","url":"https://api.github.com/users/spoofax-shell","html_url":"https://github.com/spoofax-shell","followers_url":"https://api.github.com/users/spoofax-shell/followers","following_url":"https://api.github.com/users/spoofax-shell/following{/other_user}","gists_url":"https://api.github.com/users/spoofax-shell/gists{/gist_id}","starred_url":"https://api.github.com/users/spoofax-shell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spoofax-shell/subscriptions","organizations_url":"https://api.github.com/users/spoofax-shell/orgs","repos_url":"https://api.github.com/users/spoofax-shell/repos","events_url":"https://api.github.com/users/spoofax-shell/events{/privacy}","received_events_url":"https://api.github.com/users/spoofax-shell/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spoofax-shell/doc","description":"","fork":false,"url":"https://api.github.com/repos/spoofax-shell/doc","forks_url":"https://api.github.com/repos/spoofax-shell/doc/forks","keys_url":"https://api.github.com/repos/spoofax-shell/doc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spoofax-shell/doc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spoofax-shell/doc/teams","hooks_url":"https://api.github.com/repos/spoofax-shell/doc/hooks","issue_events_url":"https://api.github.com/repos/spoofax-shell/doc/issues/events{/number}","events_url":"https://api.github.com/repos/spoofax-shell/doc/events","assignees_url":"https://api.github.com/repos/spoofax-shell/doc/assignees{/user}","branches_url":"https://api.github.com/repos/spoofax-shell/doc/branches{/branch}","tags_url":"https://api.github.com/repos/spoofax-shell/doc/tags","blobs_url":"https://api.github.com/repos/spoofax-shell/doc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spoofax-shell/doc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spoofax-shell/doc/git/refs{/sha}","trees_url":"https://api.github.com/repos/spoofax-shell/doc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spoofax-shell/doc/statuses/{sha}","languages_url":"https://api.github.com/repos/spoofax-shell/doc/languages","stargazers_url":"https://api.github.com/repos/spoofax-shell/doc/stargazers","contributors_url":"https://api.github.com/repos/spoofax-shell/doc/contributors","subscribers_url":"https://api.github.com/repos/spoofax-shell/doc/subscribers","subscription_url":"https://api.github.com/repos/spoofax-shell/doc/subscription","commits_url":"https://api.github.com/repos/spoofax-shell/doc/commits{/sha}","git_commits_url":"https://api.github.com/repos/spoofax-shell/doc/git/commits{/sha}","comments_url":"https://api.github.com/repos/spoofax-shell/doc/comments{/number}","issue_comment_url":"https://api.github.com/repos/spoofax-shell/doc/issues/comments{/number}","contents_url":"https://api.github.com/repos/spoofax-shell/doc/contents/{+path}","compare_url":"https://api.github.com/repos/spoofax-shell/doc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spoofax-shell/doc/merges","archive_url":"https://api.github.com/repos/spoofax-shell/doc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spoofax-shell/doc/downloads","issues_url":"https://api.github.com/repos/spoofax-shell/doc/issues{/number}","pulls_url":"https://api.github.com/repos/spoofax-shell/doc/pulls{/number}","milestones_url":"https://api.github.com/repos/spoofax-shell/doc/milestones{/number}","notifications_url":"https://api.github.com/repos/spoofax-shell/doc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spoofax-shell/doc/labels{/name}","releases_url":"https://api.github.com/repos/spoofax-shell/doc/releases{/id}","deployments_url":"https://api.github.com/repos/spoofax-shell/doc/deployments","created_at":"2016-04-19T13:05:31Z","updated_at":"2016-04-25T18:20:52Z","pushed_at":"2016-04-28T09:39:16Z","git_url":"git://github.com/spoofax-shell/doc.git","ssh_url":"git@github.com:spoofax-shell/doc.git","clone_url":"https://github.com/spoofax-shell/doc.git","svn_url":"https://github.com/spoofax-shell/doc","homepage":null,"size":4856,"stargazers_count":0,"watchers_count":0,"language":"TeX","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":0,"default_branch":"master"}},"base":{"label":"spoofax-shell:master","ref":"master","sha":"b5ec5af93af1fc440ba0464f868b9bd4414eed3d","user":{"login":"spoofax-shell","id":18665559,"avatar_url":"https://avatars.githubusercontent.com/u/18665559?v=3","gravatar_id":"","url":"https://api.github.com/users/spoofax-shell","html_url":"https://github.com/spoofax-shell","followers_url":"https://api.github.com/users/spoofax-shell/followers","following_url":"https://api.github.com/users/spoofax-shell/following{/other_user}","gists_url":"https://api.github.com/users/spoofax-shell/gists{/gist_id}","starred_url":"https://api.github.com/users/spoofax-shell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spoofax-shell/subscriptions","organizations_url":"https://api.github.com/users/spoofax-shell/orgs","repos_url":"https://api.github.com/users/spoofax-shell/repos","events_url":"https://api.github.com/users/spoofax-shell/events{/privacy}","received_events_url":"https://api.github.com/users/spoofax-shell/received_events","type":"Organization","site_admin":false},"repo":{"id":56597361,"name":"doc","full_name":"spoofax-shell/doc","owner":{"login":"spoofax-shell","id":18665559,"avatar_url":"https://avatars.githubusercontent.com/u/18665559?v=3","gravatar_id":"","url":"https://api.github.com/users/spoofax-shell","html_url":"https://github.com/spoofax-shell","followers_url":"https://api.github.com/users/spoofax-shell/followers","following_url":"https://api.github.com/users/spoofax-shell/following{/other_user}","gists_url":"https://api.github.com/users/spoofax-shell/gists{/gist_id}","starred_url":"https://api.github.com/users/spoofax-shell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spoofax-shell/subscriptions","organizations_url":"https://api.github.com/users/spoofax-shell/orgs","repos_url":"https://api.github.com/users/spoofax-shell/repos","events_url":"https://api.github.com/users/spoofax-shell/events{/privacy}","received_events_url":"https://api.github.com/users/spoofax-shell/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spoofax-shell/doc","description":"","fork":false,"url":"https://api.github.com/repos/spoofax-shell/doc","forks_url":"https://api.github.com/repos/spoofax-shell/doc/forks","keys_url":"https://api.github.com/repos/spoofax-shell/doc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spoofax-shell/doc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spoofax-shell/doc/teams","hooks_url":"https://api.github.com/repos/spoofax-shell/doc/hooks","issue_events_url":"https://api.github.com/repos/spoofax-shell/doc/issues/events{/number}","events_url":"https://api.github.com/repos/spoofax-shell/doc/events","assignees_url":"https://api.github.com/repos/spoofax-shell/doc/assignees{/user}","branches_url":"https://api.github.com/repos/spoofax-shell/doc/branches{/branch}","tags_url":"https://api.github.com/repos/spoofax-shell/doc/tags","blobs_url":"https://api.github.com/repos/spoofax-shell/doc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spoofax-shell/doc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spoofax-shell/doc/git/refs{/sha}","trees_url":"https://api.github.com/repos/spoofax-shell/doc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spoofax-shell/doc/statuses/{sha}","languages_url":"https://api.github.com/repos/spoofax-shell/doc/languages","stargazers_url":"https://api.github.com/repos/spoofax-shell/doc/stargazers","contributors_url":"https://api.github.com/repos/spoofax-shell/doc/contributors","subscribers_url":"https://api.github.com/repos/spoofax-shell/doc/subscribers","subscription_url":"https://api.github.com/repos/spoofax-shell/doc/subscription","commits_url":"https://api.github.com/repos/spoofax-shell/doc/commits{/sha}","git_commits_url":"https://api.github.com/repos/spoofax-shell/doc/git/commits{/sha}","comments_url":"https://api.github.com/repos/spoofax-shell/doc/comments{/number}","issue_comment_url":"https://api.github.com/repos/spoofax-shell/doc/issues/comments{/number}","contents_url":"https://api.github.com/repos/spoofax-shell/doc/contents/{+path}","compare_url":"https://api.github.com/repos/spoofax-shell/doc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spoofax-shell/doc/merges","archive_url":"https://api.github.com/repos/spoofax-shell/doc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spoofax-shell/doc/downloads","issues_url":"https://api.github.com/repos/spoofax-shell/doc/issues{/number}","pulls_url":"https://api.github.com/repos/spoofax-shell/doc/pulls{/number}","milestones_url":"https://api.github.com/repos/spoofax-shell/doc/milestones{/number}","notifications_url":"https://api.github.com/repos/spoofax-shell/doc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spoofax-shell/doc/labels{/name}","releases_url":"https://api.github.com/repos/spoofax-shell/doc/releases{/id}","deployments_url":"https://api.github.com/repos/spoofax-shell/doc/deployments","created_at":"2016-04-19T13:05:31Z","updated_at":"2016-04-25T18:20:52Z","pushed_at":"2016-04-28T09:39:16Z","git_url":"git://github.com/spoofax-shell/doc.git","ssh_url":"git@github.com:spoofax-shell/doc.git","clone_url":"https://github.com/spoofax-shell/doc.git","svn_url":"https://github.com/spoofax-shell/doc","homepage":null,"size":4856,"stargazers_count":0,"watchers_count":0,"language":"TeX","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spoofax-shell/doc/pulls/9"},"html":{"href":"https://github.com/spoofax-shell/doc/pull/9"},"issue":{"href":"https://api.github.com/repos/spoofax-shell/doc/issues/9"},"comments":{"href":"https://api.github.com/repos/spoofax-shell/doc/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/spoofax-shell/doc/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/spoofax-shell/doc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spoofax-shell/doc/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/spoofax-shell/doc/statuses/88ec03815dcd3bee70ffd1e06763d9e32d619041"}}}}