Update FUBS authored by Eron's avatar Eron
### "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." ### "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program."
Linus Torvalds Linus Torvalds
# FUBS # FUBS
I had enjoyed programming since I was 10 years old. By 2016 I was programming an Android App with Google's shit and I hated my life. Apple's shit was more infuriating. Don't get me started with the embarrassment known as the "Javascript ecosystem". FUBS is a software development system that made me like programming again. I had enjoyed programming since I was 10 years old. By 2016 I was programming an Android App with Google's shit and I hated my life. Apple's shit was more infuriating. Don't get me started with the embarrassment known as the "Javascript ecosystem". FUBS is a software development system that made me like programming again.
It will continue to be a private work in progress for many more months. It will be made public and more transparent than any [open source](futo's-the-open-source-definition) project when it is ready: It will continue to be a private work in progress for many more months. It will be made public and be the ultimate [open source](futo's-the-open-source-definition) project when it is ready:
* It must be [self hosted](https://en.wikipedia.org/wiki/Self-hosting_(compilers)) on bare metal with nothing written in another language (no Linux, no LLVM, no gnu, not even legacy text editors). * It must be [self hosted](https://en.wikipedia.org/wiki/Self-hosting_(compilers)) on bare metal with nothing written in another language (no Linux, no LLVM, no gnu, not even legacy text editors).
* It must be self hosted on its own source code repository. * It must be self hosted on its own source code repository.
* It must be be under a new source license that ensures our core principal is not violated by other programmers' forks. * It must be be under a new open source license that ensures our core principal is not violated by other programmers' forks.
We have an almost pathological focus on minimalism. We want the functionality of any modern IDE with only 100,000 lines of code running on bare metal. We have an almost pathological focus on minimalism. We want the functionality of any modern IDE with only 100,000 lines of code running on bare metal.
## Core Principles (roughly in order of importance) ## Core Principles (roughly in order of importance)
1. Have a unified execution and authoring environment. Any program must also provide the tool with which it was created and allow itself to be modified. We endeavor to make it as frictionless as possible for a user of a program to understand or modify it. **Anyone using a program can become its programmer within seconds.** We will insist on this via our source license. 1. Have a unified execution and authoring environment. Any program must also provide the tool with which it was created and allow itself to be modified. We endeavor to make it as frictionless as possible for a user of a program to understand or modify it. **Anyone using a program can become its programmer within seconds.** We will insist on this via our source license.
1. Anyone can code. Make it easy for anyone to modify any part of the system. Imposing restrictive [encapsulation](https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)) is selfish and elitist. 1. Anyone can code. Make it easy for anyone to modify any part of the system. Imposing restrictive [encapsulation](https://en.wikipedia.org/wiki/Encapsulation_(computer_programming)) is selfish and elitist.
1. Milliseconds matter. A programmer should see the results of a program modification instantaneously. 1. Milliseconds matter. A programmer should see the results of a program modification instantaneously.
1. It is extremely important for systems to be self hosted. Only use other programming systems as a bootstrap mechanism. If your system uses nothing written with another system, then you can rest assured that it is complete. 1. It is extremely important for systems to be self hosted. Only use other programming systems as a bootstrap mechanism. If your system uses nothing written with another system, then you can rest assured that it is complete.
1. Be opionated and don't spend time and lines of code to make everyone happy. 1. Be opionated and don't spend time and lines of code to make everyone happy.
1. Never compromise the present for backwards compatibility. Fix mistakes as soon as they are identified regardless of how it affects existing dependers. An antiquated depender can either keep up or become an artifact. 1. Never compromise the present for backwards compatibility. Fix mistakes as soon as they are identified regardless of how it affects existing dependers. An antiquated depender can either keep up or become an artifact.
1. No sacred cows. If something can be substantially improved, do it. 1. No sacred cows. If something can be substantially improved, do it.
1. [Dynamic analysis](https://en.wikipedia.org/wiki/Dynamic_program_analysis) with 100% [code coverage](https://en.wikipedia.org/wiki/Code_coverage) is far more effective at catching programmer mistakes than static analysis will ever be. Programming tools can make such testing much less cumbersome. 1. [Dynamic analysis](https://en.wikipedia.org/wiki/Dynamic_program_analysis) with 100% [code coverage](https://en.wikipedia.org/wiki/Code_coverage) is far more effective at catching programmer mistakes than static analysis will ever be. Programming tools can make such testing much less cumbersome.
1. Use concrete [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) metrics to measure some aspects of code quality. 1. Use concrete [AST](https://en.wikipedia.org/wiki/Abstract_syntax_tree) metrics to measure some aspects of code quality.
1. Fewer nodes for the same program with similar execution time and space is almost always better. 1. Fewer nodes for the same program with similar execution time and space is almost always better.
1. If node A refers to node B, a shorter path from A to B through the AST is almost always better. 1. If node A refers to node B, a shorter path from A to B through the AST is almost always better.
1. [Dynamic reachability analysis](https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)) is the wrong way to reclaim memory. 1. [Dynamic reachability analysis](https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)) is the wrong way to reclaim memory.
1. Static analysis with [type](https://en.wikipedia.org/wiki/Type_system) annotations is a good way to catch many programmer errors. 1. Static analysis with [type](https://en.wikipedia.org/wiki/Type_system) annotations is a good way to catch many programmer errors.
## Major Tasks ## Major Tasks
* Runs self hosted on Linux. (complete) * Runs self hosted on Linux. (complete)
* MVP * MVP
* Runs self hosted on bare metal. (2024 Q2) * Runs self hosted on bare metal. (2024 Q2)
* Boot * Boot
* Keyboard * Keyboard
* HDMI * HDMI
* Storage * Storage
* Inter-computer communication * Inter-computer communication
* Nail self hosted code editing (30% complete) (2024 Q2) * Nail self hosted code editing (30% complete) (2024 Q2)
* Create self hosted source management system. (2024 Q3) * Create self hosted source management system. (2024 Q3)
* Programming / debugging bridge to another device. (2024 Q4) * Programming / debugging bridge to another device. (2024 Q4)
* Write source license. * Write source license.
## Language Details ## Language Details
FUBS is basically an object oriented imperative language with decent support for closures. FUBS is basically an object oriented imperative language with decent support for closures.
* Only classes exist at the top level. Classes can contain inner classes, data fields (global or per object members), functions, and methods. * Only classes exist at the top level. Classes can contain inner classes, data fields (global or per object members), functions, and methods.
* Inner classes exist solely for the purpose of providing a hierarchical namespace. * Inner classes exist solely for the purpose of providing a hierarchical namespace.
* A class may specify one or more parent classes for inheritance. * A class may specify one or more parent classes for inheritance.
* Diamond inheritance is prohibited. * Diamond inheritance is prohibited.
* Name collisions for global functions and data fields are prohibited. * Name collisions for global functions and data fields are prohibited.
* Name collisions for methods create a group for [dynamic dispatch](https://en.wikipedia.org/wiki/Dynamic_dispatch). * Name collisions for methods create a group for [dynamic dispatch](https://en.wikipedia.org/wiki/Dynamic_dispatch).
* Strongly typed. * Strongly typed.
* Supported types: * Supported types:
* Primitive types (passed by value): * Primitive types (passed by value):
* i1, i4, i8, bool, f4, f8 * i1, i4, i8, bool, f4, f8
* Reference types (nullable and passed by reference): * Reference types (nullable and passed by reference):
* Array * Array
* Object (instance of a specific class) * Object (instance of a specific class)
* Functions, Closures * Functions, Closures
* Tuples (passed by value) * Tuples (passed by value)
* Decent type inferencing for stack variables. * Decent type inferencing for stack variables.
* No automatic coercion except for widening of object types. * No automatic coercion except for widening of object types.
* Decent support for [generic programming](https://en.wikipedia.org/wiki/Generic_programming). * Decent support for [generic programming](https://en.wikipedia.org/wiki/Generic_programming).
* Heap management: * Heap management:
* No dynamic reachability analysis except when debugging. * No dynamic reachability analysis except when debugging.
* A reference type may be "prime", which means that it will be automatically freed when it leaves scope (for local variables), or its parent is freed (for object members). * A reference type may be "prime", which means that it will be automatically freed when it leaves scope (for local variables), or its parent is freed (for object members).
* Static analysis will help catch program errors with respect to prime reference management. * Static analysis will help catch program errors with respect to prime reference management.
* Guaranteed to catch double-free errors. * Guaranteed to catch double-free errors.
* The programmer is expected to avoid use after free errors. Less efficient execution modes can guarantee this with runtime reference counting. * The programmer is expected to avoid use after free errors. Less efficient execution modes can guarantee this with runtime reference counting.
* [Balls](https://en.wikipedia.org/wiki/Exception_handling) * [Balls](https://en.wikipedia.org/wiki/Exception_handling)
* [Closures](https://en.wikipedia.org/wiki/Closure_(computer_programming)) * [Closures](https://en.wikipedia.org/wiki/Closure_(computer_programming))
* Automatic object persistence. * Automatic object persistence.
* Object members can be annotated to be persisted. * Object members can be annotated to be persisted.
* Objects are loaded using their hash as a key. * Objects are loaded using their hash as a key.