Bunch of photos I took of the same location in 2010 and 2026. Not much care was taken to take the exact shot, but you know. You can probably guess which photos are which. Check out the albums of the before trip and the after trip . Citadel Gate Inside the Citadel Citadel Memorial Al-Sultania Mosque Right in front of the Citadel's gate. Umayyad Mosque Minaret In Front of the Umayyad Mosque Up…
في آخر زياراتي لحلب في أواخر ٢٠١٠، كان الربيع العربي في تونس ومصر على أوجه. اجتمع المصريون في ميدان التحرير في القاهرة مطالبين بإسقاط النظام. كنت يومئذ في حلب، عند الحلاق، منتظرا دوري ونشاهد الأخبار على التلفاز، وعلق صبي الحلاق أن ميدان التحرير هو «ساحة سعد الله تبعهم» فكان رد الحلاق «سعد الله تشبط رقبتك». لا يخفى على أي سوري ما مر على سورية وأهلها خلال تلك السنين العجاف منذ ٢٠١٠. ما مر على الشعب…
I have been working on a small TUI application (with ratatui , what else?) to check the spelling of my long-winded articles and fix the mistakes of my fat fingers. It obviously would not catch everything, but it is a decent effort. You can check it out here until I get to write something more substantial about it. One thing I did want to do, however, is to spell check Arabic. As well known to…
In the past few days I have been plugging away at writing a language that compiles directly to WASM. You might say, there are many languages that compile to WASM, what makes this one special? And the answer is "nothing". Yet, anyway. All I have is a few binary expressions and loops. There is only one type: int , which is i32 . I have not even implemented function calls yet! Nonetheless, I passed…
Inspired by an article shared on lobsters , I decided to explore the small world of hex viewers. It is a tiny world, really. I tried hexyl for a bit, and in my enthusiasm I created two issues and two pull requests. Then I decided I should take matters into my own hands and just do one for myself, how hard can it be, really? Turns out, it is not very hard. You open a file or read from stdin , then…
In the past few days I have making a number of small improvements to this website. For example, I used my kashida rust crate, compiled to WASM, to properly justify the Arabic poetry in my previous two articles , with a small JS shim. When I went to share these articles on social media, I realized I needed OpenGraph thingies to make the link more palatable looking. Adding og:site_name and og:title…
مؤخرا نشرت وزارة الثقافة السورية سبعة أناشيد مطروحة للملحنين والمغنين أن يختاروا واحدا منها ويلحنوه ليكون النشيد الوطني السوري القادم، بعد النشيد المغضوب (حماة الديار). فلذا رأيت أن أكتب مقارنة بسيطة بين هذه الأناشيد للمفاضلة ما بينها مع نشيد (في سبيل المجد). وليس انتقادي هنا انتقادا للأشخاص، وإنما نقد أدبي بحت يعنى بالكلمة كما قرأتها، عليا بأن اطلاعي على الشعر والكتابة أوسع قليلا من سماع الأناشيد…
كل ما يلي، بما فيها الهوامش، هي كلمات الشيخ علي الطنطاوي رحمه الله كانت 1 نشأتنا الأولى في عهد العثمانيين، وكانت لهم أناشيد يلقونها علينا باللسان التركي، إذ لم نكن نفهم معانيها الضخمة إلا بالترجمة، والترجمة لا تحمل دائما المعنى كله، فلقد كانت تهزنا ألحانها القوية المثيرة التي وضعت لتكون لمشاة الجيش قوة وعونا. وكنا إذا أنشدناها سائرين لا نستطيع أن نقف، وإذا تلوناها واقفين سرنا، وإن قرأناها قاعدين…
In the ongoing effort for activities that fill the void made by unemployment, I have recently started to learn Chinese. Got into a Chinese language institute and everything. And because not every app supports right-clicking some text and selecting the "Translate" menu option, I found myself launching TextEdit just to do that. So, I figured, maybe I can do a small command line tool where I'd…
Recently I have come across a nice article: Many Hard Leetcode Problems are Easy Constraint Problems , and I figured, I really should learn how to use these things! What else do I really have to do? I have had use for solvers (or as they are commonly called: theorem provers) In a previous article , but then I tried to prove the things with good old algorithms. I looked at z3 at the time, but found…
I am working currently on a small Zig library which I am not quite ready to talk about yet. However, it involves parsing a big table of data and then doing operations based on that data. For the remainder of this article, I shall pretend the library is about wind directions. Note that this article uses Zig 0.14.1 . Big changes have happened in the master branch since that was released. Though the…
This is a collection of ideas that may or may not be feasible to implement or to have as the base idea of a start up. It is not a structured document, but more of a stream of thought. IFC Industry Foundation Classes 1 is an open source data format for modeling BIM (Building Information Modeling). It is supported by Revit, the market leader. A well known open source implementation is Bonsai BIM . I…
This is a series of articles I wrote while writing paella , following Nora Sandler's Writing a C Compiler . It was both an exercise to learn Zig and a way to waste time instead of looking for work, as I am currently "between jobs". I did not edit them as I collect them here outside of fixing some broken links. Chapter 1: Intro Chapter 2: Unary Chapter 3: Binary Chapter 4: Logic Chapter 5:…
This is the final chapter of Part 1 of Writing a C Compiler . Something about static variables? Lexer The Book spends 15 pages talking about linkage and static variables and tentative declarations, etc, before it gets to the lexer. Only two new keywords are needed: static and extern . This is the current keyword static map: pub const keywords = std.StaticStringMap(Tag).initComptime(.{ .{ "int" ,…
After eight grueling (not really) chapters of Writing a C Compiler , time to implement more assembly instructions. Functions! Linkage! Commas! Lexer, AST, and Parser Lexer just has a comma now. I thought about adding the comma operator but that didn't seem worth the trouble. The AST has two new additions. Function call expressions and function declarations (which are rebranded and improved…
Seven done of Writing a C Compiler , a few more to go. Now is the time for loops. Lexer, AST and Parser The lexer is just a few new keywords. Been there, done that. Changes to the AST are more interesting. No less than five new statements, one for every new keyword. Here is the new Stmt without further ado: pub const Stmt = union ( enum ) { @"return": * Expr, expr: * Expr, @"if": struct { cond: *…
Chapter 6 of Writing a C Compiler was a short one. So will Chapter 7. Do not even bother to buckle up. Syntax Tree and Parsing See? Not even new tokens for lexer. This chapter is all about implementing compound statements. To abstract the similarities between a function body and compound statements, a new Block AST node shall be created. Along with a tiny change in FuncDef , you get this beauty.…
This is chapter 6 of implementing Writing a C Compiler in Zig. So, without further ado, time to get on with if statements and conditional expressions. Lexer New keywords! if and else , and two new tokens ? and : . Apparently the word query is an acceptable single word name for a question mark so I am going with that in the lexer. The new keywords are simple, enough, but it requires updating the…
Reflecting on the past chapters so far , I am starting to think that this project is perhaps the perfect vehicle to explore new languages. Right off the bat, one deals with file systems, cross compiling, data structures, memory management, pretty formatting, and what have you. But as the project goes on, especially if you are familiar with the problem (read: have done it before in a previous…
Three chapters out of who knows from Writing a C Compiler . Time onto Chapter 4. Chapter 4 is about, let me check, "logical and relational operators". Great. More operators. Lexer You would expect the lexer by now to be a boring done deal, and you would be right. However, this is slightly more interesting because I get to add more states to the state machine! The tokens for today are the…
Two chapters of Writing a C Compiler done, many more to go, and it is time to implement binary expressions. But before I get into that, let me rant a bit about Zig. The War Against Tabs Zig's grammar does not tolerate the tab character anywhere in the file. This is unfortunate, as I like tabs. With source code, it is whatever, as zig fmt takes care of it, but can I please type my tabs in…
So, with the first chapter of Writing a C Compiler behind us, it is time to start on the second chapter: Unary Operators. But first, a word from build.zig land. Running the tests with zig build test The tests for this Book live in their own repository , which I have dutifully cloned and run tests in. The process I followed to run the tests is fairly manual: navigate to the test directory. run the…
In a constant drive to spend, or waste, time while I am looking for work, I got and worked through Nora Sandler's Writing a C Compiler in Rust . It is an excellent introduction to things like intermediate representation and x86_64 assembly. About halfway through the book, however, I lost focus. Continuing to have nothing particularly productive to do, I figured that I could try following the…
Note: This was written as a draft document. The ideas are haphazard and not properly organized. The cities of Syria are, to put it lightly, in bad shape. Decades of neglect followed by the war and large-scale destruction have destroyed the cities. Everyone in Syria wants to rebuild, but we need to re-build it right . We should build them for humans. But cities should be designed for humans. Humans…
In the last few days I have been mucking around with Mimiron , my Hearthstone API library and Discord bot. One of the main functions of the bot, and the one it is used for the most, is parsing Hearhstone deck codes and presenting them in a pretty fashion. I had a working parser for a while, but I wanted to experiment with it so I decided to rewrite it in nom . Here are both parsers. Deck Code…
This is an interesting puzzle inspired by Christian Freeling's tile set The China Cube . As it really has nothing to do with China, I call it the Hanging Gardens Problem . Imagine each cube as a section of the Garden, and connections to other cubes are paths and stairways. 1 Here is a nice drawing showing the full set of 64 Cubes, from Freeling's site. Problem Formulation There are 64…
I have been doing some thinking about what my ideal code editor should be. I currently use VSCode, both to edit this site and to play around with code. However, VSCode is actually too powerful for my needs. And it lacks one crucial feature (that's pretty much lacking from almost every text/code editor outside of TextEdit and Notepad): proper Arabic language and Right-to-Left (RTL)…
In an escape from the worries of life, I have been reading recently into the Odin programming language . I wanted to learn something that is closer to the metal than Rust, and Odin seems nice. For a project to do with the language, I figured I would build a library for the abstract board game Dominions, by Christian Freeling . ( Sensei's Library link ). The game can be described as a Go…
For the tl;dr, skip to Priority . This article is a follow up to this one . Background Reading Here are some links that you might want to look at: Deficiencies of Handling Arabic Script in OpenType. Aida Sakkal and Mamoun Sakkal. Tech Talks 2021 . Mamoun Sakkal is a rather well known Arabic type designer. The video goes over the practical problems of justification in detail. On Arabic…
I am an architect (the physical kind), not a programmer, and I am interested in Typesetting and fonts. The common wisdom online is that Knuth's linebreaking algorithm, implemented for TeX some time back, is the be all end all way to typeset text on a printed page. But there are no clear explanations of what the algorithm is , beyond handwaivey explanations of boxes and glue and penalties. I,…