tractordev / wanix

Experimental, local-first, web-native, Unix-like development environment
https://wanix.sh
MIT License
205 stars 11 forks source link

Procfs and Kernel refactor #116

Closed Parzival-3141 closed 4 months ago

Parzival-3141 commented 4 months ago

Closes #70

Basic implementation of procfs. Lists running processes under /sys/proc indexed by PID. Reading a PID file returns the proc.Process serialized to JSON. The format can be changed if required. In the future I'd like to add more structured data and queries using the filesystem.

This PR also reorganizes the kernel, removing the engine package. I found it confusing initially, and more of a hinderance than a benefit. I needed more flexibility and control. Rewriting the startup code by hand was simple; now the code is explicit and much easier to follow. I'm not sure what problem engine was trying to solve. That being said, the commit can easily be reverted and procfs updated with minor changes if need be.

progrium commented 4 months ago

removing engine was unnecessary, but it also isn't being used the way its intended ... so other than consistency of design across projects which is part of the greater tractor project here, we can take it out. but its likely to come back, its part of a larger recursive design pattern. i'd rather improve it than remove it. it can't get better if its not used.

fix the nested ifs and i can merge this. but next time lets discuss removing stuff like this.

Parzival-3141 commented 4 months ago

To summarize my thoughts, engine uses implicit control and data flow. I think this is an anti-pattern and makes reading/writing code harder.

i'd rather improve it than remove it. it can't get better if its not used.

I agree, perhaps we can go over it together after the demo.