Programming Language
Jump to navigation
Jump to search
Binary Representation of Source Code
- Represents the source code. Is not any kind of executable code (ASM/bytecode). Not an IR.
- Take any valid text source code, turn it into the binary representation and back again and end up with the same byte for byte file.
- Not storing individual token (ie no LEFT_BRACE). But do need to keep things like whitespace and comments.
- Edit source code not text.
- But still allows for people to use standard text editors.
- Also allows for non-text sourcecode specific editors.
- Quick and efficient editing of the binary format (ie quickgo/quickrust concept programs).
- Graphically represent source code (not the same as a graphical programming language, ie blocky, just an eaiser way to see read code).
- Having things like frames around things like data structures and function definitions.
- Could have UML like representations (Not advocating for UML specifically, but it's a possibility).
- Easy/quick navigation of source code. Things like goto definition would be much easier to represent.
- Makes tooling much easier.
- Would be easier with a well defined syntax for the source code (ie define tabs vs spaces, number of newlines between functions).
- But might be better to just store tabs/spaces and newlines in the binary format.
- Down side, any time you have an invalid syntax everything breaks. But that happens anyway with normal code...
- Could use a virtual filesystem to automatically convert stored binary to text or visa versa.
- Text could basically have any syntax you like.