The new bug introduced by the new Default architecture. The console loop really needs prohibited chars from names, but that list grows large. o what about the dots and dashes in file names? Hmmm... Now I am back to ponder.
Somethings I know, everyone will want the dot as part of a name file or variable, no problem there. Separating the dot is optional, and default is that is dots are parts of names. I would prefer leaving slashes out of the picture; and I hat quotes especially when filenames are considered self quoting.
Still pondering. On the command line, file names are first class objects, don't need quoting. Inthe syntax engines they are always quoted. So in default mode, Derfault would treat:
ls /home
as ls divided by home, and attempt that. IPython has similar problems,. trying to embed a syntax into thee command line. I am thinking a smart tokenizer, one that knows when to tokenize the filename and when to not.
Tokenize rule
All the new apps will follow the standard tokenizer rule on this, they want their arguments in neat linear arrays. yntacengines andgeneral purpose tokenizers can cooperatel, via tokenizer control words and some common sense.
This violation I remember well:
gcc -fmax-erros=4 ./myfile.c
That cause an equals to appear before the file name in a sequence, to difficult for tokenizer. Note the dash is another problem. The distinguisher is the equals sign, if both engines and snippets could at least start there, leave out the equals unless you really mean it.
The other healer is the syntax mode the console lop is in because syntax engines can load tokenizer controls, or turn it off. But if the syntax engines shut tokenizer off, then we get a host of complaints from snippet authors. We need an intelligent method so filenames are always first class, without conflict.
A problem, not a sow stopper and we can attack it little by little as it becomes a problem. Default says the tokenizer can use the equals flip flop. Tokenizer recognizes start of statement and will, upon seeing the equals, begin tokenizing filenames until end of statement.. Tokenizer agrees, the two bots met, hashed out. That plus whatever tokenizer conrols e can make available.
Wednesday, December 26, 2018
Take Xcharts, for example
I just invented the snippet. It does basic charts in xcb, likely borrowing the Xchars Xcb interface. It can keep at the same a basic, quick level as Xchars, and use Xchars for much of the annotation. Xchars is mostly a string manager, and symbol table. An Xcharts can share the same approach, and they work together but as separate snippets. Add a spread sheet formatter.
Endless opportunity, great productivity enhancement because of the ability to do part of the tasks, a small part, and still add significantly to a project.
Intellignet tokenizer with controls and some consensus oamong syntax developers.
Or..
Make tokenizer dependent on the line completion control. Once we have Xchars, hen we get controls codes, hidden, from the command loop. An up arrow takes you tough the old command list, exclamation means line completion, and a couple of others. These are first character, non echoed controls. We make file tokenizing part of file completion. A comma is nt echoed and turns off file name tokenizing all together. We include some first character controls to modify the argument macro expansions in command lines, which is off by default.
plus syntaxengine overrides.
All three, the aim is to keep filenames as first class objects,otherwise a huge pain.
Naturally, with all syntax engines turned off, we retain the linux filename standard, where filenames are the firstest among equal in use of punctuation marks.
Endless opportunity, great productivity enhancement because of the ability to do part of the tasks, a small part, and still add significantly to a project.
Intellignet tokenizer with controls and some consensus oamong syntax developers.
Or..
Make tokenizer dependent on the line completion control. Once we have Xchars, hen we get controls codes, hidden, from the command loop. An up arrow takes you tough the old command list, exclamation means line completion, and a couple of others. These are first character, non echoed controls. We make file tokenizing part of file completion. A comma is nt echoed and turns off file name tokenizing all together. We include some first character controls to modify the argument macro expansions in command lines, which is off by default.
plus syntaxengine overrides.
All three, the aim is to keep filenames as first class objects,otherwise a huge pain.
Naturally, with all syntax engines turned off, we retain the linux filename standard, where filenames are the firstest among equal in use of punctuation marks.
Who maintains Xchars?
In total, it comes in at 560 lines, without the test code. Add a hundred lines for keyboard and mouse; this is still a snippet. Email it, cut and pasted it pass it round. Just keep it under 800 lines of code, or I will. Keep the universal interface. Add 8 more APIs only to delete stuff and start messages and set controls. The whole idea here is to make add on packages, so the enhancement might be to make a universal graphics buffer based compositor, Wayland compatible, then add on a bunch of various packages, small, just like Xchars. The concept is the users mix and match snippets to make a complete application. They are guided by their powerful enterprise syntax engine.
I keep my loadables in /home/so, and all files have the extension so, nothing more, as in: xchars.so. Then I fire up console loop and load em up. The snippet is small, has no version number in the file name Instead snippet users agree n a version command with standard output that a bot can read. So rather than go fire up the file manager to pickout the name, you might say: module xchars version, and the module built in will execute the command line query. But is is all inside your current address space, you still make the one and only system call, this time t the loadable itself, on disk, as a main(arg,argv) program.
So, in everything, Default, console loop, loadable, snippets, Bus control; kick it upstairs to python, node.js, Golang, Forth,... Stay down and dirty at the bus level generating snippets.
Snippets, an industry
The snippet community agrees to some basics, like version and help commands. Then they break into families of snippets, the group sharing a name space and interactive protocol. The important idea is to recast that args line into useful structures, then build tightly integrated systems by sharing the bindings. Very powerful method to manage large projects with independent developers because of the independence. Any snippet developer can re-purpose their snippets to different semantics via bindings and the Bus. And snippets are fun fun fun, especially when you are in an industry of growing snippet buyers and sellers; very liquid, easy to adapt, and great snippet writers, like trading bot writers, make bucks.
Right now I am debugging a Load error I introduced by specifying /home/so as default. But I will be in console loop tonight, with Xchars and Default both loaded.
I keep my loadables in /home/so, and all files have the extension so, nothing more, as in: xchars.so. Then I fire up console loop and load em up. The snippet is small, has no version number in the file name Instead snippet users agree n a version command with standard output that a bot can read. So rather than go fire up the file manager to pickout the name, you might say: module xchars version, and the module built in will execute the command line query. But is is all inside your current address space, you still make the one and only system call, this time t the loadable itself, on disk, as a main(arg,argv) program.
So, in everything, Default, console loop, loadable, snippets, Bus control; kick it upstairs to python, node.js, Golang, Forth,... Stay down and dirty at the bus level generating snippets.
Snippets, an industry
The snippet community agrees to some basics, like version and help commands. Then they break into families of snippets, the group sharing a name space and interactive protocol. The important idea is to recast that args line into useful structures, then build tightly integrated systems by sharing the bindings. Very powerful method to manage large projects with independent developers because of the independence. Any snippet developer can re-purpose their snippets to different semantics via bindings and the Bus. And snippets are fun fun fun, especially when you are in an industry of growing snippet buyers and sellers; very liquid, easy to adapt, and great snippet writers, like trading bot writers, make bucks.
Right now I am debugging a Load error I introduced by specifying /home/so as default. But I will be in console loop tonight, with Xchars and Default both loaded.
Make a simple clock in xchars
Simple, in string form.
GetConn clock;
GetWin clock win;
GetGC clock gc;
GetRect win gc rect 10 10 60 30;
while(1) {
// Then using the system, get
// the clock put it to a string
str=SysCall time str;
PutStr rect str;
sleep(1);
}
The console loop will support threaded loadables in version 3.. Default should soon be supporting these kinds of simple loops with pass thrus.
At some point the SysCall call arg1 agr2.. will become:
SysCall(cmd,ar1,..);
An enhancement of Default (allowing function arguments) that sooner or later will arrive, by me or someone else.
I try and keep Xchars updates in the file links. It is a fun project, no recursions and lots of flashes. Ultimately we have some great ncurrses games that need porting. I be neglecting Default.
GetConn clock;
GetWin clock win;
GetGC clock gc;
GetRect win gc rect 10 10 60 30;
while(1) {
// Then using the system, get
// the clock put it to a string
str=SysCall time str;
PutStr rect str;
sleep(1);
}
The console loop will support threaded loadables in version 3.. Default should soon be supporting these kinds of simple loops with pass thrus.
At some point the SysCall call arg1 agr2.. will become:
SysCall(cmd,ar1,..);
An enhancement of Default (allowing function arguments) that sooner or later will arrive, by me or someone else.
I try and keep Xchars updates in the file links. It is a fun project, no recursions and lots of flashes. Ultimately we have some great ncurrses games that need porting. I be neglecting Default.
Why is a balanced Huffman tree an optimally packed sphere ?
Principle of maximum entropy computations, Huffman trees are both balanced and optimally quantized over their complete sequence. The distance from root to branch is the same everywhere, to the limits of precision. The queues at each node stable, and optimum (meet spin exclusion actually).
The principle of homomorphic mappings between graph representations at maximum entropy hols. The Huffman graph is configured to compute pi, and we see that this balanced tree operates as close to the maximum second derivative of tanh, the ratio. It meets the hyperbolic differential equation. Go look there, I found Phi, very close to Pi, and down the end or that something close to the fundamental electron uncertainty ratio, representing the longest Huffman path supported before inventory goes to zero along the path.
The theory of everything. I can mix and match semantics form different fields and fit them into sentences formed on congestion theory. All science.
Spin exclusion, for example. At WalMart there are zero or one clerks queued per checkout, but one or two customers. The clerks got spin excluded, spin exclusion is a result of optimally congested queues must have flow (Hawkins) and be asymmetric (sphere packers). So at optimum congest we have only one minimal configuration that mantains flow. Occasionally customer will be first in a line with no clerk. Computational equivalence at maximum entropy, go with that, it leads to TOE.
Here is an example:
(a+b+c) // three vars two adders!
The bots are square rectangular fellows and will say, no, one ar on op; always in pairs. But the corner condition is Huffman encoded, it does not waste a unique, short path through the parse tree. The variables compress the adders, sphere packing. It is in language, grammar is a a queuing problem. If you are quantized, stable, you have asymmetric net flow and turbulence is contained to a constant ratio everywhere.
Sandbox generalizes.
Sandbox traders assume,true, that the uncertainty is bound and set by the activity f current trader bots, in the pits. The spreadsheet function is not so bold as set uncertainty, in general, the market sets that level at the speed of computation in the serializing pit boss. The currency banker is the gold standard, and one can normalize its measured uncertainy to 1.5 sigma, I think, leaving the surplus for re-quatization insurance. But it can run larger currency risk, thus multiplying market uncertainty down the chain.
The principle of homomorphic mappings between graph representations at maximum entropy hols. The Huffman graph is configured to compute pi, and we see that this balanced tree operates as close to the maximum second derivative of tanh, the ratio. It meets the hyperbolic differential equation. Go look there, I found Phi, very close to Pi, and down the end or that something close to the fundamental electron uncertainty ratio, representing the longest Huffman path supported before inventory goes to zero along the path.
The theory of everything. I can mix and match semantics form different fields and fit them into sentences formed on congestion theory. All science.
Spin exclusion, for example. At WalMart there are zero or one clerks queued per checkout, but one or two customers. The clerks got spin excluded, spin exclusion is a result of optimally congested queues must have flow (Hawkins) and be asymmetric (sphere packers). So at optimum congest we have only one minimal configuration that mantains flow. Occasionally customer will be first in a line with no clerk. Computational equivalence at maximum entropy, go with that, it leads to TOE.
Here is an example:
(a+b+c) // three vars two adders!
The bots are square rectangular fellows and will say, no, one ar on op; always in pairs. But the corner condition is Huffman encoded, it does not waste a unique, short path through the parse tree. The variables compress the adders, sphere packing. It is in language, grammar is a a queuing problem. If you are quantized, stable, you have asymmetric net flow and turbulence is contained to a constant ratio everywhere.
Sandbox generalizes.
Sandbox traders assume,true, that the uncertainty is bound and set by the activity f current trader bots, in the pits. The spreadsheet function is not so bold as set uncertainty, in general, the market sets that level at the speed of computation in the serializing pit boss. The currency banker is the gold standard, and one can normalize its measured uncertainy to 1.5 sigma, I think, leaving the surplus for re-quatization insurance. But it can run larger currency risk, thus multiplying market uncertainty down the chain.
Re-entrant stack
I worked this problem, unsuccessfully my first job.
Let us define a protocol on args list.
We have one process filling, another emptying args list from two separate indices, and empty and fill. The args list is assumed infinite until it is not, then the fill thread can safely stop filling. There is a stable initial point where both indices are at zero.
The one never writes index the other. But can one leave its own pointer in an intermediate unstable state? Well, he has to write the updated value of its index in an atomic operation. If that assumption is met, then the emptying process will always seethe fill process incrementing or standing still, before it updates its own index. Thus the empty process will be ale to test its index without error as less than or equal, the stable condition, before updating its index. The filling process never looks at the emptying pointer.
I think this works. I think the Xchars can run is own thread at mouse time and just use a push and pull stack on args list. When Xchars reaches the end of infinite, it stops the messages until restarted. The empty process can execute a restart in its own thread at Xchars, and Xchars will handle the handshake transparently.
In string format we have simple mouse and key messages.
KeyPress code;
PtrClked code x y;
Ican't think of any more, it is either keyboard, mouse; well, touch pad?
Touched x y;
Just pipe those message back to client, xchars provides calls for any shut,restart,echo, etc; Plus simple cursor select and place calls. All this in version 3, unless I find a good snippet already done the job.
Let us define a protocol on args list.
We have one process filling, another emptying args list from two separate indices, and empty and fill. The args list is assumed infinite until it is not, then the fill thread can safely stop filling. There is a stable initial point where both indices are at zero.
The one never writes index the other. But can one leave its own pointer in an intermediate unstable state? Well, he has to write the updated value of its index in an atomic operation. If that assumption is met, then the emptying process will always seethe fill process incrementing or standing still, before it updates its own index. Thus the empty process will be ale to test its index without error as less than or equal, the stable condition, before updating its index. The filling process never looks at the emptying pointer.
I think this works. I think the Xchars can run is own thread at mouse time and just use a push and pull stack on args list. When Xchars reaches the end of infinite, it stops the messages until restarted. The empty process can execute a restart in its own thread at Xchars, and Xchars will handle the handshake transparently.
In string format we have simple mouse and key messages.
KeyPress code;
PtrClked code x y;
Ican't think of any more, it is either keyboard, mouse; well, touch pad?
Touched x y;
Just pipe those message back to client, xchars provides calls for any shut,restart,echo, etc; Plus simple cursor select and place calls. All this in version 3, unless I find a good snippet already done the job.
XChars c bindings
int xchars(int *argc,char * args[]) { // should return NOTFOUND=0 or a non-zero.
// PutStr rect gc string
struct { char *cmd; char * rect;char * string
} *PutStr_ptr;
// NeWin conn win
struct { char *cmd; char * rect;char * string
} *NewWin_ptr;
// NewConn conn win
struct { char *cmd; char * conn;char* win;
} *NewConn_ptr;
// NewGC conn gcname
struct { char *cmd; char * conn;char * gc
} *NewGC_ptr
// SetFont gc font_name
struct { char *cmd; char * gc;char* font_name;
} *SetFont_ptr;
// SetRGB gc for_rgb back_rgb
struct { char *cmd; char * gc;char* fore_digits;char* back_digits;
} *SetRGB_ptr;
// NewRect win gc rect x y width height
struct { char* cmd; char* gc; char* rect;
char* x;char* y;char* width;char* height;
}*NewRect_ptr;
// SetRect rect gc
struct { char* cmd; char* rect; char* gc;
} *SetRect_ptr;
// for example:
SetFont_ptr = (void *) args;
printf("%s %s %s\n",
ptr->cmd,ptr->gc,ptr->wfont_name);
}
OK, this was semi-automated using the look and type method, but it is simple. Use them in the proper order. Notice, the struct pointers are just mapped to args list for use. Thislikely does not exactly compile, but this is the correct c binding approach.
Your basic Xchars API for the window. Later we get Xmice and Xboard. Use SetRect api to associate a rect with another gc. Basically this replaces putchar on the command line to putstr on the box. Everything is null terminated text, names, digit strings. The general rule is, readable names less than eight chars, but string arguments to the screen any length. The front end symbol table isd faster than anything we need, ad small, but really greases the interface.
The mouse events and keyboard events will be equally simple, and there will be a declared call back type. I think when we have mouse then client and xchars will reserve a portion of args list for message passing.
Xchar text files
Not a problem, make a set of line terminated strings in the model above, see in the comments:
NewConn MyConn; // semi colon optional here
NewWin MyConn MyWin;
NewGC MyConn MyGC;
NewRect MyWin MyGC MyRect 10 20 300 200;
PutStr MyRect "Hello World";
Once you have your script use ExecFle file_name; // at the command line
Be sure Xchars was loaded: LoadMod xchar.so; // I think, if I remember
Keep your loadable local. /home/loadables // for example.
Notice the two formats, linux command line text and compiled. The difference between the two is the console loop tokenizer, Default is not involved.
The Xchars symbol table
It will be a balanced tree for most well written scripts. A well written script is Huffman encoded, the script names allocate more char spaces for significant differences between set members. as in:
HeaderGC;
MidTxtGC;
Note, the common group names have shortest character allocation in a name. The simple table will end up sorting on the first part, where character are complex. If the first characters are sufficiently informative, then the symbol tree will be balanced. 32 names becomes a five step hop through the symbol tree, short test and jumps. Putting the fast eight char symbol tables up front of loadables is a good idea. The concept can be extended to 16 char names easily and double your test instruction to two test and jumps.
Making symbols even faster
We need text8 type: `allfitin` // which becomes a long packed with chars. then we have:
struct { text8 cmd; text8 rect; text8 gc } *SetRec_ptr;
Categorizing symbols:
Rare, seldom used symbols cal them nearly the same name:
Rarely000;
Rarely001;
.
This puts all the seldom used ont a separate branch, the informative, rapid fire commands take one step then split the remaining tree amongst themselves. Extreme Huffman encoding, actually the central algorithm for the theory of everything, pure sphere packing.
// PutStr rect gc string
struct { char *cmd; char * rect;char * string
} *PutStr_ptr;
// NeWin conn win
struct { char *cmd; char * rect;char * string
} *NewWin_ptr;
// NewConn conn win
struct { char *cmd; char * conn;char* win;
} *NewConn_ptr;
// NewGC conn gcname
struct { char *cmd; char * conn;char * gc
} *NewGC_ptr
// SetFont gc font_name
struct { char *cmd; char * gc;char* font_name;
} *SetFont_ptr;
// SetRGB gc for_rgb back_rgb
struct { char *cmd; char * gc;char* fore_digits;char* back_digits;
} *SetRGB_ptr;
// NewRect win gc rect x y width height
struct { char* cmd; char* gc; char* rect;
char* x;char* y;char* width;char* height;
}*NewRect_ptr;
// SetRect rect gc
struct { char* cmd; char* rect; char* gc;
} *SetRect_ptr;
// for example:
SetFont_ptr = (void *) args;
printf("%s %s %s\n",
ptr->cmd,ptr->gc,ptr->wfont_name);
}
OK, this was semi-automated using the look and type method, but it is simple. Use them in the proper order. Notice, the struct pointers are just mapped to args list for use. Thislikely does not exactly compile, but this is the correct c binding approach.
Your basic Xchars API for the window. Later we get Xmice and Xboard. Use SetRect api to associate a rect with another gc. Basically this replaces putchar on the command line to putstr on the box. Everything is null terminated text, names, digit strings. The general rule is, readable names less than eight chars, but string arguments to the screen any length. The front end symbol table isd faster than anything we need, ad small, but really greases the interface.
The mouse events and keyboard events will be equally simple, and there will be a declared call back type. I think when we have mouse then client and xchars will reserve a portion of args list for message passing.
Xchar text files
Not a problem, make a set of line terminated strings in the model above, see in the comments:
NewConn MyConn; // semi colon optional here
NewWin MyConn MyWin;
NewGC MyConn MyGC;
NewRect MyWin MyGC MyRect 10 20 300 200;
PutStr MyRect "Hello World";
Once you have your script use ExecFle file_name; // at the command line
Be sure Xchars was loaded: LoadMod xchar.so; // I think, if I remember
Keep your loadable local. /home/loadables // for example.
Notice the two formats, linux command line text and compiled. The difference between the two is the console loop tokenizer, Default is not involved.
The Xchars symbol table
It will be a balanced tree for most well written scripts. A well written script is Huffman encoded, the script names allocate more char spaces for significant differences between set members. as in:
HeaderGC;
MidTxtGC;
Note, the common group names have shortest character allocation in a name. The simple table will end up sorting on the first part, where character are complex. If the first characters are sufficiently informative, then the symbol tree will be balanced. 32 names becomes a five step hop through the symbol tree, short test and jumps. Putting the fast eight char symbol tables up front of loadables is a good idea. The concept can be extended to 16 char names easily and double your test instruction to two test and jumps.
Making symbols even faster
We need text8 type: `allfitin` // which becomes a long packed with chars. then we have:
struct { text8 cmd; text8 rect; text8 gc } *SetRec_ptr;
Categorizing symbols:
Rare, seldom used symbols cal them nearly the same name:
Rarely000;
Rarely001;
.
This puts all the seldom used ont a separate branch, the informative, rapid fire commands take one step then split the remaining tree amongst themselves. Extreme Huffman encoding, actually the central algorithm for the theory of everything, pure sphere packing.
Scheduled, synchronous mark to market
Wells Fargo calculated U.S. defined-benefit pensions fund would need to implement a "giant rebalancing out of bonds and into stocks" - in fact the biggest in history - with the bank estimating roughly $64 billion in equity purchases in the last trading days of the quarter and year, prompting the banks to ask if traders are about to make pension rebalancing "great" again.
Pension funds, like banks, are required to post volatility spikes in the data on a regular basis, like price fixing on an annual basis, about the most idiotic rule invented.
In this case we have the pension funds in large states taking their bear market losses on schedule. They are buying to replenish value lost, and that is an annual requirement. It also means cities in California will be hearing some bad news, officially. All the cities, then synchronously, will report hiring freezes for the near future. But seniors will synchronously enjoy heir cost of living adjustments, as will every other public sector employee.
The cycle is built in, we are required by law to have recessions synchronous to regime change. The method exceeds the bandwidth of the economy, investors get caught and have to retrace some trades, adding a loop to the flow, aliasing we call it, making sidelobes is another name, spinning wheel, snapping the whip, not enough second derivative..
Xchars functional
In test mode the basic operations are working in linux command format. I will hook it up with console loop here in a minute.
Windowing messages do not make sense
Except for mouse and keyboard clicks.
Otherwise I never understood why the graphics package wants to let me know my window is exposed. Is there something out of date in my bit map buffer? How the frig will a graphics co-processor know that?
Wayland does it better. The client knows how accurate is the bit map, let the client signals the graphics processor, the the updated bit map can be exposed when needed.
The mouse clicks make sense for messages. But there is no human punching the screen unless it is touch screen, and touching the screen does not coincide with redrawing it, quite the opposite. The Wayland architecture figured this out, and I guess no one questioned it since the message loop was needed for mouses anyway.
The whole windowing revolution was built around moving bitmaps automatically, which is why you do not need to redraw your bit map whenever it is exposed, you already drew it, so go ahead and expose it, don't tell me. Anyway, I am skipping the message loop. It works for Xchars v2 ,when you put a string, Xchars writes it to bitmap and flushes the message queue. When Xchars does mouse clicks, then Xchars activates the message loop.
The pros will tell me that window draw messages are needed to prevent flicker, when my bit map is not double buffered, the graphics processor needs treat it a bit like shared memory. The event really means just what is says, the window is being moved, and the client requested a warning. This text will not flicker, it will likely be drawn to bit buffer faster than the process timeout.
Otherwise I never understood why the graphics package wants to let me know my window is exposed. Is there something out of date in my bit map buffer? How the frig will a graphics co-processor know that?
Wayland does it better. The client knows how accurate is the bit map, let the client signals the graphics processor, the the updated bit map can be exposed when needed.
The mouse clicks make sense for messages. But there is no human punching the screen unless it is touch screen, and touching the screen does not coincide with redrawing it, quite the opposite. The Wayland architecture figured this out, and I guess no one questioned it since the message loop was needed for mouses anyway.
The whole windowing revolution was built around moving bitmaps automatically, which is why you do not need to redraw your bit map whenever it is exposed, you already drew it, so go ahead and expose it, don't tell me. Anyway, I am skipping the message loop. It works for Xchars v2 ,when you put a string, Xchars writes it to bitmap and flushes the message queue. When Xchars does mouse clicks, then Xchars activates the message loop.
The pros will tell me that window draw messages are needed to prevent flicker, when my bit map is not double buffered, the graphics processor needs treat it a bit like shared memory. The event really means just what is says, the window is being moved, and the client requested a warning. This text will not flicker, it will likely be drawn to bit buffer faster than the process timeout.
Subscribe to:
Posts (Atom)