34 ms·
Server APIs Project
- rpeden 10y agoThis 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. I've only had to work with COM very, very occasionally though. If I'd had to work with it for any extended period of time, I probably wouldn't be wishing for it, or anything like it. Perhaps sharing functionality between languages is better accomplished by separate services communicating via something like 0MQ.
- adamnemecek 10y ago> Perhaps sharing functionality between languages is better accomplished by separate services communicating via something like 0MQ. Yeah, I think that people don't want to get back from these. The setup is more complex (as in you have to write a bunch of code) but the coupling is a lot looser.
- michaelsbradley 10y agoOPC UA (IEC 62541) provides a robust platform-neutral information model, and multiple options for transport. Similarly, it specifies events, subscriptions, discovery and several higher-level abstractions (e.g. alarms and programs). In some sense, it's a cross-platform successor to COM/DCOM. Some open source implementations are incomplete, but work continues. https://en.wikipedia.org/wiki/OPC_Unified_Architecture https://en.wikipedia.org/wiki/OPC_Unified_Architecture https://github.com/open62541/open62541 https://github.com/open62541/open62541 https://github.com/OPCFoundation https://github.com/OPCFoundation You may also find Woopsa interesting, depending on your use cases. http://www.woopsa.org/ http://www.woopsa.org/
- nxc18 10y ago.NET is a modern, cross-platform com with excellent Multilanguage support. And if you really hate the idea of a VM, you can do dotnet native right now on Windows - there are strong indications that straight-to-c++ compilation will be here for .NET core (cross platform) very soon.
- rpeden 10y agoI don't hate the idea of a VM. :) Most of the work I do runs on the CLR or JVM. I just think that in some ways it would be helpful to be easily be able to write a library in Go, for example, and use it in Rust or Swift. Or FreePascal, or anything else. I suppose it wouldn't be insanely difficult to use the C interop facilities in each language plus a bit of C as glue code to share things between them. But it would be interesting to be able to say "here's my library, and here's the interface it exports. Import it and have fun!". Though I'm sure there are lots of fun details and edge cases I'm completely failing to consider. I'm looking forward to the .NET Core to C++ compilation! There are plenty of interesting things happening in the .NET world right now.
- pjmlp 10y agoWell, you could already AOT compile with NGEN, even though it isn't an optimizing compiler and requires dynamic linking. Or Mono. But I am with you, when Java and .NET came out, in both cases I thought it was a missing opportunity not having a full set AOT/JIT options similar to other languages. You could get them, but NGEN required the framework to be present anyway and on Java's case the only good AOT compilers have always been commercial. So I would remember Turbo Pascal, Delphi, Eiffel and many others with some envy.
- pjmlp 10y agoOS/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++/WinRT are still ok, even if a bit more wordy. The real pain starts increasingly with C++ WTL, C++ ATL, C++ MFC or for the real masochists pure C with COM related macros and the COM IDL compiler. Then there was that other thing called CORBA, which makes the initial versions of Java EE feel like being in heaven.
- rpeden 10y agoI'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 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 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.
- teh_klev 10y agoI still go back and dip into Essential COM now and again. I bought my copy because I was involved with a project to build a COM/CORBA bridge and needed to get my head around COM's infrastructure. Also back in the day I used to write a lot of code that ran under Microsoft Transaction Server (MTS) and COM+. Another interesting book by Mr Box and co-authored by Chris Sells, purely from a historical perspective now as it's fairly ancient, is Essential .NET Vol. 1[0]. Sadly they never got around to writing a second volume. As a humourous aside, who remembers Don's lecture he did from a bath tub?: https://blog.mattmags.com/2011/05/19/don-box-the-bathtub-lecture/ https://blog.mattmags.com/2011/05/19/don-box-the-bathtub-lec... [0]: https://www.amazon.co.uk/dp/0201734117 https://www.amazon.co.uk/dp/0201734117
- squiguy7 10y agoI have been following Rust's push into server-side development and can tell it is still green. There is a great foundation with the hyper library but quite a bit of fragmentation with frameworks and the async side of things. It will be interesting to see where swift goes with all this. I know Rust has a lot of traction now with cross-platform support and language features, but I think swift is poised to offer a much different experience for server-side development.
- steveklabnik 10y agoThe async side is all coalescing around Tokio and its various sub-projects. I too am excited to see where this goes; Swift is a great language.
- mozumder 10y agoSome future server APIs should include database connectors, machine learning libraries, & image/video processing. Standardize on these before everything gets out-of-hand.
- boterock 10y agoBut 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 and video for macOS and iOS, are written in C but Swift interfaces so easily with C, but I don't see them releasing that stuff.
- dom0 10y agoHis point is probably more concerned with hardware-accelerated machine learning and the like. Much like eg. OpenCL for machine learning.
- timanglade 10y agoSweet to see an official push from the Swift project behind server-side use-cases (and of course in a cross-platform way, as is Swift already [0]). Looks like this spirit is taking hold community-wide too, with projects like CocoaPods tinkering with Linux support this week [1]. The future looks bright for Swift! [0]: https://swift.org/download/#releases https://swift.org/download/#releases [1]: https://twitter.com/segiddins/status/790326153051447296 https://twitter.com/segiddins/status/790326153051447296
- ruddct 10y agoGreat. 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 worlds' language. Typed, but without the boilerplate seen in a lot of typed languages. Syntax that makes sense and is consistent. Immutability strongly encouraged, but not required. OO if you want it. First class functions. Etc, etc, etc. It's truly a dream to work in, can't wait for server-side to get a little more mature.
- sacheendra 10y agoI 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.
- tormeh 10y agoSwift was influenced by Scala, so that's no surprise.
- desdiv 10y agoObligatory comparison: https://leverich.github.io/swiftislikescala/ https://leverich.github.io/swiftislikescala/
- tormeh 10y agoWow. They're basically identical. Scala has a bit less boilerplate sometimes, but it's also older, so I guess Swift will get syntactical sugar to catch up in time.
- amelius 10y agoNice, but I prefer a language which runs both on client and server, because that means I can share code, and e.g. I can do prerendering on the server and stuff like that.
- K0nserv 10y agoBut Swift does run on both the client and the server. Not when the client is web, but when the client is an iOS or macOS app.
- panic 10y agoGood luck pre-rendering a UIKit app on your server, though.
- deleted 10y ago[deleted]
- daenney 10y agoThat depends a bit on what you define as prerendering. Facebook, Google and many others render client views server side (or as much as possible). See Spotify's recently open sourced HubFramework for example for how they do that with iOS. Having multiple languages doesn't preclude you from doing clever things like that and having a single language doesn't necessarily allow you to do it either.
- amelius 10y agoYes, but a single language makes it a lot easier.
- pjmlp 10y agoFor many people, client == native application.
- icebraining 10y agohttp://www.shiftjs.com/ http://www.shiftjs.com/
- dschiptsov 10y agoI hope they will look at Erlang/OTP instead of Java EE for inspiration.
- tormeh 10y agoI'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.
- qaq 10y agoTrying to emulate Erlang/OTP on JVM is just a form of a cargo cult :)
- deleted 10y ago[deleted]
- qaq 10y agoI seriously doubt they can it would break too many things.
- hota_mazi 10y agoWhy? Java EE has a much stronger success track record than Erlang/OTP does.
- nodivbyzero 10y agoCould you provide examples?
- hota_mazi 10y agoThere are millions of lines of enterprise Java code running these days and a good chunk of these are using Java EE. The trend has started moving away from it these past years but it's pretty clear that even the worst and early versions of Java EE (looking at you, EJB 2) have been used to power massive web sites and applications that are still in use today. Erlang/OTP is nonexistent in comparison.
- saosebastiao 10y agoNo mention of multicore, threads, or asynchrony. I would hope that is part of this.
- adamnemecek 10y agoThose are already coming in Swift 4.
- Zoon 10y agoThis is now unexpected to be in Swift 4 :(
- ldayley 10y agoDumb question: I'd love to learn more about Swift and try out writing Swift code, but is development still limited to XCode/macOS?
- jcnh74 10y agohttps://swiftlang.ng.bluemix.net/#/repl https://swiftlang.ng.bluemix.net/#/repl
- jacks205 10y agoLuckily not! https://swift.org/getting-started/#installing-swift https://swift.org/getting-started/#installing-swift
- harisamin 10y agoYou can play with swift on linux via docker too. https://github.com/swiftdocker/docker-swift https://github.com/swiftdocker/docker-swift I'm one of the maintainers :)
- sp33der89 10y agoI usually start learning a new programming language making various GUI programs, maybe using a library like SDL if needed. But I can't seem to find anything like SDL for swift on linux! Most beginner resources assume you're using XCode on a Mac. Or does Cocoa work on Linux too(last time I checked this is highly not plausible)?
- enos_feedler 10y agoI also have an http server setup with swift & docker: https://github.com/jkingyens/swift-http-server https://github.com/jkingyens/swift-http-server
- ontouchstart 10y agoThere are few options https://thinkswift.github.io/2016/10/01/swift-the-language.html https://thinkswift.github.io/2016/10/01/swift-the-language.h... https://thinkswift.github.io/2016/10/03/language-library-framework.html https://thinkswift.github.io/2016/10/03/language-library-fra...
- ohstopitu 10y agoI wonder what happened to the rumors that Google was planning on supporting Swift on Android officially [0]. Also, are there any good tutorials/courses to get started with Swift & iOS development? (having programmed in other languages, I can pick up fast, and I've lost interest in tutorials that start out very slowly and take time to get to the point.) [0] http://thenextweb.com/dd/2016/04/07/google-facebook-uber-swift/ http://thenextweb.com/dd/2016/04/07/google-facebook-uber-swi...
- dom0 10y agoI guess it would make more sense to support Kotlin officially, but then again it already works fine on Android.
- achikin 10y agoAs far as I understand Kotlin is reliant on Java Standard Library and is dependent on Java infrastructure(maven, jvm, xml and friends), which makes no sense for me as an iOS developer and can only benefit Java developers as it was mentioned earlier.
- vferreira 10y agoIt's in the works but it's no t officially supported by Google. https://github.com/apple/swift-corelibs-libdispatch/pull/162 https://github.com/apple/swift-corelibs-libdispatch/pull/162
- octref 10y agoWhat 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 for it. This will enable better support in editors such as find definition, refactor and auto completion. [0]: https://internals.rust-lang.org/t/introducing-rust-language-server-source-release/4209 https://internals.rust-lang.org/t/introducing-rust-language-...
- fredoliveira 10y agoI'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.
- grayrest 10y agoLast time I messed with Swift, I was using a vim plugin based on SourceKitten[1] but it was a couple months ago over a weekend and I honestly can't remember how well it worked. If you were inclined, it seems like it'd get you most of the way to a language server. [1] https://github.com/jpsim/SourceKitten https://github.com/jpsim/SourceKitten
- favorited 10y agoThe SourceKit daemon is a language server. I wonder if anyone will adapt it to support the MS protocol.
- skyebook 10y agoSoureKit, which seems to drive a lot of the Xcode Swift features, is open source: https://github.com/apple/swift/tree/master/tools/SourceKit https://github.com/apple/swift/tree/master/tools/SourceKit
- tspike 10y agoGreat question, I'm interested in the responses as well. I'm using XVim with Xcode, but it's horrendously unstable and much slower than it needs to be.
- nodesocket 10y agoI 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.
- lcfcjs 10y agoThank goodness, I just made an app last week and it was surprising how difficult it was to actually make an http request and handle the response.
- martijn_himself 10y agoMaking an HTTP request would be part of the client (Cocoa?) libraries, this is discussing Server APIs?
- seanparsons 10y agoHaving spent 10 months working in Swift, this is probably the last thing on earth I want to see right now. Pretty much every part of the entire toolchain has been a pain, from Xcode being Xcode, to compiler bugs and crashes, crappy package management and bad language design. Having built servers in Java/C#/Scala/Haskell, I'd pick Haskell over those options and Swift every single time.
- bluejekyll 10y agoWhat is it about Haskell? I'm currently heavily invested in Rust and have very briefly looked at Haskell, but find it to have some oddities that I can wrap my head around.
- seanparsons 10y agoSo 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 opposite end of the spectrum to most programming languages, as in "How do I represent functions mathematically?" rather than "How do I flip this bit in the accumulator register?". Which is probably somewhat to your point about oddities, for me coming from an OOP background there was a huge mental shift that had to happen to "get it". I've found that things tend to just slot together so much more easily as a result. Curried functions for example was a revelation for me, being able to pass (== 10) to a list filter isn't some special case syntactic sugar it just falls out by default. Now much more people have gotten to grips with it there are amazing things like the servant libraries which allow you to define a HTTP service(url, query params, request method, etc.) with a type. You can implement a service against that type and get all the appropriate checks, which is great. But then the incredible part is that you can get it to create functions for each endpoint in that service totally automatically at compile time: https://hackage.haskell.org/package/servant-client#readme https://hackage.haskell.org/package/servant-client#readme
- xenihn 10y agoDoes the inclusion of Vapor members mean we can finally declare Vapor the "winner" over Perfect?
- rgovind 10y agoHas anyone here made a living/killing selling compiler modification services? I want to contribute to Rust/Swift/Some other language with a view of selling consulting services. Can anyone here comment about their success in this regard?
- steveklabnik 10y agohttp://integer32.com/ http://integer32.com/ is the first Rust-focused consultancy I know of.
- jaybuff 10y agoMy team at Apple is hiring in San Francisco. https://jobs.apple.com/us/search?#location&ss=47424189&t=0&so=&lo=0*USA&pN=0&openJobId=47424189 https://jobs.apple.com/us/search?#location&ss=47424189&t=0&s... If you're interested, please email jaybuff@apple.com with [Swift Server] in the email subject line.
- speedkills 10y agoIs there anyway to build on Linux yet? Having to use a Mac to build and deploy is really inconvenient for some continuous integration setups.
- eyuelt 10y agoSwift has had Linux support ever since it was open sourced.
- speedkills 10y agoJust not with Xcode projects? I was looking for something like xcodebuild that I could run in a docker container and never found anything. Can you point me in the right direction?
- harisamin 10y agoI'm one of the maintainers of this https://github.com/swiftdocker/docker-swift https://github.com/swiftdocker/docker-swift :)
- akerro 10y agoSo what makes Swift better than Java/C# for server-side development? I'm getting tired with some languages and I'm looking for (fun) replacements. Yesterday I was reading about Elixir. Why and when should I adopt Swift?
- geodel 10y agoAmazing. Instead of talking about Swift server APIs, gaps or features desired, this thread gets hijacked by Scala enthusiasts.