MiShell
- 3 Devlogs
- 16 Total hours
Today we're building a UNIX shell. Not the greatest, not the fastest ... just whatever we can get out of my C programming skills (just started btw).
Today we're building a UNIX shell. Not the greatest, not the fastest ... just whatever we can get out of my C programming skills (just started btw).
My shell now started to look like something, although I know that it’s not even close to be prod ready. I did my best to hack together something usable i.e that compiles. If I were to add more than that and I would need to create a whole programming language. Even tho I would love to, that’ll be for another day…
Oh, concerning new features, I added the GNU readline library (same used by other shell) so keyboard navigation actually works like a real shell.
I also used another library to handle the parsing instead of my custom parser (it served me well) and finally I customized the prompt to make it less generic.
Now Mishell also support basic piping.
😮💨 Took me soooo long just because I didn’t google enough. It was a good learning experience.
Now, I can finally sleep …
…
…
….
I can sleep now right ?
“C is quirky, flawed, and an enormous success.”
- Dennis M. Ritchie.
Hello everyone. Hope you’re enjoying the event. On my end things got a little be nasty for the past days.
Truthfully, the challenge was not that hard but you know how it goes:
man gotta invent lemons just because he can right :)
I fell down the C rabbit whole so bad: macros, pointers, errno, free, linking, … The hardest part was obviously managing memory. I was conditioned so much by Youtube to be scared of memory leaks that I had to rewrite an allocator just so to not use malloc. The other challenge I created for myself was to copy-paste random compile flags from everywhere to ensure my code would be mEmORy SaFe:
Spoiler: didn’t even work :(
I dearly missed Python simplicity. I will just have to fix my skill issues.
Anyway, next challenge will be to improve allocation (again) and add more features to the shell. I’ll probably be done (mostly) after this devlog since the purpose of the shell (interact with cli tools) is accomplished.
Now I can finally sleep.
If debugging is the process of removing software bugs, then programming must be the process of putting them in.
MiShell is a very simple and dumb shell. It got some builtins commands
and … that’s all. I plan to improve it later (if I find time)