summaryrefslogtreecommitdiff
path: root/.html/dev/entry-points.html
diff options
context:
space:
mode:
Diffstat (limited to '.html/dev/entry-points.html')
-rw-r--r--.html/dev/entry-points.html134
1 files changed, 134 insertions, 0 deletions
diff --git a/.html/dev/entry-points.html b/.html/dev/entry-points.html
new file mode 100644
index 0000000..717c320
--- /dev/null
+++ b/.html/dev/entry-points.html
@@ -0,0 +1,134 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>
+ The Codex »
+ Entry Points
+ </title>
+
+ <link
+ rel='stylesheet'
+ type='text/css'
+ href='http://fonts.googleapis.com/css?family=Buenard:400,700&amp;subset=latin,latin-ext'>
+ <link
+ rel="stylesheet"
+ type="text/css"
+ href="../media/css/reset.css">
+ <link
+ rel="stylesheet"
+ type="text/css"
+ href="../media/css/grimoire.css">
+</head>
+<body>
+
+<div id="shell">
+
+ <ol id="breadcrumbs">
+
+ <li class="crumb-0 not-last">
+
+ <a href="../">index</a>
+
+ </li>
+
+ <li class="crumb-1 not-last">
+
+ <a href="./">dev</a>
+
+ </li>
+
+ <li class="crumb-2 last">
+
+ entry-points
+
+ </li>
+
+ </ol>
+
+
+
+ <div id="article">
+ <h1 id="entry-points">Entry Points</h1>
+<p>The following captures a conversation from IRC:</p>
+<blockquote>
+<p><a href="https://twitter.com/derspiny">Owen J</a>: Have you run across the idea
+of an "entry point" in a runtime yet? (You've definitely used it, just
+possibly not known it had a name.)</p>
+<p><a href="https://twitter.com/aeleitch">Alex L</a>: I have not!</p>
+<p><a href="https://twitter.com/derspiny">Owen J</a>: It's the point where the
+execution of the outside system -- the OS, the browser, the Node
+runtime, whatever -- stops and the execution of your code starts. Some
+platforms only give you one: C on Unix is classic, where there's only
+two entry points: main and signal handlers (and a lot of apps only use
+main). JS gives you <em>a shit fucking ton</em> of entry points.</p>
+<p><a href="https://twitter.com/derspiny">Owen J</a>: In a browser, the pageload
+process is an entry point: your code gets run when the browser
+encounters a <code>&lt;script&gt;</code> tag. So is every event handler. There's none
+of your code running when an event handler starts, only the browser
+is running. So is every callback from an external service, like
+<code>XmlHttpRequest</code> or <code>EventSource</code> or the <code>File</code> APIs. In Node, the top
+level of your main script is an entry point, but so is every callback
+from an external service.</p>
+<p><a href="https://twitter.com/aeleitch">Alex L</a>: Ahahahahahahaha oh my
+god. There is no way for me to contain them all. <em>everything the light
+touches.</em></p>
+<p><a href="https://twitter.com/derspiny">Owen J</a>: This is important for
+reasoning about exception handling! <em>In JS</em>, exception handling only
+propagates one direction: towards the entry point of this sequence of
+function calls.</p>
+<p><a href="https://twitter.com/aeleitch">Alex L</a>: Yes. This is what <em>I</em> call a
+stack trace.</p>
+<p><a href="https://twitter.com/derspiny">Owen J</a>: If an exception escapes from
+an entry point, the JS runtime logs it, and then the outside runtime
+takes over again. That's one of the ways callbacks from external
+services fuck up the idea of a stack trace as a map of control flow.</p>
+<p><a href="https://twitter.com/aeleitch">Alex L</a>: Huh. Yes. Yes I can see
+that. I mean, in my world, control flow is a somewhat handwavey idea
+right now. I'm starting to understand why so many people hate JS-land.</p>
+<p><a href="https://twitter.com/derspiny">Owen J</a>: Sure. But, for example, a
+promise chain is a tool for restructuring control flow. In principle,
+error handling should provide <em>some</em> kind of map of that, to allow
+programmers -- you -- to diagnose how a program reached a given error
+state and maybe one day fix the problem. In THIS future, none of them
+do that well, though.</p>
+<p><a href="https://twitter.com/aeleitch">Alex L</a>: Yes. Truly the darkest
+timeline, but this reviews why I am having these concerns.</p>
+</blockquote>
+ </div>
+
+
+
+<div id="comments">
+<div id="disqus_thread"></div>
+<script type="text/javascript">
+ /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
+ var disqus_shortname = 'grimoire'; // required: replace example with your forum shortname
+
+ /* * * DON'T EDIT BELOW THIS LINE * * */
+ (function() {
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+ dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+ })();
+</script>
+<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
+<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
+</div>
+
+
+
+ <div id="footer">
+ <p>
+
+ The Codex —
+
+ Powered by <a href="http://markdoc.org/">Markdoc</a>.
+
+<a href="https://bitbucket.org/ojacobson/grimoire.ca/src/master/wiki/dev/entry-points.md">See this page on Bitbucket</a> (<a href="https://bitbucket.org/ojacobson/grimoire.ca/history-node/master/wiki/dev/entry-points.md">history</a>).
+
+ </p>
+ </div>
+
+</div>
+</body>
+</html> \ No newline at end of file