Hi,
Looks like Apple has made a complete open-source project of its bridge support for gluing other languages to Cocoa, as used in RubyCocoa and PyObjC. Any chance we can bridge Squeak to it, and get back at Brad Cox for creating Objective-C in the first place? ;) http://trac.macosforge.org/projects/BridgeSupport Cheers, Tim |
Oh, that's kind of cool. When we were working on the objective -c
bridge, we were doing a lot of nutty introspection to try to fake that info. We could probably do a lot better with that stuff. If I get an free time I'll look at it. If you want to try it yourself, the objective-c bridge is on squeaksource. -Todd Blanchard On May 28, 2007, at 9:48 AM, Tim Johnson wrote: > Hi, > > Looks like Apple has made a complete open-source project of its > bridge support for gluing other languages to Cocoa, as used in > RubyCocoa and PyObjC. Any chance we can bridge Squeak to it, and > get back at Brad Cox for creating Objective-C in the first place? ;) > > http://trac.macosforge.org/projects/BridgeSupport > > Cheers, > Tim > > |
Hi Todd,
any chance to get this bridge working with current VM? I managed to compile it with latest svn version of the unix VM (stable versions did not compile on Intel Mac for some reason) and it seems there even was some message exchange between VM and ObjC runtime, but after that I got primitive failure in ByteArray>>integerAt:size:signed: e.g. in FFIPlugin>>primitiveFFIIntegerAt and I was not able to fix that. I would give my little finger for a chance to write native Cocoa software in Squeak. Jaroslav Walkback follows: ByteArray(Object)>>error: Receiver: a ByteArray(160 58 97 0) Arguments and temporary variables: aString: 'a primitive has failed' Receiver's instance variables: a ByteArray(160 58 97 0) ByteArray(Object)>>primitiveFailed Receiver: a ByteArray(160 58 97 0) Arguments and temporary variables: Receiver's instance variables: a ByteArray(160 58 97 0) ByteArray>>integerAt:size:signed: Receiver: a ByteArray(160 58 97 0) Arguments and temporary variables: byteOffset: 1 nBytes: 4 aBoolean: false Receiver's instance variables: a ByteArray(160 58 97 0) ByteArray>>unsignedLongAt: Receiver: a ByteArray(160 58 97 0) Arguments and temporary variables: byteOffset: 1 Receiver's instance variables: a ByteArray(160 58 97 0) --- The full stack --- ByteArray(Object)>>error: ByteArray(Object)>>primitiveFailed ByteArray>>integerAt:size:signed: ByteArray>>unsignedLongAt: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ObjcBridge>>coerce:from: [] in NSMutableArray class(ObjcProxy class)>>send:to:withArguments: {[invocation setTarget: anObject. invocation setSelector: aSymbol. 2 to: ...]} BlockContext>>ensure: NSMutableArray class(ObjcProxy class)>>send:to:withArguments: NSMutableArray class(ObjcProxy class)>>objcPerform:withArguments: NSMutableArray class(ObjcProxy class)>>doesNotUnderstand: #alloc ObjcBridge>>initialize ObjcBridge>>startUp ObjcBridge class>>startUp: [] in SystemDictionary>>send:toClassesNamedIn:with: {[:name | class := self at: name ifAbsent: []. class ifNil: [remo...]} OrderedCollection>>do: SystemDictionary>>send:toClassesNamedIn:with: SystemDictionary>>processStartUpList: SmalltalkImage>>snapshot:andQuit:embedded: SmalltalkImage>>snapshot:andQuit: TheWorldMenu>>saveAndQuit TheWorldMenu>>doMenuItem:with: [] in MenuItemMorph>>invokeWithEvent: {[(selArgCount := selector numArgs) = 0 ifTrue: [target perform: selector] ...]} BlockContext>>ensure: CursorWithMask(Cursor)>>showWhile: MenuItemMorph>>invokeWithEvent: MenuItemMorph>>mouseUp: MenuItemMorph>>handleMouseUp: MouseButtonEvent>>sentTo: MenuItemMorph(Morph)>>handleEvent: MorphicEventDispatcher>>dispatchDefault:with: MorphicEventDispatcher>>dispatchEvent:with: MenuItemMorph(Morph)>>processEvent:using: MorphicEventDispatcher>>dispatchDefault:with: MorphicEventDispatcher>>dispatchEvent:with: MenuMorph(Morph)>>processEvent:using: MenuMorph(Morph)>>processEvent: MenuMorph>>handleFocusEvent: [] in HandMorph>>sendFocusEvent:to:clear: {[ActiveHand := self. ActiveEvent := anEvent. result := focusHolder han...]} [] in PasteUpMorph>>becomeActiveDuring: {[aBlock value]} BlockContext>>on:do: PasteUpMorph>>becomeActiveDuring: HandMorph>>sendFocusEvent:to:clear: HandMorph>>sendEvent:focus:clear: HandMorph>>sendMouseEvent: HandMorph>>handleEvent: HandMorph>>processEvents [] in WorldState>>doOneCycleNowFor: {[:h | ActiveHand := h. h processEvents. capturingGesture := capturingGest...]} Array(SequenceableCollection)>>do: WorldState>>handsDo: WorldState>>doOneCycleNowFor: WorldState>>doOneCycleFor: PasteUpMorph>>doOneCycle [] in Project class>>spawnNewProcess {[[World doOneCycle. Processor yield. false] whileFalse. nil]} [] in BlockContext>>newProcess {[self value. Processor terminateActive]} On 28. May 2007, at 7:10 PM, Todd Blanchard wrote: > Oh, that's kind of cool. When we were working on the objective -c > bridge, we were doing a lot of nutty introspection to try to fake > that info. We could probably do a lot better with that stuff. If > I get an free time I'll look at it. If you want to try it > yourself, the objective-c bridge is on squeaksource. > > -Todd Blanchard > |
Free forum by Nabble | Edit this page |