aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2023-11-09 16:22:29 -0500
committerAnthony Wang2023-11-09 16:22:29 -0500
commitd6f7ab88dc4a5a919a831d4ad6d99f7617a163d0 (patch)
tree342a0a0498323baeb9470afe7b9975ddaff96357
parent07f67815ef01231e16c6f444ed57c77dc972603d (diff)
Stupid stuffHEADmaster
-rw-r--r--README.md4
-rw-r--r--main.ev11
-rw-r--r--main.py41
3 files changed, 54 insertions, 2 deletions
diff --git a/README.md b/README.md
index 000a4da..bad9769 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,3 @@
-# everything
+# Everything
-The massively-parallel programming language of the future! \ No newline at end of file
+The massively parallelizable programming language of the future! Everything runs every line of your program at the same time, so you'll never have to worry about manually parallelizing your program ever again! Your program just goes blazingly fast by default!
diff --git a/main.ev b/main.ev
new file mode 100644
index 0000000..b95bfcc
--- /dev/null
+++ b/main.ev
@@ -0,0 +1,11 @@
+sub a b 1
+print a c 2
+set a 10 0
+set b 1 0
+set c hi 0
+set a 10 0
+set b 1 0
+set c hi 0
+set a 10 0
+set b 1 0
+set c hi 0
diff --git a/main.py b/main.py
new file mode 100644
index 0000000..d571bac
--- /dev/null
+++ b/main.py
@@ -0,0 +1,41 @@
+import random
+import threading
+import time
+import sys
+
+mem = {}
+threads = []
+
+def thread(a, b, c, d):
+ def f():
+ # print(a, b, c, d)
+ try:
+ match a:
+ case 'set':
+ try:
+ mem[b] = int(c)
+ except:
+ mem[b] = c
+ case 'print':
+ print(mem[c])
+ case 'add':
+ mem[b] += mem[c]
+ case 'sub':
+ mem[b] -= mem[c]
+ case 'mul':
+ mem[b] *= mem[c]
+ case 'div':
+ mem[b] /= mem[c]
+ if mem[b] > 0 and int(d) > 0:
+ time.sleep(0.001)
+ threads[int(d) - 1]()
+ except:
+ return
+ return f
+
+with open(sys.argv[1]) as f:
+ for line in f.readlines():
+ threads.append(thread(*line.split()))
+
+for thread in sorted(threads, key=lambda _: random.random()):
+ threading.Thread(target=thread).start()