Lazy and Interpreter Design

I think, I’d better visit some kind of tutorial to get the knowledge about interpreter implementation. I searched the Internet and found one. Link: https://craftinginterpreters.com/introduction.html.

This one is actually an online book. Skimming through the first few parts takes me back to the college. I searched ‘recursive descent parser’ on Google, to take a quick look back. Back to the book, it brings back many terms from the college, as well as introducing some more ideas. There are 2 phases here, lexical analysis, which would give us tokens, with unnecessary stuff cleaned out. The next phase is parser generation, which would give us the parser to parse the language. There are many things. to visit, like, symbol table, etc. The book has a complete design for 2 interpreters, one done in Java and one done in C.

Lazy and GitHub

I wanted to continue on the code for my Lazy (language) interpreter. I needed to pull what I committed from the browser from ChromeBook, I needed to pull it on my MacBook. A simple ‘pull’ did not work. I needed to ‘push’ a first commit before I did it, I came to this guess from the thought of the ‘-u’ switch needed on the first ‘push’. First ‘push’ needed access to the repo, I added the ssh key to GitHub after generating it. I did not perform the ‘ssh-agent’ step. Adding the key to GitHub now takes a verification. The verification mail did not come through. I am stopping now.

Setting up Personal Website

I recently came up with an idea to make my personal website a little better, improving from a single html page. I thought, it would be a good idea to set up a website with multiple sections. Also, I thought that, a wiki would fit my needs. So, I tried installing wiki on my website space, using a panel provided by my webhost. It did not work. It gives error 500, ‘Internal Server Error’. I think, this may be related to php. An ‘index.html’ page is also not available.

ChromeBook Glitch

Here is a screenshot of my ChromeBook, I checked with a table clock, the timing is wrong, in the bottom right corner, I have a VPN on, so, that may be the cause of this error.

Lazy Compiler

Lazy is a personal programming language that started working on a few days ago. I am following a simple approach here, to use if-else statements to parse the program. It’ll be an interpreted language then. A stack will be needed to handle loops, etc. I continued on the code today, I used an online compiler since I am on a ChromeBook. I wrote a program to contain a multiline program string and then to split it into lines and then into tokens. I also wrote basic logic to try to match a variable using a regex. I am stopping now, owing to a couple of factors. One, I have used some new C++ library includes, functions, etc. I need to let it settle. And two, the compiler/interpreter parsing logic has run into a problem. I need to detect statement types well, using stack, backtracking, etc., this will take some effort.

Commit: https://github.com/amol9/lazy/commit/f8e219e7525af0efd317daa44844c83a0a7d5d8c

GitHub Again

It has been some 6 months since I deleted by GitHub accounts. I have signed up for one again, coming from VS Code. It all seems handy, the pushing of code from VS Code. There are some issues in pushing code to GitHub.

https://github.com/amol9

Compiler Design

I have harboured the idea of making compiler for some time now. Today, I searched a little on Google and looking at some code in a tutorial, I got the idea. That, I can get started fairly fast by writing a simple lexical parser, which parses input code, using a hierarchy of if-else statements. No need to have stages for lexical analysis and parser generation. I’ll need regex support though, to detect numbers.

I think, a stack will be needed, to execute loops, etc.

Here is some very basic code, just to get started, it reads in a file.

Html Menu

This evening, I wanted to make a design for the menu for my site, amol9.com. I saw menu on a website and wanted to copy the style. I saved the page and looked into the html code for the menu. The page code was long and the menu ‘span’ code looked different, it could be obfuscated, it was very long too. So, I’ll get to it later.

Development Log, Rust, Bubble Sort

I wrote a Rust program, to implement bubble sort.

OOP in C++

It has been some time, I have to admit, since the time I visited this concept clearly. I think, one has to do so every now and then. For years, more than 10, I have been writing code in Python, JS, etc. I have been studying topics related to web scraping, compilers, storage, AI, etc. And, I think, the revisit of OOP got lost in there, with only a few minor brushes with it. That did not suffice.

This was abundantly clear when I watched this video (https://youtu.be/wN0x9eZLix4?si=_WSc6OiyS07ePjzD). It describes the concepts in OOP with C++, with code, visiting topics of abstraction, encapsulation, polymorphism, inheritance, base classes, abstract base classes, pure virtual methods, virtual methods, etc. It is a must watch. It refreshes the OOP concepts well.

I think, there is something to do here. Like, coming up with some kind of “meta design”, in order to, keep refreshed, the concepts of OOP, then, other concepts like async, and then other concepts like, data engineering.