Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how do you scale prolog apps to say 30 box cluster?

31 views
Skip to first unread message

polymorph self

unread,
Apr 10, 2017, 6:42:00 PM4/10/17
to
can prolog keep a global cluster or grid image?

kint...@gmail.com

unread,
Apr 10, 2017, 10:23:35 PM4/10/17
to
On Monday, April 10, 2017 at 3:42:00 PM UTC-7, polymorph self wrote:
> can prolog keep a global cluster or grid image?

system:maplist(system:write,TEXT) .

That is a complex and engaging suite of topics .
A discussion about prolog is not about what libraries are on offer , what frameowrks or complex architectures are on offer to address these problems .

What prolog does offer is blisteringly fast performance and the perfect representation of serialization state and program structures .
You get this from prolog when you achive the modelling of the situations you want to address .

But you find out fromn prolog that your knowledge is very incomplete , your proposed structures and representations of the process you want to achieve are shoddy and partial at best - you find out that in essence outside of prolog is to throw big things and lots of work at the problem and achieve quite acceptable products .

With prolog you are instead challenged to prune down your expectations , your requirements , drastically increase your understanding , learn to represent the relationships between entities .

But there are a lot of caveats and problems with prolog .
Basically prolog propgrammers are sgtuck trying to figure out how to do rudimentary tasks because it is so damn difficult to work in this the highly restricted set of operational parameters you are foprced to work with when workling with prolog - basically with prolog you get nothing you want , but everything you need , unless you need a big solution that does what you need but never does anything more and never becomes more exciting .

oBelow is something from my archives re: scalable etc prolog applications , feel free tpo ask questions etc :

---
>>> new requests see 404. Basically, my app is down while I pub build

>> I think you could just serve your app from another directory, so that you call pub build, and then have a script to move all the generated files to the served directory. That would fix all this.

> I noted that as a possible solution. But AFAIK even then there'd be some downtime (if we were getting lots of requests) as moving files isn't atomic.


- a complete solution for this requires an implementation in the web server process

- there needs to be a time when both the old version of the application files and the new version of the application files are in place

- at that time the web server can stop serving all files from the old version and start serving all files from the new version

- you can come close to a complete solution without such web server functionality if you use load balancing

- instead of 1 web server process entirely responsible for requests , you have 2 and occasionally 3 web server process

### for this example

1. (1 load balancer) ; a web server process
2. (2 pub serve) ; a web server process
3. (3 pub serve) ; a web server process

- (1 load balancer) has the simple responsibility of handing off requests to some backend web server that it knows about

- (1 load balancer) knows about 2 backends servers, (2 pub serve) and (3 pub serve)

- (1 load balancer) will typically distribute requests to both (2 pub serve)-ACTIVATED and (3 pub serve)-ACTIVATED

- (1 load balancer) will only distribute requests to only (2 pub serve)-ACTIVATED if (3 pub serve)-NONACTIVATED

### deploying a new version of your web site

- the problem of deploying a new version of a website while maintaining uninterrupted service can be addressed if you have a configuration of servers similar to the example above

- when you want to deploy a new version of your application you follow this sequence :

1. use [2 pub serve] make sure it is ON
- status (2 pub serve)-ACTIVATED-OLD (3 pub serve)-ACTIVATED-OLD
2. use [3 pub serve] use `kill server ;`
- status (2 pub serve)-ACTIVATED-OLD (3 pub serve)-NONACTIVATED-OLD
3. use [3 pub serve] use `git pull ;` `pub get ;` `pub build ;`
- status (2 pub serve)-ACTIVATED-OLD (3 pub serve)-NONACTIVATED-UPGRADING
4. use [3 pub serve] use `pub serve ;`
- status (2 pub serve)-ACTIVATED-OLD (3 pub serve)-ACTIVATED-NEW
5. use [2 pub serve] use `kill server ;`
- status (2 pub serve)-NONACTIVATED-OLD (3 pub serve)-ACTIVATED-NEW
6. use [2 pub serve] use `git pull ;` `pub get ;` `pub build ;`
- status (2 pub serve)-NONACTIVATED-UPGRADING (3 pub serve)-ACTIVATED-NEW
7. use [2 pub serve] use `pub serve ;`
- status (2 pub serve)-ACTIVATED-NEW (3 pub serve)-ACTIVATED-NEW
8. use [3 pub serve] use `kill server`
- status (2 pub serve)-ACTIVATED-NEW (3 pub serve)-NONACTIVATED-NEW
- do this only if you do not want to have a (3 pub serve)-ACTIVATED on an ongoing basis

- note that you should minimize the time spent in the state between step 4. and step 5.

- a danger in this scenario occurs during the state described between step 4. and step 5.
- a given session (a session is a single client spanning multiple requests) might get routed to the new version , _and then back to the old version_ on a subsequent request

- if the load balancer uses sticky sessions (requests belonging to a given session are preferentially routed to the backend server used for the previous request) that helps to mitigate and almost eliminate the risk

~~kintalken~~



kint...@gmail.com

