[CCC DEV] occam in the "cloud"

Carl Ritson C.G.Ritson at kent.ac.uk
Wed Apr 3 12:00:04 BST 2013

Hi Matt,

While I don't know about Arduino, your general direction seems the same as
the thoughts I had last time I was poking the TVM.  I briefly experimented
with a port to Chrome Native Client, but didn't get round to finishing it.
 Also porting the TVM to Javascript is on my list of cool things to do that
I'll never have time to do.

One thing that needs to be taken care with is appropriate sandboxing of the
compiler.  The occ21 compiler is relatively easy to crash (with malformed
code), and hence could be exploited and used to hijack the host.  Although
I think the probability of this vector being exploited is low in reality.



2013/4/3 Matt Jadud <matt at jadud.com>

> Hi all,
> Last summer, I hacked together a visual environment for programming the
> Arduino using occam.
> https://github.com/craftofelectronics/flow
> It was kludgy, and I ran into lots of problems on Windows. (I think it may
> have been an old avrdude, but that's besides the point.)
> I rediscovered the Ace editor recently.
> http://ace.ajax.org/
> And, I've started hacking with it (screenshot attached).
> https://github.com/jadudm/jupiter
> (To test, run server.rkt in a recent version of DrRacket. I'm using 5.3.3,
> running the editor in Chrome on a Mac.)
> I'm trying to eliminate toolchains; unless a strong case can be made for
> shipping a native IDE/toolchain on Windows, Mac, and Linux, I'd like to
> move things to the "cloud."
> 1. Edit occam-pi directly in the browser. Ace is a surprisingly decent
> editor. (We need to write an occam-pi syntax mode.)
> 2. Ship the code to a server (Linux). Compile. Ship back bytecode.
> 3. Ship the code to a locally-executing server ("stub") that manages the
> upload to the Arduino.
> I wrote a draft stub last year; it is INFINITELY easier to write and
> maintain than maintaining a complete toolchain. I have a 36 line stub right
> now that just serves up the editor and receives the "compile" message. It
> isn't a long road to having a round-trip that works.
> The next step would be to compile the TVM with Emscripten (
> https://github.com/kripken/emscripten/wiki). This is a tool that takes C
> code, compiles it to LLVM ASM, and then compiles that to JavaScript. This
> has been used on some huge projects successfully; I expect the TVM to
> cleanly port. This would give us a browser-based occam-pi execution
> environment, which (with a small wrapper) we'd be able to have an editor
> and execution environment right in a web page.
> I'm interested in either hearing why this is a bad idea/direction, or if
> anyone has any students who would be interested in poking at these bits.
> (Or, if anyone wants to do any hacking themselves.) I haven't thought of
> why this is a really bad idea yet; it certainly promises to give me a
> cross-platform occam-pi/Arduino environment far faster than me rebuilding
> all of our build systems.
> I'm just trying to take steps that reduce maintenance for myself. The
> JavaScript technologies weren't there a few years ago; I think they are now.
> Thoughts?
> I will move these things under the c.cc banner soon, sooner if anyone else
> wants to hack directly.
> Cheers,
> Matt
> _______________________________________________
> developers mailing list
> developers at concurrency.cc
> http://lists.concurrency.cc/mailman/listinfo/developers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.concurrency.cc/pipermail/developers/attachments/20130403/14295927/attachment.htm>

More information about the developers mailing list