Live data from Hacker News

Bringing Objective-C to the Amiga

heap.zone

21–30 of 113 posts

Re: Bringing Objective-C to the Amiga

#21

Earlier quoted context omitted.

My apps almost never crash since I switched to Swift. That alone gives it the edge over ObjC for me.

How do you do DSP work in Swift?

My synth app is still a C++/ObjC app. Integrating with C++ code is one area where ObjC still wins.

Re: Bringing Objective-C to the Amiga

#22
post #19

Earlier quoted context omitted.

What got me over the line was optionals and protocols + generics, the safety and expressiveness combined will eventually (hopefully!) win you over!

Yea, but you lose C++ interop, your binary will be inflated with those Swift proxy libs and your compilation times will increase 2-3-fold.

Those are actually temporary problems. Once ABI stability is implemented, those DLLs will not be needed. The compiler is obviously a WIP and will take years to become more mature and optimized. Likewise for C++ interop.

There are fundamental issues with Swift, but those are not them.

Re: Bringing Objective-C to the Amiga

#25
post #7

Does anyone else look at Objective-C code, and just want to puke?

It’s not puke inducing, but it is verbose. The language designers just took a different approach to how to write code. Just for some background, it came out at a similar time to c++. Both were designed to be a ‘better c’

Objective-C itself is not verbose, method names can be as long or as short as you like. You can have method names with only colons if you want:

- (void):(id)param1 :(id)param2 :(id)param3

Keyword names do not have to be unique such as:

- (void)drawLine:(id)gfxContext x:(double)x1 y:(double)y1 x:(double)x2 y:(double)y2

Cocoa/Cocoa Touch is verbose, but Objective-C is not (it is by far my favorite programming language)

Re: Bringing Objective-C to the Amiga

#26

Earlier quoted context omitted.

What got me over the line was optionals and protocols + generics, the safety and expressiveness combined will eventually (hopefully!) win you over!

I prefer to keep the dynamism over unreadable fp "expressiveness" or safety that was not needed in the first place.

There's nothing stopping you from writing dynamic Swift code or functional programming in Objective-C.

Re: Bringing Objective-C to the Amiga

#27

Earlier quoted context omitted.

My apps almost never crash since I switched to Swift. That alone gives it the edge over ObjC for me.

How do you do DSP work in Swift?

vDSP is exposed to Swift: https://developer.apple.com/documentation/accelerate/vdsp

Re: Bringing Objective-C to the Amiga

#28
post #7

Earlier quoted context omitted.

It’s not puke inducing, but it is verbose. The language designers just took a different approach to how to write code. Just for some background, it came out at a similar time to c++. Both were designed to be a ‘better c’

Personally I prefer the brackets of ObjC to the colon overload of C++

> the colon overload of C++

There's a lot of colons here too:

  - (id)outputImageProviderFromBufferWithPixelFormat:(NSString *)format 
                                          pixelsWide:(NSUInteger)width 
                                          pixelsHigh:(NSUInteger)height 
                                         baseAddress:(const void *)baseAddress 
                                         bytesPerRow:(NSUInteger)rowBytes 
                                     releaseCallback:(QCPlugInBufferReleaseCallback)callback 
                                      releaseContext:(void *)context 
                                          colorSpace:(CGColorSpaceRef)colorSpace 
                                    shouldColorMatch:(BOOL)colorMatch;

Re: Bringing Objective-C to the Amiga

#29
post #9

Earlier quoted context omitted.

I actually prefer Objective-C to Swift.

Swift is a solution to a non existent problem.

How so? I personally feel that most of the changes Swift made to the language really do solve real problems that Apple and third party developers have had with Objective-C (and other languages, as well).

Re: Bringing Objective-C to the Amiga

#30
post #19

Earlier quoted context omitted.

Yea, but you lose C++ interop, your binary will be inflated with those Swift proxy libs and your compilation times will increase 2-3-fold.

Those are actually temporary problems. Once ABI stability is implemented, those DLLs will not be needed. The compiler is obviously a WIP and will take years to become more mature and optimized. Likewise for C++ interop. There are fundamental issues with Swift, but those are not them.

I'm much more hopeful for ABI stability than C++ interoperatability. I think will take a long time before we'll be able to seamlessly work with C++ code as we do currently with say Objective-C or C.
Post reply on HN