3 ms·
As a Python programmer, the appeal of the Haskell family seems to be correctness -- I've come to think of Python as a "surprisingly typed" language. This parti
by sevensor 10y ago
As a Python programmer, the appeal of the Haskell family seems to be correctness -- I've come to think of Python as a "surprisingly typed" language. This particular language looks like it has Haskelly syntax without the type system. I'd be most interested in the latter; I'd be willing to trade off performance in some places for stronger ability to reason about types. I envision a pure, strongly typed language with strict evaluation, that looks like Python to the rest of my code base.
- nkantar 10y agoHave you tried Python's type hints with Mypy, and so you have any thoughts on it?
- sevensor 10y agoI haven't yet -- type annotations in Python 3 still don't seem to have stabilized. Although I admit I haven't looked too deeply into it, I know a bunch of new stuff landed in 3.6. The appeal of a library that adds a functional layer on top of Python is that it partitions "new stuff" from "old stuff". It seems easier to tear out and reimplement if we screw it up, versus type annotations diffusing out into the rest of our codebase.
- chubot 10y agoFWIW I tried it on a relatively new 10K line project and gave up, because it doesn't play well with metaprogramming. I consider metaprogramming to be part of Python, so mypy and statically typed Python are really different languages with less power IMO. And of course the mypy author knew that -- that's why he gave it a different name. http://www.oilshell.org/blog/2016/11/30.html http://www.oilshell.org/blog/2016/11/30.html update here: http://www.oilshell.org/blog/2017/01/06.html http://www.oilshell.org/blog/2017/01/06.html I'm not claiming my experience generalizes... if you have a lot of Java-like code you can probably use mypy. Bizarrely, some people do actually have a lot of Java-like Python code.
- domenukk 10y agoI've used typehints to write a compiler but with my own small homegrown annotations and it worked really well. It feels natural coming from languages with similar syntax like rust and the like. Cool integrates well with pycharm too
- maweki 10y agoMaybe you should try dogelang (dg). That's all the Haskell syntax goodness with the Python typesystem :D
- sevensor 10y agoWell, my boss did used to own a Shiba Inu, so I think it's inevitable once he finds out about dg :)