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

The only popular language I can think of that requires side effects to be declared is Haskell. Which doesn't have a distinction between statements and expressions.

Are there any good examples of languages that have it, where it isn't "useless"?




python, javascript, pretty much any language that is popular. I believe everything in Haskell is an expression, even the do notation, no?

But I think the argument being advanced is that the distinction between statements and expressions is fundamentally unnecessary. I don’t really know of any good argument in favour of them: I tend to think lisps have the perfect and simplest possible syntax.


Python, Lisp and Javascript don't require functions with side effects to be declared in a particular way. Haskell does.


The question was about expressions vs statements, not about the IO type.


I was replying to the point programmer_dude made in his comment.


Yes, that is indeed the point I was making. And yes, I’m a lisp programmer.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: