Reddit but for code snippets, developed with Phoenix

phoenix
#1

I’m thinking to build a small site to share snippets of code (I know nothing new about this), but with the reddit style. The snippets of code can be voted and built/executed (using docker). In the comments there could be modified versions enhanced by users.

I was thinking to start with the support for elixir, obviously. You post your code, the code you want to discuss about, this code is voted and can be changed and executed to see the output. And with the possibility of embedding the snippet in other pages.
It should have support to mix and dependencies (maybe not at the beginning but… I think it should).

My concern is about giving the ability of networking to the containers. I’ve seen that the elixir playground (anyone knows why is not online anymore?) wasn’t enabling networking features. Then obviously the other concern is about the cost of the servers needed, but I could limit the number of possible executions.

Is it something would be interesting/useful to this community (and maybe other dev communities)?

2 Likes
#2

Sort of like Gists ? Or more like a social service for jsbin, jsfiddle, ellie etc.?

Anyhow, I like this idea. If there’s nothing like this I believe it could get popularity. But I think you need to define the product itself very clearly first before you start thinking about the technical implementation details. What kind of code snippets would people be pasting and why? To compare code quality, to show how to do new things in a neat way or what?

#3

There are few of such services already, ex. https://ideone.com (which uses pretty old Elixir version) and Try It Online (which uses fairly newer version).

#4

More like a social version of jsbin/jsfiddle/codepen but for both backend and frontend. The cool thing about the sites you said is that they don’t need to execute the code, they let the frontend to execute the javascript delegating the risk and computational investment (smart!).

What is “ellie” ?

Nice, thanks for sharing! Something like this but polished like codepen and with a much better social part (with groups like reddit).

I see two probles with ideone and similar:

  • they disable the networking (and maybe for a good reason!). I really see the risk of keeping the networking enabled, with code that attacks other servers or similar (and owning a site with this kind of risk scares

  • there is no way of handling dependencies, so with elixir for example, I can’t show anything more that some recursion or genserver implementation.

Said that, are these two things + social making something that people would use? Don’t know…

#5

Ellie is jsfiddle but for Elm.

they disable the networking

Is this really any major problem though? Do you think your service would get popular if you made an identical service but with networking? I just don’t see this as so big problem, I doubt nearly anyone does. What would be the use cases for code snippets with internet access? Unless there’s something I’m missing about your concept.

Do you really need to execute the code to begin with? A lot of the code snippets would be taken out of context (say, from a large backend codebase) but still inherently tied to it. There would be no way to execute it unless all the code was given. Without executing, the code itself and its viewing can still be meaningful, as GitHub Gists prove.

1 Like
#6

Something like “download something from HTTP”, but yes, it’s maybe not a major issue, this can be mocked.

Good point. Executing code would be a nice to have, but it leads to high costs and complexity. Without this I could use just reddit :smiley:
My idea is/was to be able to share some working and executable code which downloads data from internet and process it. To do this, with elixir, I need networking and a a project with mix and dependencies like HTTPoison.

I’m just inspecting the idea, and see its weaknesses, so this conversation with you is super helpful! :smiley:

#7

I think you should try to validate your idea’s popularity with something simple to set up first.

Making internet-connected dependency-configurable code execution platform is already trouble for one programming language, let alone multiple. Might not be so fun to work on that for a year just to find out that’s not what people really need.

Moreover, I suspect that the real major work is building those rich text editors that support different programming languages. It looks incredibly complicated front-end development to me.

GitHub Gists support commenting already. Yet you don’t often see any long discussions there. Perhaps people don’t take GitHub as a social platform and prefer to discuss elsewhere. I think you’re right in that there’s no good code snippet platform that supports both well, code execution and social features. But you would need to find one clear selling point that would win popularity for your service.

1 Like
#8

Yes you are right.

There is this amazing text editor which supports almost all the languages: c9 Ace

1 Like
#9

I always end up on https://til.hashrocket.com/ when searching for solution and I love the format. I think a more general community around this concept would awesome (ie. upvoting). I don’t know how much that help with your project goals but I say go for it.

1 Like