Retro on iOS: October 25 Update

I'm continuing to slowly work on Retro for iOS. Still not finished, but it's inching ever closer.

At this point I have the 11.6 image loadable, some documentation, the stack display, and the ability to save and reload an image (though this isn't tested on actual hardware yet, just under the simulator).

The UI still has a bunch of flaws (on devices smaller than the iPhone 6, the editor disappears when the keyboard is loaded; the documentation is still too small to be readable, and the stack should probably indicate the top value in some way), but it's (barely) usable.

Apple's Test Flight service has just started supporting third party testers. I'll probably open this up for testing within the next two weeks. Let me know if you are interested in this.

A Weekly Summary

It has been a long week. But I haven't made any significant progress on my main projects (currently Retro for iOS). A summary of developments this week:

  • wrote a small color selector application
  • started work on support for saving images under retro (no UI implemented for this yet)
  • more experiments with auto layout and storyboards
  • began notes for a couple of work-related tools

I haven't watched the latest Apple event yet, but I did take a look at the new stuff. A few initial thoughts: I really like the idea of a Retina iMac (after using the iPhone 6+ for a few weeks, I really notice the lower resolution screens now). I'm afraid that if I go and look at one that I'll end up being really tempted to buy one (and I can't afford it currently). Maybe someday...

It was good to see the Mac Mini updated, but it's disappointing that RAM and drive upgrades are much more difficult. (I have an old Mac Mini that's due for replacement, but has run smoothly 24/7 for several years).

The updates to iPad Air 2 look really good. A8X, laminated display, touch id. It's tempting. The 3rd generation mini is disappointing though. Apart from adding touch id, nothing else appears to be new. This is a shame as I prefer the mini form factor.

The biggest disappointments are that the original iPad mini is still being sold and that the iPod touch hasn't seen any updates. This makes it probable that iOS 9 will still support the A5 and non-retina form factors, meaning that I'll be stuck supporting the older architectures longer than I had hoped.

I've upgraded to OS X Yosemite. I won't review it (others have done far better than I can), but it installed without any issues and seems stable so far. I'm still adapting to the UI changes. I think it'd probably look better on a retina display, but it's acceptable on the low-res display on this MacBook Air.

And so the week ends. It was long. But mostly uneventful apart from some changes at work. I think that next week should be better, so I'll hopefully be able to make some progress on getting Retro for iOS close to a releasable state.

Retro on iOS (10/12 Update)

I'm continuing to make headway on building Retro for iOS. As of today here's what's done:

  • basic interface (editor / evaluate, with results displayed)
  • stack display
  • embedded documentation
  • runs 11.6 with most libraries preloaded

I'm still working on support for saving the image and editor contents, and then will try to allow selection from a list of images that can be supported by the current Ngaro.

For anyone wanting to test this: Apple still hasn't turned on external testers in TestFlight yet, but if you send your UDID I should be able to build an ad-hoc .ipa that can be installed via iTunes. Send me an email (or private message on IRC) if you are interested.

Apologue 1.2

Release 1.2 of Apologue is now available.

  • New API endpoint (consolidates multiple separate endpoints into one)
  • Updated to latest Parable (20140929)
  • Improved logo

This lays the groundwork for future updates. With the endpoint issues fixed, it'll be much easier to add new features and keep in sync with the latest Parable code base. Going forward, there are a few big things that I want to tackle: support for multiple projects, code sharing, a dark color theme, more examples, and editor improvements.

But first, I'll be shifting gears. For the rest of the month I am going to focus on getting an initial release of Retro for iOS ready. I don't expect this to be too problematic. I already have a basic UI in place, with a secondary view for the stack display. The other bits I want to add are an image selector, and persistent storage of the current session. I'll also have to deal with some potential issues that may cause crashes (divide by zero).

You can get Apologue on the App Store.  

Some Thoughts on Quotations

In several of my experiments with concatenative languages, I have offered various forms of quotations. Today they form crucial parts of both Retro and Parable. While I personally find them incredibly useful, there is a strong dislike of them in the larger Forth community.

A big thing I dislike in Forth is the number of special syntax forms used for control structures. With quotations, these can reduce down to much simpler forms where the code in question is packaged as a quote and passed to a combinator.

    if ... then
    if ... else ... then
    for ... next
    do ... loop
    begin ... again
    : ... ;
    :noname ... ;
[ ... ] if-true
[ ... ] [ ... ] if
[ ... ] repeat
[ ... ] loop
[ ... true ] while-true
[ ... ] '...' define
[ ... ]

Quotations can also help reduce stack noise. Primitive stack shufflers (e.g., swap, dup, drop, nip, etc) have their places. But often the added stack noise can make it more difficult to keep a mental picture of what's going on.

1 2 3 >r + r>
1 2 3 dup >r + r>
base @ >r ... r> base !
10 dup >r 10 * r> 20 *
<array> dup sum swap length /

s" john" s" John"
  swap to-uppercase
  swap to-uppercase
#1 #2 #3 [ + ] dip
#1 #2 #3 [ + ] sip
&base [ ... ] preserve
#10 [ #10 * ] [ #20 * ] bi
<array> [ sum ] [ length ] bi /

'john' 'John'
[ to-uppercase ] bi@ =

Quotes and combinators also make it easier to experiment interactively. In most Forth dialects, you need to define a function before using control structures. So you can't just do something like this at the interpreter:

base @ 10 = if s" decimal" else s" not decimal" then

Once quotes are added into the mix, it's just a couple of anonymous definitions and a combinator. This could be used interactively or in a definition:

&base @ #10 = [ 'decimal' ] ['not decimal' ] if

I'm curious as to why Forth users in general seem to dislike this. While it's certainly different than traditional Forth, the added flexibility and reduction in special syntax forms make this a net win in my opinion.