A deep dive into ASTs, with examples in three different programming languages

AST for a simple Java class

Most of the code we write is turned into an Abstract Syntax Tree(AST) at some point during the development workflow. Typically AST is thought to be part of the compiler, but there are variety of places and use cases where it can be used. While compiler design books might differentiate between syntax vs. semantic tree representations, the below figure works as a simple model.


An introduction to type systems in TypeScript

Photo by Da Nina on Unsplash

What is it all about?

A type system is a set of rules for performing various consistency and correctness checks in a program. There are various definitions and classifications for type systems. A good working definition is the following:

In programming languages, a type system is a logical system comprising a set of rules that assigns a property called a “type” to the various constructs of a computer program, such as variables, expressions, functions or modules. — Wikipedia

There are different categorizations of type systems including:

  • Static vs. Dynamic
  • Structural vs. Nominal
  • Strong vs. Weak (this is more…

A python library for “Diagrams as Code”

Photo by Florian Krumm on Unsplash

As a software developer there is a high probability that you would have created a presentation, wiki or some other asset to document your architecture. And one of the key component is diagrams. You could have generated a UML class diagram to show your design or a deployment diagram for your cloud deployment.

But the problem with these diagrams is that once done, mostly it’s never revisited and updated. Your architecture or design evolves over time. Code, infrastructure and every other component gets updated but not your original architecture diagram unless there is significant change. …


Automating browser tasks

Photo by Richy Great on Unsplash

A communication protocol is a system of rules that allow two or more entities of a communications system to transmit information via any kind of variation of a physical quantity. The protocol defines the rules, syntax, semantics and synchronization of communication and possible error recovery methods.

What is it ?

The Chrome Dev Tools(CDP) enables us to communicate with the Chromium & Chrome browsers and helps perform

  • Test Automation
  • Tracing & Troubleshooting
  • Profiling & Instrumentation

Many libraries and browser extensions leverage the protocol to orchestrate various actions within the browser. For e.g Puppeteer provides a higher level API on top of the CDP.

Getting Started

In…


A novice attempt at learning music via programming

Photo by Omar Prestwich on Unsplash

Instead of picking up an instrument, learning music theory or any other type of formal training, I recently got interested in learning music via programming. Enter Sonic Pi.

Sonic Pi is a music programming environment, which lets you write code and execute it on the fly. The output as expected is sound, MIDI sounds to be specific. Sonic Pi was created by Sam Aaron as a tool to be used in schools for teaching computing and music. I should say it achieves this in spades. …


Photo by Caspar Camille Rubin on Unsplash

ElasticSearch provides the ability to not only store and retrieve text in an efficient manner but can be used as an effective analytics store. While the ElasticSearch query DSL is fantastic and provides all the capabilities for a developer to retrieve data, it can quickly become verbose and complicated.

Use Case

One of the most common use cases of ElasticSearch is log analysis and we ingested logs from multiple sources into an ElasticSearch cluster mainly for troubleshooting purposes. The log analysis started with typical ingestion pipeline where the logs are parsed, cleansed, enriched with additional metadata and indexed in ElasticSearch.

Rengarajan

Software Engineer | Passionate Learner | Lifelong Student

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store