zippy / ceptr Goto Github PK
View Code? Open in Web Editor NEW(a recomposable medium for distributed social computing) || (semantic self-describing protocol stacks)
Home Page: http://ceptr.org
License: GNU General Public License v3.0
(a recomposable medium for distributed social computing) || (semantic self-describing protocol stacks)
Home Page: http://ceptr.org
License: GNU General Public License v3.0
Document the naming prefixes in the C code and make sure it's visible in the Doxygen output
currently we declare receptor symbols in the vmhost. But, the receptor itself is stored as a semtree of that type in Receptor.root structure, which means that if you try to print it out using: _td(r,r->root) the type will be unknown (since the defs in r, don't include the symbol that is r). i.e. the receptor can't be defined in it's own context can it?
The whole way we handle encapsulating a receptor for storage as well as it's structure/semantic type seems shaky and need re-evaluating, including how we currently use INSTALLED_RECEPTOR as the receptor's "type" bleah.
This is a feature/use-case that requires integration of a bunch of issues.
We'll start with two commands: time & receptors, the first just gets the time from the clock receptor and sends a text representation to the stdout receptor, the second sends a text representation of the receptors to the stdout receptor kind of like unix ps
The intentions here are:
When you plant a listener you also need to be able to include a expiration condition to specify when to stop listening, i.e. after a time period, after a number responses, until some threshold, etc.
Initial accounting via microseconds for process end less process start. This becomes a means to stop runaway processes or ones that are taking too much overhead. It can also provide our hooks for an initial activation energy currency (akin to ether in Etherium).
I attempted to get it building on a mac with this set of changes:
thosmos@ce84d6f
But I'm still getting this set of build issues:
➜ ceptr git:(master) make
rm -rf ceptr_specs .o ceptr_spec.dSYM
gcc -pthread -g -o ceptr_specs spec/.c src/*.c
In file included from spec/ceptr_specs.c:15:
In file included from spec/tree_spec.h:9:
spec/http_example.h:496:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
In file included from spec/ceptr_specs.c:21:
spec/process_spec.h:292:5: warning: implicit declaration of function '_p_free_context' is invalid in C99
[-Wimplicit-function-declaration]
_p_free_context(c);
^
In file included from spec/ceptr_specs.c:26:
spec/profile_example.h:153:5: warning: implicit declaration of function '_visdump' is invalid in C99 [-Wimplicit-function-declaration]
_visdump(&test_profile_defs,_t_child(r,1),pt);
^
3 warnings generated.
src/process.c:381:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
src/process.c:694:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
_p_free_elements(Qe *e) {
^~~~~~~~~~~~~~~~
src/process.c:696:9: warning: implicit declaration of function '_p_free_context' is invalid in C99 [-Wimplicit-function-declaration]
_p_free_context(e->context);
^
src/process.c:701:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
src/process.c:704:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
_p_free_context(R *c) {
^~~~~~~~~~~~~~~
src/process.c:715:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
src/process.c:755:18: warning: incompatible integer to pointer conversion passing 'int' to parameter of type 'void *' [-Wint-conversion]
pthread_exit(err);
^~~
/usr/include/pthread.h:320:25: note: passing argument to parameter here
void pthread_exit(void *) __dead2;
^
7 warnings generated.
src/receptor.c:457:13: warning: implicit declaration of function '_p_interpolate_from_match' is invalid in C99
[-Wimplicit-function-declaration]
_p_interpolate_from_match(params,m,signal_contents);
^
1 warning generated.
./ceptr_specs
Running all tests...
..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................Can't open output file test/test.instances!
make: *** [specs] Interrupt: 2
When sending a signal that would result in a long-term listener being planted, the PENDING_RESPONSE needs to be
I think the way this needs to work is that signals that expect persistent listeners should add a bit of extra code on the stack (or some place, like some other process handler?) that waits for an initial response that accepts or declines the persistent request and if accepted says for how long it will actually honor that request for.
This also means giving some tools to programmers on the receiving end for sending back such honoring/declining signals in protocols that do long term listening
This became necessary to really handle elapsed time in the RECEPTOR_STATE symbol. (see #37)
Topaz:ceptr thomas$ make
rm -rf ceptr_specs .o ceptr_spec.dSYM
gcc -pthread -g -o ceptr_specs spec/.c src/*.c
In file included from spec/ceptr_specs.c:18:
spec/semtrex_spec.h:168:31: warning: too many arguments in call to '_makeTestSemtrex1'
T *s = _makeTestSemtrex1(t);
~~~~~~~~~~~~~~~~~ ^
In file included from spec/ceptr_specs.c:19:
spec/receptor_spec.h:146:26: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
spec_is_true(matched = _t_matchr(req,signal_contents,&result));
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
spec/test_framework.h:22:42: note: expanded from macro 'spec_is_true'
^
spec/receptor_spec.h:146:26: note: place parentheses around the assignment to silence this warning
spec_is_true(matched = _t_matchr(req,signal_contents,&result));
^
(
spec/test_framework.h:22:42: note: expanded from macro 'spec_is_true'
^
spec/receptor_spec.h:146:26: note: use '==' to turn this assignment into an equality comparison
spec_is_true(matched = _t_matchr(req,signal_contents,&result));
^
==
spec/test_framework.h:22:42: note: expanded from macro 'spec_is_true'
^
spec/ceptr_specs.c:32:13: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (err = setjmp(G_err)) {
~~~~^~~~~~~~~~~~~~~
spec/ceptr_specs.c:32:13: note: place parentheses around the assignment to silence this warning
if (err = setjmp(G_err)) {
^
( )
spec/ceptr_specs.c:32:13: note: use '==' to turn this assignment into an equality comparison
if (err = setjmp(G_err)) {
^
==
spec/ceptr_specs.c:36:2: warning: implicit declaration of function 'def_sys' is invalid in C99 [-Wimplicit-function-declaration]
def_sys();
^
spec/ceptr_specs.c:47:2: warning: implicit declaration of function 'sys_free' is invalid in C99 [-Wimplicit-function-declaration]
sys_free();
^
5 warnings generated.
src/def.c:249:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
1 warning generated.
src/process.c:108:25: error: non-void function '__p_reduce' should return a value [-Wreturn-type]
if (!is_process(s)) return;
^
1 error generated.
src/semtrex.c:310:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
__stx_freeFA2(SState _s) {
^~~~~~~~~~~~~
src/semtrex.c:320:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
src/semtrex.c:629:11: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (_rP = stack[depth].match) {
~~~~^~~~~~~~~~~~~~~~~~~~
src/semtrex.c:629:11: note: place parentheses around the assignment to silence this warning
if (_rP = stack[depth].match) {
^
( )
src/semtrex.c:629:11: note: use '==' to turn this assignment into an equality comparison
if (_rP = stack[depth].match) {
^
==
src/semtrex.c:653:14: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (t = _t_next_sibling(p)) break;
~~^~~~~~~~~~~~~~~~~~~~
src/semtrex.c:653:14: note: place parentheses around the assignment to silence this warning
if (t = _t_next_sibling(p)) break;
^
( )
src/semtrex.c:653:14: note: use '==' to turn this assignment into an equality comparison
if (t = _t_next_sibling(p)) break;
^
==
src/semtrex.c:680:12: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (r = stack[depth].match) {
~~^~~~~~~~~~~~~~~~~~~~
src/semtrex.c:680:12: note: place parentheses around the assignment to silence this warning
if (r = stack[depth].match) {
^
( )
src/semtrex.c:680:12: note: use '==' to turn this assignment into an equality comparison
if (r = stack[depth].match) {
^
==
5 warnings generated.
src/tree.c:389:6: warning: implicit declaration of function '_r_free' is invalid in C99 [-Wimplicit-function-declaration]
_r_free((Receptor _)t->contents.surface);
^
src/tree.c:394:2: warning: implicit declaration of function '_s_free' is invalid in C99 [-Wimplicit-function-declaration]
_s_free((Scape *)t->contents.surface);
^
src/tree.c:806:9: warning: implicit declaration of function '_sys_structure_size' is invalid in C99 [-Wimplicit-function-declaration]
size = _sys_structure_size(st.id,_surfaceP);
^
3 warnings generated.
make: *** [ceptr_specs] Error 1
we need to add a timeout to all pending responses, along with a thread that services cleaning them up occasionally.
short term listeners (like those installed bye EXPECT_ACT instructions) need to be cleaned up after they run
every run-tree can have a error routine that executes in the case of an error being thrown. This should provide native "try-catch" like functionality for every process at a very granular level
Error routine should expect a REDUCTION_ERROR structured error which always contains a tree path to the node that threw the error.
Should be able to re-throw errors up the chain
As run-trees get moved to the completed list, we need to add the processing time to receptor (and flux) totals for accounting purposes.
This entails adding a Receptor State symbol that can hold this, and other information about the state.
Every vmhost needs a clock receptor that other receptors can listen to for timing events, kind of like a cross between cron and regular system time libraries.
_p_make_run_tree can't handle system processes for creating run trees. It should be able to, but they have to be handled differently because it's not about copying the code from the process definition, it's about adding the parameters directly to the one process node.
currently the code evaluator is designed to stop descending a run-tree when it hits a non-process symbol. This works fine if PARAM_REF symbols are always direct children params of processes. But if they are hidden by a data symbol they wont get substituted in for. We can either walk the entire code tree, or require coders to mark tree portions that need walking with a special instruction.
should include handling for running in a separate theread
This means adding a carrier symbol into signal envelopes (which is just the same as the body symbol) which is used for two things:
This involves the following:
Document the signal structure for each of the main message types... Ceptr messages -- internal to a VMhost vs. between VMhosts (probably with priv/pub keys, signing, etc.). Also, what is the structure of sync signals for the data-engine/accumulator
We need an instruction for creating a looping construct (what we call replication) that:
see @todo in def.c
Currently we hard-code in c the base system symbols. Adding new ones is a pain and there should be some good macroy way to make it easier and clearer
All symbols whose structure is LIST (like SIGNALS and PENDING_RESPONSES) are an indicator that we've got something going wrong. It maybe that these are instances where we are using Symbols to manage collections which should be managed by scapes, or and indicator that we should be using optional element structures (see #8)
currently _r_deliver() simply calls the synchronous version of _p_reduce. We can now break this up so that the vmhost can actually have a process queue for semtrex matching of listeners, which then add the actions to a receptors process queue.
This also requires:
currently we assume malloc will work. Gotta clean up this tech-debt!
we now need refactor and build a better version of the signal sending/delivery/response system. This entails:
Currently RESPOND puts its response signal on the end of the run_tree it's executing under, and that run_tree is a sub_node of the signal that triggered the action. This is ok, but we don't have a signal ID mechanism from the sending end, so that responses can get matched up to correct initiating run-tree.
Semantic Web / Linked Data use various shared vocabularies to created shared understanding. You can find simple centrally controlled vocabularies like http://schema.org as well as tons of ones created independently http://lov.okfn.org
How do you connect semantics in ceptr to human concepts and language?
Currently signals are delivered via __r_deliver_signals which uses the receptor xaddr as looked up in an instances data structure to figure out which receptor to deliver the signal to. This doesn't really work. We have to have a hierarchical resolution mechanism to go up the receptor instances chain, or something like that
this is for things like moving the current position on a stream, resetting a stream, etc.
Valgrind reveals that there are some invalid reads in _p_step. Need to figure out why they are happening and remove them.
This is the output of make on a stock Linux Mint 17.2.
user@user-linux-mint-17 ~/src/ceptr $ make
rm -rf ceptr_specs .o ceptr_spec.dSYM
gcc -pthread -g -o ceptr_specs spec/.c src/_.c
In file included from spec/ceptr_specs.c:15:0:
spec/tree_spec.h: In function ‘testCreateTreeNodes’:
spec/tree_spec.h:19:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘size_t’ [-Wformat=]
spec_is_long_equal(_t_size(t),(long)6);
^
spec/tree_spec.h:58:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘size_t’ [-Wformat=]
spec_is_long_equal(_t_size(t5),(long)0);
^
In file included from spec/ceptr_specs.c:16:0:
spec/mtree_spec.h: In function ‘testCreateTreeNodesM’:
spec/mtree_spec.h:71:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘size_t’ [-Wformat=]
spec_is_long_equal(_m_size(h),(size_t)6);
^
In file included from spec/ceptr_specs.c:17:0:
spec/def_spec.h: In function ‘testGetSize’:
spec/def_spec.h:93:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘size_t’ [-Wformat=]
spec_is_long_equal(_d_get_structure_size(0,0,INTEGER,0),sizeof(int));
^
spec/def_spec.h:94:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘size_t’ [-Wformat=]
spec_is_long_equal(_d_get_structure_size(0,0,BIT,0),sizeof(int));
^
spec/def_spec.h:95:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘size_t’ [-Wformat=]
spec_is_long_equal(_d_get_structure_size(0,0,FLOAT,0),sizeof(float));
^
spec/def_spec.h:96:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘size_t’ [-Wformat=]
spec_is_long_equal(_d_get_structure_size(0,0,XADDR,0),sizeof(Xaddr));
^
spec/def_spec.h:97:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘size_t’ [-Wformat=]
spec_is_long_equal(_d_get_symbol_size(0,0,STRUCTURE_PART,0),sizeof(Symbol));
^
spec/def_spec.h:98:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘size_t’ [-Wformat=]
spec_is_long_equal(_d_get_symbol_size(0,0,SYMBOL_LABEL,"shoe_size"),10);
^
spec/def_spec.h:116:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘size_t’ [-Wformat=]
spec_is_long_equal(_d_get_symbol_size(symbols,structures,house_loc,ll),sizeof(ll));
^
spec/def_spec.h:117:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘size_t’ [-Wformat=]
spec_is_long_equal(_d_get_structure_size(symbols,structures,latlong,ll),sizeof(ll));
^
In file included from spec/ceptr_specs.c:20:0:
spec/receptor_spec.h: In function ‘testReceptorDef’:
spec/receptor_spec.h:218:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘size_t’ [-Wformat=]
spec_is_long_equal(__r_get_symbol_size(r,lat,0),sizeof(float));
^
spec/receptor_spec.h:222:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘size_t’ [-Wformat=]
spec_is_long_equal(__r_get_symbol_size(r,house_loc,0),sizeof(float)_2);
^
spec/receptor_spec.h:225:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘size_t’ [-Wformat=]
spec_is_long_equal(__r_get_symbol_size(r,name,"zippy"),(long)6);
^
spec/receptor_spec.h:231:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘size_t’ [-Wformat=]
spec_is_long_equal(__r_get_symbol_size(r,home,surface),sizeof(float)2+6);
^
spec/receptor_spec.h: In function ‘testReceptorSerialize’:
spec/receptor_spec.h:447:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘size_t’ [-Wformat=]
spec_is_long_equal(length,250);
^
spec/receptor_spec.h:448:5: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘size_t’ [-Wformat=]
spec_is_long_equal((size_t *)surface,250);
^
./ceptr_specs
Running all tests...
......................................................................................................................................................................F..........................................................................................................................................................................................................................................................................................................................................................................................................
1 out of 561 specs failed:
testCreateTreeNodesM:188 expected xx to be:
"t121"
but_was:
"t1210��"
currently streamReader and streamWriter receptors want to share the idea of a Line, and that probably shouldn't be part of the system defined symbol set. It's now time to implement how these semantic vocabularies get shared by receptors that want to use them. (label table?)
This means adding a bunch of stuff:
Pull selected JS visualizations used in the MIT webinar to the Doxygen documentation to make data structures visible.
Create vmhost scapes for:
where the data source is the receptor, and the key source is the element in the Receptor State symbol
First steps toward building a Ceptr IDE in having a JavaScript based client that can match labels in the tiers of label tables, and build a semantic tree representation (probably in JSON which will get sent back to Ceptr then translated)
Scapes, Stream, Receptors. We currently have special functions that create symbols of these types, and also know how to dispose of the underlying data structures when the symbol is disposed (using _t_free)
As in the case of Streams, where you have code that has a symbol that refers to a given stream, you don't actually have the stream, but rather a reference to it, i.e. a Handle. We need to think through how such handles will work and be allocated/used etc.
The vmhost needs structures and code for handling edge-receptor threads, as well as a thread pool to allocate to handling receptors process queues.
This code needs to be called from the main thread that comes from the accumulator boot-up sequence
This was async in SEND, but now provides the code that should be added as it's own pre-pre-blocked execution context as the response-point for the __r_send.
currently we have some commented out code from our original attempt to serialize receptors, plus we have mtree serialization. This now needs to be moved to or utilized by the data engine code together with the instances code
we built EXPECT_ACT as an instruction to plant an expectation on the flux, which LISTEN also does, but it doesn't block waiting for the expectation to match.
This seems a little like the difference between synchronous and asynchronous SEND. These two instructions should probably be unified, and LISTEN also needs some additions to LISTEN (which doesn't handle the carrier correctly see #42) and to EXPECT_ACT, which doesn't use _add_listener
This involved:
We need a system for inserting multi-level/target area debugging printout capacity, especially now that we are executing more complex code in the vmhost state machine.
It should be #ifdef based so it can be switched off in different compilation modes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.