Live data from Hacker News

Introducing the IBM Swift Sandbox

developer.ibm.com

41–50 of 61 posts

Re: Introducing the IBM Swift Sandbox

#41
post #26
post #23

How funny the server is down. This shows IBM cloud quality somehow. http://m.imgur.com/dGNPBAr

really? it just worked for me http://swiftlang.ng.bluemix.net/?cm_mmc=developerWorks-_-dWd...

503 Service Unavailable

No server is available to handle this request.

Re: Introducing the IBM Swift Sandbox

#42
post #34

Earlier quoted context omitted.

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.

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

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.

Re: Introducing the IBM Swift Sandbox

#44
post #29
post #8

Earlier quoted context omitted.

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

It should be noted that there are some caveats to TypeScript, namely that it's type-safety is only compile-time and not at run-time. It is best-effort type-safety. That said, the edge cases are few and far between. TS is a fantastic language to work with.

I think the issue you're mentioning isn't so much that TS only enforces type safety at compile time, because that's true of Haskell, OCaml, C++, etc. as well, but that by its nature it can't enforce any type contracts with the large quantity of dynamically-typed JavaScript you're probably going to be dealing with. Of course, this is also an issue when safe Haskell, OCaml, etc. code interacts with compiled C code at runtime as well.

Re: Introducing the IBM Swift Sandbox

#45

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 n…

Nice, Testsuite As A Service, I like it!

Re: Introducing the IBM Swift Sandbox

#46
post #42

Earlier quoted context omitted.

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

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 ind…

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.

Re: Introducing the IBM Swift Sandbox

#47
post #2

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

If you're writing iOS apps, Swift is the language to learn. If you're writing server-side code for Linux/OSX, probably not quite yet. The language is nice, but it's only been available as open-source for a day now... the ecosystem you'd need to be productive in Swift isn't there yet. (On the other hand, if you'd like to be involved in building that ecosystem, now's probably the time to jump in.)

Is this IBM link the best first starting point to learn swift -- or should one look to something else as a first entry to swift?

Re: Introducing the IBM Swift Sandbox

#48

Earlier quoted context omitted.

If you're writing iOS apps, Swift is the language to learn. If you're writing server-side code for Linux/OSX, probably not quite yet. The language is nice, but it's only been available as open-source for a day now... the ecosystem you'd need to be productive in Swift isn't there yet. (On the other hand, if you'd like to be involved in building that ecosystem, now's probably the time to jump in.)

Is this IBM link the best first starting point to learn swift -- or should one look to something else as a first entry to swift?

Official documentation is here [1], with additional documentation and resources (that are more iOS and OSX specific) available here [2].

In particular, the Swift Programming Language ebook isn't a bad starting point. The IBM Swift Sandbox looks like a nice little interactive environment to complement it, though, if you don't have access to a Mac to run Xcode.

[1] https://swift.org/documentation/ [2] https://developer.apple.com/swift/resources/

Re: Introducing the IBM Swift Sandbox

#49

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 n…

This might help with the deploy downtime (works on Bluemix , PWS, etc):

https://github.com/concourse/autopilot

Post reply on HN