"computationalalchemist answered: You could use Prolog-style lists for split."
I'm not totally sure what you mean, but my best guess as to what you meant is probably pretty similar to how I making it.
I implemented it and I think it works, I need to double check though.
With what I have now when I use
split [THIS,THIS,THIS,THIS,THIS,THIS,NULL]COUNTER; ~ATH(COUNTER){ print "bananas"; BIFURCATE COUNTER[JUNK,COUNTER]; }EXECUTE(print "ok";); print "whee!";
it yields
bananas bananas bananas bananas bananas bananas ok whee!
Which seems to make sense to me, and also, fits with how lisp lists work, and apparently also prolog lists.
also where it says split it will also accept bifurcate. they are actually treated as the same command.
import statements aren't fully implemented yet though.
I think I will put this version on github pretty soon.
Thank you for the advice.
Most programs people use have some form of user input. A calculator isn't much use if it always uses the same numbers after all!
~ATH of course accepts user input and output as shown in the file Roxy sent Jane.
Also I just found out you can put more than one read more line in one post.
The input command has the syntax:
INPUT VARNAME;
What this does is when program execution meets this line, the program pauses execution, allowing the user to input text. When the user hits enter, program execution will continue and the variable VARNAME will be made to point to an object corresponding to the text the user entered.
This object is such that the left half is the object that corresponds to the first character. If there is no character after that, the right half will be the NULL object. Otherwise the right half will be the object corresponding to the input without the first character. If they hit enter without inputting any characters the object will just be the NULL object.
Now that we have that all explained, we can start to make programs that actually take user input!
As you might have guessed from the title, the thing we will be making is a very basic calculator. All it does is add two numbers, like in the last example.
But in this, it will get the numbers from the user!
One simple way to do this is to use the length of the input text as the number: The way we define what we call numbers just so happens (heh) to be such that if we interpret the object for the input string as a number, the number will be the same as the length of the input!
This isn't the greatest solution, but it is easier than other methods. We will use this method first and then move on to other methods that are harder to write, but will be nicer when using the end program.
HERE WE GO:
ok, so like I said, much of it is pretty much the same as that previous program, so we might as well just include said here:
SOME CODE TO GET A AND B HERE import bluh BLAH; BIFURCATE [BLAH,A]ATEMP; BIFURCATE [BLAH,B]BTEMP; BIFURCATE ATEMP[JUNK,ATEMP]; BIFURCATE BTEMP[JUNK,BTEMP]; BIFURCATE [BLAH,NULL]C; BIFURCATE C[JUNK,C]; ~ATH(ATEMP){ BIFURCATE ATEMP[JUNK,ATEMP]; BIFURCATE [BLAH,C]C; } ~ATH(BTEMP){ BIFURCATE BTEMP[JUNK,BTEMP]; BIFURCATE [BLAH,C]C; } BIFURCATE [BLAH,C]CTEMP; BIFURCATE CTEMP[JUNK,CTEMP]; ~ATH(CTEMP){ BIFURCATE CTEMP[JUNK,CTEMP]; print some text; } print DONE!;
so pretty much what we need to do it put the code to get A and B where that goes(at the beginning), as well as stuff to tell the user how to print stuff.
Like I said, the objects from the input commands can be interpreted as numbers.
so this becomes:
print INPUT SOMETHING WITH THE NUMBER OF CHARACTERS AS THE FIRST NUMBER YOU WANT TO ADD; INPUT A; print INPUT SOMETHING WITH THE NUMBER OF CHARACTERS AS THE SECOND NUMBER YOU WANT TO ADD; IMPORT B; import bluh BLAH; BIFURCATE [BLAH,A]ATEMP; BIFURCATE [BLAH,B]BTEMP; BIFURCATE ATEMP[JUNK,ATEMP]; BIFURCATE BTEMP[JUNK,BTEMP]; BIFURCATE [BLAH,NULL]C; BIFURCATE C[JUNK,C]; ~ATH(ATEMP){ BIFURCATE ATEMP[JUNK,ATEMP]; BIFURCATE [BLAH,C]C; } ~ATH(BTEMP){ BIFURCATE BTEMP[JUNK,BTEMP]; BIFURCATE [BLAH,C]C; } BIFURCATE [BLAH,C]CTEMP; BIFURCATE CTEMP[JUNK,CTEMP]; ~ATH(CTEMP){ BIFURCATE CTEMP[JUNK,CTEMP]; print some text; } print DONE!;
So yeah. That should work. I still need to test this, but I am pretty dang sure that this works.(have to go do homework now) In the next post I will explain how to make it so that the user can type in the number as an actual number!
Today is the 10 year anniversary of the destruction of the universe frog. Such an occasion is traditionally celebrated by destroying the universe.
yeah, can i make ~ATH continue to generate variables? like if one part of the program dies it generates another variable? because i've been trying to do that lmfao
Hi. Not sure what you mean by continue to generate variables. If you mean like how in lisp you can like, automatically generate a new variable name and then use that variable name, then no, drocta ~ATH doesn't have a feature like that, but I'm guessing that's not what you mean.
Variables are just like, names in your program. If you want more objects, you can just continue bifurcating objects to get more objects.
drocta ~ATH does not support parallelism or concurrency or whatever (though presumably canonical ~ATH would, in some sense. At least, it appears to handle circumstantial simultaneity.), So, if you are referring to drocta ~ATH, then I'm not sure what you mean when you refer to part of the program dying. Though, given that in canonical ~ATH, there is the expression
[THIS,THIS].DIE();
then it seems like, presumably, it should be possible to have something like
THIS.DIE();
in order to describe part of the program dying (ending), without another part doing so.
But, again, drocta ~ATH does not support anything like that. Feel free to make a fork of it which does though. Please let me know if you do!
Learn ~ATH turned 1 today!
yaaaay!
So I think that my explanations of things hasn't been very clear so far, and while I can't promise that they will improve, I do intend to teach programming in person at my school, which might help me to know how to make this tutorial better. Maybe, maybe not.
May things go well!
How exactly would one go about downloading and running your ~ATH interpretation? Where can we download it and what is needed to run it?
“Hi! My interpreter is on my github account [here], along with a number of example files.
To run it, you need to have python 2.7 installed. (Other versions of python 2 may also work. I don’t think it quite works in python 3, but running it through a python 2 to python3 converter should probably give you a working python 3 version)
You can get python 2 at https://www.python.org/downloads/ .
The current version of python 2 is 2.7.13 . Currently that python download page has a link directly to the download on it. (If anyone is reading this post much later than January 1 2016 and the page has changed in the meantime, feel free to send me an ask asking where the current download link for python 2 is).
Once you have python 2 installed, download the interpreter from my github, https://github.com/drocta/TILDE-ATH . There should be a green button labeled “Clone or download”. If you click this, one of the options it will give will be “download ZIP” . Choose this option to download a .zip file of all the files for drocta ~ATH.
Unzip these files into a folder somewhere. Put the .~ATH files that you want to run in the same folder. Use python2 to run the python file interp_2.py . The program will then expect you to type in the filename of the .~ATH file you want to run and then press enter once. It will then load and run the ~ATH program. When it has finished running the program, it will say "press enter to close" . (this is so you can see the output of your ~ATH program before it closes, in case you run it in certain ways.). When you press enter, the python program will finish.
More details on how to run interp_2.py, in case you don’t know how to:(I am assuming you are on windows. if this is not the case, please send me another ask. It should work fine on other OSs, but these instructions for how to run interp_2.py with python might be slightly different)once python 2 is installed, if you open the command line, navigate to the folder with interp_2.py, and type “python interp_2.py” (without spaces), it should run it. Alternatively you can double click on the interp_2.py, it will probably work.One potential problem you might have is if you have python3 installed as well as python2. In this case you have to make sure you run it with the right version of python. If you are using the command line,“C:\Python27\python.exe interp_2.py” instead of “python interp_2.py” should probably work.
If any of this is unclear or you want any more help with this, please do not hesitate to send another ask.
I’m very pleased that this is still interesting for people, and am happy to help!
I have completed the syntax explanation post, and I think it is fairly clear now.
If you find any part of the post to be unclear, and that it requires further explanation, please say so so that I can improve it.
Now that that post is in an acceptable form, We can get on to writing our first few ~ATH programs.
print Hello, World.; THIS.DIE();
That wasn't so hard, was it?
I feel I should note that the syntax of the print command is not entirely finalized, it might change sometime later.
EXPLANATION:
The first line of the program says to output the text "Hello, World."
The 2nd line of the program says to end the program. This is because the variable THIS initially points to a object that is only alive when the program is running. If the object is ever not alive, the program stops.
oh gosh why is this a bullet-ed list I am not good with tumblr
To run a drocta ~ATH program, you need the interpreter (available from the github), and python 2.7 (the interpreter can be easily modified to run with python 3, but it is written to work in 2.7)
Open interp_2.py with python, and when the program comes up, type in the filename of the ~ATH program, and hit enter, this will run the ~ATH program.
With this example, it should output the text
Hello, World.
Now, of course, this is a relatively simple program, but at least its something.
Depending on how you are running the interpreter, the program might close immediately after outputting the text.
That might not be what we want.
To make the program not close until we specifically tell it to, we use the following:
print Hello, World.; ~ATH(THIS){ } THIS.DIE();
EXPLANATION:
The first line is the same as in the first program. It outputs "Hello, World."
The second line is different, this says to start a loop, which will continue until the object pointed to by the variable THIS is dead.
The third line says to go back to the corresponding ~ATH statement.
The fourth line is never executed, because the loop above it will continue until the object pointed to by THIS dies, and if that object dies the program ends. If it were to be executed it would make the object pointed to by THIS die, and the program would end as a result.
This program should be the same, except that it will keep running until you close it manually.
Now you have hello world written in two different ways!
Two questions: 1: did you actually make ~ATH, and 2: what was that Sburb text-game that you mentioned on an ask on another blog
While I was back in highschool (iirc?) I made a thing which I titled “drocta ~ATH”, which is a programming language with the design goals of:
1: being actually possible to implement, (and therefore, for example, not having things be tied to the lifespans of external things)
2: being Turing complete, and accept user input and produce output for the user to read, such that in principle one could write useful programs in it (though it is not meant to be practical to do so).
3: matching how ~ATH is depicted in the comic, as closely as I can, with as little as possible that I don’t have some justification for based on what is shown in the comic (plus the navigation page for the comic, which depicts a “SPLIT” command). For example, I avoid assuming that the language has any built-in concept of numbers, because the comic doesn’t depict any, and I don’t need to assume it does, provided I make some reasonable assumptions about what BIFURCATE (and SPLIT) do, and also assume that the BIFURCATE command can also be done in reverse.
However, I try to always make a distinction between “drocta ~ATH”, which is a real thing I made, and “~ATH”, which is a fictional programming language in which it is possible to write programs that e.g. wait until the author’s death and the run some code, or implement some sort of curse that involves the circumstantial simultaneous death of two universes.
In addition, please be aware that the code quality of my interpreter for drocta ~ATH, is very bad! It does not use a proper parser or the like, and, iirc (it has probably been around a decade since I made any serious edits to the code, so I might recall wrong), it uses the actual line numbers of the file for the control flow? (Also, iirc, the code was written for python 2.7 rather than for python 3.) At some point I started a rewrite of the interpreter (keeping the language the same, except possibly fixing bugs), but did not get very far.
If, impossibly, I got some extra time I wouldn’t otherwise have that somehow could only be used for the task of working on drocta ~ATH related stuff, I would be happy to complete that rewrite, and do it properly, but as time has gone on, it seems less likely that I will complete the rewrite.
I am pleased that all these years later, I still get the occasional message asking about drocta ~ATH, and remain happy to answer any questions about it! I enjoy that people still think the idea is interesting.
(If someone wanted to work with me to do the rewrite, that might provide me the provided motivation to do the rewrite, maybe? No promises though. I somewhat doubt that anyone would be interested in doing such a collaboration though.)
Regarding the text based SBURB game, I assume I was talking about “The Overseer Project”. It was very cool.
Thank you for your questions. I hope this answers it to your satisfaction.
okay, this might be a liiittle specific, and more HS oriented, but still. can you power a First Guardian using ~ATH? and if so, what are some ways?
This is a slightly off of the usual topic of this blog, which is more about a language which I made up and is based on and named after the language in the comic, and attempts to be as close to the comic while still being possible to implement and use, (the language in the comic is not particularly well documented), but I’ll answer it to the best of my abilities.
I’m not sure what you mean by “power”.
“Can I write a first guardian character that has some of their behavior be based on ~ATH in some ways?” : I don’t see any reason why not. If you can do ectobiology with a puppet and a cueball, why not with a computer running a program?
“Can I make a first guardian character who is a first guardian because of the continual execution of a ~ATH script?” : While you can of course write whatever you want, I’m not sure that this is consistent with what is said in acts 1-7 (I have chosen to disregard everything after act 7) about first guardians. It seems like an entity either is or is not a first guardian, and that this fact is established at the time of that entity’s creation. It seems to me like what happens with first guardians is: using ectobiology, the genetic code from some players’ subconscious-or-whatever is combined with some other source(s), and the result is a first guardian.
Oh, I suppose if you just mean “an entity has the powers of a first guardian as a result of a ~ATH script”, then, uh, I guess that doesn’t contradict anything. How would I depict such a script? Well, I don’t know that anything that we’ve seen of the language gives any particularly clear direction for what such a script would look like. If you want it to just have the keywords we’ve seen, possibly re-interpreted to mean something different, I guess one idea could be to like, say bifurcate an existing first guardian into parts with names that seem relevant, and also whatever entity is to have the abilities of a first guardian, and then like, un-bifurcate (unbifurcation is not something shown in the comic, but is something I’ve added to my language, in order to make it usable) the other entity, but with some component of the first guardian mixed in somehow? Though if you did that, you would probably want to justify why, if ~ATH can do that that easily, why it doesn’t happen all the time.
There is very little in terms of rules that the story gives for how ~ATH behaves. If you want to have a ~ATH script “power” a first guardian, just make up some stuff. If you want to depict the actual script, then look at all the pages of the comic that depict code from it, see what it says they do, and just make something up that seems to aesthetically fit.
The language that I have defined (”drocta ~ath”) does not provide any means of doing this, because the language I designed was designed to technically be usable, while also resembling the language in the comic.
I suppose that, as all first guardians get their power from the green sun, and the green sun was created by the circumstantially simultaneous destruction of, uh, either universes A and B, or specifically of A2 and B1, not sure which, and this was in some ways tied to the Möbius Double Reacharoud virus, you could argue that all first guardians get their powers from, something somewhat connected to a ~ATH script.
Why can’t I add tags to an answer to an ask?
PRINT2 prints a string object as a string. If you give it something that is not a string object it will probably crash, or output the empty string.
Now, to import user defined functions use
importf filename as FUNCTIONNAME;
Why didn't I put this up earlier?
because I have other projects and because sometimes I am busy/lazy.
OK!
So to make a function to import, you pretty much make a ~ATH file like normal, except the object passed into the function is put into the variable ARGS, and when you want to pass the output object of the function out, you have it as an argument to the DIE method.
It can either be when saying THIS.DIE(RETURNOBJ); or ANYOTHERVARIABLE.DIE(RETURNOBJ);
The object your killing doesn't have to be the one tied to the life of the function or anything.
Oh I should clarify, the THIS variable/object will refer to the current function, not the file that called it.
It CAN be returned, and will be dead when you exit the function.
PROGRESS!
FUNCTIONS WORK.
LESS SPAGHETTI CODE.
although this starts to make me wonder if maybe this strays too far from what ~ATH is like in comic,
but w/e.
I am aware that this will probably not get answered but for what its worth: Is it possible to access the 'variables' generated within the ~ATH code externally? I.e. if I import an alive object would it be possible to use the python code to test if that object is alive or not (and potentially change that)? I have taken a look at the code but am unsure if it is possible or even coded in that manner. Any response is appreciated but I will not mind and understand if this goes unanswered.
Hey,Assuming I understand what you mean by your question:Yes it would be possible to do that with not too much of a change to the code, but no the code wasn’t designed specifically to facilitate that.The way the code is written, the python function “evalScript” takes two arguments, the first of which is the text of the drocta ~ATH code to run, and the second is a drocta ~ATH object to give as input to the script.In this function, there is a python variable called ATHVars which stores a dictionary of variable names as the keys, and the values being the ~ATH object that is currently pointed to by the variable. If you want to have python do something with a ~ATH object that a particular ~ATH variable points to, you could use this dictionary in order to get that object.At the end of the “evalScript” function, it returns the ~ATH object stored in the return_obj variable. This can be set by sayinganyothervariable.DIE(theObjectYouWantToReturn);So, one way that might work to do what you are wanting to do, is in the ~ATH script you want to run, you would first take all the objects you want to check if they are alive at the end of the script, use BIFURCATE or SPLIT .... ah phooey I never actually put split in this version I guess? ok repeated use of BIFURCATE it is then I guess.Anyway, you would use BIFURCATE to get an object which is the combination of all the objects you are interested in, in whatever way you put them together, and then you make it so that that object is the one you return at the end.If you have one of the ~ATH objects in python, the way to check if it is alive or not is to check the theobjectinquestion.living attribute (see bif.py for this part if you want).
You said “if I import an alive object“, which I’m not sure if might suggest that I haven’t explained how the “import” statement works in this clearly enough.
“import” is a bit of a misnomer here. For the most part, “import” is more of a way to declare new objects, not to import existing objects from a libraryIf I set aside a bunch of time to work on this more I would maybe add support for them actually being libraries?---Oh! If you want the python code to inspect (and possibly change) whether the object that a variable currently points to is alive or not while in the middle of the ~ATH script , a good way to do that would probably be to modify the part which it handles calling functions, and make it support calling functions which are written in python and included in a dictionary under some name, similar to how it uses the funCodes dictionary.
However, that might be kind of tricky to do if you uh, weren’t the one to write the code, because the code I wrote is rather messy? I started cleaning it up at one point by starting to write a parser instead of using the terrible regex that it currently uses, but I never finished writing the parser and integrating it into the interpreter. Bler...
I would like to do that at some point. Hmm...
Maybe I should schedule some time to do that? I have had more experience writing parsers and interpreters since then, so it shouldn’t be /that/ hard for me to clean some of this stuff up and add support for functions written in python.
I probably shouldn’t try working on that like, right now, because I have schoolwork I should be getting to, but, hm.
Hey, if you can, could you send me another ask in a few days to remind me to maybe schedule a day on which to write some stuff for this?
Anyway, thanks for asking. I’m happy to answer questions about this.
News and tutorials on drocta ~ATH by drocta. interpreter here A brief summary of how to write code in the language (but also see the table of contents)
38 posts