
Introducing the IBM Swift Sandbox - julianozen
https://developer.ibm.com/swift/2015/12/03/introducing-the-ibm-swift-sandbox/
======
hmottestad
It's on Bluemix!!!

Here is my experience with Bluemix:

1\. We needed to get bills to send to our accounting department. There is no
way to get this out of Bluemix. We needed to contact 5 different people and
send 2 different support tickets.

2\. At one point we couldn't log into our accounts, the authentication server
was down.

3\. The docker container doesn't always get internet. Also it sure as hell is
guaranteed to not have internet if you restart it.

4\. If you use their SAAS databases, then some of them you can connect to from
the outside world, but some you can't. And there is no way of knowing which.

5\. Just because IBM makes a product available doesn't mean it works. We used
NodeRED together with the IBM developed database connectors for DashDB. That
connector will timeout after ~24 hours and then not throw any errors when you
keep writing to it. Took 3 days to figure this out and fix it.

6\. Their deploy system is nice, pity it brings down your service for 5-10
minutes even for deploys that are literally 100 lines of java code.

7\. It's painfully slow to push images to their docker hub. Took 3 hours to
upload an image with ubuntu and java. And our uplink is 50mbit.

~~~
IBMContainerGuy
Hi hmottestad!

I am one of the people working on the IBM container service that's available
as part of Bluemix. I am not here in any official capacity, just as someone
who wants to understand what the pain points of our customers.

Let me start by saying that I understand your pain. As every product on the
market, we have issues occasionally, such as the authentication one you
mentioned or the networking. However, these are only exceptions and rarely
affect our users, at least as far as we are aware. Did this happen repeatedly
or was it a one time occurrence?

With regards to the ticketing system, I believe you are correct. Things are
not as smooth as you or I would like them to be. I will pass this on to the
management chain.

For the uploading speed of images, I also believe this may be quite rare,
since I cannot remember hearing complaints about it. Did this happen on
separate occasions?

With that being said, please send us tickets when something is not going the
way you'd expect.

Thank you for your feedback!

~~~
hmottestad
The authentication one came right when we were going to shut down our use of
bluemix. We reported it directly to IBM here in Norway.

The networking issue in docker happened for a few days. The "fix" from IBM
(after a ticket) was for us to add a 30 second sleep to our containers.
Needles to say this wasn't a fix we were happy with.

Tickets were also a huge hassle in the beginning. It was a 10 step process
just to submit a ticket. It got better after a while.

We didn't file a ticket about the upload speed for images. I just remember
sitting in a meeting realizing that the container had crashed, and when I
restarted it it had no internet. So I thought, that while I was at it I would
just push a new image with some bug fixes. That worked fine and I got a new
container with internet, but pushing the image took more time than the meeting
lasted without there being large changes to the image.

