Re: [swift-users] Server side swift application ?

2016-05-09 Thread Fareed Quraishi via swift-users
Don't know if I'm late to this conversation. I have been using the perfect
 platform for server-side swift. My understanding was
it is the most robust platform, but I'm using it because my boss said so. I
haven't had any problems and I'm finding the community around it is growing
solid. If you want to give it a try, this tutorial

is pretty solid.

Thanks,
Fareed

On Sun, May 8, 2016 at 1:08 PM, Gerard Iglesias via swift-users <
swift-users@swift.org> wrote:

> Jens,
>
> I have to say that I am far from an expert in low level network coding,
> even if I started using Distributed object in 93 with NeXTStep, and I can
> build network connection with the basics, listen, bind, accept ... There is
> an interesting network code in swift with these basics on the IBM swift
> playground.
>
> I wonder what kind of limitations are no longer relevant ?
>
> And I found CocoaAsync very interesting to read because of the intensive
> use of GCD
>
> And maybe it would be interesting to know who use what today with swift to
> put a server or a client in use?
>
> Regards
>
> Gérard
>
> Le 3 mai 2016 à 23:03, Jens Alfke  a écrit :
>
>
> On May 3, 2016, at 12:46 PM, Gerard Iglesias 
> wrote:
>
> A good reading
>
> https://github.com/robbiehanson/CocoaAsyncSocket
>
>
> This is highly Mac/iOS-specific code, so it doesn’t make sense for
> applications targeted at servers.
>
> Also, I’ve used CocoaAsyncSocket and it’s IMHO greatly overcomplicated for
> what it does. There is a LOT of code in there, and a fair amount of the
> complexity seems to be to work around obsolete limitations of iOS
> networking that are no longer relevant.
>
> —Jens
>
>
> ___
> swift-users mailing list
> swift-users@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users
>
>


-- 
www.FareedQ.com
Twitter @IAmFareedQ
___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] Server side swift application ?

2016-05-08 Thread Raphaël Wach via swift-users
Thank you all for your feedback. That’s really helpful.

I understand that there is a lot of work in progress regarding server-side 
Swift and I’ll keep investigating this field though as nothing looks stable for 
now I’ll stick on Node.js in production for a while. 
An Apple application server designed for Swift would really be awesome.
Hopefully, a good news at the incoming WWDC ? Who knows ;)

Cheers,

Raphaël


> Le 3 mai 2016 à 23:03, Jens Alfke via swift-users  a 
> écrit :
> 
> 
>> On May 3, 2016, at 12:46 PM, Gerard Iglesias > > wrote:
>> 
>> A good reading 
>> 
>> https://github.com/robbiehanson/CocoaAsyncSocket 
>> 
> This is highly Mac/iOS-specific code, so it doesn’t make sense for 
> applications targeted at servers.
> 
> Also, I’ve used CocoaAsyncSocket and it’s IMHO greatly overcomplicated for 
> what it does. There is a LOT of code in there, and a fair amount of the 
> complexity seems to be to work around obsolete limitations of iOS networking 
> that are no longer relevant.
> 
> —Jens
> ___
> swift-users mailing list
> swift-users@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] Server side swift application ?

2016-05-03 Thread Jens Alfke via swift-users

> On May 3, 2016, at 12:46 PM, Gerard Iglesias  wrote:
> 
> A good reading 
> 
> https://github.com/robbiehanson/CocoaAsyncSocket 
> 
This is highly Mac/iOS-specific code, so it doesn’t make sense for applications 
targeted at servers.

Also, I’ve used CocoaAsyncSocket and it’s IMHO greatly overcomplicated for what 
it does. There is a LOT of code in there, and a fair amount of the complexity 
seems to be to work around obsolete limitations of iOS networking that are no 
longer relevant.

—Jens___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] Server side swift application ?

2016-05-03 Thread Gerard Iglesias via swift-users
A good reading 

https://github.com/robbiehanson/CocoaAsyncSocket

Usable In Swift, even if the umbrella module did not work for me, I had to 
compile it in my own workspace to use it in swift code

Regards 

Gérard 

> Le 3 mai 2016 à 21:17, Tyler Cloutier via swift-users  
> a écrit :
> 
> 
>>> On May 3, 2016, at 12:14 PM, Jens Alfke  wrote:
>>> 
>>> 
>>> On May 1, 2016, at 11:48 AM, Tyler Fleming Cloutier via swift-users 
>>>  wrote:
>>> 
>>> libuv and libdispatch overlap on functionality quite a bit, but libdispatch 
>>> has the benefit of using a block API instead of a function pointer API, 
>>> which makes memory management easier in Swift.
>> 
>> I think libdispatch would be the better choice, since it’s what’s going to 
>> be used in Swift’s standard library going forward.
>> 
>>> However, libuv has many additional features for setting up TCP connections 
>>> and other networking constructs.
>> 
>> The dispatch_io API lets you use libdispatch with file descriptors, so 
>> working with TCP would just involve making the usual system calls to open 
>> the connection and then creating a dispatch_io_t from the FD. It should just 
>> take a couple of lines of code.
> 
> Indeed!
> 
> https://github.com/TheArtOfEngineering/Edge/blob/master/Sources/TCP.swift
> 
>> 
>> —Jens
> 
> ___
> swift-users mailing list
> swift-users@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users
___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] Server side swift application ?

2016-05-03 Thread Tyler Cloutier via swift-users

