Hacker News new | past | comments | ask | show | jobs | submit login

Looking at the example code, it seems that this is perl-ifying Python. And I'm not saying that as a good thing. The code is more terse and less readable & understandable.



It's haskellfying it.

Some of those are very needed constructions (like algebraic data types with pattern matching), but it's adding an entire sub-language into a language that is built on the goal of being simple. I'm not sold into it either.


This is the reason why all of these "mashup" languages are so pointless.

Everyone feels like X language is so great but if only we could add a feature from Y language to it. They then attempt to trivialize what is needed for that feature not realizing that the benefits of Y are due, in part, to the non-trivial amount of functionality. They almost always turn into a façade of the feature they truly want to support and they never gain traction because their usefulness just really isn't there.


I agree. Likely-unpopular corollary: the same is true of adding threads to JavaScript (server or client).


I could be missing something but saying this language has ADTs is stretching the definition of ADT a bit much for me. ADTs are defined by combining simpler types (usually with sum and product types) but that does not seem to be possible in Coconut.


Very disappointing, like why bother doing ADTs if you aren't going to do them right and have exhaustive pattern matching.


Yes, it's stretching, but there is a section for it.

The sum types are create by multiple data declarations joined by directives. It's ugly, messy, error-prone and as your sibling comment says, misses the point of enabling static verification.


I'm a big fan of ADTs and pattern matching, but I hardly see the point in a dynamic language. I also like Haskell because of its type safety and _in spite of_ its syntax, so this sort of feels like the worst of all worlds to me.


I'd like to see an actually pythonic Haskell. Needs the right designer.


It's actually quite possible to write 'pythonic' haskell, if by pythonic you mean 'kind to human readers'. Many of the obscure < * > style infixes in Haskell have prefix counterparts ( for < * >: liftA2 id). Unfortunately infix is preferred by most haskellers, and the prefix english language forms derive their terminology from advanced branches of mathematics, which make them difficult to understand and use intuitively without sufficient background.

That said, all of these things are symptoms of the preferences of the community around the language, and not restrictions imposed by the language design itself. Core Haskell is actually comprised of some pretty easily understandable functions. You can craft synonyms for more advanced abstractions such as applicative fairly easily once you understand the type system. Haskell more or less gives you everything you need to write functional programs in a way that reads like plain english--this is very uncommon however, given the language's origin and close connection with mathematics.


I remember reading an old post by Gabriel Gonzales on exactly this topic: http://www.haskellforall.com/2015/09/how-to-make-your-haskel...

On the other hand, once I did get used to some of the infix operators, I started to really like some of them, i.e. how:

f data data

becomes

f <$> fancyData <*> fancyData

where what makes the data fancy might be validation, being in container like list, or even some sort of reactive-ui-component, like Flare library for Purescript does: http://try.purescript.org/?backend=flare


this statement makes we wonder: what does pythonic exactly mean?


The important part to me is good ergonomics from the point of view of the programmer and reader.

Beyond that, some particulars:

* Being terse is a lower priority than usual

* Cool features are a lower priority than usual

* Be careful how you use and then re-use symbols (Haskell can be confusing this way).

* Use English (or whatever spoken language) in your symbols


Coconut seems anti all of those. In particular all of the weird infix operators ( ` $.> `, ` :&$ `, etc) [1]. Gives me flashbacks to dealing with Haskell.

[1]: I just made those up, but I wouldn’t be surprised if they were real.


I've started to hate the phrase pythonic at work. its ambiguous and leads to bikesheding.


When talking about a language it usually means the design principles summarized in "The Zen of Python"[1]. When talking about Python code it can also mean "idiomatic".

[1] https://www.python.org/dev/peps/pep-0020/


Elixir-ifying Python, maybe? The only Perlism I recognize are the dollar signs, but that could be PHP.


I've done my fair share of Elixir. And this looks like you hit it right on the nail. Elixir is a great language, but I think Python is Python and Elixir is Elixir. We shouldn't me complicating any more than it already is (not that python is complicated, just adding another languages functionality another hurdle to learn).


It's got the pipe operator, but that's about it.


I always refer back to PEP 20 when thinking about these issues (and many things in life actually):

https://www.python.org/dev/peps/pep-0020/

"Explicit is better than implicit."




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: