Live data from Hacker News

Advanced programming languages (2009)

matt.might.net

181–190 of 208 posts

Re: Advanced programming languages (2009)

#181
post #175

He only mentions Clojure in passing. At some point I decided that, were I to learn a functional language, it would be Clojure. How would you say Clojure fits in this comparison? Is it only relevant or interesting for concurrency?

The article's 7 years old. Clojure's first stable release (1.0) was released the same year.

Thanks, I knew it wasn't new but didn't think it was so old.

Re: Advanced programming languages (2009)

#182
post #135
post #121

Earlier quoted context omitted.

Once you have had real Hindley-Milner Scala feels painfully primitive. Just go straight to OCaml.

Can you expand on this for someone who is not familiar with Hindley-Milner typing?

Hindley-Milner means that you – unlike Scala – don't need to provide any type annotations at all as they can all be inferred.

This comes at a steep price, as HM-inferable typesystems are very limited, and most languages have in fact a typesystem that might be based on what HM can infer, but have extensions that require type annotations.

In the end Scala's requirement to annotate input parameters is not a big deal, as this only enforces what Haskell/Ocaml/... consider to be best practice anyway.

Re: Advanced programming languages (2009)

#183
post #63

Can someone comment on what it's like building a webapp with Scala/Play?

Unlikely you'll be cranking out a Rails style MVP in Scala + Play, but you will produce a robust, blazing fast, scalable application that's a dream to maintain and build upon. In short, Play is a really, really good MVC framework. For SPAs you can go lightweight with just Play's router and WS api, or try something like http4s for a more FP-based REST api. Throw Scala.js into the mix and you've a got a fully typed sta…

> you will produce a robust, blazing fast, scalable application that's a dream to maintain and build upon.

At work I'm working on a scala/play app. It was 2 years old already when I joined, and the first scala/play project for the team. It's not that fast or scalable. That is to say, scala and/or play are not silver bullets that will make your code hyper optimized and scalable.

ATM I'm working on performance. There are a few blocking calls in the API that are used everywhere and they manage to block the various execution contexts (controller, akka, etc.) It's a mistake to use blocking calls when it can be avoided, but it's an easy mistake to make.

So yeah you can write robust / fast / scalable / maintainable apps in Scala but you need to properly learn it first.

Re: Advanced programming languages (2009)

#184
post #160

Earlier quoted context omitted.

Scala can be a fine Java replacement, if you drop 20% of its features on the floor. As long as you never see a higher-kinded type, I think you are ahead of Kotlin, and the learning curve is not really any different. The problem with this approach is that 90% of Scala libraries are built by people that live in higher-kinded land, and believe that since they have reached that level of expertise, so should everyone else…

Scala compatibility is not so great. It has its own collections and other libraries. And it does not even support java getters and setters.

Why would you create a new language and then keep a huge part of what developers interact with on a daily basis in such a broken shape as in Java? (Or rack up a massive amount of complexity and break your typesystem by trying to put lipstick on the Java collection pig? (Kotlin).)

Re: Advanced programming languages (2009)

#185

I am still stuck on why this is titled Advanced Programming Languages. Wait, so anything other than the most widely adopted robust language technologies used in enterprise systems is 'advanced'? Language compilers, interpreters, database engines, and runtime implementations are advanced. Who says, "we need an advanced language for this solution", as opposed to "this problem requires an advanced solution"?

OP reeks of subjectivity. "Scala is a rugged, expressive, strictly superior replacement for Java." I have nothing for or against Scala, and Java is a popular target. But "strictly superior"? There are critiques of the language and its toolset that contradict the strictness of its superiority. ( https://www.quora.com/What-are-some-criticisms-of-Scala )

I think "strictly superior" makes sense in the way that Scala was never designed or intended to be a worse-is-better language like Java and people were willing to make that happen by evolving the language. It was never intended to be a Java-with-more-concise-syntax unlike some other newer languages.

If something was clearly worse, it would have been changed years ago already. That some design is still there might suggest that some people just have a different minority opinion on some aspects. (Assuming that "strictly superior" does not mean "100% of devs agree 100% that this is 100% better than Java".)

Re: Advanced programming languages (2009)

#186
post #93

Earlier quoted context omitted.

Well, there's: - Dependently typed languages (ATS, Agda, Idris)¹ should be fairly familiar if you're a Haskell veteran. - Array languages (APL, J, K, and more obscure ones like Nial) are pretty enlightening if you're a functional programmer (at least they are for me). Most of these trace to Ken Iverson and his Notation as a Tool of Thought . They are a bit brain-bending at first, largely because of the density, but t…

I had gnu apl installed (along with emacs mode:). APL and it's siblings are amazing, tiny, expressive, light.. lot to love. Juts nothing as mind bending as; say lambda calculus. Didn't know FL/FPr were arrow-like. Didn't even know they were implemented .. I thought Backus quit because of IO. Lots of people are suggesting the Idris/Agda road .. I guess I have my answer.

As far as FL/FP/FPr go, http://www.call-with-current-continuation.org/fp/ is the most mature and complete implementation I'm aware of.

There's #proglangdesign on freenode where a bunch of us have been on an array language/function-level streak lately. Some people there might be aware of more.

Re: Advanced programming languages (2009)

#187
post #12

This post is very fortuitous for me. I've been looking to learn a functional language and I had more or less narrowed my options to Haskell, OCaml and Scala. I liked the breakdown between these languages and the resources. Can anyone who programs in Haskell or OCaml regularly tell me the current state of standard and third party library support? I'm very attracted to Scala because it has JVM support, which sounds fan…

I would recommend Elixir or Clojure over Scala. In my opinion, Scala and F# suffer from supporting multiple programming paradigms, which means that people tend to fall back on the procedural or object-oriented programming they know, rather than learning how to do things the right way, functionally speaking. That has been my experience with them, anyway.

Re: Advanced programming languages (2009)

#188
post #135

Earlier quoted context omitted.

Can you expand on this for someone who is not familiar with Hindley-Milner typing?

Hindley-Milner means that you – unlike Scala – don't need to provide any type annotations at all as they can all be inferred. This comes at a steep price, as HM-inferable typesystems are very limited, and most languages have in fact a typesystem that might be based on what HM can infer, but have extensions that require type annotations. In the end Scala's requirement to annotate input parameters is not a big deal, as…

> In the end Scala's requirement to annotate input parameters is not a big deal, as this only enforces what Haskell/Ocaml/... consider to be best practice anyway.

It's a huge deal. I always write type signatures once I know what they are, but a lot of the time I get the compiler to infer them for me which saves significant headaches.

Re: Advanced programming languages (2009)

#189

Earlier quoted context omitted.

The size of the Javascript generated by Scala.js alone makes it a non starter for serious projects.

Yeah, these tens of kilobytes of JS next to those ten badly compressed 600kB jpgs are really killing it.

this isn't a fair comparison. It fails to account for what happens after the files are downloaded, which is where overall js code size has an outsized effect.

Re: Advanced programming languages (2009)

#190
post #121

Earlier quoted context omitted.

I can recommend Scala: - It is mature and rock-solid, but still manages to evolve, fix issues and simplify/remove features. Most other languages are purely additive, meaning you will have to carry on all the baggage since the languages' inception. - It is a language which is interested in identifying the best way to solve common programming issues and spares you with all this ideological "OOP/FP is bad" bullshit. - I…

Once you have had real Hindley-Milner Scala feels painfully primitive. Just go straight to OCaml.

Or go to F# and enjoy the vast universe of .NET.
Post reply on HN