4 ms·
Id much rather have python syntax and Haskell semantic to get good parts of both!
by makapuf 7y ago
Id much rather have python syntax and Haskell semantic to get good parts of both!
- piinbinary 7y agoI'm attempting to create something like that: http://www.ikkolang.com/ http://www.ikkolang.com/
- laughinghan 7y agoThis looks amazing!!! I am also working on a statically-typed language that aims to be fully inferred and have no type annotations, I will definitely be gleaning Ikko's design and your blog for insights.
- piinbinary 7y agoThanks! Feel free to reach out to me if you have questions
- fishmaster 7y agoI'll be following this
- anentropic 7y agoThat would be interesting! There is Hacket, which is Racket with Haskell semantics (Haskell in S-Expressions)... https://lexi-lambda.github.io/blog/2017/05/27/realizing-hackett-a-metaprogrammable-haskell/ https://lexi-lambda.github.io/blog/2017/05/27/realizing-hack...
- fishmaster 7y agoI thought I read that Hacket wasn't actively developed anymore?
- nineteen999 7y agoYou're posting on a website where the most fashionable language is Lisp. Dead/niche languages are a popular thing around here.
- fishmaster 7y agoWell, that is true.
- amelius 7y agoOne problem with Python's syntax, though, is that you can't have anonymous lambdas which span more than one line (unless perhaps you start using escapes, but that would miss the point).
- progval 7y agoI'm not sure what you mean by escapes, but you can use parentheses as block delimiters, "and" and "or" as a semicolon, and ternary operator for conditionals >>> f = lambda x: ( ... ( ... print('a') or ... print('b') ... ) if x % 2 ... else ( ... print('c') or ... print('d') ... ) ... ) >>> f(42) c d >>> f(43) a b
- samatman 7y agoMy God, man. My eyes! That is strikingly hideous. After such knowledge, what forgiveness?
- saagarjha 7y agoA language that actually cares about functional programming.
- cle 7y agoOh please. You can "do" functional programming just fine in Python. If it's longer than a line, give it a name. It's not hard and it makes the code more readable and easier to maintain.
- saagarjha 7y agoI do most of my work in multi-paradigm languages–so it's not like they're specifically designed around the ergonomics of working with functional programming–but Python is probably the worst language that I have used that could reasonably say that it supports this style of work. It's like it actively tries to make things strange and annoying to convince you to use other constructs (such as list comprehensions). Why can't I have a multiline lambda (…some things have no need for a name)? Why are all the functional methods free functions that take the list as the second parameter? Why was reduce arbitrarily excised from the list of built-in functions and put inside functools? Why can't I use a member function or operators as parameters without hacks like operators.__{operator_thats_a_reserved_word}__? Why do all the Python 3 functions return generators by default, when Python never really cared much about performance in the first place? It's just a death by a thousand cuts that always makes me regret even trying to do functional programming, and deep down I actually think the Python authors just don't want you do be doing it because they think it would lead to what they believe is difficult-to-understand code. Honestly, I think even C++ has better functional programming constructs than Python, even with its ugly-looking lambdas and lack of chaining, because <algorithm>'s extensiveness makes up for some of the language's warts.
- polemic 7y agoI think this is the punchline
- wyager 7y agoMost of python’s syntax (partial if-statement, return, break, for-loop, etc) don’t make sense as first class terms in a pure language. You can’t represent the semantics of a Haskell program with something that looks anything like idiomatic python.
- perl4ever 7y agoYes, I clicked on the link without reading carefully and was disappointed because that's what I expected.
- discord 7y agoScala?