6 ms·
REPL for Dart
- daft_pink 2y agoI love repl and I hope more languages implement it.
- aidos 2y agoEven 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 2y agoAfter learning how to do this in lisp I've been missing it in python. Do you use anything alongside ipython to make this happen?
- mixmastamyk 2y agofrom importlib import reload Reload paired with inotify are the building blocks, to wire up yourself.
- aidos 2y agoConfig file here with a couple of lines to add it to ipython automatically. https://github.com/aidos/dotfiles/blob/master/_config/ipython/profile_default/ipython_config.py https://github.com/aidos/dotfiles/blob/master/_config/ipytho...
- dbtc 2y agoThanks!
- westurner 2y agojupyter-dart-kernel: https://github.com/vickumar1981/jupyter-dart-kernel https://github.com/vickumar1981/jupyter-dart-kernel : pip install jupyter-console jupyterlab -e https://github.com/vickumar1981/jupyter-dart-kernel#egg=jupyterdartkernel jupyter console --kernel jupyterdartkernel jupyter kernelspec --list IPython/extensions/autoreload.py: https://github.com/ipython/ipython/blob/main/IPython/extensions/autoreload.py https://github.com/ipython/ipython/blob/main/IPython/extensi... docs: https://ipython.readthedocs.io/en/stable/config/extensions/autoreload.html https://ipython.readthedocs.io/en/stable/config/extensions/a...
- mdhb 2y agoThere 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 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 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/2662d252b7fa9317586efdd49b3d730f9465a54d/working/333%20-%20shared%20memory%20multithreading/proposal.md 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 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.
- BrutalCoding 2y agoI 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 2y agoI 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.
- skybrian 2y ago
- meiraleal 2y ago[flagged]
- IshKebab 2y agoNo the Flutter team wasn't laid off.
- meiraleal 2y agoYes, it was, from the horse's mouth: https://www.reddit.com/r/FlutterDev/comments/1cduhra/more_layoffs_for_the_flutter_team/ https://www.reddit.com/r/FlutterDev/comments/1cduhra/more_la...
- mdhb 2y agoI just want to make it clear that for all the bullshit on this topic as far as I’m aware it was a SINGLE PERSON and this weird story developed around it but the story you seem to have in your heard is completely wrong.
- meiraleal 2y agoNot sure why you are triggered by this (do you work on Flutter?) but this "weird" story is backed by https://killedbygoogle.com/ https://killedbygoogle.com/ - we are not talking about a company without a track record here. Peace out.
- mdhb 2y agoI just can not for the life of me understand the mentality of someone who themselves knows full well this isn’t a topic they are an expert in will jump into the middle of a conversation about it, spout nonsense and when they are corrected that what they are saying isn’t actually true chooses to double down on it rather than just accepting they had some bad information. It’s just incredibly weird behaviour and yet, almost every time I’ve seen a conversation about Dart or Flutter on here for the past year or two I keep running into the EXACT SAME situation and made up stories like what you did today.
- synergy20 2y agodart'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, not sure what JS interop mentioned in the comment here really does. can Dart be compiled to readable JS?
- synergy20 2y agohttps://dart.dev/interop/js-interop https://dart.dev/interop/js-interop
- mhoad 2y agoThey dropped that “client side” framing a while back thankfully. It’s considered a general purpose language at this point.
- isoos 2y agoOne of the postgresql client packages (posgres) is roughly 8 years old. That's how "client side" it ever was...
- masijo 2y agoNot strictly related (because it doesn't have a working REPL yet) but may also find ClojureDart of interest. https://github.com/Tensegritics/ClojureDart https://github.com/Tensegritics/ClojureDart
- 0x_rs 2y agoDart is really nice to write in, with far less mental overhead than some of its would-be competitors that couldn't possess the same wisdom and foresight at the time of their creation, so an interactive shell for it is pretty cool. In general I think it's slowly trying to carve its place in the world other than Flutter's language (for which many great packages have been made), but it doesn't have any other forefront project or library, and probably still carries a bit of prejudice from the Dartium mayhem and being a language looking for some purpose that could be orphaned by a blind-sighted Google at any time, the Ads story about it still comes up often. I'd like to see it around more.
- vineyardmike 2y agoI somewhat disagree. Dart is a decent language for Flutter, but I’m not sure why you’d want to use it off of the flutter path. Maybe for CLI or other client-side tools? Either way, if you’re not re-using a dart package or using flutter, you absolutely should not pick it as your tool of choice. The language seems nice syntactically, but I find it really frustrating in practice. It’s good enough for the “happy path” that was envisioned - basic UI hierarchies. It’s clear some team designed the language by first writing examples of what they wanted it to look like when making a UI. I think Swift UI caused similar complexities on Swift. You can confirm that even the contributors think this from reading controversial PRs in GitHub. The nice thing about flutter, and Dart, is that it’s starting to take a life on outside Google. Google should hand off ownership to a foundation or other organization - especially now that their newest thing is Kotlin Multiplatform. I hear more and more companies writing flutter backends for their UI work, so hopefully it could survive alternative stewardship. I believe some TVs and car navigation systems now use flutter, plus all the google stuff.
- cageface 2y agoThis is the same author as the awesome flutter rust bridge: https://github.com/fzyzcjy/flutter_rust_bridge https://github.com/fzyzcjy/flutter_rust_bridge Thanks for everything you've done for the dart community!
- joelignaatius 2y ago[flagged]
- nmfisher 2y agoIs there any way this can be used to evaluate code at runtime (e.g in a Flutter app)?
- vineyardmike 2y agoIf you want to evaluate code at runtime, check out “flutter remote widgets”. This is the “built in” way to do runtime evaluation. It lets you dynamically load things. Google used this in some LLM demo where an AI created a UI in response to a user query.
- Alifatisk 2y agoIsn't there any fix for this? https://github.com/fzyzcjy/dart_interactive?tab=readme-ov-file#some-errors-will-lead-to-hot-reload-failed https://github.com/fzyzcjy/dart_interactive?tab=readme-ov-fi...
- concerndc1tizen 2y agoFrom the same author that did flutter_rust_bridge :) https://github.com/fzyzcjy/flutter_rust_bridge https://github.com/fzyzcjy/flutter_rust_bridge Really nice work!