The Alchemist Guild’s Blog

Mac Software Development and Pascal

Browsing Posts published on February 16, 2009

It may have been well over a year now but when I heard the news about someone making a Pascal Objective-C bridge (then with no name) I just ignored it for some reason. Maybe because 10.5 had not be released and there was no real reason for unless I wanted to make an Cocoa application. I should have taken notice at least so I could replace my WebKit code with native Pascal. As of 10.5 we now have the HICocoaView API which lets us use NSView classes in Carbon windows, which means: Cocoa is open game for me now. Even if I have to write the wrappers in Objective-C I can use them in Carbon.

A few weeks ago and I have compiled and ran some of the example projects (in PascalGladiator) and started some simple tests with NSTextView and NSOutline/TableView, 2 API’s which there Carbon equivalent is terrible and I spent hours trying to mimic the Cocoa version which has become the standard.

I was thrilled to see in not too long I had the 2 API’s working in a Carbon window and I can say they are designed much better then their Carbon counter parts. WASTE requires at least 1-2 weeks of full time work to get a good HIView wrapper but NSTextView was working I would argue better after just a few.

However there have been the PasCocoa bindings are incomplete and some basic features like overriding a method in an existing NSObject class is not available. Adding methods to Objective-C runtime for delegates/controllers is also a kludge. I plan to start making contributions to the project as well as adding macro support and code generation utilities in PascalGladiator to aid the process.

At any rate this is a great start and something I fully support as the future of Mac development using Pascal.

With the release of 0.4 and what seems to be more bugs than fixes I have hit a cross roads. The text editor API I have been using for years instead of MLTE has proven to be obsolete and no longer suitable for development. The developer has more or less abandoned the project and there is an absolutely crippling speed bug which you have no doubt noticed. The single bug along with the terrible speeds when applying/retrieving attributes to text has cost be countless hours in the hundreds working around this and still the end result is typing in files larger than 1200+ lines is dog-slow.

The final nail in the coffin when code folding which put strain on the already fragile system and basically wrecked the editor. Even if I remove it all the hacks I made in my WASTE HIView have tampered with some basics like syntax coloring copy/pasting and the bugs are there to stay. Worst of all problems is that hidden objects had to be inserted into the text which MURDERED the editing process and was hacked to pieces to even work. I should have never implemented code folding if that was the only option.

I’m trying to release commerical grade development tools which have a text editor at the core and my system is totally broken and hundreds of hours have been poured into this obsolete technology. Depressing…

Unless I change now, I’m doomed. MLTE is just to primitive to handle what a good editor needs. Is that really all the Mac has to offer Carbon programmers? But there is one option…

With the release of 10.5 there is an HICocoaView API which allows the wrapping of a NSView into a Carbon application. I thought this was cool at first, but overlooked until my current crisis. NSTextView is a great API which is FAST and offers a great system for applying/retrieving custom attributes to text. I never considered it because it was Cocoa and thus I could not use it. My HIView WebKit view wrapper I use is based on Objective-C code that I slapped together (barely) and uses Carbon events, which works well enough. This is the only HIView based API that Apple bothered to bridge for Carbon. Shame…

I’m sorry to say the next version of PascalGladiator will not be anytime soon because I am committed to removing WASTE from my code once and for all and using HITextView, which I will be authoring using PasCocoa, all native. Also get prepared for PascalGladiator to be 10.5+ no exceptions. Code folding will need a serious overhaul which I may just omit for since I’m so sick of it. I wish the only Intel native version was more stable, next time!