"Janet Playground" proof of concept -- request for input #570
Replies: 13 comments 58 replies
-
Case A: Nice work! Case B: I guess combination with source documenting capabilities of Mendoza will be a good match. Case C: I can easily see Osprey as a good solution. I am adding a web interface to the Neil project, so I have experience using it (and it is not that much to learn), so I can definitely help with this. It is not only that. You will need some persistent storage and other usual suspects. But I think I am aware of a good solution for any of those problems in the community codes. |
Beta Was this translation helpful? Give feedback.
-
Hi, Mike. What is the difference between the repl at janet-lang.org and the Janet Playground? In my own experience, I've found that
Is there any way to have the Janet Playground run jaylib, with a split window so users can see their graphical output in an additional pane, all in one browser tab? My understanding is that raylib can provide output for the browser, but I'm not sure that's been set up in jaylib yet. I think this would be huge. I know some people who would immediately find that useful. I would also find it immediately useful for demo purposes. |
Beta Was this translation helpful? Give feedback.
-
@MikeBeller Haven't tested running yet, but was able to build
Now I see a new Does that sound about right? Just writing this up in case there are other folks who want to try. |
Beta Was this translation helpful? Give feedback.
-
The "bundled" When I tried my locally built one for the evaluation result I see "running..." Wonder what I'm doing wrong...I guess my emsdk may be old. |
Beta Was this translation helpful? Give feedback.
-
@MikeBeller So after walking around in subzero (celcius) weather for a bit, a couple thoughts came up... I have a work-in-progress PEG tutorial: https://gitlab.com/-/snippets/2053876 As you can see, it's quite long (too long perhaps). I've found successive evaluation with some narrative / annotative text to be quite helpful in becoming more familiar with various libraries, programming language constructs, etc. Modifying existing forms but also coming up with one's own seems to also help with memory (at least in my case). I got to thinking about how one might try to provide this kind of thing using the wasm janet-playground. One way might be to try to have multiple instances on a page. I'm not sure how all of this works, but depending on the details, it seems like it could be a problem in terms of brower resources. Another issue might have to do with continuity of state between one instance and another (e.g. the result of a An alternative approach is to have one (or a few) large "windows" on a page that have multiple "sets of forms" that work together:
...but have some way to not evaluate everything at once. In Emacs terms that might be something like evaluate the last s-expression, based on where one's cursor is. Presumably to make that ergonomic one would want some sort of shortcut / hot key to invoke evaluation. Possibly also some nice way to display an evaluation result so that it is clear which form that's associated with. A possibly related thought is that tree-sitter can generate |
Beta Was this translation helpful? Give feedback.
-
I like this. If I could make two requests, they would be:
|
Beta Was this translation helpful? Give feedback.
-
This looks like a cool project! In answer to your question about whether 'the community' has a webserver, janet-lang.org is a server that is administered by @bakpakin. He mentions on his GitHub Sponsors page using donations to cover this cost. Perhaps something like this could live there. Alternatively, while it would probably not be adequate for large-scale usage, Heroku's free tier is another option. I used to maintain the syntax highlighter Rouge and its preview dingus is a Sinatra app that runs entirely on the free tier there. I made a buildpack that can be used for deploying web apps written in Janet that could be of use if you wanted to pursue that route (discussed more in #574). |
Beta Was this translation helpful? Give feedback.
-
So, I'd like this to follow more in the style of the Janet website than the go playground CSS, for my two cents. Usually language playgrounds tend towards unique styles, rather than aping other ones, and I like the visual style of Janet's janet-lang.org |
Beta Was this translation helpful? Give feedback.
-
Hey y'all -- thanks for the input. I incorporated a number of ideas from you all. Better usability, better emcc build, some JPM, built-in local server for testing. I created an "explanation page" and a "live docs" example. All my examples have truly horrible or nonexistent CSS because it's just not my thing. sigh. Will eventually have to improve that. Online demo: https://externalweb.s3.amazonaws.com/play/index.html Next major step will be integrating with a back end. @swlkr suggests integrating with janetdocs -- sounds good to me. I am looking in to it. |
Beta Was this translation helpful? Give feedback.
-
Hey gang thanks for the input. I put up a new version with the ace editor, syntax highlighting (using clojure mode). The bug involving not printing types is also fixed. Give it a spin if you wish! https://externalweb.s3.amazonaws.com/play/play.html |
Beta Was this translation helpful? Give feedback.
-
Re: #570 (comment) Nice! The syntax highlighting and evaluation have been working well 👍 How is the indentation determined currently? Some minor notes:
|
Beta Was this translation helpful? Give feedback.
-
New version of Janet Playground. Now integrated with JanetDocs. Now includes spork/format based formatting, and integrates with the examples on janetdocs. Try it here: https://janetdocs.com/playground -- old playground will go away soonish. |
Beta Was this translation helpful? Give feedback.
-
Oh not at all. I just misread. I already have a fix in my fork of
janetdocs, but as I said I'm working on a larger update before sending a PR.
…On Thu, Jan 28, 2021 at 3:00 PM John Gabriele ***@***.***> wrote:
Ah! Whoops, I see I was unclear about that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#570 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAM7HKTHTQRXAXOAPEUHBCDS4G67DANCNFSM4V4T3RAA>
.
|
Beta Was this translation helpful? Give feedback.
-
I am working on a WebAssembly based Janet Playground. The idea is for trying, documenting, and sharing Janet code and posting "live docs" examples that can run in the browser. It is inspired by the go playground, play.golang.org, and I shamelessly stole their CSS styles. Here is a proof of concept version of it. Please try it out! You can edit the code there and run whatever you want (It's running in your own browser).
https://externalweb.s3.amazonaws.com/play/play.html
There is a web repl already on the Janet home page but I do not find it sufficient for my use cases:
Use case A: Just trying out some code without having to fire up an editor or even install Janet.
Use case B: Creating online documentation where the examples are executable.
Use case C: For sharing live code with others for discussion purposes.
The code I wrote works for A and B (it demonstrates case A but to do case B all you have to do is modify the html page to have multiple "code" and "output" locations, and intersperse with your docs.)
For case C we will need some kind of back end. For that we will need a non-static web server. I do not have one now and wondering if the community does?
Anyway -- looking for feedback on all of this. Code is also available at https://github.com/MikeBeller/janet-playground but it is very primitive still. No useful build organization. That will evolve.
Beta Was this translation helpful? Give feedback.
All reactions