5 ms·
Sentient: a high-level, declarative programming language
- dang 7y agoThis is pretty neat about this: https://news.ycombinator.com/item?id=12429393 https://news.ycombinator.com/item?id=12429393.
- carapace 7y agoSee also Tau Prolog implemented in Javascript http://tau-prolog.org/ http://tau-prolog.org/
- spedru 7y agoSo the webdev crowd have invented Prolog?
- fao_ 7y agoI know this comment is being flagged as inflammatory, but I appreciate knowing that there are at least some other people who find people rewriting eveything in webtech tiring.
- detaro 7y agoSo what has been "rewritten" here? Does the fact that other declarative programming languages exist mean the author shouldn't experiment with their own, or do you merely object to their choice of tech stack for this?
- KennyCason 7y agoAgreed. Furthermore, taking on a project like this is a great learning process. I’d encourage more people to experiment like this.
- bane 7y agoSomething feels kind of "right" about this in the same sense that machine learning techniques seem to be able to produce correct results. In my "things that exist in Star Trek:TNG that we should be making more progress on" list, I think that how we program is wrong for a great many of use-cases. 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 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.
- oscargrouch 7y agoI 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 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.
- hderms 7y agoI'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
- oscargrouch 7y agoin Nginx HttpRequest/HttpResponse are larger abstractions but the "real fun" will happen at the buffers, where you will end up mostly manipulating bytes on the buffers. 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.
- 7y ago
- i_don_t_know 7y agoAt first glance, this appears to be similar to languages like MiniZinc (https://www.minizinc.org/ https://www.minizinc.org/) and maybe AMPL (https://ampl.com/ https://ampl.com/). That is, you describe a problem in some form of constraint-based programming language, and you send it to a solver to find the solution. Am I understanding this correctly? Or am I missing something? What are the differences between Sentient and MiniZinc etc?
- xvilka 7y agoProlog, and Lambda Prolog are much more universal. See the Awesome Prolog[1] list for more resources and examples. [1] https://github.com/klaussinani/awesome-prolog https://github.com/klaussinani/awesome-prolog
- Gormisdomai 7y agoWhy does the subset sum example here seem to fail on '0'? Or is it just returning the empty set?
- cpatuzzo 7y agoIt's returning the empty set. You can click on the grid to cycle through some of the solutions. Also, there's an easter egg hidden in this example.
- angel_j 7y agoNeat, 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 runtime count?
- cpatuzzo 7y ago>Neat, but not the most illuminating introductory demo. 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.
- cpatuzzo 7y agoHey everyone, I'm really flattered by everyone's interest in the language. I had no expectation of that when I worked on it. I'm happy to try and answer questions, though my memory's a bit fuzzy now. I think the reason for this sudden interest was this self-referential Tweet by Robin Houston which used Sentient to construct a pangram: https://twitter.com/robinhouston/status/1177575725240639489?s=20 https://twitter.com/robinhouston/status/1177575725240639489?... The best resource to understand the language is probably this podcast: https://whyarecomputers.com/4 https://whyarecomputers.com/4 I'm immensely grateful to Tom for coaxing me into recording it with him.
- tiberius_p 7y agothis is something that hardware verification languages like specman-e and systemverilog have been doing for decades