The_Programmers_ByAble/Catch-22; Why you and I can't use ableOS.md

54 lines
2.4 KiB
Markdown
Raw Normal View History

2023-09-13 03:10:29 -05:00
# Catch-22
A Catch-22 is defined by [wikipedia](https://en.wikipedia.org/wiki/Catch-22_(logic)) as
`Catch-22s often result from rules, regulations, or procedures that an individual is subject to, but has no control over, because to fight the rule is to accept it.`
The Catch-22 in the case of [AbleOS](https://git.ablecorp.us/AbleOS/AbleOS) is
`Drivers not being developed so nobody uses AbleOS so drivers are not developed`
This is a loop that makes it hard to develop for AbleOS and to combat this a singular or small set of developers must toil endlessly to develop a small usable set of drivers to give the layperson something to test out and play around with.
If people are willing to test and play and hopefully document how they break a system they might also be willing to contribute a couple hundred lines of code to improve or make the beginnings of a new driver.
AbleOS has a small benefit of being a microkernel with only userspace drivers which push forward the general userspace application tooling as they improve leading to a generally better tooling for all programs.
For example `logging` in AbleOS will be identical between driver and application
providing one single simple logging api
I will not be explaining step by step this API like I have done previously
```rust
use timestamp::TimeStamp;
enum LogLevel{
Error,
Warn,
Info,
Debug,
Trace,
}
@documentation["This logger is an application specific logger that would stream the logs to the system logger"]
struct Logger {
@documentation["This history is read+append by default to prevent overwriting previous logs"]
history: Vector<(LogLevel, TimeStamp, String)>,
enabled: bool,
last_timestamp: TimeStamp,
@documentation["Log to the history"]
@validator[time: Timestamp > last_timestamp]
log: function(log_level: LogLevel, time: TimeStamp, note: String) -> None;
@documentation["Set the log level filter, which ignores levels below itself. To turn off logging use disable()"]
log_level: function(filter: LogLevel) -> None;
@validator[enabled == false]
enable(None) -> None;
@validator[enabled == true]
disable(None) -> None;
}
```
As a driver/app developer this will not change when you swap from one to the other which lowers the bar for writing portable code and that is a giant plus to make it easier for application developers to work on drivers as well.