unread,
Apr 10, 2017, 10:46:33 PM4/10/17
to
/*
--
--
On Monday, April 10, 2017 at 3:42:00 PM UTC-7, polymorph self wrote:
> can prolog keep a global cluster or grid image?
---
---
*/
.

/*
---
---
here is a perfect prolog project .

- implement the bit torrent protocol
- implete the dht hash of bit torrent
- the dht is the ultimate global cluster messaging system
- i am not sure what you mean by grid image

- use the following structure for all of your funkctors :
*/
.
{
:- op(10'1105,'xfy','&') .
'myname':'ret':'S0','stage':'S':'self':
(__,X,_status_,_stage_,_state_,_self_)
&
'monad':'p'(_self_) ,
'monad':'p'(_state_) ,
'monad':'p'(_stage_) ,
'monad':'p'(_status_) ,
'freex':'p'($X,$EXIT) ,
'parent':'p'(__) ,
$EXIT=
'true' .
}
.
/*
where :
---
*/
.
{
'freex':'p'($X,$EXIT) &
'system':'freeze'($X,$EXIT) .
}
.
/*
---
aside
---
*/
.
{
}
.
/*
---
perhaps mat would like to implement that .

mat a 'monad':'p' is a type copnstraint such that the structure
is a dcg pair encoded like this M=[[_|_]|[_|_][_|_]]=M
where the leftmost of the monad triad is nmd status
where the rightmost of the monad triad is nmd states
where the middlemost of the monad triad is nmd stage
*/
.
{
}
.
/*
whence:
~~kintalken~~
*/
.

kint...@gmail.com

unread,
Apr 11, 2017, 11:44:32 AM4/11/17
to
On Monday, April 10, 2017 at 3:42:00 PM UTC-7, polymorph self wrote:
> can prolog keep a global cluster or grid image?


Herin i will describe how I use prolog ,
and I will describe the general nature of prolog
in the context of considerations
relevant to the general nature
of "server" programs .

a bit of background :
I was once a developer at caucho.com ,
makers of the Resin Enterprise J2EE Web Server ,
extremely high-performant and scalable ,
fully laden with perfect features like load balancing and excellent caching .
I did work on that project for 7 years ,
and was the most senior software engineer ,
next to the chief technology officer ,
who was/is an amazing and talented programmer .

therefore I hope you understand that
I am not talking pout of my ass ,
probably deserve some respeckt ,
no barbs or hard knox , eh ?

a fully blown and scalable web-cluster-capable-server
is not something you want to or need to implement yourself .
many excellent open source packages exist , but in fact
just use Resin it is indeed perfect you get :

- load balancing with sticky sessions
- a session id
- excellent http(s) support
- very versatile and capable url rewriting
- a fast-cgi protocol handler
- a very very good and important "Http-Proxy-Cache"
- the ability to scale indefinately on for example Amazon ElasticCloud .

Now , where does prolog fit in .
This is where prolog fits in , in my opinion .
A prolog server app should only use fast-cgi
to publish communications and receive requests .
everything else is a waste of time .
prolog programmers , do not waste your time
trying to figure out sockets and shit ,
or handle a multifarious load of bizarro protocols .
just use fast cgi .

now , what is the operation of a fast-cgi enabled prolog server like ?
prolog starts up and it starts fast cgi .
fast cgi is trigerred to enable a custom function to respond to an incoming request .
the custom function receives a stream of incoming events from fast-cgi
those events might include some protocol system stuff like headers at the beginning ,
but it soon devolves into a stream of unicode characters .

for the following i will speak somewhat theoretically and inacurrately ,
because more likely to be understood ,
for example i will talk through the lifecycle of this process ,
as if prolog reads all the input from the request into a big memory before and then prcesses the results .
in fact the difference is that prolog actually "processes" on an ongoing basis ,
basically every unicode charcter received on the input triggers a chain reaction ,
but for simplicity let us pretend the process is NOT asynchronous but rather SYNCHRONOUS ;

prolog inputs each unicode character ,
and thus obtains the set of all input characters ,
which does represent the full consumption then ,
by the prolog server program of the request .

prolog now has a representation of the full body of the request and that full
body is via krow nomenklatur called the "CST" and/or "the State" .

prolog will now make a xform of the CST into a different form .
CST mnz "Concrete Syntax Tree" .
the very first step performed by a well-intentioned prolog program ,
is to create "a term data strukctur" .
The term data strukture is basically a binary array of bytes .
However it has two additional properties .
First of all , it understood by prolog to be an infinitely nestable
sequence of function calls . All data is represented concretely by the names
of functions and their arguments have direct byte representations packed right
into them .
Such a struktur is again via krow nomenklatur "a AST" .
The term struktur of prolog is ingenius . It allows prolog to easily represent all programming representations and data strukturs
as a set of simple functions with hardened arity .
It can represent any complex data struktur - maps , vectros , multi-dimensional arrays , numbers etc .
Furthermore many prolog impl add indexing to these data functions such that
subsequent processing that analyzes the data struklturs is very efficient . In
my opinion prolog has this basic pipeline of reading in a data stream (the CST)
and producing from it an in-memory struktured representation of it (the AST)
nearly perfected and every other system/language is laughably and woefully
complicated and unsophisticated . what other languages have in regards to
prolog is more stuff , more libraries , more frameworks , more semantic maps
aka "library api" that help you learn to navigate the complexities of software
representations of machine activity .
prolog gives you a VERY MINIMAL KIT but what it does give hyou is really
excellent and really simple , unless you complicate it .

I described the process of reading/inputting "the CST 'State'" from the fast-cgi input , which is connected to the server (i.e. Resin) and thus the http=proxy pass-through-cache and on through the load balancer out out to the internet and down to the client .
The client is anything really , typically for example a javascript client or whatever .
now wise prolog ppgrammerz but not the dead ones insist that their client
consume their server services in the term data strukltur format . offload the
work of conversion to other stupid and limited text-transmission protocols like
json or even worse the bullshit of google protocol buffers .

now a good secret of prolog is that the term data struktur just described is
exactly what they type in when they create prolog prograqms and interact
with a prolog system .

the wise but not dead prolog pogrammer simply executes the AST term struktur ,
whioch is really just a highly optimized and efficient nesting of
straightforward function calls , as if it was a source file .

many are the men and also it happened to 27 woman that they freak out at this point and think that they have to make some kind of limited bottleneck that protects them from the evil nefarious potentialities of "nonparsable data" or even worse "din't know that was parsable much less could blow out my hard drive like that " -
you have to let go of all such concerns and considerations and pretend that you
are SAFE SAFE SAFE and you just pipe everything you receiove into prolog the
same as a program .

you let your prolog impl vendor tell you how to create a "sandbox" so that nothing nefarious can be achived .

Now briefly I want to skip ahead to the end of the process :

At some point the flow of programming logic will bring about the time for a
reponse to be sent back to the client , the straightforward path is to do the
exact reverse of the input , in the input the CST State was a bunch of numbers
and it wuz xform`d into an AST suite of function calls : now the reverse occurs
and the "status" AST suite of function calls becomes the "state" CST .

Now it is not exactly true that this happens as described , what was deskcribed
is the pragmatic end result - what really happens is that the good prolog
program maintains an absolutely perfect correspondence between the AST and the CST at all times .

It has not been mentioned yet but the AST might change , even on an ongoing basis .
Now it is true that the AST is explosiv compared to the CST , it is an
expansion of the CST data into a more elaboratly sophisticated (but equally
efficient) suite of function calls , and it can and does branch off into
further elaborations of the AST that no longer correspond directly with the CST
.
In fact the development of the AST is like the unfurling of a multifudious
flower wheras the CST is the seed .
But consider that with CST as source a sort of pressur has pushed out and
expanded into the AST and caused it's expansion in the computers memory and so
on - the AST was formed by pressur from the CST , can the pressur be now
applied by the AST into the CST , can the process be reversed ?

There is use of the terms "pressur" and "flow" , by what are they anlgous to in
the prolog program ? All prolog strukturs are modelled by a sequnce of
operand-operator-operand and/or {very rarely , operand-operator units) , the
"operand" is a noun and it is some data such as a number or a word or a
"function body" etc , the "operator" is a verb and it is a logickal connective .
the logickal connectiv has a specific character and performance , the
operators/logickal:connectives is/are the basic building block that the
pogrammer has used .

it is an achievment of prolog ONLY to have made the following even a potential
topick of conversation :

The CST flows through to the AST which expands ,
now consisder the reverse by which the AST flows through to the CST ,
is it possible ?

Is the "map" or "graph-system-of-explorations" that is our program
representation : able to provide the reversal of the flow initially
established via a **process** described as a one-way transformation ?
What if the process of transformation :
- has kept no viable record of mementos describing the steps it perfromed
- - has created a semantic map of execution pathways out of "operator" and
- - "function call" units that in their unit persona have no defined semantic for
- - what will hapen if the function is asked to perform the reverse for the AST of
- - what it did for the CST .

The notion is laughable by that description olone , and Just(Maybe(ThisWontHelpLiebnizOneBit_)) .
Only in Prolog is this achievement possible or even conceivable by simple or complex understanding .

Now, for further description ,

it is true that the input is read from fast-cgi :
{ CST <= fast-cgi }
it is true that the CST becomes the AST :
{ AST <= CST }
is it true that the AST becomes the CST ?
{ AST => CST ? }
it is true that the AST becomes the MST :
{ AST => MST }
it is true that the CST became the MST :
{ MST <= CST }
it is true that the MST is a commonly held middle state :
{ AST <= MST <= CST }
{ AST => MST => CST }
therfor when we asked (above) : is it true that the AST becomes the CST ?
{ AST => CST ? }
now we can answer that it is true :
{ AST => CST }

If we want to achieve this bi-directional capable flow ,
then we must maintain a middle state ,
and our process must establish and maintain the property of :
: jargon : | "monotonicity" | : jargon : .
what does ":monotonicity:" require ?
it requires that very every step of the process taken ,
in the transformation of the CST into the AST ,
and note that each "step" is merely the application of a function ,
the application of a "function" upon two (or one) "arguments" ,
also understood as the application of an "operator" upon two "operands" ,
also understood as the application of an "logikcal konnektiv" upon two "variables" ,
also understood as the application of an "xform" from an input/AST to an output/CST " ,
also understood as the application of an "formx" from an input/AST to an output/CST " ,

a special technique called the trackers derived trail of monotonic state xformx events ,
which because we use prolog and we all love Markus Triska we are able to enact via this scheme :
whereby for each occurence of a step which by our desire must be monotonic and thus reversable .
we mark each such event with a prior mu and a next mu ,
and the mu is imagined to someday be a number ,
but for now is a potential number not yet reified into a real integer ,
and for now is a potential number upon which have been placed restrictions ,
restrictions which limit the potential number the mu may become ,
such limits being modelled as mathematical quantity-based relationships ,
between the prior mu and the next mu ,
and being quantity-based the mu are restricted to those numbers which occur
in the finite , countable , {monad:spsd:to:mn:"one"} , ordinal ; domain .
For purposes of the MST ,
the {next mu prior} relationship ,
is a relationshipo for two numbers ,
and consider that when gaining from the CST a unit of a unicode character ,
we did thus also gain a thing by which we could relate to as an ordinal number
in a counting based finite domain ,
so we can simply place upon the mu the restriction ,
such that { mu_next - 1 #= mu_prior , mu_next #= mu_prior + 1 }
but at no time has the mu become yet a real actualized value ,
but at any time , having secretly any other mu but then made a request of prolog
with a different a mu , prolog can be asked "if this mu is a twelve , what will
all of the other mu's be ?" and the sekretly held mu wil instantly obtain a real and actualized number
perfectly correspondent now in the real domain because maintained perfectly correspondent
in the domain of constraints ,
and the sequence of all such mu's obtained is the MST ,
and because available via the MST is a sequence of mu ,
also associatable is any other ad-hoc data structure ,
the data structure associated to the mu because containing it ,
is now a data structur that can participate in sequence of such data structur ,
and perfectly bi-directionality of analysis and reconstruction is therby enabled ,
and though what just described is mighty and wonderful ,
is perhaps overwhelming described if too prematurely is it broached ,
the cpability that we can derive branches and alternativ scenarios of such state ,
for now let us keep the conception of a giant byte vectro as a 1xN sequence line
of data events , the CST (remeber) being simply a sequence of unicode numbers ,
the CST is a noun , the CST is NON stateful to itself it is STATELESS to itself
but by the MST and the AST is to be called "the state" because the them a static and unchangic
"tonic" identity .
the MST is an intervening process ,
notably capable of reaching decisions ,
notably capable of performming logick-driven analysis of the data flowing from the CST ,
notably capable of using the mu to maintain a monotonically viable representation of sequence for itself ,
thus no longer stateless such as the CST but rather now stateful ,
able to also thus maintain a vectro of any kind of data it chooses ,
such that the monotonic sequence of the vectro is in bi-directional correspondence ,
with the monotonic sequence of the mu ,
and the vectro may contain any elements in addition to the mu ,
such elements being essentially byte vectro at their most fundamental ,
the CST now conceivable as a byte vectro that grows ,
the MST now conceivable as a byte vectro that grows ,
the MST now holding in some slots of the vectro ,
a mysterious mu ,
and the MST now being driven through a prgressive moving sequence ,
driven by the sequence of the mu ultimately rooted to the correspondence with
an element of the CST vectro ,
able to construct an AST ,
able to construct because able to reproduce as AST a byte vectro ,
a stateful byte vectro fashioned in the same manner as itself ,
with the nature of statefulness and bi-directionality and of being monotically sound ,
and now know that the MST is able to construct an AST in a specially recognized fashion ,
such that the construction of the AST triggers built-in by-the-prolog-system-made-avaiable-commands ,
the full suite of those which are necessary being completely and excellently described in the iso-prolog specification ,
and by the attentiv and wise and perhaps in some ways beginning to become aliv
prolog programmer easily recognized as the full set of "library" and "api"
functionality they should ALLOW themselves to dabble with ,
perhaps DEC-10 prolog was excessiv in some ways ,
the goal of the prolog programmer being most usually the establishment of a minimal kit ,
by which they accomplish all things ,
this minimal kit now providing them the ability to drive the process of
Stateful AST creation and system command execution from the sequence of bytes
represented in the Stateless CST as mediated by the Stateful MST .
And notice that the MST is active ,
in contrast to the CST which is very passiv ,
also the AST is passiv ,
but the AST is semi-activ ,
because able to become activated into system commands ,
and because { AST is passiv , MST is activ , CST is passiv } ,
is aking to { noun verb noun }
is akin to { operand verb operand }
is insight as {new verb old}
is { (AST allfor MST) allfor (MST (allfor CST)) }
nd is completely fully described now ,
though the above description lacking a consideration ,
such consideration being ,
what about the part of the process whereby the AST does become the CST ?
for example , maybe ask? : is it necessary to establish a cousin to the MST ,
let XST be a theoretical cousin to the MST ,
similar because also an intervener between the AST and the CST ,
maybe ask : then answer , with a claim of monotonicity , and bi-directionality ,
we must enable the AST to become the CST , therefore must we certainly create an XST ?
The answer is that we have already achieved a system of logickal consistency ,
and monotonic sequenc-ability ,
that has established perfect synchronization between the state in the CST and the state in the AST ,
such that any new manifestion from the CST will flow through the MST and expand into the AST ,
such that any activity occurring because modelled in the AST as activity for the system to perform ,
is by association of the mu linked to the correspondent representation of inner state held by the MST ,
and referentially then also by association to the mu within the inner state held by the CST ,
now bound completely to the pattern of the CST ,
the pattern of the CST being its inner state which because the CST is only state it is Stateless and passiv its inner state is the acktual representation of it's body ,
thus the AST is able to trigger an expansion within the inner state of the CST ,
and also the AST is able to trigger the system to provide as response to fast-cgi ,
a portion of the CST which the AST has caused to becomed formed there ,
a portion of the CST whcih now represents the response ,
the response next correspondent to the response via fast-cgi ,
and consider the next part a diversion ,
born from love of TeX ,
but mostthus the AST is able to trigger an expansion within the inner state of the CST ,
and also the AST is able to trigger the system to provide as response to fast-cgi ,
a portion of the CST which the AST has caused to becomed formed there ,
a portion of the CST whcih now represents the response ,
the response next correspondent to the response via fast-cgi ,
and consider e next part a diversion , though illustrativ ,
of the general nature of the { S9<= AST <=> MST <=> CST <= S0 } ,
consider that the heart of weav is the source code for weav ,
and the soul of weav is the source code for TeX ,
the output of tangle is the glorius manifestation ,
of the most cpable computer ppgrammer in human history ,
a man not only obsessed with mathematics and abstract relationships ,
but also fiercely artistic and the creator and sketcher and designer and
implentor of the artistic-work-of-wonder tha is the Computer Modern font on an
lcd screen ,
but also perhaps in love wi predure ,
because ultimately choosing to manifest as his primary target and focus of attention ,
the output of tangle ,
whcih Barb Knox will explain might a contain an := ,
and perhaps? tangle thus providing for us the ultimate description of **process** ,
thus was started the tangle-ast-via-cst krow-game-via-raven was started ,
whereby KeRTeX was used as the canonical source of TeX ,
and the out of Tangle was examined ,
and from which output small constructs where chosen by game participants ,
and asked as problem statements , with accompanying partial (attempts at) answers ,
the goal being to create a prolog construct responsive to :
tangle-ast-via-cst
whereby the mst is the via ,
and the purpose of the mst is is such that ,
it causes the formation of an ast ,
such that { ast(via(cst(ele(p(ele(p(root(_root_,_root_)))))))) }
is a valid phrase for `phrase/3` ,
and the game consists of any/many such phrase ,
which are always funcktors ,
which are always strukture and named the same way ,
which might have different variable names ,
which might have an apendage provided by prolog-typical `:-`
which might have an apendage provided by krow-special `:=`
which might have an apendage provided by krow-special `:~`

which by sample example are demonstrat_d :

{
bark(_1,_2,_3):-(write_canonical(_1,_2,_3),write(.),nl).
barf(_1,_2,_3):-(writeq(_1,_2,_3),write(';'),nl).

ast(via(cst(ele(p(ele(p(root(_root_,_root_)))))))) .
ast(via(cst(ele(p(ele(p(root(_root_,_root_)))))))) := _ETC_ :~ _ETC_ .
ast(via(cst(ele(p(ele(p(root(_root_,_root_)))))))) :~ _ETC .
ast(via(cst(ele(p(ele(p(root(_last_,_prev_)))))))) :- my:foo(_last_,_prev_) .
ast(via(cst(ele(p(ele(p(root(_prev_,_next_)))))))) :- my:bar(_prev_,_next_) .
ast(via(cst(ele(p(ele(p(root(_ast_,_cst_)))))))) :- my:baz(_ast_,_cst_) .
ast(via(cst(ele(p(ele(p(root(_all_,_for_)))))))) :- my:qux(_all_,_for_) .
ast(via(cst(ele(p(ele(p(root(_mst_,_cst_)))))))) :- my:sht(_mst_,_cst_) , my:th(_mst_,_ast_) , my:barf(_cst_,_mst_,_ast_) .
ast(via(cst(ele(p(ele(p(root(_ast_,_mst_)))))))) :- my:twx(_ast_,_cst_) .
ast(via(cst(ele(p(ele(p(root(_ast_,_via_)))))))) :- my:atu(_ast_,_cst_) .
ast(via(cst(ele(p(ele(p(root(_via_,_cst_)))))))) :- my:idu(_ast_,_cst_) .

bark(_1,_2,_3):-(write_canonical(_1,_2,_3),write(.),nl).
barf(_1,_2,_3):-(writeq(_1,_2,_3),write(';'),nl).
}

but dcg operaor --> "is never used" <--- oops![_|..].dif(..,[]),dif(..,[|])).

and now let us go to our server-oriented proicess ,
which did first initialiaze a prolog system with application/\module source code ,
simply using { ['file:foo.en_CA.ko.P'] } to load the source file(s) ,
which did second establish an incoming client request from fast-cgi ,
or perhaps just did more simply receive from stdin via { get_CODE(_code_) }
and then third did contribute to the swipl parser the code via { eval_CODE(_code_) }
the swipl parser then constructing the AST ,
using char_conversion/2 first thus allowing full user kontrol of xform-ation ,
but providing default prolog-style implementation for construction of terms ,
for AST from incoming CST representd as an nonnumbered but numberable sequence of code ,
did also activate perhaps many system commands thus providing the programmer all typical manouevres and data representations ,
and is now immediately available for streaming ,
directly from via ,
via { :- listing , testing } .
this is a complete snapshot of the enitire state of interaction established with your user ,
bound inextricably to a moment in because obtained by setting mu to the system time in milliseconds ,
obtained as a stream on stdout out ,
able to perfectly reconstruct the entire state of prolog now a simple but effectiv virtual machine ,
such a reconstruction simple by pushin into stdin unicode characters ,
with many and various interesting things to be done ,
for example a dump to { system("|xv>"|[FILE]) }
triggered as a cron-like operation ,
ongoing logging of state machine representations , with the ability
to reload these files and reconstrukt and entire state machine legacy ,
this ability critically eliminated by the obtuse and history bound peons who wanted all immediately add this to their prolog systems if the -k option is specified :

goal_expansion((P:-Q),(asserta((P:-Q)))) .

remember that what is actually stored in the memory of the computer ,
is fundamentally something akin to a byte vectro ,
our byte vectro does in the abstract consist of a body containing ,
the 3 byte vectro correspondent to the AST , the MST , the CST ,
if it is laid out by logging snapshots over periods of time ,
upon receiving such logs as input thus now seeking to restabl;ish from the log files the previous state of the machine ,
it must be true that program commands .i.e. | :- | .e.i are asserta such that they reconstruckt the priority of operations as expressed in the log files because more recent is of higher priority ,
it must be true that program data .i.e. | clause without :- | .e.i are assertz by similar consideration ,

you can saave a snapshot of your virtual machine to disk file ,
add it to a local git repository ,
and then push your snapshot up to a git central server .
you can setup your elastic cload instance to regularly poll your git central distribution and pul down updates, which are just canonical terms , produced via `bark(_term_)` which dumps them to stdin , reingested as source code from local git repository , instantaneus updates of all machione states by simple transferral of text files ,

I want to tell to tell you about an exciting part of this that is very exciting
but first I must immediately fix the example I gave of the MONOT00NE I
foolishing said it must be { PREV #= LAST + 1 }
or some other such follishness that was a critical mystakce it mUzt B3 :
{ MONOT00NE #>= SYSTEM_TIME_AS_MILLISECONDS }
and it cannot use #> because then there will not have
been the establishment for a place that is 'equality' .

Okay to tell you the exciting part guaranteed it will probably mean
I am going to teach you something and I know you are very sensitiv to being acted upon in a tacherly way ,
well the baby boomers did tha ta us to so lets see if we
can have a little space wher I getta us to to be
a respected teacher and I don't don't have to be a fucking strucktExchange
"expert" doling out my desir to share into the long term asset-gaining-from-my
work plan of a site tha lets see if we can have a little space wher I getta us
feeling like I gotta be perfect in every rsponse or assholes will jump all over me
with surprisingly effect v insinuations ,

anyways i digrss : the point is lets learn about how prolog is able to
generate for you branches aka alteratives of the state of your virtual machine
coexisting peacefully but provinding orthagonal reprsentations of (for example) :

- states of possibe progrssion waiting upon input conditions
- historical states of session-data from previous user interactions
- hisorical logs of real failures thve ocurrd in the past
- branches of possibility rooted in a singular state representaive of the "root" ,
with diversions emergent from computations performed as consequence of systems of analysis
that predict user behaviour that will occur 5 seconds into the future ,
that jointly and in thread-parallel assess the the perdict for success obtained by simple metric and
then correlate that with signals to the predict that modify the predict behaviour

- 3 alternative scenarios of layout that provide the user 3 options for the layout of a svg-based (wise choice!) image that you are updating with your response by completely replacing the contents of document.textContents with a minimal html file containing embedded javascript representing direct dom manipulation cpommands that render your svg (modelled in your AST as nested functions , remember) directly by using { document.createElement($ELE) } .

To explain this behaviour let me explain the behaviour of an (idealized) simple prolog system , again from the start :

we start again with receipt of the application and module sopurce code ,
our application source came from a file which is/was a vectro of byte so ,
again we load a cst that is a user request in as if it was source code ,
it within our prolog system is actually just a staic vectro , a CST , with no mutable state , it is statless .
also within our program is a statless CST representing the user request ,
the MST is implemented using the :- operator
it has the general form :

{
system:asserta(P,Q) :- true,system:asserta((A:-)) .

GOAL_TRAP_PATTERN :- STATEMENTS_THAT_ELABORATE_GOAL_TRAP_PATTERN=A,GOAL_TRAP_PATTERN=B,A=(system:asserta(B,A),system:asserta(A,B)) .

system:asserta(P,Q) :- false,system:asserta((A:-)) .
{

It's really a simple system ,
our term structure is our program commands is also all of our memory based data ,
it consists of named functions with a hardened list of arguments with concrete arity ,
which is to say very simple and rebustly structured ,
everything uses the [prolog unicode-text based representation of primitiv data] , numbers and strings and so on ,
and let me tell you [prolog has the very best parsing rules for all the babylonian texts of the human world ,
and for recognizing such primitivs the prolog rules are min-boggling ingenius .
the net result of the excellence of the base grammar protocol of prolog ,
is a data representation that is ultr-efficient in coinsideration of size ,
the one caveat being that numbers are represented as text , so large blobs that
are essentially unparsable as any kind of text are best stored distinctly and
directly into to prolog memory datase as a single term with arity equivalent to
the 16-bit packing of the blob .


With such a description above of an amazing system ,
which is a true desription for any prolog system as capab;le as DEC-10 prolog ,
you might ask why is prolog relegated to the backwaters ,
used by laughabkly few ,
understood by relatively none ,
responsible for a disaster in japan ,
... ?

our cst expands into our ast , and as described is a stic representation ,
able to manifest from the cst via the mst in forms thta trigger system commands ,
and entirely encoded as a byute vectro of 16-bit code values .

now let us consider the second of the five most essential essential prolog special sequences of codes :

ignore(
call(
,
;
.

it is `call(` .
prolog when first transferring src into memory xforms the codes into a term structure , which is m0ostly just a rearrangement of codes into the nested function structures herin described ,
now many perhaps most of the nested function structures are no funtions in so much as they return a value , because all of their values are "ground" which means "siolidifed" and also "not-a-variable-with-an-'javascript:undefined,c++void'-in-its-value-slot" .
in a sense , these ground functions (which have only a claus head and not a claus body of statements , for what could statements do with no arguments to act on that are variable ?) ... these ground functions which are "data" or "hard-core-fakts" are in a sense like functions because they can be queried for with pattern matching , there are many good examples of simple prolog data assertions and query retrievals on the internet .
the basic lowdown is that if you have a fackt of a certain structure, nested function names , arguemnts - if you query for an exact match with one of these fackts then the prolog query will be true if there is a fackt that matches in all ways but false otherwise. now you can put something called a "variable" into one or more of the spots of the function arguments . In this way you can descend somewhat into a stRukture and then put a variable in an argument place , perhaps an argument place tht is fiulled with a deeper complex structure , now available by name as a variable and usable in programming tasks .

A variable (naively described) is recognized in source files because surround by `_` codes the `_` code is kulled "'the Flat'" .

for example

{

data(base(fact(recent(barf(sysmillis,barf(bucket(puke(true),bile(true)))))))) .

Now succeed query :

query ,
[
data(base(fact(recent(barf(_ysmilli_,_ar_))))) ;
]
-->
(
data(base(fact(recent(barf(_ysmilli_,_ar_))))) ;
) ,
{
system(shout(demo(ms(_ysmilli_,_ar_)))) ;
} .

Now fail query because every single code that is a name in the strukture must match :

query ,
[
]
-->
(
data(base(fact(recQQQ(barf(_ysmilli_,_ar_))))) ;
) ,
{
system(shout(demo(ms(_ysmilli_,_ar_)))) ;
} .

Now succeed query , perhaps surpisingly because some code(s) DID change , but they were in variable names , which don't have to match , a vriable will match any concrete thing .:

query ,
[
data(base(fact(recent(barf(_,_))))) ;
]
-->
(
data(base(FACT(recent(barf(_WHOA_THIS_NAME_IS_TOO_LOING_FOR_THE_OLDTIMERS_,_ar_))))) ;
) ,
{
system(shout(demo(ms(_ysmilli_,_ar_)))) ;
} .

what is hapening here , how do these variables work ?

a variable represents a chunk of data tha is a small piece byte vectro thaFACs the program .
a variable has a left edge and a right edge , and edge is defined as the 0.5 space between 2 code spaces ,
the semantics of the variable needing a position is such that conceptually the number of spots for codes is doubled for in equal measure do they become correspondent to edge spots now available foto variables ,
to variables the edge spot is just a straightforward integer ordinal number that identifies the edge of a slot in the byte vectro ,
the variable having a left adge has between them a span and indead the span of the variable is such that it encompases the two `_` flat that mark its edges and also everything in between them ,
starting in this state the variable has a representation of value that is the same as its representation as name , therfore it is as if having no variable , called a \+ nonvar state/\undefined/\void\/null\/nil\/[|] .
a variable without a value has a special property , if it is pattern matched against another thing then the variable will grow a span larger or smaller than it's own span , beyond the edge of a thing is found when the edge is found a punctuation mark/\control character .
as soon as this occurs with a variable the computer algorithm performing this activity described (called "the backtracker") notes the change in variable state , and takes a snapshot of the state of all possible variables and remebers the ocurrence as an event ocurring within a monotanically constrained sequence .
this is a minimal operation and can be very efficient , for example my prolog impl i am owrking on does a copy-on-write copy of the vectro buffer , and subsequently represents state changes the byte vectro akin to a "piece table" - in any case now we have a continuum of changing variable state , where the universe of all known variables is now known to have changed in one monotonic step into a different universe of akl possible variables different because different by difference of one variable from its previous state - in this way please imagine that your term strukture is like a giant spider web that you can explore as a surface phenona , and can descend into at will , and can mark with spots that are variables . the variables w(while still in a varyable status and not ground to a concrete primitiv value)w are like a marker system whereby each marker indicates a spot of open possibilites -
now when you do a query with a strukture having an open possibility in a spot because in that spot in the query having a variable , the backtracker when dpoing for you the search indicated by your query if it finds a fackt with a concrete value in that spot will now create a snapshot point for the state of the universe ,
but now this is where it gets exciting , the backtracker could find 2 fackts that match your query , remeber that you had a variable spot and the backtracker does not naively just put the first fackt in there , thus causing the variable the be ground with primitiv data ; in fact the bactracker explores all the possibilities so it creates branches of the universe correspondent with the succesive use of each value found as an alternative value for the variable .
In this way prolog explores branches and maintains a complex graph of open variables and the alternativs that are found as values now tried each in turn as the value of the variable .
Now a function is an extended version of a fackt , a function has a head which is really just a fakt as such described ,
but a function is different such that :
it can aspecify a variable in an argument slot in it's head when it is defined , and then in it's body it can check that variable against a list of alternatives known woithin it's body - basically the use of the variable has reversed direction instead of in first description above wherin the query had the variable and the fackt or fackts had the concrete value , now the function head has the variable so the query must have the value when it matches ,
a query internally might only have recognition of a particular value in the argument variable ,
or it might have 2 or more alternativ values for the variable ,
in which case the backtracker behaves as described before and creates branches of possibilty correspondent to the ongoing continuum of the state of all variable values ,
a function is also different in that it can optionally return an (implicit) false , which means that it rejects the current state of the variables as invalid ,
a function can return an implcit true which means it is satisified that what it knows of the arguments satisfy its requirement for validity vis a vie its evaluation of the state of the variables .
a function can also modify attributes on the variable , attributes do not chnage the value of the variable rather they are executable statements that the prolog system executes in correspondence to variable events , at this time via activation of those hooks the variable attributes can respond to variable events , perhaps for example monitoring for the ocurrence of forbidden values within a variable and thus the attribute responds by declaring the current state of variables as false ,'

Anyways that was a long rant i really enjoyed creating it's nice to see my ideas come together and gain reality as a practically enjoyable solidification of nascent ideas into an excellent form .

I hope this gives you a good overview of how prolog ideally slots into a server-farm scenario in tthe role of being a slave-daemon responsive to fast-cgi-demarcated responses and request .

Pklease do not concern yourself with idiotic panderings about "performance" or "apis" or "AngularJS - more complicated than the dom event model by 47 times , yet more popular than tomatoes in your soup" .

Prolog is abpout helping humanity find a way to represent it's notions about the viabilit of it's abstract schemes of logickal reasing a way to represent those notions in the more solidified form engendered my the encounter of the logic and its expectations weaknesses and contradictory incompatibilities within its own system but hidden by its (admitted weakness) at discovery its own problem areas .... prolog forces the programmer to work with the reconciliation of those abstract modalities with the real outcome and performance of a good computer prgrammer , something very difficult to achieve by prolog programmers perhaps because somehhat stymied dumbfounded and foolish in the face of being shown how little we understand about process and the actual requirements of flow and the mainttanence of valid data strucktures reconstrucktable as bi-directional and wholly succesful representations of those real processes and the real steps needed in order to achieve them .

~~kintalken~~

polymorph self

unread,
Apr 11, 2017, 11:40:00 PM4/11/17
to
I find no peace from your answer.

kint...@gmail.com

unread,
Apr 12, 2017, 7:29:37 AM4/12/17
to
> I find no peace from your answer.

That does not mean that peace is unavailable to you ,
nor does it mean that I am now responsible for having harmed you ,
by causing for you a state of non[peacefulness ,
because I think by reasonable consideration with reference to conventional expectations ,
it would be unfair and unjust to imply or explcitly state that the dokument i gave above ,
should be accepted as some kind of evil which is now found to be guilty of the krime of having made you nonpeaceful ,
furthermore by tour statement (now seeming akusation) your komplaint is that you did not find what you are lokking for ,
and now me having expended all of that effort and hoping from the world at least perhaps someday some dim good feeling or outcome demonstrating to me that yes , indeed , my efforts are wiorthwhile
- you would like to deliver to me your "chagrin" or your "dissapointment" , as if my failure , implied by you to be my failur to bring peace to a sitation ,
this is what you want , i am your servant and i have failed to provsiion the answer you wanted ?
so i have failed you and you are ready to discard me after delivering insult ?

Thanks !

~~kintalken~~

polymorph self

unread,
Apr 21, 2017, 12:07:56 AM4/21/17
to
If you have an answer, lets have it.
Don't babble incoherently.
You only appear weird.
Get a life.
These are real questions by working engineers considering prolog.
Don't spread FUD.
If you don't know, then shut up.
0 new messages