Arc Forumnew | comments | leaders | submitlogin
Try Arc ported to WordPress (tryarc.org)
6 points by evanrmurphy 4792 days ago | 13 comments


2 points by evanrmurphy 4792 days ago | link

Hey folks,

WordPress has become my favorite platform for building websites. The software is so robust and the ecosystem of themes and plugins so rich - I find it's really conducive to productivity.

That's why I'm excited to announce this port of Try Arc to WordPress. I think it will make the codebase more maintainable, and help me to get features & fixes out faster.

If you're curious, the Arc web server is still in play here. But now rather than the whole site being hosted that way, only the REPL is (the only component that needs to be). The rest of the site is served from a separate Apache instance; it gives way to the REPL through a simple IFrame in a WordPress page template.

Hope you enjoy! Let me know what you think.

Evan

-----

2 points by akkartik 4792 days ago | link

Looks great!

Can you make the nav links only open in new tabs for the repl page, not otherwise?

-----

1 point by evanrmurphy 4792 days ago | link

Yes, you're right. It is very annoying to have the new tab on every nav link. I will try what you suggested. Thanks, Kartik. :-)

Update: For now I just disabled the new tab feature altogether. Later we'll find a way to add it just for the REPL page or otherwise address the problem. For now, be careful what you click on while working at the REPL!

-----

1 point by akkartik 4792 days ago | link

Gmail and a few other places (basecamp) have a way of detecting when you have an unsubmitted form and popping up a confirmation dialog if you accidentally try to navigate away. I used to know how to do this - it's a standard javascript function that works on all browsers..

-----

1 point by evanrmurphy 4791 days ago | link

Ok, I did it your way with the confirm dialog. :-)

-----

2 points by thaddeus 4790 days ago | link

Just out of curiosity... what about using a hidden session id? It could be used to re-connect to the old session whenever you swing over to the repl.

Or does using WordPress prevent that somehow? (really, I've never used WordPress... so I have no clue what the limitations are... if any.)

-----

1 point by evanrmurphy 4790 days ago | link

Hey thaddeus, the main issue I run into with something like this is that sessions are very resource-intensive on the server side. As it stands I get to reclaim session resources right when people leave, and still Try Arc gets overloaded and requires manual restart about once every two weeks.

Ah, but the solution seems so straightforward now: just put sessions to sleep. Every session can be stored efficiently as a list of expressions, and then re-awakened by running the expressions through a new REPL before showing it to the user.

Maybe this should be the next update.

-----

3 points by rocketnia 4789 days ago | link

If the REPL session takes any input, including by measuring timings or generating random numbers, it won't be deterministically recreated by a list of commands. And what if I want a fresh REPL?

When I go to Try Arc, I imagine there's a single REPL per window/tab, which goes away as soon as I leave the page. So I think it would be cool to be able to copy out transcripts (without spurious hyphens showing up :-p ) and load/paste Arc libraries, but that's all the power I hope for.

If you're looking for more of a server-side challenge (and more of a productivity site rather than a tutorial :-p ), it would be awesome to have a user account system that lets me paste a bunch of Arc utilities and load them automatically every time I start a REPL.

-----

4 points by akkartik 4789 days ago | link

Nah, don't get into the business of managing user logins and passwords if you can possibly avoid it.

An alternative is a session system. Menu commands: "save this session", "past sessions". Give each session a URL so it can be bookmarked/shared.

-----

3 points by rocketnia 4789 days ago | link

Works for me. ^_^

I'm still a bit suspicious about abstraction leaks in the concept of "save this session." I'd prefer to think in terms of a library pastebin, where I may choose to turn my REPL session into a library but I'm not misled into thinking it'll preserve more about my session than the raw code I entered.

-----

2 points by evanrmurphy 4789 days ago | link

For what it's worth, managing user logins and passwords is a very easy business with WordPress! The challenge would be figuring out how to interface those WordPress user accounts with REPL functionality.

-----

2 points by thaddeus 4789 days ago | link

> And what if I want a fresh REPL?

If implemented like HN x-id's you could just refresh or reload the page in order to get a new session. And like HN one could just expire a stored session after x minutes without being used.

Note though: Originally when I posted the session-id idea I was thinking tryarc was only one session with many threads, where each session-id would really just point to its own namespace. Had this been the case it would just be the functions and variables being stored in memory. And then threads/session-ids/namespaces (whatever) could be spun up or down and managed in a myriad of ways.

-----

2 points by rocketnia 4789 days ago | link

Me: "And what if I want a fresh REPL?"

You: "If implemented like HN x-id's you could just refresh or reload the page in order to get a new session."

That's the behavior I expect, but then I also expect to get a new session if I navigate somewhere and click the back button. If the back button case does not give me a new REPL, I don't see why refreshing the page would.

-----