u/ing-brayan-martinez

Request permission to create issues on GitHub

I wanted to speak with a member of the Google engineering team to request permission to create issues on GitHub so I can contribute like any other user. I know it was complicated at first, but three years have passed since then, and I've learned a lot. To finally close this chapter with you all, I wanted to create the following issue:

Improve numeric data types

Intention of Change

Greetings, today I'm going to make another attempt, number 111. I'm going to make an interesting proposal that I've been analyzing for a long time to improve the Dart language. The goal is to create variations of the int and double types, such as int8 and int16, among others, resulting in the following:

Dart alias type Dart Rust C++ Swift
int8 i8 Int8
int16 i16 short Int16
int int32 i32 int Int32
int64 i64 long Int64
double4
double8 f8
double16 f16
double32 f32 float Float
double double64 f64 double Double

Justification

To justify why this would be positive for the Dart VM, let's look at the following reasons:

  • Greater numerical precision for performing mathematical calculations
  • A one-to-one relationship with low-level language data types
  • Greater flexibility
  • Possibilities for advanced computing, because when compiling Dart code into an executable with instructions in x64 assembly code, it will have greater precision in giving instructions to the processor
  • Possibility of RAM optimization since it has a data type that occupies the least amount of memory space
  • Approach to the functional programming paradigm, which focuses on creating concurrent code following mathematical principles
  • Improved robustness of the Dart language from the ground up, making it equivalent to Java, C#, C++, Rust, etc.
  • Making the creation of libraries that control low-level processes, i.e., those closer to the hardware, simpler without depending on C++
  • Opening the possibility for the Dart language to be a A language used in the hardware and artificial intelligence industries due to its high performance and low-level communication capabilities.

When we went to university, one of the most basic concepts for understanding computer science was that a PC is an advanced computing machine, a concept that has existed since the first supercomputers.

Impact

The impact of this change, from my point of view, is minimal, because it adds new features to the language without modifying the existing codebase, opening the possibility of implementing memory optimizations.

It would also serve as a basis for improving debugging and code optimization tools by taking into account how much memory the running process occupies, suggesting better numeric types.

Mitigation

The risks of this change are already mitigated, since the Dart language has a feature called type aliases that allows you to name a data type.

Therefore, the original int and double types will become aliases of int32 and double64, ensuring that the entire existing codebase is fully compatible with the new data types without requiring any changes. This avoids any risk of breaking anything and causing problems. I've been thinking about this for a long time.

Conclusion

Up to this point, I have tried to explain this idea as clearly as possible so that you, who work daily on this project, can review its technical feasibility and make the best decisions. My goal is to lay the groundwork for making Dart a more robust implementation, capable of processing large volumes of data and performing massive advanced computing calculations without breaking down, at the level of Java, C#, or Rust. We still have a long way to go in optimizing; this is a long-term vision, as Dart is a project that should have a lifespan beyond Flutter as a general-purpose language. I hope you find this helpful.

reddit.com
u/ing-brayan-martinez — 8 days ago