Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Compile .NET in your browser using Compilify (appharbor.com)
47 points by johns on April 16, 2012 | hide | past | favorite | 12 comments


I'm not sure of the overall utility of what's been made here, but it's very cool that it's possible.

It also is a great showcase of how .NET isn't as limiting as some people think it is- you can and should be using Redis, MongoDB, Memcached and the like as appropriate. Don't think that .NET developers can only use MS tools.


I've seen several online code tools that allow you to compile, run, and even debug CLR code online. What's special about this one? The back-end Roslyn interface looks interesting though: http://msdn.microsoft.com/en-us/roslyn


Simplicity and speed are the advantages.

Compilr, Coderun, and Ideone all look like great in-browser replacements for a full blown IDE. The builds even take as long as a Visual Studio would. They're great for when you want or need the full IDE experience.

But there are many times when a developer might not want that experience. Maybe you're brainstorming a new implementation for an algorithm and you just want to get an idea of what it might look like. Maybe you're in the middle of a presentation and someone in the audience asked you a slightly off-topic question, and you don't want to spin up a new instance of an IDE just to help them understand.

This tool is for those situations like those.


I don't know of any other online ones for .NET. Do you have a link?


Also http://compilr.com.

Edit: here's the one I've used before, complete with integrated debugger: http://www.coderun.com/



Interesting that it fails to mention LINQPad. I'm always surprised to find a .NET dev who doesn't use this on a daily basis (for the REPL rather than any LINQ abilities).


And there is also snippet compiler: http://www.sliver.com/dotnet/SnippetCompiler. Unfortunately, it only works up to framework 3.5, but that's good enough in many cases.


I always just use Immediate window


The Immediate window is cool, but you can write whole applications in LINQPad scripts if you want which I don't think you can do in the Immediate window (i.e. can you define classes in the Immediate window?). I find I often use LINQPad to mockup and run a bit of code that I would have traditionally made a full command line project for.


It seems cool but, and maybe I'm reading something between the lines that's not really there, we have live code editing built into most browsers.

In Chrome or Safari press Ctrl-Shift-J (on OSX Cmd-Option-J) or Ctrl-Shift-K in Firefox and paste this

    c = document.createElement("canvas");
    document.body.appendChild(c);
    ctx = c.getContext("2d");
    ctx.translate(150, 75);
    ctx.beginPath();
    for (var i = 0; i < 60; ++i) {
        var a = i * 2; 
        ctx.lineTo(Math.sin(a) * 75, Math.cos(a) * 75); 
    }
    ctx.stroke();
This is one of the things I love about programming in JavaScript. Being in the browser means I always have a live "listener" where I can manipulate code on the fly.

Anytime I need to check something simple it's just a moment to try it out. If I want to make something easily inspect-able I temporarily assign it to a global.

   xxx = someObjectIWantToInspect
And now I can type `xxx` to see it live.

Since I do lots of visualizations and games and other things that re-evaluate live it's easy to just manipulate the settings as they run. For example paste this code.

    m = 2;
    c = document.createElement("canvas");
    document.body.appendChild(c);
    ctx = c.getContext("2d");
    ctx.translate(150, 75);
    setInterval(function() {
        var t = +Date.now();
        ctx.clearRect(-150, -75, 300, 150);
        ctx.beginPath();
        for (var i = 0; i < 60; ++i) {
            var a = i * m + t; 
            ctx.lineTo(Math.sin(a) * 75, Math.cos(a) * 75); 
        }
        ctx.stroke();
    }, 100);
Then try typing `m = 1` or `m = 9` etc and watching the shape change live.

Yes, I understand the OP is about C# but like I said, I read something between the lines that suggested maybe some people didn't know this. Sorry if it's off topic.


Doesn't http://ideone.com already do this for a ton of languages, including C# and VB.NET?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: