Run code in the playground

Hello everybody,

We’re very happy to announce you can now run code (including when there are runtime dependencies from the standard libraries) in the playground! Just remember to enable “Auto-run”.

Have fun!

8 Likes

might need to add a cap on the log lines

first thing I did was set fizzbuzz to a really big number and it crashed my browser

1 Like

Well there are tons of ways you can crash your browser by executing arbitrary code, with or without logging, I’m not sure we should spend too much time trying to mitigate those issues, but if you’re interested in a PR, don’t hesitate, I’ll take a look at it!

1 Like

sure thing. I think I was just making a note that auto-run felt a bit unintuitive XD

What do you mean by “it felt unintuitive”?

not really used to having my code run as I type and I ended up crashing the browser window.

Used the word unintuitive because it’s a cool feature, just unexpected results

1 Like

Oh I see, we could add a “Run” button as a way to run your code on demand without doing it on every key stroke. What do you think?

6 Likes

A run button would be great!

@YKW @yangdanny97 I added a run button (and a keyboard shortcut) in the playground, don’t hesitate to give some feedback :slight_smile:

3 Likes

yes. love the keyboard support as well. Thanks

2 Likes