I am planning two features to add.
one us user defined functions.
the second is, uh, it would let you make an object that would have itself as one of its components or one of the component of one of its components etc.?
the third one I am not sure if I think it is dumb yet, but I was thinking maybe functions being objects that you can bifurcate together to make functions.
which would allow for macros kind of?
which of these three features are good ideas, (as in, for each, it is a good idea)?
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!
Ok, if you tried running a script with the interpreter, it might not have run properly. The part of the code that handles what part of the code is executed next is buggy. It is in the process of being fixed. Also, if python gives you a syntax error, it is probably because you are using a different version of python. Change raw_input to input And change print stuff to print(stuff) I will post an introduction to the syntax soon.
How do you use this?
Just to be super clear, though you probably understand this, “drocta ~ath” is not for practical purpose. It is purely an amusement.
That being said, to run this, you need to have python 2 installed. (Yes, currently most new python projects are in python 3. Unfortunately I haven’t gotten around to making any of the updates I’ve wanted to on this project, and it has been years since I’ve worked on it.)
To run it: download the github repository from https://github.com/drocta/TILDE-ATH
then, (probably from the command line, though running it in other ways may also work) navigate into the folder where you put all those files, use python 2 in order to run interp_2.py . [1] Then, it will allow you to type something in. It would be good if it gave some sort of prompt saying that it is accepting input, but it currently does not. What you have to type in is the file name of the drocta ~ath program that you want to run.
for example, you might type:
python interp_2.py looptest.~ATH
in order to run the program looptest.~ATH , and then you would see the output:that alternates between “APPLE” and “ORANGE” a number of times (like, 5 times I think).
If it isn’t working for you, let me know and I can try and help you troubleshoot what’s going on.
If you are asking, not “how do I run the programs in this language” but “how do I write programs in this language”, uh, read through the rest of this blog I guess. It isn’t complete, but the point of this blog was meant to be a tutorial for how the language works. If you have any particular questions about how to do a particular thing in the language, then ask that. But I don’t currently have time to re-do the whole project of this blog and put a tutorial for the language as a whole in one response to an ask.
P.S. I am currently in grad school for math (I made this language while in high school). I haven’t been doing all that much programming lately unfortunately.
([1] What’s that? “interp_2.py” is a weird name for the main file? Indeed it is. Originally I had “interp.py” and then before I started using git I made a new version which I called interp_2.py, and then, for basically no good reason, I kept that name for the file. If I go back to this at all, I suspect that I will change that to just “interp.py” or maybe “main.py” or something. idk.)
Heyho, I now red alot of your sources and i started to understand your interpretation of ~ATH. You do alot of things with the bifurcate command.. I actually thought that bifrucate JUST splits the programm in different colors like here : "bifurcate THIS[THIS(red), THIS(blue)]; " I think that you can actually split your script into N colors while N > 0. like this: bifrucate THIS[THIS(COLOR(0),THIS(COLOR(1),THIS(COLOR(2),THIS(COLOR(3),THIS(COLOR(4),THIS(COLOR(5),THIS(COLOR(6)] and so on.
Yes. I do use BIFURCATE often.
Personally, I doubt that one could say
BIFURCATE A[D,B,C]; (for some names and colors for a b c and d),
because of the "Bi" part of the word "bifurcate", meaning two. (or in some cases, "both")
Further, I would defend my use of it to BIFURCATE things other than THIS with http://mspaintadventures.com/?viewmap=6 which, for the start of act 5, says
BIFURCATE ACT_5[red(ACT_1), blue(ACT_2)];
which seems to indicate that things other than THIS can be BIFURCATED.
To split something into more than 2 parts, I would just bifurcate it multiple times. *
I don't know what the etiquette is for whether I should click publish or answer privately, so I am going to pick one and hope for the best.
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.
My ~ATH keeps crashing whenever I run a non-computer exploding code, or if I press enter. Why is this?
Based on the username which recently followed this blog at the same time as I received this ask (which I won't say what it was because you asked this on anon, and haven't received permission), I'd guess that you may be running a different version of ~ATH than the one I document here :P
Unfortunately, I don't have a specification for the version you have.
If you have such a specification, or the executable for it, I'd be happy to take a look if you could send it to me, haha.
If on the off chance you are using the version I document here, then presumably you have a syntax error or something in your code?
ok, so last time I didn't actually get to converting from unary to binary again.
So I guess I will do that here. (HAHA I JUST GOT IT TO DIVIDE WITH REMAINDER. APPLYING THAT TO THE CONVERSION IN PART 2)
so to do this we have to find the largest power of two not greater than the number, then the largest power of two not greater then what is remaining of the number, and repeat until we reach zero.
OR we can
find the largest power of two not greater than the number, then for each power of two less than the number, if it is not greater than it, use a 1 and subtract it from the remaining number.
and then for both of these, of course, reverse the result at the end so it is in the right order.
I think so far the second one of these sounds better.
but come to think of it, repeated integer division by two might work well.
that is, instead of repeated doubling, and then checking which one is larger, it might be faster to do repeated halving. (with a remained of either zero or one)
this could be then used to make a integer base 2 logarithm, with a remainder thing.
and instead of checking each power of two less than it, we could just find the integer base 2 log, and the base 2 log of the "remainder" and the base 2 log of THAT remainder and so on.
that seems like its the best way to me so far, but how do we take the integer logarithm AND get the log remainder thing?
getting the logarithm is fairly simple, just keep dividing by the number until you reach 1.
but how do you get the remainder part? and also how do you do the integer division in the first place with these number like things that we have created?
well lets answer the first of those questions first.
It seems like the remainder of the logarithm is probably related to the remainders of the divisions that make it up.
so lets look at taking the integer base 2 logarithm of 9:
9 4 (rem 1) 2 1
that took 3 halvings, and there was one remainder of one.
what if we try on 10 or something though?
10 5 2 (rem 1) 1
that also took 3 steps and one remainder, but the remainder was on a different step.
now lets try 11
11
5 (rem 1) 2 (rem 1) 1 (rem 0)
now wait, theres a pattern here, which might allow for converting it even faster.
the remainders of the divisions are the remainders of the logs expressed in binary!
we COULD turn them back into unary, so we could take the log of it again,
but what we are doing it converting it into binary anyway! (so that would be a silly step)
so if we look at what we were doing with the repeated division again, but looking at the numbers in binary, it will be pretty evident how to convert it in a better way.:
lets try 9 again (which is 1001)
1001
100 (rem 1) 10 (rem 0) 1 (rem 0) 0 (rem 1)
whats that? the remainders are the number we want in binary?
and now that I think of that it was kind of obvious?
yes. I for some reason did not think of that earlier.
so yeah, thats what we will do, we will repeatedly integer divide the number by 2 until we reach zero, and the remainders will be the number in binary.
but wait, we haven't even written out how to divide the number by two in the first place!
well turns out its not actually that hard to do.
in a loop (that keeps looping provided the number is not zero) subtract one, and if its still not zero, subtract one again. if it is zero after the first subtracting, the remainder of that division is 1. (only the last loop will cause the remainder to be 1) count the number of times where 2 was subtracted.
so like for 5 that would be
5 3 1 1 2 0 2 (remainder 1)
so that gives the correct answer (2 with remainder zero)
ok, now to implement this integer division by 2 in drocta ~ATH (wow! already? that was fast! /sarcasm)
//given that NUM is the variable that has the name we are halving BIFURCATE [NUM,NUM]2NUM; BIFURCATE 2NUM[NUMCPY,JUNK]; BIFURCATE [BLAH,BLAH]2BLAH; BIFURCATE 2NULL[SUBCOUNT,REMAINDER]; ~ATH(NUMCPY){ BIFURCATE 2BLAH[UNEVEN,JUNK]; BIFURCATE NUMCPY[JUNK,NUMCPY]; BIFURCATE [NUMCPY,NUMCPY]2NUMCPY; BIFURCATE 2NUMCPY[NUMCPYCPY,JUNK]; ~ATH(NUMCPYCPY){ BIFURCATE [BLAH,SUBCOUNT]SUBCOUNT; BIFURCATE NUMCPY[JUNK,NUMCPY]; BIFURCATE 2NULL[UNEVEN,NUMCPYCPY]; } ~ATH(UNEVEN){ BIFURCATE [BLAH,REMAINDER]REMAINDER; BIFURCATE 2NULL[UNEVEN,JUNK]; } } BIFURCATE [NUMCPY,NUMCPY]2NUMCPY; BIFURCATE 2NUMCPY[NUMDIV2,JUNK];
ok, that should divide the number by 2, put the result in NUMDIV2, and put the remainder in REMAINDER.
this takes linear time based on the size of the unary number. (provided I didn't make a mistake)
so now it is time to make sure it works, hold on a second while I check it. (I mean, im not going to post this until after I check it, so it doesn't really make sense to tell you to wait, because you just keep reading, but as I am writing this, I am about to test it.)
ok, I tested it. and it didn't seem to work, but then I realized that I made a mistake in making the test. (I checked the wrong variable)
but yeah, turns out that works...
ok, so now we need to repeatedly divide the number by two to get the remainders.
and we need to store these remainders in a list or something.
I am still here, and I am wondering what my update schedule for this tutorial should be.
Its been a week or two since I last posted part of the tutorial, so I feel like I probably should have posted during that time, but I haven't.
I will probably post one today.
Do you have any suggestions for what type of update schedule I should keep on this tutorial?
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!
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