Category: Code Hacking
-
A Clean Approach to Generating Test Cases Dynamically Using Python’s Introspection
Hello everyone, in this blog post, I’ll share a recent exploration I undertook using Python’s introspection features. For those who aren’t familiar, introspection refers to Python’s ability to inspect and know about its own state and objects at runtime. It includes abilities such as determining the type of an object, fetching its attributes, and so…
-
Parsing Python F-Strings: A complete example
If you’re like me, and you like to cause yourself pain, you may be writing a programming language and want to support python-like fstrings. Well, f-strings are quite a funny little thing to parse, because a typical lexer doesn’t have the theoretical power (as they only support regular languages) to parse pythons handy dandy fstrings…
-
A Cute Little Test for Compiler Hackers: Ensuring Codebase Consistency
Building compilers, transpilers, and interpreters involves writing numerous production and transformation rules. As the complexity of the language increases, the rules’ number could potentially reach into the hundreds. Ensuring consistency between different parts of the language toolchain becomes a challenging task. However, there is a cute little trick that can help to maintain consistency while…
-
Black is just not enough to keep the code tight…
In my pursuit of maintaining coding standards in Python, I used to believe that relying on “black” was sufficient. However, I soon realized the need for a more stringent approach. This led me to adopt a new code linting strategy, combining “black” with “flake8” and a ninja mix of plugins. In this article, I will…
-
Kicking Off Jaseci 2: Evolving the Future of Data-Spatial Programming
Today marks an important milestone as we begin the planning stages for Jaseci 2. Over the past three years, Jaseci has enabled the creation of numerous sophisticated production products, showcasing its power and versatility. However, during this time, we discovered a design flaw that affects the interaction of inheritance with Jaseci’s walker abstraction. This revelation…