ponylang / pony-playground Goto Github PK
View Code? Open in Web Editor NEWA web interface for running Pony code
License: MIT License
A web interface for running Pony code
License: MIT License
Would it make sense to refactor getQueryParameters()
to use URL
/URLSearchParams
, so we don't have to maintain custom code over native one or do you prefer not to fix something that ain't broken?
Lines 295 to 305 in 35f1d18
By the way, this
Lines 7 to 12 in 35f1d18
function optionalLocalStorageGetItem(key) {
return localStorage.getItem(key) ?? null;
}
and so can
Lines 496 to 501 in 35f1d18
theme = optionalLocalStorageGetItem("theme");
set_theme(editor, themelist, theme ?? "GitHub");
as well as
Lines 25 to 33 in 35f1d18
var themes = themelist.themes;
themes.sort((a, b) => a.caption.localeCompare(b.caption));
Then, we have
Lines 116 to 121 in 35f1d18
else
, since it has a return
:
var classes = mappings[arguments[1]];
if (classes) {
return '<span class="' + classes + '">' + arguments[2] + '</span>';
}
return arguments[2];
The following is an interesting case:
Lines 251 to 258 in 35f1d18
it could either be rewritten as
if (req.status == expect) {
if (on_success) {
on_success(req.responseText);
}
} else if (on_fail) {
on_fail(req.status, req.responseText);
}
or
if (req.status == expect && on_success) {
on_success(req.responseText);
}
if (req.status != expect && on_fail) {
on_fail(req.status, req.responseText);
}
Next, we have a bunch of these:
Lines 617 to 627 in 35f1d18
bind
:
asmButton.onclick = compile.bind(window, "asm", result, session.getValue(), asmButton);
irButton.onclick = compile.bind(window, "llvm-ir", result, session.getValue(), irButton);
gistButton.onclick = shareGist.bind(window, result, session.getValue(), gistButton);
clearResultButton.onclick = clear_result.bind(window, result);
themes.onkeyup = themes.onchange = set_theme.bind(window, editor, themelist, themes.options[themes.selectedIndex].text);
request.ontimeout = set_result.bind(window, result, "<p class=error>Connection timed out" +
"<p class=error-explanation>Are you connected to the Internet?");
One could possibly also refactor editGo()
, editShowRegion()
, editShowLine()
, and editShowPoint()
, but that'd be slightly more than a simplification.
As part of it, we can move the docker image builds into a pr.yml like we have in other repos.
Related to ponylang/pony-tutorial#546
This could be implemented statically into static/web.html at first, but it would make sense to prospectively make it dynamic by converting it to a template and creating the tags depending on the Query
params.
snippet
, code
, or gist
I know, I'm crazy, but one should be allowed to dream every once in a while ๐
To verify that the playground (minus the frontend) is actually working, we need some integration tests to run upon every PR and merge to main
:
For more information on how this is imagined to look like:
This is the output of current master:
nightly-20191123 [release]
compiled with: llvm 7.1.0 -- cc (Alpine 8.3.0) 8.3.0
Defaults: pic=true
Building builtin -> /root/.pony/ponyup/ponyc-nightly-20191123-musl/packages/builtin
Building . -> /tmp/tmp.olfgho/main
Building collections -> /root/.pony/ponyup/ponyc-nightly-20191123-musl/packages/collections
Building ponytest -> /root/.pony/ponyup/ponyc-nightly-20191123-musl/packages/ponytest
Building time -> /root/.pony/ponyup/ponyc-nightly-20191123-musl/packages/time
Building random -> /root/.pony/ponyup/ponyc-nightly-20191123-musl/packages/random
Building itertools -> /root/.pony/ponyup/ponyc-nightly-20191123-musl/packages/itertools
Generating
Reachability
Selector painting
Data prototypes
Data types
Function prototypes
Functions
Descriptors
Writing ./main.ll
expected output: the LLVM IR from ./main.ll
and no compilation logs.
It would be finest if we had (headless) browser-based integration tests, verifying the basic operations this playground offers.
Any pointer on good tools to use here are very much welcome.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.