Live data from Hacker News

Server APIs Project

swift.org

101–110 of 181 posts

Re: Server APIs Project

#101

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…

Typescript is C# in spirit

Re: Server APIs Project

#102
post #58
post #50

Earlier quoted context omitted.

Obligatory comparison: https://leverich.github.io/swiftislikescala/

The comparison should be updated to Swift 3. Swift syntax is more intuitive and readable than Scala. A common mistake in language design is to depart from C syntax, without substantial gain. For example, replacing {}, &&, || with other things. Swift strikes a great balance between intuition and innovation.

And scala doesn't have {}, &&, || ?

Re: Server APIs Project

#103

Earlier quoted context omitted.

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…

Typescript is C# in spirit

Except IDE and tooling support, maturity and stability, and you can't share any libraries between Typescript and C#.

Re: Server APIs Project

#105

Earlier quoted context omitted.

The levels of enlightenment: http://www.scala-lang.org/old/node/8610 Most Scala developers are in the A bracket. The experts are in the L. The code written by either is so different they could almost be different languages. You don't get this sort of split in Swift, Java etc.

This is more of a split between techniques for programming-in-the-small vs. programming-in-the-large. All languages have this. You could write more or less the same list for Swift or Java with minimal changes. Again, do you have any actual experience with this, or is this just your assumption? Because I have never seen this issue in the wild.

I have absolutely seen it in the wild, but at least in my case it seemed to be more a case of "People who wish they were writing Haskell, but found more commercial opportunities with Scala" compared with "People who found Scala to be an improvement over Java".

At the extreme of the first group you'd have people for whom it seemed like every problem was best solved with a higher-kinded-type. And while it might well have been technically (and mathematically) elegant, the rest of the team was left scratching their heads trying to understand it.

Re: Server APIs Project

#106

Earlier quoted context omitted.

And is "dank" good or bad?

It usually means "good", though some people use it in an ironic sense to imply something is bad. Kinda like how "bad" can also mean "good" in the right context, but in reverse. Here I took it to mean "good."

The definition I am aware of is undeniably negative: "disagreeably damp, musty, and typically cold"

Re: Server APIs Project

#107

Earlier quoted context omitted.

It usually means "good", though some people use it in an ironic sense to imply something is bad. Kinda like how "bad" can also mean "good" in the right context, but in reverse. Here I took it to mean "good."

The definition I am aware of is undeniably negative: "disagreeably damp, musty, and typically cold"

Ha! I was so used to the... one I'm used to, that I forgot this obvious one. Seems like my analogy to "bad" was appropriate.

"dank" as in "dank memes" as in "a word stoners use to describe good weed" is how I'm taking it to be used here.

Re: Server APIs Project

#108
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?

You can play with swift on linux via docker too. https://github.com/swiftdocker/docker-swift I'm one of the maintainers :)

I also have an http server setup with swift & docker:

https://github.com/jkingyens/swift-http-server

Re: Server APIs Project

#109

Earlier quoted context omitted.

I think most languages thatare popular today are 'best of most worlds' for their users. For example, Scala has all the features you specified and has an even larger ecosystem of libraries for the server side. I am still happy that this has been done as I know having a common API to program against does ease development and creates a great ecosystem as evidenced by node.JS.

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…

It's only a disadvantage if you work with people that try to use every feature for every job. Admittedly some people do this, but you'll get the same problem in many languages like c++, ruby and c# as well.

The features are great for people writing libraries, but general purpose code should usually only need a subset.

Re: Server APIs Project

#110
post #70
post #68

Earlier quoted context omitted.

> If not, I don't see a huge amount that it actually improved over C++. One advantage, from the point of view of someone that likes using C++, is being a safer programming language. C++ has several features that allow to write safe code, but they only work when working solo, or in a team that accepts and makes use of modern C++. If you cannot control the team on how they write C++, or the libraries being used, than t…

> One advantage, from the point of view of someone that likes using C++, is being a safer programming language. How so? Last I checked swift doesn't have garbage collection (but does have refcounting, which is nearly as good, but still requires modifying algorithms with cycles), and only offer syntactic sugar over existing null pointer semantics (as opposed to the memory ownership guarantees provided by rust). Isn't…

It sounds like you're used to manual reference counting in ObjC, which genuinely is a pain. Swift (and modern ObjC) use automatic reference counting, which is much more robust and less dependent on autorelease pools. For one thing, class instances get released when they no longer have a strong reference -- so to answer your specific question, you can totally instantiate a class for just one iteration of a loop. Plus, Swift makes much better use of value types, so you're less reliant on heap allocations in the first place.

I personally cringe whenever I have to go back to a GC and relinquish all control over object lifecycle.

Post reply on HN