61 comments

[ 1.6 ms ] story [ 115 ms ] thread
This is incredible. The key is in its simplicity, speed, and variety of languages.

Kudos!

This is good! Though, some sort of captcha will be useful to avoid people spamming this.
Some metadata:

MIT license

Haskell infrastructure

Containered

Open source everything -- runners, site, etc

Very nice!

It looks like only glot-www is Haskell.

glot-snippets and glot-run are both erlang APIs, and glot-code-runner is a go application.

This is interesting, but I'm not sure why they use CouchDB and PostgreSQL.
Can you elaborate?
Probably refering to the diagram from their github page[1]

[1] https://github.com/prasmussen/glot

Pet Peeve: There is no way to post ASCII diagrams on HN

(comment deleted)

      snippets.glot.io                  glot.io                     run.glot.io
    ┌──────────────────┐   http   ┌──────────────────┐   http   ┌──────────────────┐
    │  glot-snippets   │◀─────────│     glot-www     │─────────▶│     glot-run     │
    └──────────────────┘          └──────────────────┘          └──────────────────┘
              │                             │                             │
         http │                             │                        http │
              ▼                             ▼                             ▼
    ┌──────────────────┐          ┌──────────────────┐          ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─
    │     couchdb      │          │    postgresql    │                 docker      │
    └──────────────────┘          └──────────────────┘          └ ─ ─ ─ ─ ─ ─ ─ ─ ─
Almost works. I just pasted it as code.
I'd say it works quite well. That looks perfect.
Indent each line by four or more spaces.

The markup documentation is linked from the FAQ, and the FAQ is linked from the bottom of each page.

People not using a relational DB drives me nuts when it clearly is the right tool for the job. Possibly that is his issue. Something that is a perfect match for a relational DB and instead use a "NON-SQL" DB for a project.
Yes. Usually when I build an application I'd use a single database. While I don't think in the end it would matter for PostgreSQL or CouchDB, two databases is a bit much. Just curious as why they use two databases that can accomplish the same task (from what I can tell from my limited digging into the project).
CouchDB has really good, built-in versioning of documents so that may be one reason.
This. Awesome service, but pleasefortheloveofgod don't let people run arbitrary code inside Docker, unless you don't mind them getting out into the parent OS and messing around. You want VMs for that. (Yeah, that's much more resource intensive. Safely running arbitrary code is hard.)
seccomp provides a really good jail, probably all that's needed here.
Great, would be nice to have and updated clang (seems to be using 3.5.1) and python3 (using 3.4.3). Generally its nice to point out the version of the compiler it's using somewhere as a note.
This is very cool. I'd really love to see a "how it works" blog post, particularly for the runnable snippets, and what your approach to protecting it from abuse and hacking is.
The code is, but I assume there's some configuration that's not code that might be interesting in the "avoid abuse and hacking" space.
All of the code is open source. This is a beautiful thing:

website: https://github.com/prasmussen/glot-www

snippets: https://github.com/prasmussen/glot-snippets

runner-web: https://github.com/prasmussen/glot-run

runner-onserver: https://github.com/prasmussen/glot-code-runner

containers: https://github.com/prasmussen/glot-containers

EDIT: And this is directly from the main github source repository -- https://github.com/prasmussen/glot

Is there a guide for setting this up internally (within a local network)?
I think this is pretty cool. Might be nice to be able to embed them (i.e. like you can with Github gists).
(comment deleted)
I hope they add R soon.
I wrote up the Perl 6 entry. It's relatively trivial to add languages to the project you just need to have a link to a docker registry with the version of R you want. The rest is basically just bits of boiler plate in the other repositories for the project.
Thank you for this! Going to share it with the rest of my team right now. I always need a tool like this and had been using http://codepad.org/ until now. This interface is much slicker.
nice, you can even require other files in JS - although it would be nice to be able to customize the file names - but still very useful for the kind of thing I would normally use a gist for.

Edit: I do wish it had a more recent version of node though (currently v0.12.7)

This is very fascinating.

How does the rocket science work here? Like how do you run different programming languages in the client side.

Do they pass the code to the server and run it in there then pass it to the client?

Please make R a language here. That would be amazing to be able to run snippets. I could see a lot of uses!
+1 for R. I was pleasantly surprised to see Julia there
This is really cool to see, but also somewhat depressing because it reminds me that I spent about 500 hours of my free time building the same thing, and even had it deployed at codetrain.io for a while, but then lost interest and now my code's wasting away in a private bitbucket repo.

Before I shut mine down it could run 13 or so different languages, spin up collaborative REPLs for Node.js/Python/Ruby, and organize snippets into tutorials/lessions, etc. It was awesome, but now sits in my side project graveyard. It's a shame really.

Glad to see glot.io getting more attention.

you should open source it
Any idea what the business model is? There are no ads or anything.
Feature request - be able to make the editor's height taller.

Other than that, awesome job!

Would be cool to integrate with https://ace.c9.io/#nav=about
It is using Ace as the code editor: https://glot.io/about

> Ace is used as the code editor. Make sure to check out the leftmost and rightmost tabs, where you can select language version, set a custom run command and change the editor keybindings.

Can I install packages/modules for my scripts (e.g. using npm)?
Doesn't look like it. The containers don't have network access, either so putting something like `npm install left-pad && node main.js` as the run command won't work.
FYI - This is the work of one guy only not multiple, just thought i mention it as people refer to the dev in plural.

And my guess as to different parts of the application has been developed in different languages and to the use of two db's are for educational purposes.

Could also be singular 'they' -- that's how I read it.
This is excellent! Reminds me of a tool I wrote a few years back that only supported 4 languages that we used at my past company. Great to see this open sourced!