Github   Twitter(X)   Linkedin

Hi, I’m Ahmed Hossam, a programmer, computer science student, and aspiring engineer.

Currently I’m a Software Engineer at TJM Labs. I build AI bots to automate data entry.

I also make Youtube videos.

When I’m not coding, I’m playing chess.

Email: [email protected]

Projects

  • Chatbang – CLI tool to access ChatGPT from the terminal without an API key
  • Chessmate – Chess game written in C++ and Raylib
  • Lesser Pandas – Data Analysis library in C++

Writing

Reading Notes

The Tiger Book: 2 Lexical Analysis

The lexical analyzer (lexer) takes a stream of characters and produces a stream of names, keywords, and punctuation marks; it discards white space and comments between the tokens.

Lexical tokens have types in any programming language, example:

  • ID foo, x, n14
  • NUM 73, 0, 082
  • REAL 3.14, 10., 1e9, 0.5
  • COMMA ,
  • NOTEQ !=
  • LPAREN (
  • RPAREN )

Punctuation tokens such as IF, VOID , RETURN constructed from alphabetic characters are called reserved words and, in most languages, cannot be used as identifiers.

Read more →

The Tiger Book: 1 Introduction

A compiler is built from many modules (lexical analysis, parsing, semantic analysis, IR translation, optimization, code generation, etc). Each module does a specific job, but they must work together. The interfaces between them are just as critical as the algorithms inside the modules.

Any large software system is much easier to understand and implement if the designer takes care with the fundamental abstractions and interfaces.

For a compiler, it’s better to break it to many pieces (modules). This allows for reuse of the components. For example, to change the target-machine for which the compiler generates machine code, you just need to change Frame Layout and Instruction Selection modules.

Read more →

How I Made ChatGPT Run on My Terminal without an API key?

alt text

I had a problem where I wanted to stop leaving the terminal and going to ChatGPT back and forth just for a quick question. For example: git commands, I always forget most of git commands and I want to ask ChatGPT how can I do something using git. Also to take a suggestion for how to do something using bash (write a bash script to replace every space with a ‘_’ for all the files in that directory). It would be a lot faster if I can do it from the terminal without going to the browser.

Read more →

Why I Quit Competitive Programming

TL;DR

I tried competitive programming for a whole year and it didn’t work out well for me, I didn’t enjoy it and didn’t achieve anything remarkable as well. So it’s better to take the L and move on and try other things I wanted to try, but I couldn’t because of competitive programming. For the rest of the article I’m going to talk about the sunk cost fallacy.

Read more →