------
amasad
I'm also planning on adding support for Swift to
[https://repl.it](https://repl.it) once I figure out how to implement a proper
REPL with it.

~~~
akanet
We also just added Swift support over at
[https://coderpad.io](https://coderpad.io) for anyone that wants to run swift
during interviews.

Amjad, I got started filing some issues against codemirror for better Swift
support :)
[https://github.com/codemirror/CodeMirror/issues/3680](https://github.com/codemirror/CodeMirror/issues/3680)

~~~
alexpersian
Just wanted to say that coderpad is fantastic. :)

------
melling
Swift is gaining momentum fast. It has a big advantage because it's arguably
the best way to write iOS apps. It'll replace Objective C as a top 5 used
language.

In fact, a quick check of Tiobe shows Objective C heading down fast with Swift
about to pass it on its way up:

[http://www.tiobe.com/index.php/content/paperinfo/tpci/index....](http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html)

------
Apocryphon
Looks like we're finally seeing the fruits of the Apple-IBM global
partnership.

------
king_magic
This is really cool to see. Really hoping to see something similar appear for
Swift on Azure or AWS. Also really hoping to see Swift web frameworks begin to
appear, now that Swift is open-sourced & running on Linux.

~~~
SeldomSoup
Absolutely. Two days ago (before the open source announcement), I begrudgingly
started learning Swift for a school project in iOS development. Now I'm
itching to dive into the language.

------
msoad
How funny the server is down. This shows IBM cloud quality somehow.

[http://m.imgur.com/dGNPBAr](http://m.imgur.com/dGNPBAr)

~~~
osipov
really? it just worked for me
[http://swiftlang.ng.bluemix.net/?cm_mmc=developerWorks-_-
dWd...](http://swiftlang.ng.bluemix.net/?cm_mmc=developerWorks-_-dWdevcenter-
_-swift-_-lp#/repl)

~~~
LeoNatan25
503 Service Unavailable

No server is available to handle this request.

------
fauigerzigerk
This seems to be down. I'm getting 500 errors or a blank/blue page. I hope
this wasn't supposed to be a demonstration of IBMs scalability prowess.

~~~
osipov
just worked for me...i ran my hello world app
[http://swiftlang.ng.bluemix.net/?cm_mmc=developerWorks-_-
dWd...](http://swiftlang.ng.bluemix.net/?cm_mmc=developerWorks-_-dWdevcenter-
_-swift-_-lp#/repl)

------
sosedoff
If you're looking for something similar for other programming languages too,
check out [https://bit.run/](https://bit.run/). It supports Ruby, JS, Go,
Python, Rust, PHP and many more.

~~~
coupdejarnac
Would it be alright for me to embed bit.run in a Swift tutorial site I'm
making? My contact info is in my profile.

------
Shivetya
I am looking for a new language to learn, preferably more PC style platform
focused, would this be a good language to learn?

~~~
rdtsc
What do you want to do with the language?:

Here are some choices I think are interesting as new languages:

Elixir : interpreted / scalability / concurrency / fault tolerance/ friendly
community

Rust : compiled / close to C speed / memory safety / concurrency

TypeScript : compiles to Javascript but with types / runs in the browser

Elm : compiles to Javascrtipt / functional / runs in the browser

~~~
praveenster
You can probably include Go alongside Rust.

~~~
zeckalpha
Or TypeScript? Rust and Go are not much alike.

------
schnevets
I wonder if this was announced as a reaction to Swift going open source. I
could see some IBM team working on this system as a POC, and suddenly being
given an urgent deadline to coincide with the license change.

Gain from the momentum and maybe turn a pet project into something bigger. I
guess that's the benefit of having tens of thousands of developers...

~~~
mingodad
I think that you are right on this, when looking at one of the examples
(server.swift) it seems that people are paid by characters typed and they
forget (or never heard of) the mantra DRY (Don't Repeat Yourself):

func fdSet(fd: Int32, inout set: fd_set) {

    
    
    		let intOffset = Int(fd / 16)
    
    		let bitOffset: Int = Int(fd % 16)
    
    		let mask: Int = 1 << bitOffset
    
    		switch intOffset {
    
    		case 0: set.__fds_bits.0 = set.__fds_bits.0 | mask
    
    		case 1: set.__fds_bits.1 = set.__fds_bits.1 | mask
    
    		case 2: set.__fds_bits.2 = set.__fds_bits.2 | mask
    
    		case 3: set.__fds_bits.3 = set.__fds_bits.3 | mask
    
    		case 4: set.__fds_bits.4 = set.__fds_bits.4 | mask
    
    		case 5: set.__fds_bits.5 = set.__fds_bits.5 | mask
    
    		case 6: set.__fds_bits.6 = set.__fds_bits.6 | mask
    
    		case 7: set.__fds_bits.7 = set.__fds_bits.7 | mask
    
    		case 8: set.__fds_bits.8 = set.__fds_bits.8 | mask
    
    		case 9: set.__fds_bits.9 = set.__fds_bits.9 | mask
    
    		case 10: set.__fds_bits.10 = set.__fds_bits.10 | mask
    
    		case 11: set.__fds_bits.11 = set.__fds_bits.11 | mask
    
    		case 12: set.__fds_bits.12 = set.__fds_bits.12 | mask
    
    		case 13: set.__fds_bits.13 = set.__fds_bits.13 | mask
    
    		case 14: set.__fds_bits.14 = set.__fds_bits.14 | mask
    
    		case 15: set.__fds_bits.15 = set.__fds_bits.15 | mask
    
    		default: break
    
    		}
    
    	}

~~~
mikeash
Given the unfortunate way fd_set apparently got imported, how else would you
do this? The only alternative I see is to throw UnsafeMutablePointer at it,
but that brings in the ugly specter of undefined behavior. Note that in Swift
you cannot use a variable to address a tuple, so there's no way to use
intOffset to access the corresponding field of set.__fds_bits.

~~~
mingodad
For me is hard to understand how a language with a behavior/constraints like
you describe get so much noise about "been easy to use/learn".

I do not like it but at least be DRY as much as possible:

case 0: set.__fds_bits.0 |= mask

~~~
mikeash
What you're seeing here is a result of an unfortunate interaction with
bridging to C APIs. fd_set is a C struct which contains a fixed-length array.
Swift doesn't have fixed-length arrays, so those get translated to tuples
instead.

This is not ideal, but it comes up almost never.

As for your suggestion, that seems like an entirely stylistic thing. DRY is
about not copy/pasting large chunks of code, not minimizing individual lines
by using compound mutate/assign operators. I've never seen anyone say
(before!) that something like `x = x + 1` violates DRY.

~~~
weego
More importantly nothing about DRY overwrites the ideal that making the intent
of your code explicitly clear is more important then fixating on micro
optimisations. I feel like the code as it is less easy to misunderstand while
skim read.

------
asadlionpk
We also added support for swift in
[https://codepad.remoteinterview.io/](https://codepad.remoteinterview.io/)

Collaboration enabled REPL is there too (enter 'swift' in the shell).

~~~
pat2man
Seems a lot slower...

------
jacques_chester
There was a half-joke on Wednesday that we should do a Swift buildpack for
Cloud Foundry.

