News for hackers. Stuff that matters.
Re:An Opinionated Treatise on Cosmos, a New Programming Lang... by skrebbel on Tuesday November 18, 2014 @02:45AM (#8622855)
1. Please keep getting carried away

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 :-)

Re:An Opinionated Treatise on Cosmos, a New Programming Lang... by tempodox on Tuesday November 18, 2014 @07:58AM (#8623669)
Yes, C++ is notorious for abusing the “functor” concept in the way you mention. Compare the Wikipedia article: http://en.wikipedia.org/wiki/Functor

A better way to describe a class that defines the »operator apply« is “function object”, as it is called in Lisp.

Re:An Opinionated Treatise on Cosmos, a New Programming Lang... by abathologist on Tuesday November 18, 2014 @03:24PM (#8626094)
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)`.
Re:An Opinionated Treatise on Cosmos, a New Programming Lang... by tomp on Tuesday November 18, 2014 @04:28AM (#8623104)
To me, a functor is a ML function from modules to modules :)