Live data from Hacker News

An Opinionated Treatise on Cosmos, a New Programming Language

medium.com

21–30 of 66 posts

Re: An Opinionated Treatise on Cosmos, a New Programming Language

#21
Thanks for the replies. A few comments:

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.

Re: An Opinionated Treatise on Cosmos, a New Programming Language

#22

It's really neat that someone is trying to make logic programming accessible, but the introduction and the first fews sections are really offputting. There are lots of highly performant new languages competing for attention, and statements like "Today I want to talk about programming. It is interesting to note that I have solved it. Yes, I solved it." will drive a lot of the potential audience away. I recommend break…

I quite liked the opinion part.

Specifically, I liked it because there's a huge number of opinions on programming languages and (as the author notes) people ranting against other people's opinions on programming languages. I think it's very valuable to say: I understand the ecosystem of opinions on programming languages and purport to be above that.

You know he's not serious when he says it is the best language (the word 'opinionated' is even in the HN title, though not the article itself?), but you know it means that he's trying to go beyond bickering over functional vs imperative, typed vs untyped, etc. It got my attention and started me out with a good impression.

It.. somewhat delivered. I don't know Prolog, which makes it harder to decide. Some of the opinions are very reasonable and reflect awareness of language-advocate-bickering (for example I agree that 'optional typing' is the only defensible way to handle types if you are trying to unify lots of preferences on languages). But non-deterministic variables, while cool, look like black magic to me and I can't judge their good-vs-bad-ness from this article.

Re: An Opinionated Treatise on Cosmos, a New Programming Language

#23

Thanks for the replies. A few comments: 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.

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.

Re: An Opinionated Treatise on Cosmos, a New Programming Language

#24
A fun paper, but it neglected to explain its means of modularization. I had to read the language implementation to discover the 'require' keyword used to import functions.

Projects like Mercury (http://mercurylang.org/) are also covering similar space.

Re: An Opinionated Treatise on Cosmos, a New Programming Language

#26
It is cute, but you can't design a language for toy problems or you run into problems with bigger software.

I kind of stopped reading here:

"Since it is declarative code, update returns a new world w2 instead of merely modifying w1. The funny thing is, just by doing this our code becomes 200% better. For example, you can now modify the code to store all world states in a list!"

Uh huh. Try doing that with a nontrivial game that needs to be performant, and let me know how that works out.

Re: An Opinionated Treatise on Cosmos, a New Programming Language

#27
post #26

It is cute, but you can't design a language for toy problems or you run into problems with bigger software. I kind of stopped reading here: "Since it is declarative code, update returns a new world w2 instead of merely modifying w1. The funny thing is, just by doing this our code becomes 200% better. For example, you can now modify the code to store all world states in a list!" Uh huh. Try doing that with a nontrivia…

I should clarify before people respond antagonistically ... as someone who is designing a programming language, I think it's great any time someone is making languages and trying out new ideas. That part is great, if you want to make a functional imperative declarative loosely strongly typed language then hey, go for it.

But I think one has a responsibility not to try and sell one's project as something it's not, which especially means being careful with claims. I know this is sometimes hard because a lot of language design stuff comes from the academic community which notoriously overclaims (because it is their job to overclaim), and it is easy for that culture to rub off.

But if you are going to say something like "just by doing this our code becomes 200% better", with a straight face, about something that most practitioners know is going to be terrible in most cases without a tremendous amount of additional work and solving of unsolved problems (solution not shown), you're just telling the reader that they can't take you seriously. It's a bad thing to do.

Re: An Opinionated Treatise on Cosmos, a New Programming Language

#28

So I think that there are a lot of good ideas in here. Unfortunately, since I've never seen an application written in your language, I have no idea whether it's good or not. Lemme tell you about TI-BASIC (for the TI-84). That stuff was the bee's knees. One day I wrote a really slow loop to translate whatever key was pressed into a number if the key corresponded to a button on the number pad. [1] In JS the loop would…

Did you read the TFA? It linked to the cosmos implementation, along with the information that it was implemented in cosmos.

Here's one file from it:

https://github.com/mcsoto/cosmos/blob/master/src/cosmos.cosm...

Re: An Opinionated Treatise on Cosmos, a New Programming Language

#29
post #10
post #9

I wonder why they're called functors.

It's a pretty overloaded term. I haven't looked into the Cosmos semantics much, but since it's mentioned in the "logic programming" part of the language, I suspect it's referencing the Prolog sense of the term: http://www.cse.unsw.edu.au/~billw/prologdict.html#functor

Oh, there you go. I'd never heard them in that context before.
Post reply on HN