148 karma · joined March 13, 2016
https://twitter.com/robinhouston/status/1177575725240639489?...
The best resource to understand the language is probably this podcast: https://whyarecomputers.com/4
I'm immensely grateful to Tom for coaxing me into recording it with him.
Agreed. It was the first one I made so it just happened to become the homepage. It'd probably be better served by one of the others.
>I still don't see how/where it assigns an index to "members", or how it reasons about "members" at all
Members is an array of booleans. Its intended meaning is: "is the number with this index in the subset?". When it iterates over the numbers, it only adds them to the sum if members[index] is true. The standard library is light so doesn't have a #zip function which would probably help clarity.
>Also confusing is declaring sum=0 instead of sum=?
I think this demonstrates an unusual thing about Sentient in that you can write your constraint-based programs in a procedural style, but their evaluation is far from procedural such that you can set sum to anything you like at runtime.
I sometimes think of Sentient programs as running over the space of all possible values for variables. Sometimes they're completely deterministic (as in a conventional language) but other times they're determined at runtime as a consequence of the invariants of your program.
It reminds me a bit of quantum physics where the 'act of measuring' seems to determine the actual value of something.
Also, there's an easter egg hidden in this example.