Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The Rust playground is one of the many great things about Rust.

It's really helpful to share code and try concepts. The mere existence of the playground is a catalyst to reduce and refine problems before airing them to get help from the wider community.

Furthermore it's well integrated with the Rust community forums. The share button functionality is brilliant.

A minor quibble: its state management is not particularly intuitive. There's no notion of "save" or "branch" or versions as in Gists, for example. If there is, I haven't found it. The playground URL appears to be a hash of its contents? That's my guess. Does anybody know?



Code is here: https://github.com/integer32llc/rust-playground

> Does anybody know?

Yes, there's no branching for gists, but there are saves. If you hit "Share", you get various options:

* Permalink to the playground <- this creates a gist. URL is the gist hash.

* Direct link to the gist <- this gives you a link to the gist

* Embedded code in link <- this URLencodes the source and puts it in a parameter

* Open a new thread in the Rust user forum & Open an issue on the Rust GitHub repository <- hopefully self-explanatory


Looks like it's heavily inspired by the Go playground (which took it's inspiration also elsewhere, but afaik was a first for a compiled language).

There's always a trade-off between ease of use and flexibility, and I think the KISS principle is great for a tool like this. Never used it for Rust (only playing with it at the moment) - but in the Go world it's also referenced and used everywhere.


I really like to use CodeRunner for these types of purposes, I just save off the snippets of code into a folder so I can easily locate those ideas/thoughts/snippets later.

https://coderunnerapp.com




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: