dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.06k stars 1.56k forks source link

Why dart lang can not bootstraping self? #47890

Closed ghost closed 2 years ago

ghost commented 2 years ago

bootstrapping is a programming who will be more stable and strong .

by wikipedia :

In computer science, bootstrapping is the technique for producing a self-compiling compiler — that is, a compiler (or assembler) written in the source programming language that it intends to compile. An initial core version of the compiler (the bootstrap compiler) is generated in a different language (which could be assembly language); successive expanded versions of the compiler are developed using this minimal subset of the language. The problem of compiling a self-compiling compiler has been called the chicken-or-egg problem in compiler design, and bootstrapping is a solution to this problem.[1][2]

Many compilers for many programming languages are bootstrapped, including compilers for BASIC, ALGOL, C, C#, D, Pascal, PL/I, Factor, Haskell, Modula-2, Oberon, OCaml, Common Lisp, Scheme, Go, Java, Elixir, Rust, Python, Scala, Nim, Eiffel, Vala, and more.

Reference: https://en.wikipedia.org/wiki/Bootstrapping_%28compilers%29

mraleph commented 2 years ago

Large parts of the Dart toolchain are written in Dart (e.g. Dart CFE, type flow analysis, dart2js compiler, dartdevc compiler etc).

Where there are significant benefits and no draw backs we tend to write code in Dart.

Full bootstrapping is non-goal because it does not really yield enough benefits that would out-weight amount of work we need to put into it to achieve it.

ghost commented 2 years ago

Here document about why golang self bootstrapping, https://www.infoq.com/news/2015/01/golang-15-bootstrapped/

By my side, Dart lang it is a more powerful language, better than Golang, i work on Android app develop, using Dart lang in my day life.

ghost commented 2 years ago

If we self bootstrapping, we can do it early. Or we will got much dirty shit CPP code everywhere, much more tech debt.

mraleph commented 2 years ago

You somehow think that rewriting C++ to Dart is going to magically improve it. This is unquantified. I will repeat myself: it's a large investment for imaginary / questionable gains.

Anyway - this is offtopic. We have no plans to fully rewrite all our C++ code to Dart.