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

Come up with some handy examples for Elchemy-live #295

Open
wende opened this issue Feb 8, 2018 · 9 comments
Open

Come up with some handy examples for Elchemy-live #295

wende opened this issue Feb 8, 2018 · 9 comments

Comments

@wende
Copy link
Owner

wende commented Feb 8, 2018

Follow up for #163

You can now see Examples section in Elchemy-live (http://elchemy-live.herokuapp.com/new)
It'd be nice to think of some good examples with decent comments to make people more familiar with the syntax.

@ShalokShalom It feels like you might be helpful here

@n1k0
Copy link

n1k0 commented Feb 25, 2018

I'd like to help with this but I just want to check first, can examples only ever return a string? Would be nice to at least render html and css, and ideally perform a command, though I understand we're not there yet :)

@wende
Copy link
Owner Author

wende commented Feb 25, 2018

@N10K The run function has to return a string.
Rendering an html is not possible because it's meant for server side and it's meant to present a back end language.
Performing a command unfortunately is not possible yet until we make side effects work.

Any example presenting the language syntax and features like types aliases or currying would be the most helpful

@n1k0
Copy link

n1k0 commented Feb 25, 2018

Rendering an html is not possible because it's meant for server side and it's meant to present a back end language.

I get that, but a backend may generate an HTML string, and the elmchemy-live right iframe might render it directly. That would ease presenting things computed by the code on the left side methinks.

@n1k0
Copy link

n1k0 commented Feb 25, 2018

Even JSON is weirdly rendered, that would be the most minimal fix I could think of if you really don't want to render HTML. Maybe just serve the frame as text/plain.

@wende
Copy link
Owner Author

wende commented Feb 25, 2018

Well it prints the string. The target for elchemy-live was to behave like a web console. So the output looks like it would printed in a REPL.

You can see a layout planned in this issue
elchemy/elchemy-live#19

@n1k0
Copy link

n1k0 commented Feb 25, 2018

I see. Then may I suggest the run function received a list of arguments? It's kinda challenging to come with anything creative and affordant without any kind of interaction with the program.

Also that would match the idea of a CLI target usage.

@wende
Copy link
Owner Author

wende commented Feb 25, 2018

I don't think I understand. What would it take the arguments out of?

@n1k0
Copy link

n1k0 commented Feb 25, 2018

From your latest layout prototype one might expect a prompt, so that you could pass args to the program. run could then receive a List String (or maybe just a String) which would imho be more convenient, natural and fun than fiddling with an array in the program itself. That means you could test your program with different things just by entering them in the prompt, interactively, a little like what a terminal or a REPL provide, but in a much simpler fashion.

All my suggestions may sound like unnecessary candy, but candy is important when developers discover a new API. Just my opinion obviously.

@wende
Copy link
Owner Author

wende commented Feb 26, 2018

@n1k0 It's always worth to see another point of view!

The nature of elchemy-live is strongly experimental and more in a proof of concept form right now.
It's been an effect of one week effort to give a way for people to try Elchemy without installing all of the dependencies.
With that being said I consider it rather a living experiment, to which all contributions are more than welcome.

My first idea for the elchemy-live was a browser REPL kind of thing (strongly influenced by Elixir Playground which unfortunately seems to be down for at least a month now)

I like the idea of adding some interactivity to it.
Unfortunately making it an entirely interactive REPL is quite a complex task (as we discovered while working on #154 ) but I think just taking the parameters might be possible.
I don't have an idea though on how to provide the arguments so that it was easily understandable for a newcomer that just wants to compile a "Hello World"-like program

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