Live data from Hacker News

Why Rubyist Will Love Swift

littlelines.com

31–40 of 42 posts

Re: Why Rubyist Will Love Swift

#31

if current_user = find_current_user notify_user(current_user) end Funny to see an anti-pattern in C/C++ so lauded in another community. Also, you know what I like about Ruby? I can write it and it'll run everywhere, and it is maintained by a vibrant community effort. Where's that on this list?

It is just as much an anti pattern in Ruby as well.

While I can think of usages where I could see myself use it, the given example is definitely not one.

Re: Why Rubyist Will Love Swift

#32
post #21
post #8

Earlier quoted context omitted.

Scala, yes, but not C++ at all. Indirectly from C#, perhaps (and there is a fair bit of that), but there is very little that borrows from C++ at the language level.

Oh I would love to see a write up comparing it with Scala idioms. As a person who has done C# for a while a lot of idioms translate very well to Swift. The if let x = whatever {} syntax in Swift is damn brilliant after looking at a ton of C# code with the as check.

Here is a Swift vs Scala syntax comparison:

https://leverich.github.io/swiftislikescala/

And also, a comparison to C#:

http://pietschsoft.com/post/2014/06/07/Basic-Comparison-of-C...

Re: Why Rubyist Will Love Swift

#33

As a wannabe-rubyist who thinks reading Obj-C is somewhere between having a migraine and using H2SO4 eye drops, so far I'm in love with the language. I'm doing lots of tripping over the Cocoa APIs, though, in no small part due to Xcode. The error messages you get when you've done something wrong are unintuitive at best and downright misleading at worst. Example: I've got a field I want to render an image in. It's rep…

That setValue(AnyObject)->Void autocompletion is interesting. I don't believe any such method exists anywhere in Cocoa. I think it's probably a bug where a spurious method declaration is being generated from the NSKeyValueCoding protocol header based on setValue:forKey:.

Re: Why Rubyist Will Love Swift

#34
post #11

Earlier quoted context omitted.

Ruby isn't fast enough, and it would chew battery on a phone and make some apps impossible to do correctly. Ruby is a great language, it's my favourite hands down, but all that sugar comes at a cost. Even in ruby, we often use c libs to do the heavy lifting, they're just wrapped by ruby using the C extension framework.

The RubyMotion folks disagree: RubyMotion for Android features a completely new Ruby runtime specifically designed and implemented for Android development. This is a new implementation of the Ruby language, it does not share code with RubyMotion for the Objective-C runtime. We are using the RubySpec project to make sure the runtime behaves as expected. ... We feature an LLVM-based static compiler that will transform…

That doesn't actually dispute either of the claims you're saying it does. Everything you just quoted can be true and Ruby could still be too slow compared to Objective-C and chew up too much battery.

Re: Why Rubyist Will Love Swift

#35

I'm not a rubyist, neither I am a professional programmer, but I'm sad that Apple didn't/couldn't choose Ruby as their main language. Nowadays I'm deciding what programming language to learn as a hobby. Reality (market) tells me that should be JavaScript or right now Swift (looks like javascript for me). It makes me sad, I wish it could be Ruby. So clean and clear. Everything makes sense, I don't need to memorize alm…

You seem to care a great deal about a topic you don't yet know enough about. You seem to have a superficial attraction to Ruby, which is fine, but it doesn't actually make Ruby better in any meaningful way. If you actually use a language and make real programs in it, you'll stop being a beginner before long, and your opinion now will be irrelevant even to you. Ruby is my go-to language for getting things done, but there is still a whole lot that is awesome in Swift.

Re: Why Rubyist Will Love Swift

#36
post #10

Earlier quoted context omitted.

I could be wrong, but I believe the parent is referring to the inability for a "vibrant community" to maintain Swift as a language implementation (instead of Apple), which is very different than Ruby. There's no doubt in my mind that there will be swarms of people developing with the language, but AFAICT, we'll mostly only see Apple developers working on the language itself.

also, isn't swift intimately tied to Cocoa & co? Even if apple made great strides in open sourcing the language, compiler etc, I doubt we'll ever be able to run it on anything other than OSX/iOs.

