Sunday, September 1, 2024

Coding CLX diary…

Adding insights on CLX’s development here to keep it in one post, now until 16 September 2024. After this “simple” script, I will stop developing programs entirely.

It’s 8pm 1/9 and I am dazed, unsure what kind of interface clx will have. Thinking of bashing in code blindly and see what comes out.

4pm, 2/9 am entering the wonderful world of escape sequences. Last night, I made some headway with these and tonight I will build the interface using escape codes which manipulate the console in multifarious ways.

6pm 3/9 the purpose of the app diverges from the original aim to build a browser in Bash. It will be in python again and be called netlang, a cli app that dissects webpage data via a custom search / interpreter string. I may call it nettle for short. It will not use Lynx and be essentially very simple, using only re and url lib modules.

It will use a walking pool of terms and adjustable bait. The pool walks over the text or markup while the bait is varied. Another pool can also be used as bait. Results show up automatically in the terminal. Nettle will also scrape eBook files for their HTML and maybe XML files too like DocX. Tonight, I will be coding just a little of it as I have 12 more days to finish.
 
11am 4/9 netLang morphs again, into a script embedded in HTML / other ML formats. I am using Antlr4 to generate the parser and lexer etc. It's much more fun than making yet another browser or search tool.

1pm 4/9 more or less figured out Antlr4 and how it works with python by reading examples. But the design of nettle is incomplete still. It uses 4 keywords: enter, exit, goto, and style. They go between tags in comment form. For example:

<a href=“xxx”>some link<!— enter style navigation —></a>
<a href=“yyy” style=“visibility: hidden;”>other link<!— xxx goto zzz —></a>
<h1 class=“navigation”>zzz<!— exit style hidden —></h1>

Kind of silly example that mangles the html in a loop between a and h1 tags. Need to read more examples to generate the proper grammar.

No comments:

Post a Comment