Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc runnableExamples #217

Open
3 tasks done
timotheecour opened this issue May 17, 2020 · 2 comments
Open
3 tasks done

misc runnableExamples #217

timotheecour opened this issue May 17, 2020 · 2 comments

Comments

@timotheecour
Copy link
Owner Author

timotheecour commented May 18, 2020

  • runnableExamples forwarding to nim playground

links

if msg.startsWith("!eval "):
        let code = msg[6 .. ^1]
        let evalResult = await evalCode(code)

nim r -d:ssl $nim_D/nimbot/src/playground.nim

@PMunch
Copy link

PMunch commented May 18, 2020

The way the playground uses this (it communicates over a JSON REST API with the back-end): https://github.com/PMunch/nim-playground-frontend/blob/master/frontend.nim#L111-L112

You can select the Nim version to run, the compilation target (currently C and C++ only), and output format HTML/Ansi/AnsiParsed/Raw. HTML is with style tags to colour the output, Ansi is what the compiler outputs to the terminal, AnsiParsed is essentially the output of https://github.com/PMunch/ansiparse, and Raw is all styling stripped away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants