Dear Sir, You Have Built a Compiler

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • rosette

    The Rosette solver-aided host language, sample solver-aided DSLs, and demos (by emina)

    Racket is often heralded as the "programming language programming language" and comes with tons of features to build full blown languages: https://racket-lang.org/

    The most complete language/ecosystem that really showcases Racket's capabilities is Rosette IMO: https://github.com/emina/rosette/

  • racket

    The Racket repository

    Racket is often heralded as the "programming language programming language" and comes with tons of features to build full blown languages: https://racket-lang.org/

    The most complete language/ecosystem that really showcases Racket's capabilities is Rosette IMO: https://github.com/emina/rosette/

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • nx

    Multi-dimensional arrays (tensors) and numerical definitions for Elixir (by elixir-nx)

    Most people who want this end up just selecting a regular programming language where the macro system + parsing rules mean that you can define a "more or less complete DSL" within the language itself. For example, the Nx library in Elixir (https://github.com/elixir-nx/nx/tree/main/nx#numerical-defin...), or Groovy/Kotlin as configuration languages for Gradle in Java.

    You still end up with all the power of a programming language tucked in at the edges of the DSL — but you don't have to use or document that power as being available. As long as users of the DSL can do everything they need to do without "breaking out" of the DSL's little world, they don't need to be aware that they could e.g. make fully-namespaced calls to regular stdlib functions of your runtime.

  • the-power-of-prolog

    Introduction to modern Prolog

    To be honest I don't know any short articles that do a good job of describing Prolog.

    For a practically-minded programmer, I'd recommend this longer tutorial that guides you through the creation of an old-skewl text-based adventure game:

    https://amzi.com/AdventureInProlog/apreface.php

    As far as I remember, the tutorial should run on most Prologs without (significant?) modification.

    For a more in-depth, high-level, more computer-sciency view try Markus Triska's pages:

    https://www.metalevel.at/prolog

    Marcus Triska is also the author of several constraint logic programming libraries, for example:

    https://www.swi-prolog.org/man/clpfd.html

    Then, there's a number of textbooks. The classics are Clockin and Mellish and Bratko:

    Programming in Prolog (Fifth Edition):

    https://www2.cs.arizona.edu/classes/cs372/spring15/Programmi...

    Prolog programing for AI

    https://archive.org/details/prologprogrammin0000brat

    I personally really enjoyed this book by George Luger:

    AI Algorithms, Data Structures and Idioms in Prolog, Lisp and Java

    https://www.cs.fsu.edu/~cap5605/Luger_Supplementary_Text.pdf

    For the theory behind DCGs, there's Pereira and Shieber:

    Prolog and Natural Language Analysis

    http://www.mtome.com/Publications/PNLA/prolog-digital.pdf

    And for logic programming theory in general, the seminal source is J. W. Lloyd:

    Foundations of logic progamming

    https://link.springer.com/book/10.1007/978-3-642-83189-8

    Unfortunately, I can't recommend any newer texbooks.

  • discussion

    Discussion repository for Forth enthusiasts. (by ForthHub)

    With respect you've ignored the point I was making. There exist several Forth engines with native code-compilation, for instance VFX Forth, SwiftForth, and iForth.

    > Typically the C version outperformed the Forth version by 3:1 or better, and I would not have known how to bridge that gap.

    With a threaded-code Forth interpreter I'd expect the C version to outperform it by something closer to 5:1, so 3:1 doesn't sound too bad. The only way you can close the gap is with good quality native-code compilation.

    > Nowadays with far larger caches Forth might do better, I haven't really worked with it for years.

    It's interesting how advanced in CPU architecture change the relative performance of the different threading strategies. This has been nicely studied by the gforth folks. [0][1] Threaded-code interpreters still easily lose to optimising native-code compilers though, [2] and I expect they always will.

    More on how Forth collides with low-level CPU matters: [3][4][5]

    [0] https://www.complang.tuwien.ac.at/forth/threading/

    [1] https://www.complang.tuwien.ac.at/forth/threaded-code.html

    [2] https://github.com/ForthHub/discussion/issues/88#issuecommen...

    [3] The Behavior of Efficient Virtual Machine Interpreters on Modern Architectures - https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.12...

    [4] Branch Prediction and the Performance of Interpreters -

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts