Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    S

    Semantic Domain

    semantic-domain.blogspot.com · Personal blog · on HN since 2013

    Semantic Domain is a programming languages researcher's blog on functional programming, verification, compilers, type theory, and regular expressions.

    Visit blogRSSHN submissions
    Languages & CompilersProgrammingMath
    What HN says

    Commenters recommend its posts on Antimirov derivatives for regex matching and on why functional programs are easier to verify than imperative ones.

    Stats for nerds
    32HN people shared it
    32linked in comments
    500story points
    Sep 2024last shared
    2013people per year2024

    Top posts on HN

    1. 1
      How to implement a spreadsheet
      2 people · 177 points · first shared 2015 · 68 comments on HN
    2. 2
      Thought Experiment: An Introductory Compilers Class
      3 people · 98 points · first shared 2020 · 22 comments on HN
    3. 3
      Every Finite Automaton Has a Corresponding Regular Expression
      1 person · 94 points · first shared 2019 · 44 comments on HN
    4. 4
      What Declarative Languages Are (2013)
      6 people · 44 points · first shared 2013 · 12 comments on HN
    5. 5
      The Worm Ouroboros
      1 person · 44 points · first shared 2018 · 12 comments on HN
    6. 6
      The golden age of PL research
      4 people · 9 points · first shared 2022 · Discussion on HN
    7. 7
      Are functional programs easier to verify than imperative programs? (2018)
      3 people · 9 points · first shared 2018 · 2 comments on HN
    8. 8
      The Relationship Between Static Analysis and Type Theory
      2 people · 5 points · first shared 2019 · Discussion on HN
    9. 9
      Linear-Time Parser Combinators
      1 person · 5 points · first shared 2023 · Discussion on HN
    10. 10
      Are functional programs easier to verify than imperative programs? (2018)
      2 people · 3 points · first shared 2018 · Discussion on HN

    What HN people wrote when they linked it

    • nickpsecurityJan 2019

      An article you might find helpful is this one on why imperative algorithms are harder to mathematically verify than functional ones:

      https://semantic-domain.blogspot.com/2018/04/are-functional-programs-easier-to.html

      You don't need to be a mathematician to follow it with this excerpt summarizing its key point:

      "The difficulty of imperative programming arises from the combination of state, aliasing and procedure calls. Any two of these features can be handled without that much difficulty, but the combination of all three effectively makes reasoning (nearly) as difficult as correct concurrent programming. "

      The garbage-collected languages let you ignore the aliasing problems with a performance penalty. Rust in safe mode without GC forces you to (a) deal with it and (b) deal with it in a way that works for all inputs (type/memory safety). That usually requires mathematical verification using tools such as separation logic. Rust's method is much easier to use with tradeoff of limitations on expressing code in certain ways.

      Folks that get along with the borrow-checker say it helps to design the program around data and easy methods of using it versus starting with control flow forcing it on a data structure. I'll also add that linked lists are inherently hard to get right on all inputs regardless of low-level language. They're actually a popular way to test new, mathematical methods for specifying and proving algorithms correct. Fortunately, Rust folks have a goto write-up on…

    • telFeb 2019

      "Declarative" programming has become something of a buzzword. This is unfortunate because it prevents finer distinctions between domain specific language techniques.

      I think it achieved its buzzword status because it for a long time was something people clearly recognized but couldn't define. Fortunately, Neel Krishnaswami wrote a very cogent post putting his finger on the nerve.

      https://semantic-domain.blogspot.com/2013/07/what-declarative-languages-are.html

      With this definition we can see that (a) the author misses the boat on "declarative" in a concrete way and instead lands on something much closer to DSLs in general and (b) then only uses a narrow set of DSLs to provoke criticism and thus presents a very weak argument.

      The powerful core of his argument—the "unfolding" principle—is not something I can claim to understand fully from this article, but it suggests something worrying: that every DSL must transparently resemble its interpretation. This makes it easy for a user of the DSL to recognize how it will be interpreted and thus achieve ease of understanding... but it gets dangerously close to banning abstraction all together!

      In my opinion, the true measure of a DSL is the consistency and diversity of semantic interpretations (or "models") that are valid for the DSL and consistent with one another. This measure seems to establish the resilience and leverage a given DSL's topic might have.

      Consider how SQL can describe set operations, an abstract search process,…

    • edwintorokJun 2015

      If I oversimplify I would say that due to pattern matching and functional nature of OCaml you can avoid
      much of the boilerplate code needed for building tree nodes, or finding the node you want, allowing you to focus on the high-level task you want to actually achieve.

      In fact one thing that you might notice in the beginning when reading OCaml is that the code seems more "dense".
      In C I was used to reading code by skipping over large chunks of it (again I'm oversimplifying here) like the one below, and one of the things I had to get used to when learning OCaml was to slow down and avoid skipping large chunks of code:

      if (some_complex_condition == failed) {
      /* ... large block of code for error handling to ignore on first read .. */
      }

      result = malloc(...);
      result->... = ...;
      result->... = ....;

      Here are some examples of what is possible with symbolic manipulation in OCaml, although I would recommend learning a bit of OCaml syntax and concepts from a book first
      (such as Real World OCaml):

      A short example of implementing regular expression matching using Antimirov's partial derivatives that illustrates symbolic manipulation:
      http://semantic-domain.blogspot.ro/2013/11/antimirov-derivatives-for-regular.html

      A step-by-step explanation of a DSL optimizer that doesn't use too many advanced notions of OCaml:
      http://okmij.org/ftp/tagless-final/course/optimizations.html

      A nice example of symbolic manipulation is this counter-example generator for regular…

    • spekcularMar 2021

      > I've pressed for details, and I've seen others do the same, but it never ends in anything concrete—just an implicit appeal to the new conventional wisdom that they do more harm than good.

      Really? Merits of the criticism aside (I don't know anything about compilers, so I'm not capable of judging), the received wisdom seems to be that the Dragon book spends far too much time on parsing and not enough time on other, more important aspects of modern compiler development.

      See, for instance, this blog post by a professor about teaching a compilers course: http://danghica.blogspot.com/2020/04/teaching-compilers.html.

      Or this blog post (and the one it links in the first paragraph): https://semantic-domain.blogspot.com/2020/02/thought-experiment-introductory.html.

    • neel_kNov 2018

      Eleven years on, this remains one of my favorite papers!

      There's a pretty variant of this idea introduced in 1995 by Valentin Antimirov called partial derivatives of regular expressions. His idea was to replace the single derivative with a set of partial derivatives that add up to the whole derivative. This simplifies the derivative algorithm quite a bit, and makes it possible to write amazingly concise and efficient regular expression matchers.

      E.g., here's an implementation of a regular expression compiler that uses Antimirov derivatives to take a regexp and build a table-driven matcher in about 50 lines of code:

      http://semantic-domain.blogspot.com/2013/11/antimirov-derivatives-for-regular.html

    • dysocoSep 2024

      I remember John Carlos Baez having some interesting stuff: https://johncarlosbaez.wordpress.com/

      Some other ones I had bookmarked the other day but haven't seen much in depth, mostly computer science based but more towards theory/math side:

      https://blog.computationalcomplexity.org/

      https://semantic-domain.blogspot.com/

      https://greydanus.github.io/

      Also go to Terry Tao's blog and look at the sidebar, there are a lot of links to external blogs there.

    Related

    Existential Typeexistentialtype.wordpress.com157 people

    Haskell Is Exceptionally Unsafe (2012)

    Existential Type
    Personal · last shared 2026
    Lambda the Ultimatelambda-the-ultimate.org615 people

    Simon Peyton Jones Elected into the Royal Society Fellowship

    Lambda the Ultimate
    Publication · last shared 2026
    Norman Hardycap-lore.com38 people

    Category Theory

    Norman Hardy
    Personal · last shared 2026
    FP Complete Blogfpcomplete.com201 people

    Monads and GATs in Nightly Rust

    FP Complete Blog
    Company · last shared 2025
    Semantic Kernel Blogdevblogs.microsoft.com/semantic-kernel16 people

    The Semantic Kernel – SDK for Integrating LLMs into Your Apps

    Semantic Kernel Blog
    Company · last shared 2026
    Luke Palmerlukepalmer.wordpress.com35 people

    IDE WTF

    Luke Palmer
    Personal · last shared 2020
    Well-Typed Blogwell-typed.com60 people

    Falsify: Hypothesis-Inspired Shrinking for Haskell (2023)

    Well-Typed Blog
    Company · last shared 2026
    Jonathan Aldrichcs.cmu.edu/~aldrich29 people

    The Power of Interoperability: Why Objects Are Inevitable [pdf]

    Jonathan Aldrich
    Personal · last shared 2025