Totemo omoshiroi ne? More info about the Premise Language can be found here: http://independent.academia.edu/PiagetModeler There is a draft Language Guide as well as a language synopsis. So there are three kinds of parenthetical objects: Lists - {a b c} borrowed from LISP.Forms - (+ 1 2 3) borrowed from LISP.Premises - [Idea ^ Idea_1 :All people :Are mortal] borrowed from CLIPS, sort of. The language itself is a combination of LISP, Self, Javascript, CLIPS, OPS, and Object Relational Mapping. If you'd like to test drive it let me know, I'll send you a copy. Right now we're revamping the namespaces,and we've struck upon an approach. The co-inventor loves speed, so rather than being fully interpreted, it is just-in-time compiled. And I think we now have a good memoizing approach for the namespace resolution. ~PM From: [email protected] To: [email protected] Subject: RE: [agi] Namespace search optimization Date: Tue, 6 Jan 2015 03:31:42 -0500
Er uhm glancing at your Premise coding syntax from a symbolic dynamical systems perspective one can’t help to notice it’s rather large Dyck shift IOW there are a lot of (()([][(([(())]()[()][()]) for example see:http://www.dim.uchile.cl/~mschraudner/SyDyGr/Talks/meyerovitch5.pdf Much bigger shift than the average computer language. FWIW… didn’t want to mention it but… John From: Piaget Modeler via AGI [mailto:[email protected]] Sent: Sunday, January 4, 2015 3:50 PM To: AGI Subject: RE: [agi] Namespace search optimization Thanks for the responses so far, keep them coming... These are also in the ball park... Oracle Managing Object Name Resolutionhttp://docs.oracle.com/cd/B28359_01/server.111/b28310/general008.htm#ADMIN11561 Name Resolution Division of Responsibilities between DLL and Service Providershttp://msdn.microsoft.com/en-us/library/windows/desktop/ms739868%28v=vs.85%29.aspx ~PMFrom: [email protected] To: [email protected] Subject: RE: [agi] Namespace search optimization Date: Sat, 3 Jan 2015 14:20:41 -0500Yes .NET is pretty good with types and has something called Reflection which is powerful allowing you to do things like create code on the fly. .NET has a Type object type example:System.Type oType = typeof(int); Delegate.CreateDelegate is powerful, I use that in reading XML textual definitions of finite state machines where method names are text XML attributes put into a generic Dictionary, Dictionary<Type, String> of Types and method names. This sounded similar to what PM was doing... then using Delegate.CreateDelegate on loaded Assembly dll’s and invoking the delegates(function pointers) dynamically. Very dot net specific but similar can be done with Java. John From: Jim Bromer via AGI [mailto:[email protected]] Sent: Saturday, January 3, 2015 1:16 PM To: AGI Subject: Re: [agi] Namespace search optimization Microsoft (is it .net?) also allows you to request the type of a variable by using the variable name in a function parameter. So I assume that their object reference to their type "Int32" holds the space for a 32 bit integer value and the variable type along with it. It may hold more than, I was just pointing that fact out.Jim Bromer On Fri, Jan 2, 2015 at 5:48 PM, John Rose via AGI <[email protected]> wrote:Not sure if this is what you are asking but in C# you store the type and the method delegate then combine them both before invoking with Delegate.CreateDelegate: http://msdn.microsoft.com/en-us/library/system.delegate.createdelegate(v=vs.110).aspx John From: Piaget Modeler via AGI [mailto:[email protected]] Sent: Friday, January 2, 2015 5:03 PM To: AGI Subject: RE: [agi] Namespace search optimization Further constraints... 1. There is a global list of namespaces. (namespaces) .: {System Premise Bar Baz} 2. Qualified functions will be unknown if their namespace is not defined in the global list of namespaces. (An.Unknown.Namespace.Hello) .: [Exception :Text 'function is not known'] 3. Each namespace defines zero or more functions and a zero or more dependent namespaces. (namespace Foo (requires Bar) (requires Baz) (function goodbye {} BYE) (function niceToKnowYou {} NTKY) ) .: Foo (using Foo) .: Foo ; sets the current namespace, akin to USE <DB> in SQL. (functions Foo) .: {goodbye niceToKnowYou} (dependencies Foo) .: {Bar Baz} (functions Bar) .: {wellWell ohISee} (dependencies Bar) .: { } (functions Baz) .: {thisOne thatOne} (dependencies Baz) .: { } 4. If an unqualified function is not defined in the current namespace nor one of the required namespaces then it is unknown. (Hello there) ~PM From: [email protected] To: [email protected] Subject: RE: [agi] Namespace search optimization Date: Fri, 2 Jan 2015 13:37:18 -0800That's a start. What kind and how could even that be improved? ~PMDate: Fri, 2 Jan 2015 15:16:00 -0500 Subject: Re: [agi] Namespace search optimization From: [email protected] To: [email protected] look up table?Jim Bromer On Thu, Jan 1, 2015 at 9:45 PM, Piaget Modeler via AGI <[email protected]> wrote:In the Premise language function rules are very simple. A function name follows a left parenthesis.However the name can be fully qualified <namespace>.<function> or unqualified <function> . When the name is unqualified we have to resolve the name, qualifiy it in order to select the appropriate function to execute. Each namespace has a set of imported namespaces which may contain the correctfunction definition. We only need the first namespace that has the correct function definition, we don't care if it is multiply defined. Suppose we're in the namespace User and want to access the sum function defined in the Math namespace.We have a situation like this: (using User) .: User (dependencies User) ; return the namespaces this namespace requires.: {Premise System} (namespace Math (function sum ?args (apply + ?args))).: Math (dependencies User) .: {Premise System} (Math.sum 1 2 3) ; fully qualified function call.: 6 (sum 1 2 3) ; unqualified function call Math namespace is not known to User.: [Exception :Text 'The function sum is unknown'] (require Math) ; make Math known to user.: Math (dependencies User) .: {Premise System Math} (sum 1 2 3) ; resolves sum to Math.sum.: 6 The resolution takes time. Albeit a small fraction of time. But it is cumulative. This is the specific problem. ~PMDate: Thu, 1 Jan 2015 20:39:02 -0500 Subject: Re: [agi] Namespace search optimization From: [email protected] To: [email protected] Are you referring to a problem which involves taking runtime data and searches for an appropriate function given the dynamic value? The search for the type of object that is defined in runtime is not part of the problem is it? Because a simple call where the type of the variable is given or directly implied (by uniqueness for example) should not take too much time even during runtime. I can think of two search problems that might occur in something like that. If the establishment of the appropriate set function requires some trial and error data-fitting (or function fitting) that could turn out to be inefficient. Or if the search involves a proverbial tree search then that might take some time as well. I don't see a straightforward run-time function call (to something that is like a template) as being that time consuming.Jim Bromer On Thu, Jan 1, 2015 at 8:11 PM, Piaget Modeler via AGI <[email protected]> wrote:It basically boils down to a basic speed versus extensibility tradeoff. From: [email protected] To: [email protected] Subject: RE: [agi] Namespace search optimization Date: Thu, 1 Jan 2015 08:55:44 -0800Given 200-250 base functions in 10 packages (namespaces), if the functions are defined as language intrinsics (like if or for) then there is no need for pakckage lookup, no need to resolve the name with the namespace, so no overheard is incurred. If the functions are defined as qualified identifiers (prefixed by package name) then we need to look up any unqualified identifiers first, thereby resolving the identifier with the package, before proceeding with the evaluation. For Example, the set function in the System.KB package (namespace) sets a slot in a prototype instance to a value. The programmer can fully qualify the function call (System.KB.set ?identifier ?slot ?value) Or the programmer can reference the package and use an unqualified call (require System.KB) (set ?identifier ?slot ?value) When set is encountered we need to search the required namespaces to determinewhich set function is implied, hence we find System.KB.set and replace set withthe fully qualified name. We do this during form evaluation in the REPL,whetherthe REPL is just-in-time compiled or interpreted. If we defined set as an intrinsic then there would be no package issue, but also no modularity. We just encounter set and call the set intrinsic. So there is no overheadincurred by attempting to resolve the function name with a namespace. So, my question is, are there any known optimizations to this problem of resolving function names with packages? ~PM From: [email protected] To: [email protected] Subject: RE: [agi] Namespace search optimization Date: Thu, 1 Jan 2015 09:03:05 +0000Dictionary lookups (on the first part of the name if the full list is big compared to RAM)?From: Piaget Modeler via AGI [[email protected]] Sent: 01 January 2015 05:53 To: AGI Subject: [agi] Namespace search optimizationAre there any optimizations that can be done to look up identifiers in namespaces for either just in time compilers or interpreters ? I'm writing a REPL and namespace resolution of function identifiers takes too much time away from overall evaluation. Any ideas or thoughts? ~PM AGI | Archives | Modify Your SubscriptionUNIVERSITY OF CAPE TOWN This e-mail is subject to the UCT ICT policies and e-mail disclaimer published on our website at http://www.uct.ac.za/about/policies/emaildisclaimer/ or obtainable from +27 21 650 9111. This e-mail is intended only for the person(s) to whom it is addressed. If the e-mail has reached you in error, please notify the author. If you are not the intended recipient of the e-mail you may not use, disclose, copy, redirect or print the content. If this e-mail is not related to the business of UCT it is sent by the sender in the sender's individual capacity. AGI | Archives | Modify Your Subscription ------------------------------------------- AGI Archives: https://www.listbox.com/member/archive/303/=now RSS Feed: https://www.listbox.com/member/archive/rss/303/21088071-f452e424 Modify Your Subscription: https://www.listbox.com/member/?member_id=21088071&id_secret=21088071-58d57657 Powered by Listbox: http://www.listbox.com
