7 ms·
> A python-esque language with algebraic data types I think [Pony](https://tutorial.ponylang.io/types/type-expressions.html https://tutorial.ponylang.io/types/
by brabel 8y ago
> A python-esque language with algebraic data types
I think [Pony](https://tutorial.ponylang.io/types/type-expressions.html https://tutorial.ponylang.io/types/type-expressions.html) is close to being that (but it has much more, like Actors and reference capabilities).
- 3jckd 8y agoI don't know much about Pony but glancing over the doc it seems very Scala-ish, which can already be written in very pythonic way and has ADTs. Am I missing something here?
- coldtea 8y agoThat Scala is a beast of a language with a huge surface syntax?
- pkolaczk 8y agoIt is not. Its syntax is simpler and more regular than Java or C#, and on par with Kotlin. I haven't heard many complaints on them having complex syntax. Ironically Kotlin is promoted as simple, when its syntax is almost the same as Scala.
- divs1210 8y agoSurely, you must be joking? Scala is much closer to C++ than Java, forget Kotlin. It is a kitchen sink with every feature under the sun.
- pkolaczk 8y agoThen how come most Scala code can be translated to/from Kotlin or Swift with just find-and-replace? https://hackernoon.com/how-i-ported-10k-lines-of-scala-to-kotlin-in-one-week-c645732d3c1 https://hackernoon.com/how-i-ported-10k-lines-of-scala-to-ko... The syntax of both is extremely similar. https://leverich.github.io/swiftislikescala/ https://leverich.github.io/swiftislikescala/ Basically Swift and Kotlin based their syntax exactly on Scala. > It is a kitchen sink with every feature under the sun. You obviously don't know Scala and you're just repeating BS found on the Internet. Scala is a much more powerful and much more abstract language than Kotlin, so comparing their syntax complexity is unfair from the start. But if you restrict the problem space to what can be covered by both Scala and Kotlin, then Scala has in fact fewer features than Kotlin. It just happens to have a few more generic, and very powerful unique features, which might look unfamiliar to Java programmers. Examples: * Kotlin has special syntax for null-checking. Scala has no special syntax and implements the same feature in the standard library. * Kotlin has special syntax for coroutines. Scala achieves the same with a library. * Kotlin has special syntax for extension methods. Scala doesn't provide special syntax for extension methods - they can be created with implicit objects which are a much more generic feature and have other important use cases not possible in Kotlin nor Java. * Java has special syntax for array access. Scala does not. * Java has special syntax for interfaces with method implementations. Scala does not. * Java has static members which are completely alien to OOP. Scala does not. * Kotlin and Java have operators, and Kotlin has operator overloading (just like C++!), making operators second class citizen. Scala has just method names, so "operators" and regular methods are the same. > Scala is much closer to C++ than Java Only in terms of abstraction power (IMHO it is much above C++ in abstraction power; actually much closer to OCaml than C++), but not in terms of complexity. Scala language specification is ~200 pages long. Java is ~750 pages, C++ is ~1300 pages.
- jarcane 8y agoWhat are you talking about? Scala doesn’t even have a consistent syntax, on purpose. By design there are multiple ways to write many things in the language, often with unpredictable and inconsistent results, method syntax being the most obvious example. I think you have confused Scala for something else. “Regular” it is most assuredly and deliberately not.
- pkolaczk 8y ago> By design there are multiple ways to write many things in the language This can be said about any language. True for Java, true for Python, true for Kotlin.
- zeckalpha 8y agoPython itself now has dataclasses, which can be paired with MyPy. Note, though, that they're not closed. https://docs.python.org/3/library/dataclasses.html https://docs.python.org/3/library/dataclasses.html
- trishume 8y agohttp://coconut-lang.org/ http://coconut-lang.org/ is actually a Python superset with algebraic data types and other functional programming features. It even compiles to Python that is compatible with both Python 2 and 3.
- jarcane 8y ago“Python-esque with ADTs” is exactly what I loved about F# when I first found it. Unfortunately, the tooling is just as much of a nightmare (though with the dotnet CLI it is slowly showing signs of improvement), and cross compatibility is still iffy for a lot of things, so I’m not sure it satisfies the rest of the author’s specs. I would kill to see a dialect of F# completely freed of the .net nightmare and allowed to fly free on its own.
- 0815test 8y agoWhat about Ocaml/ReasonML?
- verdex_phone 8y agoI can second ocaml. Im using it more lately and really enjoying it. Of course the compiler error message leaves a lot of room for improvement. And it does take a lot of time to get used to all of the peculiar syntax. But you get ADTs, the best modules on earth (even if the syntax is a bit old ...), GADT if you want them, object row polymorphism, polymorphic variants, streams, etc.
- jarcane 8y agoOcaml is ok, but coming from F# it feels just clunky enough to be noticeable, as if you’re using some early pre-release version version of F#, which in a way yu are, since F# started out as just a port of it. Adopting a light-ish syntax similar to F#’s helped, but there’s still a sense it isn’t as polished for public consumption, and the tooling is no less painful while also being almost hostile to Windows users. :( Bucklescript-TEA was kind of nice though, getting to play with the Elm architecture but with a more flexible type system and better inference. But I found the size of the bundles and tools and the slowness in the environment I was using it in made me just go back to Elm instead. :( As for Reason ... well ... Facebook has taken over webtech with a lot of halfassed misunderstandings of better technologies, but this one might take the cake. I honestly find that whole project insulting, and so should you. It’s as if they’ve declared JavaScript developers to be so stupid that they physically can’t use a language with any other syntax, so they have to fuck up one to get them to use it.