Categories for:

Create a stand-alone LALR(1) parser in Python

Over the years, I noticed that many developers are reluctant to use parsing libraries, especially if the language they need to parse is relatively small. The reason is that they wish to avoid adding external dependencies to their project. Although pip (setuptools) can automatically fetch... View Article

1 Comment

How to write a DSL (in Python with Lark)

The first time I used Logo, it felt like magic. I could type a short sequence of simple commands, and draw beautifully complex shapes on the screen. In this tutorial, I will show you how to parse and interpret a Logo-like language in just 70... View Article


Baker – Expose Python to the Shell

It's been a long time since my last post, and it would be appropriate that I post about whatever it is that I've been working on. But I won't. I'm writing this post only to tell you about an interesting new python library I stumbled... View Article

1 Comment

PySnippets – improving code reuse

For a long time now, I've been hindered by the issue of utilities, or snippets. These are convenience functions and classes that are too small or too incomplete to justify a library, yet are useful enough to be used. I've posted a few on my... View Article


FileDict – bug-fixes and updates

In my previous post I introduced FileDict. I did my best to get it right the first time, but as we all know, this is impossible for any non-trivial piece of code. I want to thank everyone for their comments and remarks. It's been very... View Article


Pickling Python Expressions

My last post introduced the concept of X, a class which "absorbs" operations and behaves like a function. As many people pointed out, this was merely a syntactic alternative to lambda. You may like it, you may not. Now, after a rewrite, X can now... View Article


Fun While Avoiding Lambda (Python)

Readers, meet X. X is a class I wrote in Python as an alternative to using lambda. It has two main features: It acts as an identity function ( so X(3) == 3, etc. ) When performing operations on it, it returns a new class... View Article