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?
Sentient: a high-level, declarative programming language
21–27 of 27 posts
Re: Sentient: a high-level, declarative programming language
#22Why does the subset sum example here seem to fail on '0'? Or is it just returning the empty set?
Also, there's an easter egg hidden in this example.
Re: Sentient: a high-level, declarative programming language
#23Neat, but not the most illuminating introductory demo. Took me a few minutes to figure out the UI is filling in the blanks at runtime, and I still don't see how/where it assigns an index to "members", or how it reasons about "members" at all. 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 runti…
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.
Re: Sentient: a high-level, declarative programming language
#24https://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.
Re: Sentient: a high-level, declarative programming language
#25Earlier quoted context omitted.
I think one programming paradigm that is very underserved is something in the sorts of filters. 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…
I'm inclined to agree but if an nginx filter is like (HttpRequest, HttpResponse) => (HttpRequest, HttpResponse) then aren't we basically saying we like purely problems that can be expressed as compositions of pure functions? Signal programming I have less feelings on
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).
Re: Sentient: a high-level, declarative programming language
#26Earlier quoted context omitted.
I think one programming paradigm that is very underserved is something in the sorts of filters. 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…
You might be interested in Halide: https://halide-lang.org/
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.