Skip to content
0:00 / 0:00

#clojure#clojurescript#ast

Timothy Baldridge - Data All The ASTs

ClojureTV

111K subscribers • 159 videos on Hallway

YouTube
  • Recommended by 6 people: 1 on Lobsters and 5 in engineering communities.
  • A classic. People kept recommending it from 2014 to 2022.
  • Presented by Timothy Baldridge, Clojure core contributor

Advanced. Deep dive for people who know the field.

8.5K views12 years ago6 recommendations

Systems programmingProgramming languagesCompilers and interpretersLisp and ClojureLanguage design and type systems

Timothy Baldridge explains how treating Abstract Syntax Trees as nested hash maps simplifies compiler design in Clojure and ClojureScript.

The ClojureScript has inspired a revolution in compiler design. The concept of treating Abstract Syntax Trees as nested hash maps was a design decision that started with this compiler and has since spread to almost every compiler in the Clojure ecosystem. This talk will start with a description of how ASTs are traditionally designed in other languages (C#, Haskell, ML, and Clojure as examples). The problems with these approaches will be discussed. The talk will then describe how the hash map approach used by Clojure enables compiler designers to be more productive. The talk will then end with examples and case studies from ClojureScript, Clojure in Clojure, core.typed and core.async.

Why it's here

6 people recommend this

What people say. Recommended as an excellent explanation of Clojure's tools.analyzer and the benefits of data-oriented compiler design.

u/nefreatin r/Clojure • Recommends

On “Advantages of Data Oriented Programming”

> I find that static typing and, to a lesser extent, object-oriented encapsulation help with ensuring correctness. Data Oriented Programming is orthogonal to data orientation. It just so happens that Clojure is setup in such a way to make it that style idiomatic. > For those who have done a lot of coding with this paradigm in mind, has it worked well for you? At work I took a Java service that produced responses and is thousands of lines long and was able to rewrite it in Clojure in about 300 lines. The main logic is 77 lines. Basically using the techniques outlined here. Edit: This link to this video is actually a better example.

juliangambleon Lobsters • Recommends

Clojure Compiler progress report "Data All The ASTs"

u/alexdmillerin r/Clojure • Recommends

On “Parsing Clojure into an AST”

This is what the tools.analyzer.jvm,.js projects are designed to do (it uses tools.reader as well). See: https://github.com/clojure/tools.analyzer.jvm And this is a useful video for using it: link to this video

u/joinrin r/Clojure • Recommends

On “What have you watched this month/week in clojure?”

performance / benchmarking / optimization talks (older but still relevant): link to this video link to this video clojure.tools.analyzer compiler tech (I'm interested in using this for some optimizing compiler passes that I've been doing in a limited fashion with macros). I don't think we leverage this as nearly as well as we could (we should have something like MAGIC for the jvm backend). If I was smarter I'd explore using core.typed's analyzer (or even something spec-based). link to this video

u/agumonkeyin r/Clojure • Recommends

On “Communicating Sequential Processes with core.async”

Oh we can peek at the first 30 seconds. In the mean time, T. Baldridge talks on AST link to this video

u/abudabuin r/Clojure • Recommends

On “GitHub - leonoel/cloroutine: Coroutine support for clojure”

FWIW, I think I've figured out a bit more about how this works. Timothy Baldridge's explanation of the analyzer is helpful: link to this video It also looks like cloroutine is doing ssa: https://en.wikipedia.org/wiki/Static_single_assignment_form