> On May 3, 2016, at 12:14 PM, Jens Alfke  wrote:
> 
> 
>> On May 1, 2016, at 11:48 AM, Tyler Fleming Cloutier via swift-users 
>> > wrote:
>> 
>> libuv and libdispatch overlap on functionality quite a bit, but libdispatch 
>> has the benefit of using a block API instead of a function pointer API, 
>> which makes memory management easier in Swift.
> 
> I think libdispatch would be the better choice, since it’s what’s going to be 
> used in Swift’s standard library going forward.
> 
>> However, libuv has many additional features for setting up TCP connections 
>> and other networking constructs.
> 
> The dispatch_io API lets you use libdispatch with file descriptors, so 
> working with TCP would just involve making the usual system calls to open the 
> connection and then creating a dispatch_io_t from the FD. It should just take 
> a couple of lines of code.

Indeed!

https://github.com/TheArtOfEngineering/Edge/blob/master/Sources/TCP.swift

> 
> —Jens

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] Server side swift application ?

2016-05-03 Thread Jens Alfke via swift-users

> On May 1, 2016, at 11:48 AM, Tyler Fleming Cloutier via swift-users 
>  wrote:
> 
> libuv and libdispatch overlap on functionality quite a bit, but libdispatch 
> has the benefit of using a block API instead of a function pointer API, which 
> makes memory management easier in Swift.

I think libdispatch would be the better choice, since it’s what’s going to be 
used in Swift’s standard library going forward.

> However, libuv has many additional features for setting up TCP connections 
> and other networking constructs.

The dispatch_io API lets you use libdispatch with file descriptors, so working 
with TCP would just involve making the usual system calls to open the 
connection and then creating a dispatch_io_t from the FD. It should just take a 
couple of lines of code.

—Jens___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] Server side swift application ?

2016-05-01 Thread Dru Satori via swift-users
Fwiw, I already have some swift code deployed in my internal server clusters.

Sent from my iPhone

> On May 1, 2016, at 12:40 PM, Basem Emara via swift-users 
>  wrote:
> 
> This is certainly possible even today. There are many vibrant initiatives in 
> this space that make it usable. I wouldn’t use it in production for another 
> couple years until the dust settles and gets battle tested in real-world 
> production scenarios (think how long Node.js took to be adopted by enterprise 
> companies). If Apple were to officially release a Swift server, it would 
> definitely accelerate this process.
> 
>> On May 1, 2016, at 10:48 AM, Raphaël Wach via swift-users 
>>  wrote:
>> 
>> Hi Swift programmers,
>> 
>> I would like to ask for opinions or feedback about server side application 
>> with swift.
>> Is it realistic to think about creating an application server with swift ?
>> I would love to develop games with both client and server in Swift and get 
>> rid of any other technologies in my stack but I am not sure that it’s a good 
>> idea for now.
>> I know that IBM started to allows server side Swift in their cloud though 
>> probably not many people use it for now as it’s a very recent work.
>> 
>> So does that seem possible for you to develop, host and maintain a game 
>> server with Swift or should I keep using more common server side 
>> technologies like C++, Node.js… ?
>> 
>> Hopefully, you can give me advices and help me to choose the best solution.
>> 
>> Cheers,
>> 
>> Raphaël
>> ___
>> swift-users mailing list
>> swift-users@swift.org
>> https://lists.swift.org/mailman/listinfo/swift-users
> 
> ___
> swift-users mailing list
> swift-users@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users
___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


Re: [swift-users] Server side swift application ?

2016-05-01 Thread Tyler Fleming Cloutier via swift-users
Hi Raphael,

I took a look at the current Kitura (Swift-IBM) code and they appear to be 
using libdispatch, but only to put there blocking calls off the main queue: 
https://github.com/IBM-Swift/Kitura-net/blob/master/Sources/KituraNet/HttpServerSpi.swift#L52.
 

This might be because libdispatch on Linux is not mature, I’m not sure. I 
haven’t benchmarked it or anything so it might be sufficient for what you are 
looking for. 

I’ve been looking into libuv which is the async IO library that Node.js is 
built on top of, but you would still have to wrap it in Swift. I’m currently 
trying to see what it would be like to replicate some of libuv’s functionality 
with libdispatch. libuv and libdispatch overlap on functionality quite a bit, 
but libdispatch has the benefit of using a block API instead of a function 
pointer API, which makes memory management easier in Swift. However, libuv has 
many additional features for setting up TCP connections and other networking 
constructs.

Hope that helps a little bit, I’m exploring this area myself!

Tyler


> On May 1, 2016, at 7:48 AM, Raphaël Wach via swift-users 
>  wrote:
> 
> Hi Swift programmers,
> 
> I would like to ask for opinions or feedback about server side application 
> with swift.
> Is it realistic to think about creating an application server with swift ?
> I would love to develop games with both client and server in Swift and get 
> rid of any other technologies in my stack but I am not sure that it’s a good 
> idea for now.
> I know that IBM started to allows server side Swift in their cloud though 
> probably not many people use it for now as it’s a very recent work.
> 
> So does that seem possible for you to develop, host and maintain a game 
> server with Swift or should I keep using more common server side technologies 
> like C++, Node.js… ?
> 
> Hopefully, you can give me advices and help me to choose the best solution.
> 
> Cheers,
> 
> Raphaël
> ___
> swift-users mailing list
> swift-users@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

___
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users