Show HN: I made an esoteric programming language that's read like a spellbook (github.com)
it's literally read like a spellbook because the syntax consists of all natural language, and newlines are optional. your code can now be an essay, like everybody wants!
for example, if you want to print something, you'd write: `begin the grimoire. inscribe whispers of "hello, world!". close the grimoire.`
it has variables, dynamic typing, arrays, functions, conditionals, loops, string manipulation, array manipulation, type conversion, and user input, among other (listed in the docs!)
but why? i wanted to see how far you could push natural language syntax while still being parseable. most esolangs are intentionally obtuse (BF, Malbolge), but i wanted something that's weird but readable, like you're reading instructions from a spellbook, which makes it incredibly easy to read and understand. like an anti-esolang? hmm...
github: https://github.com/sirbread/spellscript
docs: https://github.com/sirbread/spellscript/blob/main/resources/...
34 comments
[ 3.1 ms ] story [ 57.2 ms ] thread1: https://codewithrockstar.com
2: https://youtu.be/6avJHaC3C2U
This is not natural language.
This is the true value of AI.
More such creative projects please.
Flipping through it just now I was struck with several observations. First, it has a very formal structure (Proposition N Theorem M Phenomena P etc). And also the sheer amount of work he did in (Euclidian) geometry prior to even discussing gravity or calculus. But most remarkably of all, how little a computer would have helped Newton in his work. Oh sure, a computer would have helped Kepler a great deal! And even Newton is not without his tables. Newton would have really enjoyed Mathematica, but even it would have been useless since it assumes what Newton sought to prove.
In any event, this all leads me to realize what a narrow place traditional computation has within the entire field of human communication. The optimist in me sees this as affirming the unique power of the human mind; the pessimist notes that there are always more ways to get a problem wrong than to get it right.
P.S. The Principia is as often a philosophical work as a scientific one. Consider this excerpt:
RULE I. We are i’o admit no more causes of natural things than such as are both true and sufficient to explain their appearances.
To this purpose the philosophers say that Nature does nothing in vain, and more is in vain when less will serve; for Nature is pleased with simplicity, and affects not the pomp of superfluous causes.
RULE II. Therefore to the same natural effects we must, as far as possible, assign the same causes.
As to respiration in a man and in a beast; the descent of stones in Europe and in America ; the light of our culinary fire and of the sun; the reflection of light in the earth, and in the planets.
RULE III. The qualities of bodies, which admit neither intension nor remission of degrees, and which are found to belong to all bodies within the reach of our experiments, are to be esteemed the universal qualities of all bodies whatsoever.
These Rules of Newton have become so far subsumed into the zeitgeist that we hardly ever repeat them. (It reminds me of the feeling I got reading Descartes math papers). Indeed, most modern physicists scoff at philosophy for just this reason, because to them it's been "solved" and remains only as a jobs program for verbally talented charlatans. This is deeply unfortunate for at least two reasons: first, it is dangerous to assume the basics will always be in place; civilizational drift is quite real. Second, you give up using those same tools to advance human knowledge further - if Newton was able to use philosophy to clarify his point and purpose, surely another scientist might as well.
0 - https://archive.org/details/IsaacNewtonPrincipiaEnglish1846/...
would be a little bit better styled as you can define the class of the var x. Thus defining it descriptively as a Thing. You can group similar Things in a collection or you can throw them all in a bag.
https://metacpan.org/dist/Lingua-Romana-Perligata/view/lib/L...
I think you should read some actual grimoires before developing this further. I suggest the Picatrix or the PGM as starting points. Maybe a copy of 777 as well.
That said, perhaps something like this would be more thematically appropriate:
'O Master of sublime name and great power, O Saturn: Cold, Sterile, Mournful, Pernicious; Sage and Solitary, Impenetrable and Sure; Thou who knowest no joy, bringest prosperity or ruin, deceivest wisely, judgest truly— I conjure thee, Supreme Father, by thy bounty and ancient cunning, to do as I ask: print("hello world")'
If you know more than someone else does, that's great! Please do share some of what you know so the rest of us can learn. But don't put down the other person. That never helps, and it tarnishes your positive contribution in a way that is bad for the community.
https://hn.algolia.com/?dateRange=all&page=0&prefix=true&sor...
https://news.ycombinator.com/newsguidelines.html
Fantastic idea. Now I'm in the mood of implementing this scripting language for a game builder.
(but I will admit to this day 30 years later I still remember scheme because of that project)
https://suberic.net/~dmm/projects/mystical/README.html
If you're interested in the idea of treating programming with an air of mysticism, Daniel Suarez's scifi novel "Daemon" is a highly recommended read.
https://en.wikipedia.org/wiki/Daemon_(novel)
Should this not be "(essence of (0 through (ritual amplify with power)))?
https://aphyr.com/posts/341-hexing-the-technical-interview
“O mighty jsonparse, he who calls forth structure from the chaos; O clever urllib, ethereal messenger who weaves between worlds; O wise flogger, who scribes our deeds in the book of names that they shall never be forgotten…”
If you fail to heap sufficient praise on the libraries, they refuse to help you run your program.
But I enjoy the idea so much that I'd like to see a useful version of it. When you think about it, most programming languages already read in your head like language, even if you're using operators.
So there's no need to be that verbose, if you want to print something just go whisper "hello", or even just wh "hello".
When a programmer reads a spellscript it will still sound like a spell in their head, it doesn't have to look like a spell to non-coders.
To expand further on that. Declare is already a great spell word, just use declare for variables.
I think summon should be used for importing libraries.
Just imagine if you wrote a game in this. "Summon orc from creatures".
https://archive.org/details/JohnDeesFiveBooksOfMysterJosephH...