from Hacker News

Debugging compilers in Clojure

by jpmonettas on 10/23/23, 11:52 AM with 12 comments

  • by fiddlerwoaroof on 10/26/23, 12:30 AM

    This is a nitpick, but I think this is a bad mental model of most lisps:

    > Since the compilation unit of most Lisps is a form instead of a file like on most other languages, the core of the ClojureScript compiler can be seen as a program that will take a string representing a Clojure form as input, read it, recursively parse it into a tree of expressions also known as an AST (abstract syntax tree), and then walks down the tree emitting strings containing JavaScript code.

    There might be a string representation of the code, but one thing that’s unique about a lot of lisps is that the input to compile/eval is not text: there is usually a function called something like “read” that turns the textual format into normal lisp objects and then eval can take any lisp object and evaluate it. Typical lisp objects are “self-quoting”, but what characterizes a lisp is that the domain and codomain of eval are the same type.

  • by iLemming on 10/26/23, 1:38 AM

    I recently joined a team where I need to sift through copious amounts of very confusing code. The company is a startup, and many elements were designed hastily. The Flowstorm debugger has proven to be an invaluable tool; my life would have been significantly more difficult without it. I highly recommend it. Also, Juan is an incredibly friendly person, he is clearly very knowledgeable and always eager to help. There's a #flow-storm channel in Clojurians Slack.
  • by KRAKRISMOTT on 10/26/23, 12:19 AM

    Awesome work, super pumped for this. I wish the Clojure devs would release a first party debugger, almost every other lisp has one built in.
  • by upghost on 10/26/23, 12:10 AM

    if this works you can have all my money. stellar work in advance ohhhh do I dare even hope?

    edit: sorry realize my comment is confusing, I got very emotional when I saw about flow storm http://www.flow-storm.org/

    clojurescript debugging.. oh my god I can't even imagine.