One of those things I have been thinking about for countless years...
A language that can be very simple and easy to use, like BASIC but with the power of Bash and others.
A language that can span many levels, from the startup firmware of a machine, to user applications, from the machine code to the abstract concepts.
A language that is efficient, to build optimised code like in C (not just by making a powerful compiler but letting you guide and iterate the compilation)
A language that can work with interpreted and compiled code (like FORTH but more advanced ?)
...
This language is inspired by Bash/C/FORTH/JavaScript as well as a few others (LISP/Scheme or the Pascal/Ada/VHDL lineage for example) for:
- ease of programming (no crazy syntax, as Python advocates, so no obscure stack stuff like FORTH)
- security/safety (inherent checks like Ada)
- performance (so you can tweak a script into fine-tuned machine code at will)
- self-sufficience (store the system in a Flash/ROM)
- interactive console use (like Bash)
- building the OS
- support of my CPU's features (so the F-CPU and the YASEP have something to run)
This keeps many nice things we have come to expect from today's programming languages but some concepts diverge :
- Don't bother with POSIX
- Enforce sandboxed and separate units of code (safety, modularity, reuse) with capability-based access rights. Just like HURD's "everything is a server".
- Several subsets can be enabled/disabled depending on the use :
- machine code generation is allowed only in the compiler and assembler context
- hardware features, IO, protections etc are allowed only in the kernel modules
- implicit dynamic features are not allowed for code that will be compiled (like VHDL code that can't be synthesised)
- code introspection (like in FORTH or JS's "eval") only available in development mode (introspecting code can't be compiled)
The main idea is to create a baseline interpreted language that is used to compile itself. It must be able to generate machine code from its own source code, starting from a basic assembler and evolving into a more featured compiler. The interpreter's command line can also serve as a classic shell to administrate the computer.
Logs:
1. A bit of historical perspective on early language design
2. The need for a preprocessor
3. Note for later
4. Units
5. Typing
6. Standard types
7. Programming is too complex...
8. 2024
9. Typing (for realz)
10. A critical concept
.
.
To read :
https://sinclairql.speccy.org/archivo/docs/books/Threaded_interpretive_languages.pdf
https://archive.org/details/R.G.LoeligerThreadedInterpretiveLanguagesTheirDesignAndImplementationByteBooks1981/page/n15/mode/2up