No offense but they're not getting inhumane shock treament either if you're going to pull "our stress is holier than thou" and say it's magnitudes higher, I'll be waiting scientific backing on this or else it's just rude... plus they can always just not make me periodically re-install all my addons with no option to just bypass verification... except this time it doesn't work even with the fixes. (Actually, one time I just didn't see it was set to update automatically downgrading one of them. I'm no expert on these issues, really. They just could have asked first in my opinion.) Thanks, Mozillama.
Edit: I had to click "Restart with addons disabled (safe mode)" for those wondering.
It is 0/0 that is undefined. For 1/0 the standard is either infinity (easily checkable in a language like JavaScript or C) or you get the usual talk that you can't mix infinity with numbers and the operation would be meaningless, etc.
I designed a logic-functional language called Cosmos (https://github.com/mcsoto/cosmos) based on what I thought would be a good/minimalist/innovative/easy-to-use language design that I'd like to program in. It's lacking in implementation, as it'd ideally have at least a VM in C (and a game framework, I like those).
One property of Cosmos is that there is no boolean type and relations are themselves booleans (q() would be false in this case). Hence, the code would be rather like this:
rel q()
true
false
...
rel main()
if(q())
...
Indeed, having an 'else' that negates the condition would get tough for complicated conditions. Negation-by-failure and soft-cut ('choose') have their own problems in certain circumstances.
Yeah, it's going to decide that | x = 0 | x = 2 (there is no CLP for strings).
1. I might have gotten a bit carried away when writing some parts of the article.
2. "Functors" are the same as functors from Prolog. Note that Prolog lists are functors too. They also may enable the language to have an 'Option' type like in some functional languages.
2. I completely didn't understand how a functor can make a list. Note, to me, a functor is a C++ class that overrides operator(). I loved how your writeup allowed me to understand Cosmos concepts _without_ learning Prolog, so an introduction to functors (maybe a later blog post?) would be warmly appreciated :-)
What the designer calls "functors" just appear to be positional records (or labeled tuples). In Lisp, a list is a series of nested pairs with an empty list as the last element: `(a . (b . ())`. The data structures the designer calls "functors" are just labeled pairs. The Lisp empty list, `()`, is the Cosmos term `Cons`, the Lisp pair `(a . ())` is the Cosmos compound term `Cons(a, Cons)`.
I think I'm having an internet crisis ... I read your article, and examined your project, and I've spent the last hour convinced that Cosmos is a very smart joke.
Forgive me if this is insulting, because either way (real or a prank), your project is impressive.
Can you help me out? Otherwise, I'll spend all night thinking that nondeterministic monads are the new hotness and then I'll need to quit programming and start selling scones on craigslist.
Modelling nondeterminism with monads is a fairly standard use of monads. Specifically, you can model multiple possible results with a (lazy) list, and list is a monad. That's about it.
I %100 support this project: though I am no expert, I am a PL enthusiast and I have high hopes for the future of logic programming. It's also just great to see projects like this exploring the space of PL design. The more the merrier! That being said, I tend to side with those who find the jocular arrogance of the writeup irritating and off putting rather than charming. My 2 cents, fwiw.
Stylistic quibbles aside, I have some reservations about the choices you've made in diverging from Prolog.
Your use of 'functor' seems to be different from Prolog's. You are therefore adding a forth or fifth meaning to the term, will have to compete with those already given by of Carnap, Quine, category theory, and OCaml. You are, thus, further muddying the sense of an already over-loaded term (http://pinealservo.com/posts/2014-10-22-ManyFunctionsOfFunct...). You seem to use 'functor' to refer to labeled tuples, or positional records. Prolog 'functors' are rather the atoms used to label such structures, e.g., `p(a)` and `p(a,b)` are different compounds with the same functor, 'p'. As a matter of fact, Prolog's compound structures do also serve as labeled tuples, but that is only a symptom of Prolog's explicit evaluation and homoiconicity. In fact, Prolog functors are "function like" in that we can call a functor on arguments, thereby instantiating a predicate. Your "functors" seem to be inert, and I think it would keep things much clearer if you just called them "records" or something. 'Functor' makes sense in the context of Prolog, where labeled compounds can be both data structures and propositions/propositional functions; for in that case, the atom used for labeling also serves a role akin to the string 'sin' in the function `sin(x)`.
This brings me to my other reservation: one of Prolog's real strengths, in my estimation, is the combination of explicit evaluation, unification, and homoiconicity. That combination gives us many higher order behaviors for free and facilitates meta programming. Thus, explicit evaluation and data-as-code means the compound `p(a)` can be mapped over a list, giving us partial application of `p(a,X)`. We also get the equivalence of first-class functions, allowing predicates to be passed as arguments to other predicates. We are also permitted remarkably deep reflection, including unification-matching on predicates and arbitrary data structures: e.g., I can do `p(X,q(r,S)) = p(2+2, Y)` to get the assignments `X = 2+2, Y = q(r,S)` and then `Sum is X * 2`, to get `Sum = 8`, and `S` will still be free until bound to something later.
This is why we differentiate the unification operator `=/2` from the arithmetic evaluation operator `is/2` and various equality operators. Contrary to your assertion, `X = 1+2` works very well, allowing me to do `X =.. [F|Args]` to get the assignments `F = +, Args = [1,2]`, so I can choose to multiply the arguments instead (e.g., `Y =.. [*|Args], Product is Y` getting `Product = 2`), inspect he functor (in this case, `+`), or simply pattern match to get the values in X (`2+Y = X` yielding the assignment `Y = 2`).
As a Prolog user, I have to say, I wouldn't dream of giving up this flexibility just to save the trouble of writing commas for explicit conjunctions and gain the (dubious) convenience of an operator that conflates assignment and equality.
Lastly, as an SWI-Prolog user, it is disingenuous to ask "where is list.map or string.concat?", as I'm sure you are well aware that both of those predicates (and many more besides) are supplied in the standard library. SWI, great as it is, still wants for features, but basic operations like those are well provided for.
So, there's some criticism from an inexpert enthusiast. Truly, I am inspired by your effort and look forward to trying out your language!
Edit: I had to click "Restart with addons disabled (safe mode)" for those wondering.