<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>

         var _gaq = _gaq || [];
         _gaq.push([‘_setAccount’, ‘UA-8312793-5’]);
         _gaq.push([‘_trackPageview’]);

         (function() {
         var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
         ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
         var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
         })();




‘Simplicity is the ultimate sophistication.’ — Leonardo da Vinci</description><title>Cloudshift.cl</title><generator>Tumblr (3.0; @cloudshift1)</generator><link>http://cloudshift1.tumblr.com/</link><item><title>haXe, Node.js, Remote Data Sneak Peak </title><description>&lt;p&gt;I recently posted a haxe data store I&amp;#8217;m working on here&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/cloudshift/Data" target="_blank"&gt;&lt;a href="https://github.com/cloudshift/Data" target="_blank"&gt;https://github.com/cloudshift/Data&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;it has persistent hashes and indexable/relatable buckets.&lt;/p&gt;
&lt;p&gt;example here &lt;a href="https://github.com/cloudshift/Data/blob/master/usage/Test.hx" target="_blank"&gt;&lt;a href="https://github.com/cloudshift/Data/blob/master/usage/Test.hx" target="_blank"&gt;https://github.com/cloudshift/Data/blob/master/usage/Test.hx&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I have first cut of a remote client working, flavor ..&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;import cloudshift.Core;&lt;br/&gt;using cloudshift.Mixin;&lt;br/&gt;import cloudshift.Data;&lt;/p&gt;
&lt;p&gt;class TestRemote {&lt;br/&gt;  public static function&lt;br/&gt;  main() {&lt;br/&gt; Data.store(REMOTESQLITE(&amp;#8220;http://localhost:8083/&amp;#8221;)).then(function(store) {&lt;br/&gt;        store.bucket(&amp;#8220;users&amp;#8221;).then(function(users) {&lt;br/&gt;            users.where(&amp;#8216;blah=&amp;#8221;elennena&amp;#8221;&amp;#8217;).then(function(recs) {&lt;br/&gt;                trace(recs.stringify());&lt;br/&gt;              });&lt;br/&gt;users.insert({email:&amp;#8221;lorena@ritchie.com&amp;#8221;,name:&amp;#8221;lore&amp;#8221;,passwd:&amp;#8221;and why not&amp;#8221;}).then(function(u) {&lt;br/&gt;                trace(u);&lt;br/&gt;              });&lt;br/&gt;          });&lt;br/&gt;      });&lt;br/&gt;  }&lt;br/&gt;}&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This has the same bucket interface as the in-process version (couple of methods throw as not applicable on client).&lt;/p&gt;
&lt;p&gt;Works over haXe remoting, and with a tweak to the neko code generator that I&amp;#8217;ve already made to my js generator, would be client compatible with neko.&lt;/p&gt;
&lt;p&gt;Any serverside bucket can be made available over http - via http async remoting - and security can be added with my session project.&lt;/p&gt;
&lt;p&gt;Because  proxy async works via  haxe.Http I&amp;#8217;ve had to modify haxe.Http and add a #if nodejs  for requests, but I can ship this in the nodejs haxelib until Nicolas sees fit to recognize Node.js as a first class platform - but don&amp;#8217;t hold your breath.&lt;/p&gt;
&lt;p&gt;Node complements sqlite very well as being a great single threaded server on a very fast database that prefers non concurrent access. So now you don&amp;#8217;t have to do your data access in-process and can spread the load over multiple buckets on multiple servers.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve posted to github, I won&amp;#8217;t complete til end of next week as there&amp;#8217;s a long weekend here and I haven&amp;#8217;t finalised the api.&lt;/p&gt;
&lt;p&gt;R&lt;/p&gt;</description><link>http://cloudshift1.tumblr.com/post/12066471668</link><guid>http://cloudshift1.tumblr.com/post/12066471668</guid><pubDate>Sat, 29 Oct 2011 05:59:00 -0300</pubDate><category>haxe</category><category>node.js</category><category>remote data</category></item><item><title>Waking up to haXe Macros</title><description>&lt;p&gt;I&amp;#8217;ve been a bit slow to get into haXe macros but i found a use case that I wasn&amp;#8217;t able to solve to my satisfaction any other way.&lt;/p&gt;
&lt;p&gt;I blogged previously about a Part -  a self contained component. A Part knows how to start/stop itself, can signal errors and exceptions and has it&amp;#8217;s own set of events.&lt;/p&gt;
&lt;p&gt;I wanted to combine Parts into Assemblies, where an Assembly knows what it&amp;#8217;s parts are and contains the logic that specifies how these Parts interact, via the events the parts emit. An assembly is also a Part. So an Assembly is a typical collection class, which you can iterate over.&lt;/p&gt;
&lt;p&gt;To retain typing when dealing with an Assembly and it&amp;#8217;s constituent Parts one needs to use an Enum as a container, e.g. to specify an Assembly and it&amp;#8217;s Parts I do this.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;enum ViewParts {&lt;/p&gt;
&lt;p&gt;    LOGINVIEW(loginView:LoginView);&lt;br/&gt;    REGISTERVIEW(registerView:RegisterView);&lt;br/&gt;    LAUNCHVIEW(launchView:LaunchView);&lt;br/&gt;    BASEVIEW(baseView:BaseView);&lt;br/&gt;    CONTROLLER(controller:Controller);&lt;br/&gt;}&lt;/p&gt;
&lt;p&gt; _viewAsm = new ViewAssembly();&lt;/p&gt;
&lt;p&gt;_viewAsm.add(REGISTERVIEW(new RegisterView(&amp;#8220;#pageView&amp;#8221;)));    _viewAsm.add(LOGINVIEW(newLoginView(&amp;#8220;#pageView&amp;#8221;)));&lt;br/&gt;_viewAsm.add(LAUNCHVIEW(new LaunchView(&amp;#8220;#pageView&amp;#8221;)));&lt;br/&gt;_viewAsm.add(BASEVIEW(new BaseView()));&lt;br/&gt;_viewAsm.add(CONTROLLER(new Controller()));&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The whole point of an assembly is to provide controlling logic for the constituent parts, but the problem _was_ that adding the view to the collection as an enum greatly inhibits the ease at which you can get at the objects you want to manipulate, i.e. you need to use a switch to get at them.&lt;/p&gt;
&lt;p&gt;So with a simple macro I&amp;#8217;ve been able to remove this limitation. Below is the controller code from within the _viewAsm assembly which switches between the views, I&amp;#8217;ve only included two cases for brevity. &lt;strong&gt;The main point to note is that I can access my views by name; loginView, registerView, controller etc. These are fully typed, no manual var declarations, no untyped string switches in sight, or unnecessary switch dereference to get an object from it&amp;#8217;s container!&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;    watch(function(vp,state) {       &lt;br/&gt;        switch(vp) {        &lt;br/&gt;             case LOGINVIEW(lv):&lt;br/&gt;                       switch(state) {&lt;br/&gt;                       case Started:&lt;br/&gt;                       case Stopped:&lt;/p&gt;
&lt;p&gt;                       case Error(s):&lt;br/&gt;                       case Except(ex):&lt;br/&gt;                            ex.toString().info();&lt;br/&gt;                       case Event(s):&lt;br/&gt;                            switch(s) {&lt;br/&gt;                                case onLogin(email,passwd):&lt;br/&gt;                                     controller.doLogin(email,passwd);&lt;br/&gt;                                case onRegisterView:&lt;br/&gt;                                     lv.stop();&lt;br/&gt;                                     registerView.start();&lt;br/&gt;                            }&lt;br/&gt;                   }&lt;/p&gt;
&lt;p&gt;        case REGISTERVIEW(rv):&lt;br/&gt;               switch(state) {&lt;br/&gt;                      case Started:&lt;br/&gt;                            rv.observe(function(op) {&lt;br/&gt;                                  switch(op) {&lt;br/&gt;                                       case onRegister(email,password,name):&lt;br/&gt;                                            controller.doRegister(email,password,name);&lt;br/&gt;                                       case onLoginView:&lt;br/&gt;                                            registerView.stop();&lt;br/&gt;                                            loginView.start();&lt;br/&gt;                                  }&lt;br/&gt;                            });&lt;br/&gt;           default:&lt;br/&gt;           }&lt;br/&gt;});&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The Assembly class has a macro that adds for each constructor of the enum a new field of the correct type into the Assembly class, thus all the parts added may be accessed internally or externally by name. The Assembly, in a way, implements a Dynamic&amp;lt;ViewParts&amp;gt;.&lt;/p&gt;
&lt;p&gt;The new assembly field name is created by the macro from the enum by extracting the var name, e.g. loginView from the constructor&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;    LOGINVIEW(loginView:LoginView);&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;and adding it as haXe meta data to the enum. At runtime the meta data is extracted and applied as each new enum constructor is added. &lt;/p&gt;
&lt;p&gt;What&amp;#8217;s great with this is I get single instance dependency injection to boot!&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s how I attach the macro to the Assembly class (which ViewAssembly derives from)&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;@:autoBuild(cloudshift.core.PartAssemblyMacro.build())&lt;br/&gt;class AssemblyImpl&amp;lt;T,Q&amp;gt; implements PartAssembly&amp;lt;T,Q&amp;gt;, implements Part&amp;lt;Q&amp;gt;{}&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And here&amp;#8217;s the macro&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;class PartAssemblyMacro {&lt;br/&gt;  @:macro public static function build()&amp;#160;: Array&amp;lt;Field&amp;gt; {        &lt;br/&gt;    var pos = haxe.macro.Context.currentPos();&lt;br/&gt;    var fields = haxe.macro.Context.getBuildFields();&lt;br/&gt;    var local = haxe.macro.Context.getLocalClass().get();&lt;/p&gt;
&lt;p&gt;    switch(local.superClass.params[0]) {&lt;br/&gt;    case TEnum(t,params):&lt;br/&gt;      var en = t.get();&lt;br/&gt;      for (n in en.names) {&lt;br/&gt;        var enumFld = en.constructs.get(n);&lt;br/&gt;        switch(enumFld.type) {&lt;br/&gt;        case TFun(args,ret):&lt;br/&gt;          for (a in args) {&lt;br/&gt;            var thispos = haxe.macro.Context.currentPos();&lt;br/&gt;            enumFld.meta.add(&amp;#8220;woot&amp;#8221;,[{ expr&amp;#160;: EConst(CString(a.name)), pos&amp;#160;: thispos }],thispos);&lt;br/&gt;            switch(a.t)  {&lt;br/&gt;            case TInst(ref,prms):&lt;br/&gt;              var classDef = ref.get();&lt;br/&gt;              var myt = TPath({ pack&amp;#160;: [], name&amp;#160;: classDef.name, params&amp;#160;: [], sub&amp;#160;: null });&lt;br/&gt;              fields.push({ name&amp;#160;: a.name, doc&amp;#160;: null, meta&amp;#160;: [], access&amp;#160;: [APublic], kind&amp;#160;: FVar(myt,null), pos&amp;#160;: pos });&lt;br/&gt;            default:&lt;br/&gt;            }&lt;br/&gt;          }&lt;br/&gt;        default:&lt;br/&gt;        }&lt;br/&gt;      }&lt;br/&gt;    default:&lt;br/&gt;    }  &lt;br/&gt;  return fields;&lt;br/&gt;  }&lt;br/&gt;} &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I haven&amp;#8217;t included the runtime where I decode the metadata and add the field into the assembly instance but it&amp;#8217;s trivial.&lt;/p&gt;
&lt;p&gt;To sum up, I&amp;#8217;m blown away by the possibilies now that I&amp;#8217;ve woken up to haXe macros.&lt;/p&gt;
&lt;p&gt;My Part/Assembly system will be posted on Github after a bit more testing as part of the &lt;a href="https://github.com/cloudshift/Core" target="_blank"&gt;&lt;a href="https://github.com/cloudshift/Core" target="_blank"&gt;https://github.com/cloudshift/Core&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://cloudshift1.tumblr.com/post/11957511387</link><guid>http://cloudshift1.tumblr.com/post/11957511387</guid><pubDate>Wed, 26 Oct 2011 16:21:00 -0300</pubDate><category>haxe</category><category>macros</category><category>component</category></item><item><title>Unobtrusive Class Extensions</title><description>&lt;p&gt;As a framework developer, one of my concerns is how to introduce functionality with as little disruption to the user of the framework as possible.&lt;/p&gt;
&lt;p&gt;For example, inheritance as the primary mechanism of extension is used as the first resort for most users, hence if the framework forces the use of it&amp;#8217;s base classes it becomes a larger question if it will be used.&lt;/p&gt;
&lt;p&gt;Let me explain my problem. I want to integrate a component model into an application, I want to be able to start/stop components, to query their state, to observe them using an Observer pattern. But I don&amp;#8217;t want to introduce a special base class to do this, this enables my component model to be more readily adopted.&lt;/p&gt;
&lt;p&gt;One can implement an interface, but if your extension requires state, and has many methods it&amp;#8217;s fairly intrusive.&lt;/p&gt;
&lt;p&gt;One can use &amp;#8220;using&amp;#8221; to mixin static methods, but as a framework developer your mixin methods will not be tied to a user&amp;#8217;s class but something more generic.&lt;/p&gt;
&lt;p&gt;So the solution is to use a combination of the two methods above. In the code my component is called a Part, so I want to be able to mixin Part functionality with minimal intrusion to a user class, so I defined a Part interface with a single var.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;interface Part {&lt;br/&gt;     var part_:Part_;&lt;br/&gt;}&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;To use my component model the user must implement Part, to do so they have to use the real Part_ implementation class.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;class MyClass extends MyBase , implements Part {&lt;/p&gt;
&lt;p&gt;      public var part_:Part_;&lt;br/&gt;      public function new() {&lt;br/&gt;           part_ = new Part_();&lt;br/&gt;     } &lt;/p&gt;
&lt;p&gt;      public function start() {&lt;br/&gt;           part_.notify(&amp;#8220;started&amp;#8221;);&lt;br/&gt;      }&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The user requires to create a part_ var and initialize it - the part_ var provides any plumbing the extension requires within the class, e.g. in my Part I initialize an observable and have other functionality.&lt;/p&gt;
&lt;p&gt;When one uses the class, you want the Part functionality without accessing part_, and this is where we can use &amp;#8220;using&amp;#8221; to make the extension as seamless as possible.  &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;class PartExtensions {&lt;/p&gt;
&lt;p&gt;     public static var observe(Part:p,cb:Dynamic-&amp;gt;Void){&lt;br/&gt;         p.part_.events.observe(cb);&lt;br/&gt;    }&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Finally&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;import MyClass;&lt;br/&gt;using PartExtensions;&lt;/p&gt;
&lt;p&gt;var inst = new MyClass()&amp;#160;;&lt;/p&gt;
&lt;p&gt;&amp;#8230;.&lt;/p&gt;
&lt;p&gt;inst.observe(function(msg) { });&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For two lines of code to get started the user can get full integration with Part extensions without having to rethink their class hierarchy. That&amp;#8217;s pretty good without macros.&lt;/p&gt;</description><link>http://cloudshift1.tumblr.com/post/11909069704</link><guid>http://cloudshift1.tumblr.com/post/11909069704</guid><pubDate>Tue, 25 Oct 2011 12:21:00 -0300</pubDate><category>haxe</category><category>component</category></item><item><title>haXe, Node.js Object Store</title><description>&lt;p&gt;I&amp;#8217;ve posted &lt;a href="https://github.com/cloudshift/Data" target="_blank"&gt;here&lt;/a&gt; a Sqlite backed object store for haXe/Node.js, fully asynchronous and Promise based.   Classes or typedefs are stored as serialized objects and there&amp;#8217;s no class annotation required.&lt;/p&gt;
&lt;p&gt;No spod as it&amp;#8217;s not async. The design is based on initial work i did with &lt;a href="https://github.com/blackdog66/bdog-pstore" target="_blank"&gt;pstore&lt;/a&gt;, an experimental Redis object store.&lt;/p&gt;
&lt;p&gt;There is a persistent hash. &lt;a href="https://github.com/cloudshift/Data/blob/master/usage/TestHash.hx" target="_blank"&gt;Usage&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There is a concept of &amp;#8220;buckets&amp;#8221;. A bucket contains an object of a given type. &lt;a href="https://github.com/cloudshift/Data/blob/master/usage/Test.hx" target="_blank"&gt;Usage&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The bucket provides indexing by supporting &amp;#8220;indexers&amp;#8221;, functions that are run on your object to produce an index key before the object is serialized to the data store on an insert or update. Indexer values are indexed ultimately by sqlite indexes. Indexers are the query mechanism too. If your indexer returns null, the object will be ignored in searches on that index. &lt;/p&gt;
&lt;p&gt;You may link objects between buckets, thereby producing relations.  &lt;/p&gt;
&lt;p&gt;Future directions will be more drivers as required probably Redis to start, command line backup/dump to json.&lt;/p&gt;</description><link>http://cloudshift1.tumblr.com/post/11727524486</link><guid>http://cloudshift1.tumblr.com/post/11727524486</guid><pubDate>Fri, 21 Oct 2011 06:24:00 -0300</pubDate><category>haxe</category><category>node.js</category><category>persistence</category></item><item><title>haXe, Node.js and Workers</title><description>&lt;p&gt;Node.js is single threaded, so holding up the event loop with heavy processing is a no-no.&lt;/p&gt;
&lt;p&gt;The way of solving this problem is to start a new sub-process that does the heavy lifting, connect to it&amp;#8217;s stdin/stdout and then manage some kind of protocol between the main and the sub-process.&lt;/p&gt;
&lt;p&gt;This is a great way of doing things, the main event loop fires off a sub-process and continues on it&amp;#8217;s merry way until there is some data returned. Further, the OS can schedule the sub-processes over multiple cores and it removes an entire class of bugs associated with threaded programming.&lt;/p&gt;
&lt;p&gt;Node makes it quite easy to perform this task with it&amp;#8217;s childprocess function, however at each stage you&amp;#8217;re continually thinking of a new protocol to talk to the sub-process over the wire.&lt;/p&gt;
&lt;p&gt;haXe already has the remoting protocol, so all we need is an async stdio remoting protocol to take advantage of typed calls to sub-process. &lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve just posted on &lt;a href="http://github.com/cloudshift/Worker" target="_blank"&gt;github&lt;/a&gt; the means of doing this, here&amp;#8217;s the worker that runs in a sub-process&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;import cloudshift.Worker;&lt;/p&gt;
&lt;p&gt;class OtherProcess extends Worker {&lt;/p&gt;
&lt;p&gt;  public function foo(x,y,cb:Int-&amp;gt;Void):Void {&lt;br/&gt;      cb(x+y);&lt;br/&gt;  }&lt;br/&gt;}&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A Worker extends haxe.remoting.Context, and addObject is provided with &amp;#8220;this&amp;#8221; as the target, thus all public functions can be workers.&lt;/p&gt;
&lt;p&gt;and here&amp;#8217;s the main process defined in the same source file as the Worker&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;class Test {&lt;br/&gt;   public static function main() {&lt;br/&gt;     Worker.run(Test);&lt;br/&gt;   }&lt;/p&gt;
&lt;p&gt;public function new() {&lt;br/&gt;   var worker = Worker.create(OtherProcess);&lt;br/&gt;   worker.OtherProcess.foo.call([1,4],function(result) {&lt;br/&gt;       trace(&amp;#8220;woot:&amp;#8221;+result);    &lt;br/&gt;   });&lt;br/&gt;}&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can also create an AyncProxy for typed calls &amp;#8230;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;class OtherProxy extends haxe.remoting.AsyncProxy&amp;lt;OtherProcess&amp;gt; { }&lt;/p&gt;
&lt;p&gt;&amp;#8230;..&lt;/p&gt;
&lt;p&gt;var _proxy = new OtherProxy(worker.OtherProcess);&lt;br/&gt;_proxy.foo(2,5,function(res) {&lt;br/&gt;        trace(&amp;#8220;proxy res:&amp;#8221;+res);&lt;br/&gt;});&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So how does it work. Let&amp;#8217;s say you compiled your app into test.js, thus to run you do&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;node test.js&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;on the first invocation, Worker.run(Test) runs your main class as the default.&lt;/p&gt;
&lt;p&gt;However Worker.create(OtherProcess) calls a new instance of node as a childprocess like this&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;node test.js OtherProcess-someID&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Worker.run, is called on the new instantiation of the subprocess and knows it must use OtherProcess, not the default Test, as the main entry point. Thus a new sub-process is started from the very same compilation unit.&lt;/p&gt;
&lt;p&gt;One then adds the ability to do haXe remoting over the stdin/stdout channels of the sub-process and you have a very clean way of doing heavy lifting in Node.js in an non threaded async manner.&lt;/p&gt;
&lt;p&gt;My code is first cut and nasty, but I was eager to share ;)&lt;/p&gt;
&lt;p&gt;R&lt;/p&gt;</description><link>http://cloudshift1.tumblr.com/post/11410921028</link><guid>http://cloudshift1.tumblr.com/post/11410921028</guid><pubDate>Thu, 13 Oct 2011 19:39:00 -0300</pubDate><category>haxe</category><category>node.js</category><category>worker</category></item><item><title>haXe, Node.js and Remotes</title><description>&lt;p&gt;haxe remoting is a useful technique for transferring serialized objects between haxe platforms. Remoting can be used asynchronously over http.&lt;/p&gt;
&lt;p&gt;Node.js although not an officially supported platform of haXe is available via these type signatures.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://github.com/cloudshift/hx-node" target="_blank"&gt;http://github.com/cloudshift/hx-node&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That is, haxe can generate javascript from statically typed haxe code.&lt;/p&gt;
&lt;p&gt;Node.js can be a great haxe remoting target with some tweaks. It needs to process http posts, decode the serialized object pass it to a function, gather the output and pass a serialized object back.&lt;/p&gt;
&lt;p&gt;The main issue is haxe remoting on the backend assumes a blocking server, that is, the processing remote function must return a value, not callback a value. This doesn&amp;#8217;t work well in a single threaded non-blocking server such as node. Thus the standard haxe.remote.HttpConnection.processRequest function needs altered as does haxe.remote.Context.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve made the required tweaks here in this project which also provides an http server.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://github.com/cloudshift/Http" target="_blank"&gt;http://github.com/cloudshift/Http&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can create a haxe remote like this&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;var http = Http.server(&amp;#8220;localhost&amp;#8221;,8082,{ server: &amp;#8220;MyServer 0.5&amp;#8221;,root:&amp;#8221;www&amp;#8221; });&lt;br/&gt;var remote = Http.remote(http,&amp;#8221;/my/remote&amp;#8221;);&lt;br/&gt;remote.addObject(&amp;#8220;MyRemote&amp;#8221;,new MyRemotes());&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;where MyRemotes looks like this&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;class MyRemotes {&lt;br/&gt;public function new() {}&lt;/p&gt;
&lt;p&gt;public function foo(x:Int,y:Int,cb:Int-&amp;gt;Void) {&lt;br/&gt;    cb(x+y);&lt;br/&gt;}}&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Notice we&amp;#8217;re calling back rather than returning from foo. And on the client&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;var URL = &amp;#8220;http://localhost:8082/my/remote&amp;#8221;;   &lt;br/&gt;var cnx = haxe.remoting.HttpAsyncConnection.urlConnect(URL); &lt;br/&gt;cnx.setErrorHandler( function(err) trace(&amp;#8220;Error&amp;#160;: &amp;#8220;+Std.string(err)) ); &lt;br/&gt;var proxy = new MyRem(cnx.MyRemote); &lt;br/&gt;cnx.MyRemote.foo.call([5,2],function(v) {        trace(&amp;#8220;value = &amp;#8220;+v);      });&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is precisely the normal haXe client code for an async remoting call.    How about remoting proxies?&lt;/p&gt;
&lt;p&gt;By creating a proxy class you may have typed calls on the client&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;import MyRemotes;&lt;br/&gt;class MyRem extends haxe.remoting.AsyncProxy&amp;lt;MyRemotes&amp;gt; { }&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The haXe code generator creates a typed proxy class automagically for you, allowing the following &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;var proxy = new MyRem(cnx.MyRemote); &lt;br/&gt;proxy.foo(5,4,function(v) {        trace(&amp;#8220;value=&amp;#8221;+v);      });&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;However the default haxe js generator wants to try and serialize the final function which is incorrect, so use the custom generator provided like this&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;br/&gt;-js www/client.js-cp src&lt;br/&gt;-cp ../http&lt;br/&gt;&amp;#8212;macro exclude(&amp;#8220;MyRemotes&amp;#8221;)&lt;br/&gt;&amp;#8212;macro cloudshift.http.JSGenerator.use()&lt;br/&gt;-main TestClient&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://cloudshift1.tumblr.com/post/11224349570</link><guid>http://cloudshift1.tumblr.com/post/11224349570</guid><pubDate>Sun, 09 Oct 2011 09:59:00 -0300</pubDate><category>node.js</category><category>haxe</category><category>remotes</category></item><item><title>Clojurescript</title><description>&lt;p&gt;Compiles to Javascript, has support for &lt;a target="_blank" href="http://nodejs.org"&gt;Nodejs&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I learned lisp and functional programming on &lt;a title="clojure" target="_blank" href="http://clojure.org"&gt;Clojure&lt;/a&gt; a couple of years ago, but I&amp;#8217;m not keen on the JVM, particularly the memory consumption, so I dropped it, and reverted to haXe, targetting Js and nodejs with my &lt;a title="hx-node" target="_blank" href="http://github.com/cloudshift/hx-node"&gt;type sigs&lt;/a&gt;; coding in a more functional style, which has been very beneficial.&lt;/p&gt;
&lt;p&gt;This exciting development allows me to use my platform of choice, nodejs, in, I&amp;#8217;ll bet, the best supported lisp compiling to javascript that&amp;#8217;s available.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll be posting more on this as I get into it, but already the clojurescript use of the google closure compiler has tweaked me to add that to my haXe pipeline.&lt;/p&gt;
&lt;p&gt; Javascript as an assembler is the only way to go.&lt;/p&gt;</description><link>http://cloudshift1.tumblr.com/post/7897024386</link><guid>http://cloudshift1.tumblr.com/post/7897024386</guid><pubDate>Thu, 21 Jul 2011 16:32:00 -0400</pubDate><category>clojure</category><category>clojurescript</category><category>nodejs</category></item><item><title>"‘Simplicity is the ultimate sophistication.’ — Leonardo da Vinci"</title><description>“‘Simplicity is the ultimate sophistication.’ — Leonardo da Vinci”</description><link>http://cloudshift1.tumblr.com/post/7759909368</link><guid>http://cloudshift1.tumblr.com/post/7759909368</guid><pubDate>Mon, 18 Jul 2011 08:27:42 -0400</pubDate></item><item><title>from emacs</title><description>&lt;p&gt;;; This buffer is for notes you don&amp;#8217;t want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file&amp;#8217;s own buffer.&lt;/p&gt;</description><link>http://cloudshift1.tumblr.com/post/7759292234</link><guid>http://cloudshift1.tumblr.com/post/7759292234</guid><pubDate>Mon, 18 Jul 2011 07:46:09 -0400</pubDate></item></channel></rss>
