Live data from Hacker News

Server APIs Project

swift.org

141–150 of 181 posts

Re: Server APIs Project

#141
post #42

Earlier quoted context omitted.

One benefit Swift has over Scala is that it compiles down to LLVM and is statically linked. I still love Scala though, hands-down my favorite language to work with.

Can you explain why this is such a significant benefit? Honest question.

With Scala, if I want to build a distributable application, I need to bundle a JRE and the Scala library, which means that a "Hello World" installer would be around 30 MB in size. It's bad practice to assume that your user has Java installed.

With compiled languages like Go or Swift, that same application now is 2 MB or so. On top this, the application runs natively on the OS since it is compiled to LLVM.

Re: Server APIs Project

#142
post #141

Earlier quoted context omitted.

Can you explain why this is such a significant benefit? Honest question.

With Scala, if I want to build a distributable application, I need to bundle a JRE and the Scala library, which means that a "Hello World" installer would be around 30 MB in size. It's bad practice to assume that your user has Java installed. With compiled languages like Go or Swift, that same application now is 2 MB or so. On top this, the application runs natively on the OS since it is compiled to LLVM.

Same with Scala.

Re: Server APIs Project

#143
post #140

Earlier quoted context omitted.

So I only know a minimal amount about Rust, so if there's things which are the same there, then I'll probably be blindly ignorant about them. First thing is that with the build tool Stack and now with recent versions of Cabal the process of having a nice repeatable consistent build is pretty smooth. I also used a tool called ghcid to get sub-second feedback on my changes as I make them. Haskell has started at the opp…

Minor nitpick: "(==) 0" wouldn't be syntactic sugar, but "(== 0)" is. But I agree it's a very natural consequence of the way the language is designed.

I'm not sure I understand, is there some special casing going on with "(== 10)"? As I'm admittedly not aware of it.

Re: Server APIs Project

#144
post #36

Dumb question: I'd love to learn more about Swift and try out writing Swift code, but is development still limited to XCode/macOS?

There are few options

https://thinkswift.github.io/2016/10/01/swift-the-language.h...

https://thinkswift.github.io/2016/10/03/language-library-fra...

Re: Server APIs Project

#145
post #141

Earlier quoted context omitted.

With Scala, if I want to build a distributable application, I need to bundle a JRE and the Scala library, which means that a "Hello World" installer would be around 30 MB in size. It's bad practice to assume that your user has Java installed. With compiled languages like Go or Swift, that same application now is 2 MB or so. On top this, the application runs natively on the OS since it is compiled to LLVM.

Same with Scala.

If you're talking about the currently very experimental Scala Native, my response is that comparing such a fledgling implementation to languages built from the ground up for AOT compilation and static linking is just silly.

If not, please explain.

Re: Server APIs Project

#146
post #140

Earlier quoted context omitted.

Minor nitpick: "(==) 0" wouldn't be syntactic sugar, but "(== 0)" is. But I agree it's a very natural consequence of the way the language is designed.

I'm not sure I understand, is there some special casing going on with "(== 10)"? As I'm admittedly not aware of it.

Not anything major. It's just syntactic sugar for "\x -> x == 10".

Re: Server APIs Project

#147
post #145

Earlier quoted context omitted.

Same with Scala.

If you're talking about the currently very experimental Scala Native, my response is that comparing such a fledgling implementation to languages built from the ground up for AOT compilation and static linking is just silly. If not, please explain.

I don't think it is vastly different from Swift.

In Scala the language is stable, the std lib is stable and the runtime is being worked on, in Swift the language is changing heavily, the libraries are under development, but the runtime might be slightly ahead. (If one can describe reference counting as "ahead".)

Re: Server APIs Project

#148

Earlier quoted context omitted.

The problem with Scala is not that it has all the features of Swift, it's that it has way more. Scala developers see this as an advantage, everybody else sees that as a liability. Swift and Kotin manage to capture the perfect amount of "a few new features but not too many" of all languages I've played with these past ten years. They are both the perfect example of languages that hit the right compromise in many dimen…

I am terrified of working with experienced Scala developers. The code they write is less about implementing some business functionality in the most elegant way possible. But rather it's an exercise in who can use the most obscure parts of the language. And unfortunately there are far too many obscure parts.

> The code they write is less about implementing some business functionality in the most elegant way possible. But rather it's an exercise in who can use the most obscure parts of the language.

I think it's rather more likely that you simply don't understand why they're using the more obscure parts of the language on any given problem. They're probably trying to rule out certain invalid uses as type errors, which is typically encouraged in the more advanced typed languages.

Re: Server APIs Project

#149
post #135

Earlier quoted context omitted.

In which sense?

I was saying Scala was designed for a certain audience in mind, probably Haskell/OCaml devs forced to develop for Java or something like that. Similarly Swift was designed for an intended audience in mind, iOS developers, and so certain programming features would not mesh well like higher kind types. Maybe this is more of a case of an ideal feature set as envisioned by Odersky vs' Lattner, idk. Either way different p…

Scala was designed to provide the best of OOP and the best of FP, without adding cruft or having multiple non-orthogonal features of one concept.

I think there is large audience of people who want the best OOP tools, or the best FP tools or both.

Re: Server APIs Project

#150

Earlier quoted context omitted.

The real problem with Scala is Java. Most of us over here in C / Ruby / Python land or .NET land have been bitten by dipping our toe into Java and now avoid it like the plague.

Then use Scala! You almost never need to deal with Java except if you want to. Plus, unlike C/Ruby/Python/.NET you get a JS backend that actually works¹ (unlike mess like GWT, or various other languages). ¹ In the sense of: Scala.js is stable, mature and production-ready. You can use it, save a lot of time, share a lot of code, use mny of the libraries you already know, enjoy great IDE and tooling support, use it in…

Scala on Android is pretty terrible
Post reply on HN