Live data from Hacker News

Advanced programming languages (2009)

matt.might.net

201–208 of 208 posts

Re: Advanced programming languages (2009)

#201
post #160

Earlier quoted context omitted.

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).)

1 billion lines of code, that is why.

Re: Advanced programming languages (2009)

#202
post #178
post #81

> Scala is a rugged, expressive, strictly superior replacement for Java. Scala is not replacement for Java. It runs on JVM and can invoke java code, but has completely different approach than Java. Use Kotlin if you want Java replacement. Also I would argue that Scala is much better suited for writing compilers than Haskel.

> Also I would argue that Scala is much better suited for writing compilers than Haskel. Any examples of how it can help out?

Languages today are not just about command line compiler.

Compiler today must interact with tools such as IDE. If you keep some basic rules, it is reasonably simple to write compiler which can interact with Intellij Idea and provide incremental compilation, live edit hints, error messages.

In Haskel you dont have any of that.

Re: Advanced programming languages (2009)

#203
post #189

Earlier quoted context omitted.

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.

I think people have been including jQuery just fine for the last decade.

Yes, but jquery is much smaller than an empty scala.js app. jquery is about 25kb gzipped and minified (the other comment used the raw size) whereas scala js is 45kb for an empty application.

Re: Advanced programming languages (2009)

#204
post #203

Earlier quoted context omitted.

I think people have been including jQuery just fine for the last decade.

Yes, but jquery is much smaller than an empty scala.js app. jquery is about 25kb gzipped and minified (the other comment used the raw size) whereas scala js is 45kb for an empty application.

TBH, You don't use scala.js to write hello world apps. I'm much more curious how Scala.js handles a 100Kloc app, but I haven't seen any data on that.

Re: Advanced programming languages (2009)

#205
post #116

Earlier quoted context omitted.

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

Look at here: https://www.scala-js.org/ "The generated JavaScript is both fast and small, starting from 45kB gzipped for a full application." - 45kB... jQuery is ~80kB.

jQuery gzipped and minified is 25kb. You're comparing raw to compressed.

Re: Advanced programming languages (2009)

#206
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…

Knowing Java won't help you much in learning Scala. It's the functional programming parts that will trip you up if you haven't done that before, and this is the most valuable part to learn. I use Scala every day, and it was easy to learn; but I suspect that was because I did a lot of functional programming before that.

This is true, I was from an OO background and Scala was my first functional language. I had to put it aside for a while and learn Haskell to grok the functional side of Scala. The ML world can be a little alien if you're new to it, and I found it useful to learn from a purely functional language first and then go back to Scala with a better understanding of how it fits OO and ML together.

Re: Advanced programming languages (2009)

#207
post #139

Earlier quoted context omitted.

The combination of stronger type systems (especially dependent typing), less error-prone design (no manual memory management, no mutation, no global state, no loops/off-by-one errors), separated side effects (crashing during computation won't break things, less places for outside interference/external failure, etc.), and better error handling (no null, usually no exceptions meaning you have to encode failure into the…

Type systems - already available in the most popular languages no memory management - c++, go, java come to mind No mutation - has a side effect which you probably will never mention. But it will become important as the internet of things gets smaller No global state - in what environments would that ever be an encouraged paradigm? Javascript? No loops/off by one - you still need loops, they are just recursive. The d…

>Type systems - already available in the most popular languages

This implies you haven't actually spent time with a strongly typed functional language like Haskell. Once you have, it's hard to continue thinking of Java or C++ as having "type systems".

Re: Advanced programming languages (2009)

#208
post #22

I would argue that a well-known language is fairly expressive in the sense that it is well-known. Imagine English itself was a programming language - this is the best. But for now I would recommend using those who are commonly used in the common platforms of interest (Java, javascript, C etc)

> Imagine English itself was a programming language That's a terrible idea. https://en.wikipedia.org/wiki/Buffalo_buffalo_Buffalo_buffal...

Yes, but in any language - syntactically valid code is not necessarily good code
Post reply on HN