The swift API, not necessarily the language. No more than obj-c is at least. With the support for swift to call obj-c code, if they release an implementation it might be interesting to see where projects like Etoile can take things.

Re: Why Rubyist Will Love Swift

#37
post #10

Earlier quoted context omitted.

You realise that you're talking about a prerelease, right? The language hasn't even been available to developers for a month yet, let alone the general public. Give the vibrant community effort some time.

I could be wrong, but I believe the parent is referring to the inability for a "vibrant community" to maintain Swift as a language implementation (instead of Apple), which is very different than Ruby. There's no doubt in my mind that there will be swarms of people developing with the language, but AFAICT, we'll mostly only see Apple developers working on the language itself.

>There's no doubt in my mind that there will be swarms of people developing with the language, but AFAICT, we'll mostly only see Apple developers working on the language itself.

Well, it's not like there's a "vibrant community" working on Ruby either.

AFAIK, the core developers are Japanese ( http://rubycoreteam.heroku.com/ ) and the core communication and decisions is mostly opaque to outsiders, and new language stuff mostly comes in bunches pre-formed.

As opposed say to Python and the PEPs discussion, PHP etc.

Re: Why Rubyist Will Love Swift

#38
post #22
post #17

Earlier quoted context omitted.

Heh, this is the truth. Most of the difficulty of learning Swift I think will lie in learning Cocoa. Just like Objective-C that.

That is true for every programming language and platform pair. The syntax is always the easy part, but unfortunately the only thing most people fixate on.

Valid point, also amusing that everyone focuses on the trivial part of syntax over the difficulty of the environment it lives in.

Re: Why Rubyist Will Love Swift

#39
post #23

I'm not a rubyist, neither I am a professional programmer, but I'm sad that Apple didn't/couldn't choose Ruby as their main language. Nowadays I'm deciding what programming language to learn as a hobby. Reality (market) tells me that should be JavaScript or right now Swift (looks like javascript for me). It makes me sad, I wish it could be Ruby. So clean and clear. Everything makes sense, I don't need to memorize alm…

Swift is not anything like JavaScript. And unfortunately ruby isn't powerful enough to do what Apple needs, but I agree that it would be nice if they could have chosen something with more syntactic elegance, although I'd have preferred it if they'd just gone in the direction of Smalltalk. I presume you haven't programmed lisp, because although there is very little syntax to memorize, there are a huge number of functi…

> And unfortunately ruby isn't powerful enough to do what Apple needs

I'd say on the power spectrum of programming languages, ruby is MORE powerful than swift.

There are so many things you can do in ruby that you can't do in swift, especially along the lines of reflection. The only stuff swift has that ruby doesn't comes in way of restrictions eg. typing.

Re: Why Rubyist Will Love Swift

#40
post #37
post #10

Earlier quoted context omitted.

I could be wrong, but I believe the parent is referring to the inability for a "vibrant community" to maintain Swift as a language implementation (instead of Apple), which is very different than Ruby. There's no doubt in my mind that there will be swarms of people developing with the language, but AFAICT, we'll mostly only see Apple developers working on the language itself.

> There's no doubt in my mind that there will be swarms of people developing with the language, but AFAICT, we'll mostly only see Apple developers working on the language itself. Well, it's not like there's a "vibrant community" working on Ruby either. AFAIK, the core developers are Japanese ( http://rubycoreteam.heroku.com/ ) and the core communication and decisions is mostly opaque to outsiders, and new language st…

I entirely disagree. As most all open source projects, Ruby has a set of core contributors, but is clearly open to community contribution, as can be seen from their Git repo's history (https://github.com/ruby/ruby/network). And no, core communication and decisions are NOT opaque to outsiders, as is the usual case with most open source software (Google groups, mailing lists, IRC channels, etc). And lastly, language features and design is a product of the RubySpec, which is itself a Git repo for people to contribute to possible language design/syntax/core libraries for Ruby VM implementors to introduce (https://github.com/rubyspec/rubyspec/).
Post reply on HN