Live data from Hacker News

Server APIs Project

swift.org

31–40 of 181 posts

Re: Server APIs Project

#31
I like that they are taking the same sort of mantra as Node.js by providing the core building blocks and letting the community develop web frameworks. This was something that Ryan Dahl got absolutely right with Node, minimal functionality, sugar on top of system calls.

Re: Server APIs Project

#32
post #24
post #2

This looks like a very organized project with well defined goals, both of which are points that will help it succeed. It seems there's a bit of a trend back toward compiled languages (Go, Rust, Swift) that don't rely on the JVM or .NET CLR to run. I think that these are all great languages, though I almost wish for something like a better, more modern, cross-platform COM to easily share libraries among the languages.…

OS/2 had its own version of COM, called SOM. The best thing about it, was that it also supported metaclasses Smalltalk style. So one could go crazy with OO metaprogramming. Sadly it died with OS/2. Then there was the other multi-platform OO ABI project from Apple, Sun and IBM, Taligent. Also not that successful. COM is ok to work with, when done from .NET or now UWP point of view. C++/CX and the recently announced C+…

I've mostly used COM from .NET, and as you said, it's fairly painless.

At one point, we were having issues with a COM DLL we were using from .NET, so I thought it might be fun and useful to dive in and learn more about COM. I bought Don Box's COM book, and tackled COM in Plain C: http://www.codeproject.com/Articles/13601/COM-in-plain-C

It was somewhat less fun than I'd hoped it would be.

XPCOM seems to be (somewhat) alive and kicking: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM ; Firefox and VirtualBox are the only apps I've seen that use it, though I imagine at least a few others do as well.

Re: Server APIs Project

#33
post #30

What editor is everyone using for Swift? Last time I played with Swift I stopped after XCode crashed 2 times in an hour for me. It is also very slow. But none other editors seem to support auto completion which is a deal-breaker for me. Without it it's hard to consume all the APIs. I hope Apple can follow Rust's path by making a language server[0] for Swift, if Apple is serious about providing cross-platform support…

I'm an XCode user myself, but I know people who swear by AppCode by Jetbrains. I tried it in the past for Objective-C and if their support for Swift is as good, it should be a decent alternative.

Re: Server APIs Project

#34
post #4

Some future server APIs should include database connectors, machine learning libraries, & image/video processing. Standardize on these before everything gets out-of-hand.

But maybe that is what they suggest should be handled by web frameworks. Is like asking WSGI api in Python to handle all those things. It just handle raw connections and is an interface for web frameworks to worry about content and not low level stuff. Maybe database connectors would be a good inclusion as well, but in Python I believe it is not part of WSGI On the other hand, Apple has libraries for handling image a…

His point is probably more concerned with hardware-accelerated machine learning and the like. Much like eg. OpenCL for machine learning.

Re: Server APIs Project

#35
post #9

Great. Great great great. A thousand times great. We've been slowly converting our iOS projects over to Swift over the past year and the results have been tremendous (a ~40% drop in LOC from ObjC, among many other benefits). Really the only language-level feature that feels missing for server development is first-class support for asynchronous/concurrent operations, but that's coming. Swift is truly a 'best of most w…

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.

Swift was influenced by Scala, so that's no surprise.

Re: Server APIs Project

#37
post #28
post #9

Great. Great great great. A thousand times great. We've been slowly converting our iOS projects over to Swift over the past year and the results have been tremendous (a ~40% drop in LOC from ObjC, among many other benefits). Really the only language-level feature that feels missing for server development is first-class support for asynchronous/concurrent operations, but that's coming. Swift is truly a 'best of most w…

Swift lines of code take about 10x more time to compile compared to obj-c too. I wished for obj-c when our project started passing the ~70 kloc mark.

I don't think it's 10x slower but it's definitely slower. If you have lots of "complicated" type inferencing the compiler does have problems:

https://spin.atomicobject.com/2016/04/26/swift-long-compile-...

https://thatthinginswift.com/debug-long-compile-times-swift/

Re: Server APIs Project

#38
post #9

Great. Great great great. A thousand times great. We've been slowly converting our iOS projects over to Swift over the past year and the results have been tremendous (a ~40% drop in LOC from ObjC, among many other benefits). Really the only language-level feature that feels missing for server development is first-class support for asynchronous/concurrent operations, but that's coming. Swift is truly a 'best of most w…

How is the memory management? That was always the downside of objective-c. Does it allow aliasing memory?

If not, I don't see a huge amount that it actually improved over C++. Why should I use swift for server stuff over c++/go/rust?

Re: Server APIs Project

#39

I hope they will look at Erlang/OTP instead of Java EE for inspiration.

I've seen people try to recreate Erlang/OTP in Java. See OpenCloud Rhino. They never really get there. It's kind of sad to watch.

I mean, it's useful if you absolutely have to use Java, but it's expensive and a pale imitation of Erlang/OTP. I'm confident that it will remain so until it dies.

Post reply on HN