[Haskell-iPhone] Objective C bindings?

Manuel M T Chakravarty chak at cse.unsw.edu.au
Fri Apr 25 18:02:32 UTC 2014


I am banking on the iOS cross-compiler either eventually supporting TH or that we can alter GHC such that TH can be eliminated in a pre-processing step. (Most of the code generated with language-c-inline code is usually foreign code anyway)

Manuel

Jake Brownson <jbrownson at gmail.com>:
> I did some googling on the TH issue. I was already vaguely familiar
> that it was a problem in cross compliers. I'm sure I'm not pointing
> out anything you guys don't already know, but just to show what I was
> able to find myself. This seemed to the the most obvious information
> on the topic is in this thread:
> http://www.haskell.org/pipermail/ghc-devs/2013-June/001473.html
> 
> There seem to be a couple of self-described hacks to work around the
> issue by preprocessing the TH of sorts:
> http://joeyh.name/blog/entry/Template_Haskell_on_impossible_architectures/
> http://hackage.haskell.org/package/zeroth
> 
> From my ~hour of googling it looks like there was hope to get a
> (hacky?) TH cross compiler patch set from the GHCJS project merged in
> to 7.8, and the 7.8 release notes talk about improved cross
> compilation support, but I take it those patches didn't make it in?
> 
> It seems like there are several folks including yourselves pushing in
> the direction of getting Haskell to run w/ nice bindings on iOS, and
> the TH cross compiler problem is the biggest hurdle remaining. Is the
> current thinking that we have to find a way to do it w/o proper TH, or
> is there still hope that we can have it and get an incredible solution
> like language-c-inline going?
> 
> Is the problem a lack of interest from the folks qualified to make
> changes to GHC? It it in progress and just not making a lot of noise?
> I'm not sure how the community works :)
> 
> I'm pretty seriously interested in this capability and would offer
> assistance moving forward w/ it. I'm really tired of using C++ to
> write apps, and have really fallen in love w/ Haskell over the past
> few months. It seems like there are already a number of folks w/
> longer Haskell backgrounds than myself who have tried so I'm not sure
> what more I have to offer, but I offer it.
> 
> On Fri, Apr 25, 2014 at 4:10 AM, Manuel M T Chakravarty
> <chak at cse.unsw.edu.au> wrote:
>> The problem with language-c-inline for iOS at the moment is that it relies on TH in a very essential way.
>> 
>> Manuel
>> 
>> 
>> Jake Brownson <jbrownson at gmail.com>:
>>> Thanks for the tips guys, and thanks to Luke for his work in this area!
>>> 
>>> I came across ObjectiveHaskell but got the idea that it was more for
>>> calling HS from ObjectiveC, but I think I got the wrong idea looking
>>> closer. The samples all still have a bunch of .m files in with them.
>>> It'd be awesome to purely have .hs files which I believe HOC would
>>> allow.
>>> 
>>> However as I was searching for ObjectiveHaskell on hackage I came
>>> across the language-inline-c project which is still in development,
>>> but looks really interesting:
>>> https://github.com/mchakravarty/language-c-inline/wiki/Motivation
>>> 
>>> It uses quaiquoting to let you write objective-c or c directly inline
>>> in a .hs file and it'll compile it and hook up all the values
>>> automatically (or that's what I get from reading the website anyway,
>>> haven't tried it yet).
>>> 
>>> On Wed, Apr 23, 2014 at 11:25 PM, Luke Iannini <lukexipd at gmail.com> wrote:
>>>> Yo Jake,
>>>> Yeah, what Max said. Sigh, I've done this (updated OH to use Max's static
>>>> lib support, fixed a bunch of bugs, and other things) an have been promising
>>>> to clean it up enough to release for quite some time. The yucky bit is that
>>>> I manually converted it to strip out the Template Haskell usage which both
>>>> makes it much uglier and not nearly as nice to use. But it works, and that's
>>>> something : ), so I'll get going.
>>>> 
>>>> I think we could design something even nicer with Type Families sometime
>>>> that didn't require TH.
>>>> 
>>>> Cheers
>>>> Luke
>>>> 
>>>> 
>>>> On Wed, Apr 23, 2014 at 9:27 PM, Maxwell Swadling
>>>> <maxwellswadling at gmail.com> wrote:
>>>>> 
>>>>> Hello!
>>>>> 
>>>>> I think ObjectiveHaskell is a more practical choice today than HOC.
>>>>> 
>>>>> ObjectiveHaskell could be cleaned up to use the new GHC 7.8 features,
>>>>> which will simplify the build process.
>>>>> 
>>>>> https://github.com/jspahrsummers/ObjectiveHaskell/tree/reboot
>>>>> 
>>>>> Try it out.
>>>>> 
>>>>> __END__
>>>>> Maxwell Swadling
>>>>> 
>>>>>> On 23 Apr 2014, at 11:25 am, Jake Brownson <jbrownson at gmail.com> wrote:
>>>>>> 
>>>>>> https://code.google.com/p/hoc/
>>>>>> 
>>>>>> Is anybody aware of any efforts to revive the HOC project that
>>>>>> provides Objective-C bindings for Haskell? Or any alternatives to it?
>>>>>> It seems like it would be a great complement to the iOS cross
>>>>>> compiler. I've started reading through the code to see what it might
>>>>>> take to get them working w/ recent GHCs. the last commit on the google
>>>>>> code project was 2010.
>>>>>> 
>>>>>> When I do the "runhaskell Setup.hs build" from the installation
>>>>>> instructions I get a few things like this:
>>>>>> 
>>>>>> "Unacceptable argument type in foreign declaration: CInt"
>>>>>> 
>>>>>> which seems to be explained by this as due to a change in FFI at some
>>>>>> point:
>>>>>> http://haskell.1045720.n5.nabble.com/zlib-build-failure-on-recent-GHC-td4971516.html
>>>>>> 
>>>>>> I'm just starting to dig into this so maybe there's a good reason
>>>>>> nobody else has. I'm pretty new to Haskell, but I love the idea of
>>>>>> making native GUIs for OS X and eventually iOS.
>>>>>> _______________________________________________
>>>>>> iPhone mailing list
>>>>>> iPhone at haskell.org
>>>>>> http://www.haskell.org/mailman/listinfo/iphone
>>>>> _______________________________________________
>>>>> iPhone mailing list
>>>>> iPhone at haskell.org
>>>>> http://www.haskell.org/mailman/listinfo/iphone
>>>> 
>>>> 
>>> _______________________________________________
>>> iPhone mailing list
>>> iPhone at haskell.org
>>> http://www.haskell.org/mailman/listinfo/iphone
>> 



More information about the iPhone mailing list