[CCC DEV] occam in the "cloud"

Matt Jadud matt at jadud.com
Wed Apr 3 04:10:46 BST 2013

Hi all,

Last summer, I hacked together a visual environment for programming the
Arduino using occam.


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.


And, I've started hacking with it (screenshot attached).


(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.


I will move these things under the c.cc banner soon, sooner if anyone else
wants to hack directly.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.concurrency.cc/pipermail/developers/attachments/20130402/e301983b/attachment.htm>

More information about the developers mailing list