this page is an evolving list of the libk project's official rules.
- when in doubt, ask yourself, "is this better than glibc?"
- always include a block comment at the top source files you contribute that includes the file name, the name of the function it defnes (if any), your name/handle, and a brief outline of the file's purpose. try to follow the pattern of existing files.
- create one file per function. if you add extra supporting functions to a file, they must not be included in the header, and must be marked
staticto prevent them from being exported. helper functions do not need to follow any namespacing convention, as they are not exported.
- in your C, do not rely on any headers that are not defined within libk itself.
- assembly code should compile under yasm and nasm. intel syntax is required, and inline assembly in C files is forbidden as it creates a maintenance nightmare and is non-standard.
- write as little assembly as possible. remember that every line of assembly you write is another line that has to be ported meticulously to every single architecture we support. assembly should only be used for those tasks that absolutely cannot be accomplished with C.
- comment your assembly very thoroughly. nearly every line should have a paragraph explaining its purpose in context, to aid porting and make the libk source useful as a tool for understanding how systems function at a low level.
- try to maintain clean abstractions, but keep in mind that abstraction should always serve a material purpose. never mix layers of abstractions, as this can make it hard to maintain clean separation between OS-specific code and general-purpose code.
- do not create new modules without first consulting the rest of the libk team.
- you may use any brace or indentation style you wish, so long as you indent with tabs and align with spaces. what's most important is that the people who maintain a particular piece of code be able to read and edit it comfortably, not styling consistency.
- for the time being, the project maintainer is the final arbiter over both technical and social issues. however, if a solid core leadership team can be established, it may be in the project's best interest to transition from autocracy to oligarchy.
- if you demonstrate convincingly that you cannot keep a cool head during disagreements or keep your ego out of technical discussions, you will be removed from the team. polite constructive criticism and respectful debate are important parts of software development, but starting arguments or refusing to let go of a topic once the community has made a decision is obnoxious and counterproductive behavior that will not be tolerated.
- please keep any and all drama out of the development process. you may reach out to an administrator if the behavior of someone on the team is affecting your ability to contribute, but keep in mind our primary goal is getting shit done, and this is not an appropriate place to pursue personal, let alone political, grievances. don't expect to be taken seriously if you haven't made any meaningful contributions to the project yourself, or if you're attempting to conduct a whisper campaign behind someone's back.
- judge people by their behavior and their contributions. this is not a place for affinity-group tribalism or identity politics, and we will neither tolerate discrimination against you nor give you special treatment for irrelevant factors like race, religion, sexual orientation, or gender identity.
the team is currently still small enough that no further community rulemaking has yet been necessary.