<div dir="ltr">Hi all,<div><br></div><div>Last summer, I hacked together a visual environment for programming the Arduino using occam. <br></div><div style><br></div><div style><a href="https://github.com/craftofelectronics/flow">https://github.com/craftofelectronics/flow</a><br>
</div><div style><br></div><div style>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.)</div><div style><br></div><div style>I rediscovered the Ace editor recently.</div>
<div style><br></div><div style><a href="http://ace.ajax.org/">http://ace.ajax.org/</a><br></div><div style><br></div><div style>And, I've started hacking with it (screenshot attached).</div><div style><br></div><div style>
<a href="https://github.com/jadudm/jupiter">https://github.com/jadudm/jupiter</a><br></div><div style><br></div><div style>(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.)</div>
<div style><br></div><div style>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."</div>
<div style><br></div><div style>1. Edit occam-pi directly in the browser. Ace is a surprisingly decent editor. (We need to write an occam-pi syntax mode.)</div><div style>2. Ship the code to a server (Linux). Compile. Ship back bytecode.</div>
<div style>3. Ship the code to a locally-executing server ("stub") that manages the upload to the Arduino.</div><div style><br></div><div style>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.</div>
<div style><br></div><div style>The next step would be to compile the TVM with Emscripten (<a href="https://github.com/kripken/emscripten/wiki">https://github.com/kripken/emscripten/wiki</a>). 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.</div>
<div style><br></div><div style>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.</div>
<div style><br></div><div style>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.</div><div style><br></div><div style>
Thoughts?</div><div style><br></div><div style>I will move these things under the c.cc banner soon, sooner if anyone else wants to hack directly.</div><div style><br></div><div style>Cheers,</div><div style>Matt</div><div style>
<br></div><div style><br></div><div style><br></div><div style><br></div><div style><br></div></div>