From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from resqmta-po-03v.sys.comcast.net (resqmta-po-03v.sys.comcast.net [IPv6:2001:558:fe16:19:96:114:154:162]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 4980777C75 for ; Mon, 22 Dec 2014 12:25:37 -0800 (PST) Received: from resomta-po-14v.sys.comcast.net ([96.114.154.238]) by resqmta-po-03v.sys.comcast.net with comcast id WkP51p00758ss0Y01kPXKn; Mon, 22 Dec 2014 20:23:31 +0000 Received: from eklhad ([68.84.191.77]) by resomta-po-14v.sys.comcast.net with comcast id WkPW1p00L1gep3001kPW5E; Mon, 22 Dec 2014 20:23:31 +0000 To: Edbrowse-dev@lists.the-brannons.com From: Karl Dahlke Reply-to: Karl Dahlke User-Agent: edbrowse/3.5.2 Date: Mon, 22 Dec 2014 15:23:30 -0500 Message-ID: <20141122152330.eklhad@comcast.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1419279811; bh=/XcfZrQ64zcN3oEUpiqFw7qltGn0Rz+gZ+dS8JOf5OU=; h=Received:Received:To:From:Reply-to:Subject:Date:Message-ID: Mime-Version:Content-Type; b=Cd9InGs0RCfeq/L0I/82M9Op4jHKcN3Cn196FHLkBVdBWy/oWyLcZwLp5Ga0X4KHk wLXECW1cFBPDXSIJHPn6RJUkgW9WcjoOt2QGnSDEP9rznGsV9pMiSuxx3WBlO6MfOU C4GrbIXvURl/XfU3InLjAebh4i/dIaLvQdr6eEWbZA5D9BOhPGHlcC3MOMZM3PxoKs KH7mJ2sREfcuwfKNXSLLkhoDB6fitEZQ2eIu5iZRvyOGr1BcCGb3irZK5Sc1XHIwhZ BRuFQDzlK4aqUeDgYkqMYhs+76yjI4w3kpYc0TJ0ioLEjzu0oUmF2wT5ln6pUuNWIX WYnarRuhwyxaA== Subject: [Edbrowse-dev] js engine process, version 1 X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Dec 2014 20:25:37 -0000 Just in time for Christmas - but don't get too excited, because it is entirely untested. All I know is it compiles. git pull and read through jseng-moz.cpp It corresponds to ebjs.c. They send messages to each other in a coordinated fashion. make edbrowse-js Then run edbrowse-js to get the usage. That's as far as I got. I was almost ready to commit this file yesterday, having worked on it for a week solid, and then I deleted it. No shit! I typed rm instead of mv or cp or whatever the hell I was trying to do, and the file was gone, with absolutely no backups. So I had to start over. Fortunately most of it was still in my head, and there was lots of copying and modifying from the existing files, and I remembered how I did it, so stayed up all night while it was fresh in my mind and banged it out again, then sent it to github in a hurry! The first thing you see is several small functions copied from stringfile.c and url.c. These are functions that I just need everywhere. This is duplication, and that concerns me, but I didn't want to drag in eb.h, and from there all of edbrowse, so for now I copied the routines I needed. Some day we might want to put these into common.c or some such. Finally the real code begins at line 546. Message management, much like that in ebjs.c, and the dom classes and setters and side effects and all that. If you like statistics, the new code is 3408 lines, and the old code is 3100 lines. Since the new has all sorts of messaging and message parsing, that wasn't there before, it's fair to say I was able to optimize much of the old code along the way. One example is making use of the C preprocessor. Look at the definitions for generic_class and generic_ctor Now the classes and constructors are basically a list, whereas they use to be pages of essentially the same C code over and over and over again. I feared this trick might derail indent, but it seems to have indented the code properly, except it keeps getting rid of the blank line after the list of classes, not sure why. Maybe I should put a semicolon in just to get it back on track. As I say this is all untested. I wanted to do some stand-alone tests, but I'd have to write some nontrivial programs to do that. It's probably about the same work to just take the plunge and modify edbrowse to use the new interface, and test it in battle. I'm not going to attempt any of this until after christmas. That gives you time to find some bugs in the code just by reading it. Karl Dahlke