3 comments

  • noelwelsh2 hours ago
    Made my day that it references an article I wrote! :-D<p>Another thing that is kinda neat: there is a duality (a bidirectional transform) between the AST for a tree walking interpreter and the AST for a stack machine. To create the stack machine AST, all you do is remove any occurrence of the expression type in the tree-walking AST; these values are now found on the stack. Obvious when you think about it, but useful nonetheless. I don&#x27;t think there is a simple equivalent for a register machine as, unless you have an infinite number of registers, you need to do register allocation.<p>(If the author reads this, my name changed from Noel to Neal at some point. I don&#x27;t really mind though; my name is a bit unusual and I&#x27;ve been called all sorts of things.)
    • Thom20004 minutes ago
      &gt; (If the author reads this, my name changed from Noel to Neal at some point. I don&#x27;t really mind though; my name is a bit unusual and I&#x27;ve been called all sorts of things.)<p>I think it&#x27;d be good to update the about page with that info: <a href="https:&#x2F;&#x2F;noelwelsh.com&#x2F;landing&#x2F;about&#x2F;" rel="nofollow">https:&#x2F;&#x2F;noelwelsh.com&#x2F;landing&#x2F;about&#x2F;</a>
    • whilenot-dev2 hours ago
      Just read your blog post[0], thanks for it!<p>If I may leave some feedback here...<p>It&#x27;d be cool if you could add some syntax highlighting, because being at it is, it&#x27;s hard to distinguish comments from code paths. The code snippets are just Scala anyway, aren&#x27;t they?<p>Why, in the <i>switch dispatch</i>- and the <i>subroutine threading</i>-variants, is the recursive call in the <i>dispatch</i> function done with a call to <i>loop(...)</i>? Is that some Scala specific thing for recursion?<p>[0]: <a href="https:&#x2F;&#x2F;noelwelsh.com&#x2F;posts&#x2F;understanding-vm-dispatch&#x2F;" rel="nofollow">https:&#x2F;&#x2F;noelwelsh.com&#x2F;posts&#x2F;understanding-vm-dispatch&#x2F;</a>
      • noelwelsh4 minutes ago
        Thanks for pointing those out. I&#x27;ve fixed both issues.<p>Syntax highlighting was a discrepancy between my local env and the Netlify env that deploys the site.<p>`loop` is what I usually call tail-recursive loops in my personal style. I think I changed that to `dispatch` for the blog post and didn&#x27;t push the change all the way through.
    • derdi32 minutes ago
      Hmm, what&#x27;s a stack machine AST? I can&#x27;t follow your description of the transform, what does &quot;remove&quot; mean here? I can remove all of the internal nodes of a tree, which leaves me with a soup of leaf nodes, but how is that an AST for a stack machine?
      • noelwelsh9 minutes ago
        I should have said instruction set or intermediate representation (IR). For a stack machine a program is an array of instructions. For a tree-walking interpreter a program is a tree of instructions. The duality transforms one instruction set into the other.<p>Hope that clears it up.
        • derdi4 minutes ago
          Fair! Though I still don&#x27;t know what you mean by &quot;removing&quot; nodes from the tree-walking interpreter&#x27;s AST. Assume we have an AST like:<p><pre><code> (Add (LoadConst 1) (LoadVar x)) </code></pre> The corresponding stack machine code might be:<p><pre><code> [PushConst 1, PushVar x, Add] </code></pre> In what way was anything &quot;removed&quot; from the tree?
  • sph3 hours ago
    Ctrl-Shift-C, click on a paragraph, search for &quot;text-shadow&quot; on the right pane of the inspector, untick the checkbox.<p>There is a time and place for text and retro-CRT effects, this isn&#x27;t one.
    • goda901 hour ago
      Reminder about Firefox&#x27;s built in reader mode, which is great for working around annoying styling or mobile rendering issues.
    • narinciye3 hours ago
      Thank you. I was about to get eye cancer
      • sscaryterry2 hours ago
        Exactly, I stopped trying to read it, thought I didn&#x27;t have my glasses on.
  • froh424 hours ago
    Why the fuck make a tech web page unreadable with CRT effects? Thank god, there is reader mode in Firefox.
    • klibertp2 hours ago
      It&#x27;s not that bad... But it is bad. It looks cool, and I managed to read the first few paragraphs. But when the code scrolled into view, it stopped looking cool and became an eye-destroying disaster.<p>YMMV, but OP, if you read this, <i>please</i> consider disabling the text-shadow for code snippets... <i>or</i> disabling syntax highlighting in code snippets. These two things are not a good thing together.
    • ubercore4 hours ago
      Everyone says they want the weird more personal internet back, then this is what we get when someone does a weird internet thing!
      • mister_mort3 hours ago
        I think they could get a close-enough effect by removing the horizontal lines on the text glyphs themselves. This would still keep the colorscheme and slight glow, but drastically improve readability.
    • arethuza3 hours ago
      I actually find it quite readable - YMMV.
      • rz2k1 hour ago
        It must depend on what you’re using to read it. It’s also readable for me on an OLED iPad, and gives me ideas about what I actually want when I wish I could turn the contrast <i>down</i> while reading it with low ambient light.<p>Bringing the brightness levels of the background and text closer together doesn’t ever seem to work, but being able to add a slight blurry dropshadow behind behind each character might be a way to reduce the artifacts OLEDs seem to create when my eyes are tired.
      • sph3 hours ago
        Then, with all due respect, you should not be anywhere near the design or evaluation of accessible systems.<p>There&#x27;s people reading this blog with all types of devices, screens, lighting and range of visual acuity. Even if you&#x27;re blessed with perfect vision and excellent displays, it should be obvious that readability has been lowered for no obvious reason.<p>The point of a blog is for people to read it, so it fails at its foremost job.
        • arethuza3 hours ago
          I wasn&#x27;t saying that I thought it should be adopted as a standard for others to follow - just that (somewhat weirdly) I <i>personally</i> find the code segments on that page quite easy to read.
    • QuadmasterXLII2 hours ago
      “everyone has reader mode” is I guess freeing?
      • layer82 hours ago
        Might as well give up on CSS and just use brutalist HTML in that case.
        • bigfishrunning1 hour ago
          We should do that anyway, CSS was a mistake. I miss gopher.
    • frameer3 hours ago
      [flagged]