Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
thosakwe wrote https://github.com/thosakwe/bullseye, a custom language that successfully ran on the Dart VM alongside Dart, and, well, Scala and Kotlin run on the JVM. Couldn't we, in theory, have Python (and its whole ecosystem) run on the Dart VM?
Yes, that's a good point. I did not propose that it would be easy. The question that I'm looking to find an answer for is "what are the parts that would make this clearly absurd". It should be noted that Dart is adding native assets https://github.com/dart-lang/sdk/issues/50565 and, as you said, it already has good FFI support. The question is: what are the actual features that are missing to make this feasible?
To get an impression of how to create a parser for a subset of Python, I created one many years ago and ported that code to Dart, again many years ago. I didn't try to implement the correct semantics, though, so __add__ and friends are unsupported as are all other fancy meta programming shenanigans of Python.
I found at least one project that managed to compile python AOT to LLVM https://github.com/exaloop/codon. Even if LLVM is more expressive than Dart Kernel, that should at least be some evidence that this might not be too impractical.