From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [IPv6:2a00:1450:400c:c05::235]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 963A077C75 for ; Tue, 23 Dec 2014 10:48:58 -0800 (PST) Received: by mail-wi0-f181.google.com with SMTP id r20so11666972wiv.14 for ; Tue, 23 Dec 2014 10:46:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=FdacB8yGH3o8VAahbYu3L+avwxhuWWtEEJQbR2/N1T0=; b=RegHWshHnmqzjGeQu6ylnZFMkQfDqjnP5sjKHOINNGfvUWz/kCZxvKFvvGFUemLs9F 1nMNbs9P3yYfacviq3q9jfgPU+MIMDweQt7H/9xVbO7J38ONVwSnTKtc6LuC1q77Wt6Z 63BcZqqae+BohG2R9QVVhcKy9EQLm5ilL3HPGGw2MgHMsghEx9vK5ae7pnM0/JyWcTjK Fbh9FyQvnqpU0Jy6R/0vp3vtlrIpBQ/LFff3m7Msk/ZMLtQC9cxrCdNbzoclOwdLBAE+ zp7NWyAb6jf3CugqANvp2krkhW1xpzL4nmyQUDwBKHuKQkZGJr4B1vXXok/4OBooco/2 1vYA== X-Received: by 10.180.73.206 with SMTP id n14mr44523839wiv.60.1419360410404; Tue, 23 Dec 2014 10:46:50 -0800 (PST) Received: from toaster.adamthompson.me.uk (toaster.adamthompson.me.uk. [2001:8b0:1142:9042::2]) by mx.google.com with ESMTPSA id a14sm18272839wib.22.2014.12.23.10.46.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Dec 2014 10:46:49 -0800 (PST) Date: Tue, 23 Dec 2014 18:46:47 +0000 From: Adam Thompson To: Karl Dahlke Message-ID: <20141223184647.GV14122@toaster.adamthompson.me.uk> References: <20141122152330.eklhad@comcast.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/CHBEyLWSSL2QXIQ" Content-Disposition: inline In-Reply-To: <20141122152330.eklhad@comcast.net> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Edbrowse-dev@lists.the-brannons.com Subject: Re: [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: Tue, 23 Dec 2014 18:48:59 -0000 --/CHBEyLWSSL2QXIQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 22, 2014 at 03:23:30PM -0500, Karl Dahlke wrote: > 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. Ok, I'll have a look at that, sounds good. > make edbrowse-js > Then run edbrowse-js to get the usage. > That's as far as I got. Yep, that works on my system. > 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! Yeah, I've done that before, the worst part is when you know what you've do= ne and know it's too late to do anything about it. > 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. Yep, common.c for the code and common.h for the prototypes probably. > 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. No please don't. The lack of a blank is potentially annoying (though tbh I'= ve never been too good at code style), but I'd rather that than an empty statement for no good reason. >=20 > 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. Yeah, I've got some time now (not back at work till 5th Jan) so if it's ok, I may have a go at plugging in the new code at some stage. It'll be a bunch of work, but it'll hopefully be useful. I'm also investigating if there's anything we can use to parse html into a = DOM rather than our own hand-rolled parser or something which is too bound up w= ith an existing browser. So far I've not had much luck finding something in c w= hich does html, is fairly lightweight and produces the kind of DOM you can actua= lly use. Cheers, Adam. --/CHBEyLWSSL2QXIQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUmbiXAAoJELZ22lNQBzHO51cH/0Do3YpJglenbDlQMTKcG8TR Qbt8MAHkxIiFA5bEUWnOITcKTurigaupWjJHnmAuqDI6nAUlR8sInY5FL5mC5Wum PEWXMuNo6TcKkJvMSpAGOR5lppxfs6ltvAa8qtt+Va6943Hg6JuXOl6BU0HflEsO sTtk5XZjVGBkjzNOAQiqGStXM3TcWInzXg/A+A17torQjGL0egvp/22GIUL1uUMB 5rfvLRTPJ109yCKVIUY6v1olEST8wm4HQI78rMSzfYJbtE8giTSm/UKu9zcptgPp 8cFiwkBynEkMzQseA948CmThfwPbrmBKK8bfJYGSv8a2COWpF9TnA8/K9GB2MBg= =cGVE -----END PGP SIGNATURE----- --/CHBEyLWSSL2QXIQ--