aidos 3 hours ago

Even though I don’t use Dart myself I very much approve of this initiative.

I live in my Python REPL (ipython) and I couldn’t live without my hot reloading without losing state. Allows for hacking about a bit directly in the REPL. Once something starts to take shape you can push it into a file, import it into your REPL then hack about with it in a text editor.

The hot reloading is great when you have a load of state in classes and you can change code in the editor and have that immediately updated on your existing objects in the REPL.

  • dbtc an hour ago

    After learning how to do this in lisp I've been missing it in python. Do you use anything alongside ipython to make this happen?

synergy20 an hour ago

dart's syntax is very easy to pick up, sadly it's defined as a 'client-side language', instead of a general purpose one, otherwise I would invest more time into it.

while flutter is cross platform I think for the web, WASM is its focus, which I dislike, note sure what JS interop mentioned in the comment here really does. can Dart be compiled to readable JS?

mdhb 3 hours ago

There is so much cool stuff at various stages of landing in the Dart pipeline at the moment. A few things that come to mind include:

1. Dart now supports the native Web platform APIs and offers a really compelling alternative to TypeScript now thanks to their their latest generation of JS interop. Example for how the code looks here: https://github.com/kevmoo/kevmoo.com/blob/main/web/main.dart

2. Compile to WASM now on the web also with future work to also align itself with the emerging WASI standards both as a compile target and the ability to embed WASI runtimes into Dart programs (technically already possible through their C interop)

3. Lots of great work on cross language interop with C, C++, Swift, Rust, Go, JavaScript, Objective C, Kotlin and Java here https://github.com/dart-lang/native

4. Upcoming Macros feature which gives fully static type safe automatic and fully debugable code generation.

5. Potentially looking at bringing Shared Memory Multithreading to the language https://github.com/dart-lang/language/blob/2662d252b7fa93175...

6. Also some early work on a bytecode compiler it seems but I’ve not seen any kind of announcement about it here https://github.com/dart-lang/sdk/tree/main/pkg/dart2bytecode

7. This REPL

It’s really a good time to be a part of the community. It’s a very bright looking future for it.

  • skybrian an hour ago

    Where is JS Interop used in the first example? (It's a bit hard to tell with the wildcard imports how much of that is actually coming from web.dart.)

    • mdhb 37 minutes ago

      Web.dart is basically designed to give you the equivalent of any of the browser based APIs you would find on MDN essentially unchanged so things like document.querySelectorAll and things like that would just work as though you were using JavaScript (and you technically are in the background) but without otherwise needing to ever leave Dart.

      • skybrian 34 minutes ago

        Well, sure, but web.dart is one of the original packages that came with Dart. That part isn't new.

        • mhoad 18 minutes ago

          That’s not actually correct I don’t know where you got that from. This is from this year and was built on top of a wider rewrite of their JS interop using new language features to make it essentially a zero cost abstraction.

          Dart has had browser support and DOM APIs before but never had the same APIs you have in the web platform before.

          • skybrian 9 minutes ago

            I think I had it confused with dart:html, which looks almost the same. I don't see a big difference in the example code.

  • BrutalCoding 3 hours ago

    I wasn't aware of that bytecode compiler, even though I work with Flutter/Dart on a daily basis. How did you find out?

    Nonetheless, that’s some low level stuff that I have little experience with haha.

    • mdhb 3 hours ago

      I spend some time each week just browsing the various repos under the Dart account to see what’s going on in the ecosystem and that turned up recently but as I said there no kind of announcement so I would take them very literally when they say it’s an experiment.

  • meiraleal an hour ago

    > It’s a very bright looking future for it.

    Err... At Google? After laying off the core maintainers? Not bright at all.

daft_pink 4 hours ago

I love repl and I hope more languages implement it.

meiraleal an hour ago

Didn't Google laid off the flutter team just recently? What sane person would use Dart after that? Almost nobody was using it even before anyway.

Dart, Kotlin, Go. I guess just one of them will survive if any.