edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] parser separation
@ 2015-08-30 11:31 Karl Dahlke
  2015-08-30 11:43 ` Adam Thompson
  0 siblings, 1 reply; 5+ messages in thread
From: Karl Dahlke @ 2015-08-30 11:31 UTC (permalink / raw)
  To: Edbrowse-dev

I was thinking about the history of our js interactions.
We felt it was wise to separate and encapsulate,
writing jseng-moz.cpp as a separate source file running a separate process.
Among other benefits,
this makes it easier to switch engines, or conform to Mozilla upgrades
and changing APIs.
We've talked about v8 and duktape for instance.
Those are still possibilities.
So ... if there is any uncertainty at all about the html parser,
or if we just want to keep the door open, should we do some encapsulation,
and should we start now?

The connection is far simpler than js.
Pass html text, get back a tree of nodes.
It's conceptually a function call,
and doesn't need to be a separate process or thread.
Nothing asynchronous etc, and no ongoing dialog with states etc.
So it's very simple, but still might be worth putting in another sourcefile.

html-tidy.c - use tidy to parse html
html-hub.c - use hubbub to parse html
...

Let the makefile link in whichever one we want,
just as the makefile determines mozilla or v8 or duktape etc.
Then htmltidy.c is the only file that needs tidy.h and its
structures and API, and it returns to us
a tree of our nodes, as converted from the tidy nodes,
which we then use to build our DOM.
It's a small bit of administrative overhead that might pay dividends.
What do you think?


Karl Dahlke

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-08-30 19:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-30 11:31 [Edbrowse-dev] parser separation Karl Dahlke
2015-08-30 11:43 ` Adam Thompson
2015-08-30 12:21   ` Karl Dahlke
2015-08-30 19:06     ` Adam Thompson
2015-08-30 19:25       ` Karl Dahlke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).