Compare commits

...

2 Commits

Author SHA1 Message Date
Palash Bauri 48dc151e8c new blog 2023-06-04 11:23:07 +05:30
Palash Bauri 52fd46c9b6 Updated zig as build system for cpank 2023-06-03 18:24:17 +05:30
2 changed files with 66 additions and 1 deletions

View File

@ -0,0 +1,54 @@
+++
date = 2023-06-04
description = "My radical philosophy of programming"
images = ["https://b.og.palashbauri.in/api/og?date=2023-06-04T05%3A50%3A12.591Z&title=My%20radical%20philosophy%20of%20programming&gh=bauripalash&blog=Adventure%20of%20Palash%20Bauri"]
kws = ["programming", "c" ,"philosophy", "windows", "programming-language", "bengali", "cross-compile"]
lastmod = 2023-06-04
showtoc = false
nocomment = false
noshare = false
showbread = true
noshowlastmod = false
tags = ["philosophy", "programming"]
title = "My radical philosophy of programming"
+++
Since the initial covid lockdown, I have been working on Pankti Programming Language. Initially, it was written in Go, then I rewrote it in Rust, and it got too much complicated. Then I settled on C, though I am having some problems as I mentioned in my previous post[^1].
Over time I developed some strict philosophy around the development which I follow radically:
### 1. A program must do its job correctly.
No matter the input or host platform the program must generate the same output, if it fails it must produce error messages which enough information so that users can report the issue in-depth. Edge cases should be handled perfectly.
This point along with number 2 is the topmost priority.
### 2. The source code of the program must be simple to understand no matter the language used.
Use simpler algorithms. Write smaller functions. Does not matter if the program is slow or has memory leaks, if the program works correctly nothing matters anymore.
### 3. The source code should be modular
instead of writing huge chunks of code in a single file, break the file into smaller chunks, such as if needed the code can be used in future projects without big changes.
### 4. The code should be cross-platform.
Whereas possible Don't use nonstandard or platform-dependent code.
### 5. The code must be well commented.
such as that you don't even need to look up the programming language or library documentation every 5 seconds.
### 6. The programmer must write notes
More like a log of what has been done till now and what will be done.
### 7. The program should be well optimized
unless it makes the code hard to understand even with good comments.
### 8. Avoid sharp characters
Characters like angled brackets <...> should be avoided as far as possible, it really hurts the eyes to skim through the code.
---
[^1]: [Zig as build system for Cpank](https://palashbauri.in/zig-as-build-system-for-cpank/)

View File

@ -3,7 +3,7 @@ date = 2023-05-29
description = "using zig as build system for Pankti Programming Language a Bengali programming language which runs on Windows, Mac, Linux, Android, and Web."
images = ["https://b.og.palashbauri.in/api/og?date=2023-05-29T04%3A23%3A45.381Z&title=Zig%20as%20build%20system%20for%20Cpank&gh=bauripalash&blog=Adventure%20of%20Palash%20Bauri"]
kws = ["programming", "c" ,"zig", "windows", "programming-language", "bengali", "cross-compile"]
lastmod = 2023-05-29
lastmod = 2023-06-03
showtoc = true
nocomment = false
noshare = false
@ -32,6 +32,17 @@ Building the GUI variant become as easy as building the core since commit [d7013
When in my last [devlog #6](https://palashbauri.in/devlog-pankti-6/) I said about using zig, I didn't think I would use it so soon. Take a look at the current state of my `build.zig`[^3], it might help you should you decide to use zig as you build system.,
### Update: Jun 3, 2023
Well, Zig is creating a mess on Windows. Unfortunately, My tests were passing, and I thought "It's alive", but the celebration was very premature.
The basic fundamental functionality of cpank is not working if compiled with zig cc on Windows, the executable is unable to parse pankti scripts written in Bengali.
But interestingly enough, when I dug deeper into the Zig source code, I found out that the problem is not with Zig cc but with the clang itself. I discussed it with Zig folks, but the problem has nothing to do with Zig.
The core cli tool is not that much of a problem, it can be easily built with gcc or msvc but I'm struggling with GUI.
Huh ..... I am tired as well as frustrated.
---
[^1]: [bauripalash/pankti](https://github.com/bauripalash/pankti)