lainchan / λ

XBF

Anonymous · 2017-09-27 12:22
This is a project for a bunch of things, all related to language, logic or mathematics current repo with what has been done: https://github.com/Capaverde/XBF road map: logic, grammar, rhetoric -> arithmos, chronos, topos -> astronomy et al -> dialectics future knowledge base: https://github.com/Capaverde/debug/tree/master/index So, what is it? As discussed in >>>/q/4946 it is an attempt at systematising general knowledge. I chose BF because of its simplicity, because I wanted a light weight language to contrast to its knowledge base, making this separation explicit. But it is an extended and extensible BF with a better support for both arithmetic expressions and rewrite-rules/lambda calculus. It does not loop the usual BF way, but instead its looping is dependent on its logic, and on its way of solving logical dependencies. You can reason about it and determine whether it will terminate by considering whether it has the 'knowledge' necessary for running the instructions, and in which mode it is running. I might be precipitating myself creating this thread now, when so much of what's intended isn't implemented yet, but this was meant to be a community project from the start, and I'd like to hear others' opinions and understandings from the start in order to not become too biased myself.
Anonymous · 2017-09-27 14:10
This eXtensible BrainFuck is an interesting concept, but I would care for an explanation. I've created a derivative of Brainfuck you may be interested in, depending on what your language offers. >You can reason about it and determine whether it will terminate by considering whether it has the 'knowledge' necessary for running the instructions, and in which mode it is running. This seems like you're trying to eliminate certain classes of errors; I've done similar with a language I'm fostering and have come to the conclusion that there's no real replacement for human care. As an example, certain mathematical functions are only defined for certain domains and so there must be some way to combat this. >I might be precipitating myself creating this thread now, when so much of what's intended isn't implemented yet, but this was meant to be a community project from the start, and I'd like to hear others' opinions and understandings from the start in order to not become too biased myself. That's interesting, as I'm the opposite way. I tend to develop an idea for at least a year or few before I reveal it to others. How long have you been giving this idea your time?
progn · 2017-09-27 14:49
I think this is really interesting, but I'd like you to describe the features that the knowledge base is supposed to have in more detail. Right now, after reading your explanation, I know nothing about how the entire thing is supposed to function, I only know the fact that its goal is to systematize human knowledge. Regarding XBF, in my opinion the language is pretty neat and something I would have a lot of fun working on, but it needs to be specified better. I will go over the files, in order from the ones that I understand the best to the ones that I understand the least. topos -- I understand everything, but are you planning to use "×" as an actual operator in the language? Support of non-ASCII characters is IMO cumbersome and makes implementation more difficult if you want to write it in something like C, so I would opt against that. arithmos -- I understand everything, except one thing: is there any point writing +^n instead of n? If these two are equivalent, shouldn't some definitions be shortened? For instance: +(^+^n)^(+) would become +(^n)^(+). current_set.txt -- These are the reserved characters/keywords, I suppose? logic -- I understand that the set L contains the symbols t and f (they are symbols, are they?). I understand that further sets like AND and OR contain tuples of symbols t and f in various combinations. But I don't know what # operator does and that -> really means (does x -> y mean that x is y?). I also don't know what symbols named like set, but in lowercase (like 'and, 'or, etc.) mean. simple logical statements -- It's quite unclear to me how the evaluation works. Is ,(,(*^0) ,(*^1)) just "eval first arguments, eval second argument, and eval the resulting S-expression"? And does that mean "apply"? How is a raw S-expression evaluated? Does it just evaluate to itself? What's the point of ', then? Does (*^n) mean the nth argument in this context? I'd like that to be specified in some way if it does. Are the parentheses part of the > print instruction, and if no, then why are they necessary? I have many more questions, but I think the best think would be for you to describe this language in more detail. That is all. I think that if I had a clearer explanation of how the language as a whole is supposed to operate, I could implement a simple interpreter of it in C so we can see how it fares. One last word, I think that if you want the language to have good performance, many optimizations would be necessary. The interpreter should be able to recognize certain patterns and replace them with more efficient internal instructions, because right now something like multiplication would take a few loops and many instructions to do what can be done in just a one.
Anonymous · 2017-09-27 17:39
>>3788 the knowledge base is not fully specified because it needs XBF (which will use it) to be testable but the intent is for each entry to have a path (filesystem path in this case) and for the content to be valid XBF using 'topos' notation (which still isn't complete) I am building from the ground up a dependency chain, and the main files can be seen as simple asserts or as definitions (depending on the implementation of the language: interpreter or others) I removed some specifications due to the inconsistencies I was getting, that might be why 'simple logical statements' is a bit cryptic I'm trying to correct this, but for now this is part of what was removed, which you might use as reference: https://pastebin.com/cJB2sBzR S expressions are to be indexable from the inside, and only evaluated explicitly (through the eval operator: , (single comma)) a (sexp -> sexp) is a replace rule or a macro a ' in front of an atom or a sexp makes it a symbol, which means it doesn't refer to anything else and is simply a "label" (there are many ways to view this) on arithmos, +^n is necessary for a bunch of reasons, mainly because of "symbolic-numerical duality" (a concept I've been grasping and aiming for) on base 1. ^ is the repetition operator (except on arguments (a inconsistency I want to solve)) which operates on strings and symbols and doesn't know a thing about more complex types or on how a number might be represented (float, int, uint, etc). It might look like that is crippling, but this agnosticity actually allows some nice properties like the extensibility that you've seen in the arithmos file (which is still not complete), ease of implementation, avoidance of a bunch of typing/converting errors and others I do plan on removing × and making it ascii-only, I'm not sure if I'd use 'x' or something else. The # operator has more than one function, but it should be easy to explain. Since this little language seems to be a bit context sensitive when dealing with rewrite rules, # functions as a type of assert, so that you know it is only taking members of L as arguments, and that it outputs a member of L. And in the case of the tuple, ... -> (*^0 *^1)#AND it asserts that the tuple is a member of the set AND, which in this case would mean that both *^0 and *^1 are true. current_set.txt is meant that way, yes, but it doesn't have any function other than preventing human error, it is not read or interpreted I've been thinking of abusing the preprocessor for optimizations, but I am still a layman on this subject.
Anonymous · 2017-09-28 01:34
>>3787 >This seems like you're trying to eliminate certain classes of errors; Ideally, there will be no errors on runtime. >that there's no real replacement for human care. I agree. The program won't run itself, and if there exists an expected behavior for the program then there also exist behaviors that you would call undesirable. But then it becomes a problem of logic, and not of knowledge. >As an example, certain mathematical functions are only defined for certain domains and so there must be some way to combat this. I'm entertaining this thought too. I've talked of something similar to type checking on my previous post. You can probably define a set with a predicate function.
Anonymous · 2017-09-29 07:54
>That's interesting, as I'm the opposite way. I tend to develop an idea for at least a year or few before I reveal it to others. How long have you been giving this idea your time? To be honest, I've had ideas that I groomed for a year or so, and they turned into nothing. But this one isn't simply an idea, as in creative fabrication, but is rooted on many things I know or am learning from my studies (for a spot in math university) and it already benefits me and my directing mind by creating it and maintaining it. It's a long road and I want to walk it.
Anonymous · 2017-09-30 08:55
hopefully I've explained it better this time: https://github.com/Capaverde/XBF/blob/master/ROADMAP https://github.com/Capaverde/XBF/blob/master/grammar https://github.com/Capaverde/XBF/blob/master/current_set.txt
Anonymous · 2017-10-02 05:54
tentative factorial: (0)! -> 1 (#N)! -> (*)^((*)-)! #N is to be the naturals it is lazy since the eval is not explicit (unsure if I shouldn't use *^0 instead)
Anonymous · 2017-10-22 10:02
a update, I guess There'll be only three basic datatypes: sets, tuples and streams
Bobby Newmark · 2017-10-22 18:00
I am a little confused. Why are you using brainfuck to express logical statements?
Anonymous · 2017-10-23 02:22
>>4506 It's actually an extended and extensible brainfuck. I haven't documented it fully, but it is somewhat modular in how it approaches different domains. I use it for the simplicity and elegance of how they can be expressed. And also for other architecture-wise benefits.