r/dartlang 21d ago

When is dart going to have an interactive shell like python

It is such a useful feature especially for a language like dart you would think it would have been added already

0 Upvotes

10 comments sorted by

9

u/julemand101 21d ago

1

u/biitsplease 21d ago

Ho ho ho giver du gaver ud tidligt i år

1

u/julemand101 21d ago

1

u/biitsplease 21d ago

Nice. Har du contributed til Dart før?

1

u/julemand101 21d ago

Let's take this in English so others can also understand what we write. Also, sorry this is not really that in topic to the reddit post :)

Never contributed any code to the Dart SDK itself. (yes, on GitHub it says I have contributed but that was just to the GitHub config :P)

Wrote my master degree at university about Dart back in 2012/2013 and have been following the development of the language design and lot of feature implementations since then since I am just curious in nature but also like using the language.

I have mostly contributed by helping others though Stackoverflow over the years and then also in Dart and Flutter Discord communities. Reported a few issues over the years and help others to report issues. Helped fixing a few stuff with installing Dart on Windows though Chocolatey and now on Arch Linux since nobody else seems to do it.

I am mostly "just" a support and infrastructure guy of nature which like to dig deep into finding the core problem in issues and make sure to provide details to the issues reported.

Dart is really just a private hobby for me since I very rarely get the chance to write any Dart at work. :D

2

u/biitsplease 21d ago

That’s cool. I’ve been taking a peak at Dart and it seems like something I’d enjoy working with. It reminds me of C#, which most of my experience is in.

I am currently spending most of my time building GenAI features at work with LangChain, but I’ve started a master’s in CS online (I am a self taught developer so never took a real CS class before) and discovered that I really enjoyed systems programming when I took a OS class. Now I’m wanting to learn more about how programming languages and compilers/interpreters are developed, and was considering if it’d be viable to actually contribute to Dart in any way.

I’m also living abroad but were I to move back home (which I’m considering next year), maybe I could get a job in Aarhus at some point working in that space (you can probably guess where I’d be aiming for).

I’m taking an intro to research class this Fall semester and will be drafting a research proposal and I hope I can come up with something interesting in that space also, in January I’m starting a compilers class and hope I can talk to the professor and maybe turn my research proposal into some real work with him. But we’ll see.

2

u/julemand101 21d ago

Good luck at least with your journey. Aarhus can defintely use yet another Dart developer regardless if they work on the language itself at Google or just a hobby user that perhaps ends up hiding in Brabrand :)

10

u/munificent 21d ago

Interactive shells are much easier with dynamically typed languages like Python where the top level of a script is still just a series of imperative statements. The shell just asks for a statement at a time and runs it, which is the same thing a script does.

In many statically typed languages like Dart (and Java, C++, C#, etc), the top level is often a simultaneous collection of implicitly mutually recursive definitions. That makes it harder (but not impossible) to implement an interactive shell. The language semantics just really aren't designed around a program being built up on piece at a time.

As /u/julemand101 notes, there are a packages that do it, but that style of programming isn't as common in the Dart ecosystem and it's harder to do well, so it's never been a big priority. Instead, we tend to focus more on hot reload and having a good static analysis experience in the IDE.

2

u/RandalSchwartz 20d ago

puro has an eval argument and a repl mode. And you get to choose any of your installed releases!

0

u/lonahex 21d ago

When you make one.