F-Script icon indicating copy to clipboard operation
F-Script copied to clipboard

Discussion: What about Swift-based F-Script?

Open juandesant opened this issue 11 years ago • 5 comments

It looks like the Swift Playgrounds are something that could be done via F-Script. In addition, given that Swift code will be using the Objective-C runtime, message passing to Swift objects should be possible. Are there any ideas for a Yosemite/Swift version of F-Script?

juandesant avatar Jun 17 '14 17:06 juandesant

You mean F-Script as a language or as an application to inject into apps?

Kentzo avatar Jun 17 '14 18:06 Kentzo

I guess I mean both: I understand F-Script should be able to explore Swift applications. But being able to use the more strict Swift semantics would be helpful.

juandesant avatar Jun 17 '14 21:06 juandesant

Are we talking here about Swift support? Because I couldn't get it to work from a .swift file; got a lot of errors and warnings. I thought Swift support would be automatic, but obviously it isn't.

Any chance to get it to support it?

Rhuantavan avatar Jul 19 '14 18:07 Rhuantavan

I definitely want this. Could you share all the errors and warning you've seen? Could you also publish a demo project that demonstrates them?

Kentzo avatar Jul 19 '14 19:07 Kentzo

To trigger the errors it is enough to include the F-Script framework to your app and add "#import <FScript/FScript.h>" to the bridging header file. The errors (I have shortened the path to the framework for readability sake):

<unknown>:0: error: .../FScript.framework/Headers/FSArray.h:12: expected identifier
<unknown>:0: error: .../FScript.framework/Headers/FSBoolean.h:16: expected selector for Objective-C method
<unknown>:0: error: .../FScript.framework/Headers/FSBoolean.h:26: expected selector for Objective-C method
<unknown>:0: error: .../FScript.framework/Headers/FSBoolean.h:33: expected selector for Objective-C method
<unknown>:0: warning: .../FScript.framework/Headers/FSPointer.h:14: '__strong' only applies to Objective-C object or block pointer types; type here is 'void *'
<unknown>:0: warning: .../FScript.framework/Headers/FSGenericPointer.h:10: '__strong' only applies to Objective-C object or block pointer types; type here is 'char *'
<unknown>:0: error: .../FScript.framework/Headers/FSNSNumber.h:18: expected ';' after method prototype
<unknown>:0: error: .../FScript.framework/Headers/FSNumber.h:31: expected ';' after method prototype
<unknown>:0: error: .../FScript.framework/Headers/Number_fscript.h:31: expected ';' after method prototype

Rhuantavan avatar Jul 19 '14 20:07 Rhuantavan