Re: [swift-users] Using Swift for interpreted shell scripts?

2015-12-16 Thread Dominik Hauser via swift-users
I write my scripts in a Playground to get autocompletion and instant feedback. 
Kind of works but sometimes I wish Playgrounds would start faster with running. 
And sometimes they stop working and I have to restart Xcode.


> On 15.12.2015, at 20:57, Erica Sadun via swift-users  
> wrote:
> 
> I've given up on it. I find it far easier to just write a command-line app 
> with Xcode's source support -- E
> 
>> On Dec 15, 2015, at 12:45 PM, @lbutlr via swift-users 
>>  wrote:
>> 
>> Are there any resources on using swift for shell scripting?
>> 
>> I’m interested in trying my hand at Swift by converting existing bash 
>> scripts into swift since bash is mostly what I am writing currently, so I 
>> figure this will at least get me started with syntax and such.
>> 
>> ZZ
> 
> ___
> 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] Using Swift for interpreted shell scripts?

2015-12-16 Thread Daniel Dunbar via swift-users

> On Dec 16, 2015, at 7:21 AM, @lbutlr via swift-users  
> wrote:
> 
> On 15 Dec 2015, at 14:12, John Regner  wrote:
>> Check out this talk from Ayaka on just this topic! 
>> https://realm.io/news/swift-scripting/
> 
> Thank you, that looks very promising.
> 
> I didn’t realize the list was set to “reply off list” so a message I thought 
> I posted didn’t go through. Rather than repost it…
> 
> On Dec 15, 2015, at 12:59 PM, David Turnbull  wrote:
>> There's this shebang for OS X:
>> #!/usr/bin/env xcrun swift
> 
> Interesting. I was just messing around with
> 
> #!/usr/bin/swift
> 
> And making some (albeit slow) progress.
> 
> ===
> 
> Is there a reason to use xcrun instead of calling swift directly?

Probably not. You can just call `swift` and it will shim through to the same 
thing as `xcrun swift`.

IIRC, 10.9 didn't have the `swift` shim, but every OS X release since then has.

 - Daniel

> 
> -- 
> 'But you ain't part of it, are you?' said Granny conversationally. 'You
> try, but you always find yourself watchin' yourself watchin' people, eh?
> Never quite believin' anything? Thinkin' the wrong thoughts?'
> 
> ___
> 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] Using Swift for interpreted shell scripts?

2015-12-16 Thread @lbutlr via swift-users
On 15 Dec 2015, at 14:12, John Regner  wrote:
> Check out this talk from Ayaka on just this topic! 
> https://realm.io/news/swift-scripting/

Thank you, that looks very promising.

I didn’t realize the list was set to “reply off list” so a message I thought I 
posted didn’t go through. Rather than repost it…

On Dec 15, 2015, at 12:59 PM, David Turnbull  wrote:
> There's this shebang for OS X:
> #!/usr/bin/env xcrun swift

Interesting. I was just messing around with

#!/usr/bin/swift

And making some (albeit slow) progress.

===

Is there a reason to use xcrun instead of calling swift directly?

-- 
'But you ain't part of it, are you?' said Granny conversationally. 'You
try, but you always find yourself watchin' yourself watchin' people, eh?
Never quite believin' anything? Thinkin' the wrong thoughts?'

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


[swift-users] Using Swift for interpreted shell scripts?

2015-12-15 Thread @lbutlr via swift-users
Are there any resources on using swift for shell scripting?

I’m interested in trying my hand at Swift by converting existing bash scripts 
into swift since bash is mostly what I am writing currently, so I figure this 
will at least get me started with syntax and such.

ZZ

-- 
The Steve is seen, rightly or wrongly, as the visionary, the leader,
the savant. Bill is the Boswell to The Steve's Johnson, but lacking
Boswell's wit, charm, and dynamic personality.

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


Re: [swift-users] Using Swift for interpreted shell scripts?

2015-12-15 Thread Erica Sadun via swift-users
I've given up on it. I find it far easier to just write a command-line app with 
Xcode's source support -- E

> On Dec 15, 2015, at 12:45 PM, @lbutlr via swift-users  
> wrote:
> 
> Are there any resources on using swift for shell scripting?
> 
> I’m interested in trying my hand at Swift by converting existing bash scripts 
> into swift since bash is mostly what I am writing currently, so I figure this 
> will at least get me started with syntax and such.
> 
> ZZ

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


Re: [swift-users] Using Swift for interpreted shell scripts?

2015-12-15 Thread Jens Alfke via swift-users
Swift doesn’t seem like a good fit for the kinds of tasks people write 
shell-scripts for. It’s a system/app programming language, like C/C++. 
Scripting languages have extremely dynamic typing, super-high-level APIs, and 
no separate compile/link stage.

There’s no reason you couldn’t convert some shellscripts as an exercise to 
learn Swift, but I don’t think you’ll find many resources out there.

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