Sentient: a high-level, declarative programming language
sentient-lang.org
sentient-lang.org
In the Star Trek fictional universe, you often see characters programming impossibly complex things very quickly. There's several episodes where a character will create a holodeck simulation simply by describing what they want and providing detail for the parts the computer got wrong until the simulation is more or less what they want.
I feel like in some cases we're starting to figure this out like with GauGAN: https://www.youtube.com/watch?v=p5U4NgVGAwg
But what about other cases? Can we just sort of describe the output we want, feed in data and have the computer more or less figure out the set of functions that produces what we're looking for? Such a paradigm would basically allow anybody to make a huge array of one-off, ultra-custom, long-tail, "programs" that solve extremely niche needs without needing to learn all the rigor of actually programming.
https://www.youtube.com/watch?v=uqV9BlxEG5s
Horribly patent-encumbered, of course, so you can't use it outside Excel, but still.
GPU shaders, Signal Processing or a Nginx filter are all on this line of thinking.
We should be more inclined into program things as filters where we manipulate and maybe mutate/transform the data that is passing through that filter, so this could be easily paralelized, cut a lot of expensive CPU branches and where humans and machines could work together making those filters. (It would be much easiar for an AI to infer/learn about how to program like this)
In this perspective how we layout and shape the data is much more important.. so if we could create new standards where we can represent anything as a matrix for instance, we could have state-of-the-art engines who would care about scheduling, compilation and paralelization so we could only focus on manipulate and transform data according to the goals of what we are trying to achieve.
As you might need to call another function inside of our procedure that mutates some data.
But i think there are some sort of problems we are imposing to ourselves just because we need to deal with the millions possible ways a data could be laid out or modeled based in our type-system centric world.
In my perfect world, we should model functions in a DNA fashion, so function is also data, and if is mutable, could even be changed by the data depending of the what is in it.
First, we would never have to re-create a function again, and if we do, the data signature would be exactly the same as the other one created before, so we can match in a index for instance.
Im more inspired by the way things are done in the natural world, than the way we ended up shaping math (where the concepts of FP are more based on).
The fact that we are creating arbitrary abstractions to represent data and imposing to others is actually the core issue here.
Supose we could set up the representation for the most things as a matrix. colors, words, sound, etc..
Than you can filter and process applying linear algebra, ML, etc..
I fell that the way we pack bytes, in arbitrary fashion, by mixing types is a core impediment for us to have a better experience with the program/data duality.
But i guess that all of this data centered, AI focused world will make us understand a better way to deal with both programs and data. The need to make our ML agents understand our world will probably change the way we deal with code and data.
But i think will be a long way til we reach tools that are more like that.
We are very dependent of the current data formats, software and tools, and going into this direction, would mean to leave a lot of working good stuff behind.
Heres the evidence: There are no unbreakable cyphers in Startrek, it's merely a matter of time or Datas smarts until whatever species of the weeks encrypted message is broken.
Thus, most optimisation and search problems are easily solvable in their universe including automatic program synthesis.
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.
Am I understanding this correctly? Or am I missing something? What are the differences between Sentient and MiniZinc etc?
Also confusing is declaring sum=0 instead of sum=?, since the program doesn't know what "sum" is until runtime. If I change the declaration to sum=10, does that change the runtime count?
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.