Wrap it up! Native code written in...Dart!

In the new-category-for-ai-assisted-software thread, there is probably more flame-fests than would be necessary to fuel a furnace in Hell. So, for the sake of completeness, I’m starting this thread to come at things from a totally different angle to “reframe” the discussion into something more usable.

Dart Native is, by definition, a wrapper. Software written in it gets transpiled to another language and then converted into “native” code regardless of the underlying subsystems. Android uses Kotlin as a backend, Mac and iOS use Swift, and finally: Windows and Linux use C++. The Linux backend uses a runtime based on GTK but it doesn’t have to be limited to that. Why not generate to a Haiku-native interface?

Wrapper languages like Dart are becoming popular but because Dart Native started as a web API that lost favor compared to EcmaScript 6, Google has changed the codebase to wrap ANY object-oriented language!

AI assistance is often used to set up rough drafts in common languages like Dart and can be used more effectively than any Haiku API because AI, like any pattern-match technology, bases its output on precedent. Self-porting code is far easier to write and maintain when coming from an established source. Dart Native is just such a source. It would be application-only but why not? It would free up the ones familiar with arcane C++ syntax to write OS code instead.

I don’t know anything about a Dart C++ transpiler, doesn’t seem to be widely discussed online, but it seems to me that the constraints imposed by C++ would get in the way of whatever advantages Dart might have to offer. Memory management being the obvious example: Dart has a “garbage collector” to deal with that, and a normal C++ program won’t; if one is grafted in by the transpiler, then Haiku will have a much more severe concurrency re-entrance issue than most platforms. Maybe I’m misinterpreting the proposition here - it sounds to me like “write a Dart program using BApplication, BWindow etc., and transform that to the same C++ program, because AI will have an easier time with it if it’s in Dart.”

Not saying that Dart couldn’t build applications on Haiku, but the way that seems obvious to me, is to port Flutter, assuming that’s what existing Dart applications use.