7 ms·
iPhone, meet Haskell
- programminggeek 13y agoWow, this looks super interesting. Would this be the first step in creating a Haskell wrapper for doing native UI work, or is it more useful for games and the like?
- lukexi 13y agoHowdy! I've been using https://github.com/jspahrsummers/ObjectiveHaskell/ https://github.com/jspahrsummers/ObjectiveHaskell/ as my bridge between the two worlds (with some modifications for iOS that I'll be posting soon). Haskell has a wonderful FFI that lets you easily call C/Objective-C from Haskell and vice versa. There's also Manuel Chakravarty's extremely exciting "Inline Objective-C" project (coming soon) that allows you to embed Objective-C code directly into Haskell, which would make it nearly effortless to speak fluently with Apple's frameworks. https://gist.github.com/mchakravarty/4632567 https://gist.github.com/mchakravarty/4632567 There are tons of awesome Haskell FRP implementations, from Netwire to Elerea to Reactive-Banana: http://ocharles.org.uk/blog/posts/2013-08-18-asteroids-in-netwire.html http://ocharles.org.uk/blog/posts/2013-08-18-asteroids-in-ne... It would also be a lot of fun to get Helm running on iOS once they finish their OpenGL backend. http://helm-engine.org http://helm-engine.org I definitely couldn't have pulled off my own project (SpaceTime, a multiplayer app engine for iOS; announcement soon) without Haskell. I've been using the development versions of GHC iOS to build it for over a year and it's been a joy.
- carterschonwald 13y agoAlso: Luke's SpaceTime is super exciting, he told me a teeny bit about it a few weeks ago. Should be seriously exciting for any ios dev who is writing collaboration tools
- seanmcdirmid 13y agoIs it related to Fujimoto et al's space-time memory? There was also a project called Stampede that that used a similar name to mean something completely different. Or is it just a name?
- carterschonwald 13y agototally unrelated, I think. :)
- mtrimpe 13y agoNo; it's probably based around using confluent data structures.
- scrumper 13y agoThis is interesting. I've been keen on experimenting with FRP for a while, and now I can use it for 'real world' stuff on a platform I know I just might have the push I need to jump into Haskell.
- carterschonwald 13y agoplease note: FRP is an idea, and while theres some interesting tools out there for FRP, it is not always the right solution, and in many respects, "FRP done Right" is still an open research problem. That said, have fun and try things out! Share what you learn, and either way, it'll be time enjoyably spent.
- nightski 13y agoI think you could say the same thing about anything else in the software world.
- dljsjr 13y agoAnybody here know, off the cuff, if the GHC packaged in Homebrew is compiled correctly to utilize the wrapper scripts out of the box, or if I'd need to build the cross-compiler myself as described in the linked documentation?
- lukexi 13y agoYou need to build it yourself at the moment since this just went into GHC HEAD. Feel free to ask me on Twitter if you need any help (@lukexi), it's pretty easy. This will be part of the upcoming GHC 7.8 release spectacular, at which point we'll release binaries and brew formulas! (we'll also likely release some test binaries sooner than that if you're impatient :), stay tuned)
- carterschonwald 13y agoNope. I also strongly recommend against using the normal "brew" formulas for haskell tools, its only by PROACTIVE efforts by mac using haskellers that the standard brew aren't a complete disaster (or at least, wont' be a disaster, soonish). I strongly recommend using standard haskell binary distributions, such as those prepared by GHC HQ, or the Haskell Platform folks, or perhaps any brew Tap that Darin Morrison or Luke Ianni author. Do not use brew for haskell tools (at least until they actually follow Darin Morrison's word to the T, because they do janky stuff for haskell.)
- reddit_clone 13y agoYou are right. I started with haskell-platform from brew and ended up with a broken ghc build. "inplace/bin/ghc-stage1" -static -H32m -O -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -package-name rts -dcmm-lint -i -irts -irts/dist/build -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen -O2 -c rts/Apply.cmm -o rts/dist/build/Apply.o /usr/local/bin/llc: : error: unable to get target for 'arm-apple-darwin10', see --version and --triple. make[1]: * [rts/dist/build/Apply.o] Error 1 I am starting over with the binary GHC distribution.
- wslh 13y agoI would love to also run the interpreter inside iOS to learn Haskell from a tablet. I will support a crowdfunding campaign.
- martin_ 13y agoApple wouldn't permit this in the AppStore
- ska 13y agoI don't think that's quite right, if I understand correctly you could have the interpreter so long as there was no download and run of external code. I'm sure I've seen a Lua environment like this.
- ciferkey 13y agoCorrect. Both python and lisp (Lisping) already have interpreters available as well.
- deleted 13y ago[deleted]
- deleted 13y ago[deleted]
- dljsjr 13y agoSure they would. http://omz-software.com/pythonista/ http://omz-software.com/pythonista/ http://omz-software.com/editorial/ http://omz-software.com/editorial/ http://twolivesleft.com/Codea/ http://twolivesleft.com/Codea/ You just can't have an app that downloads external code and then runs it; if all of the code that gets run is prepackaged in the app bundle or user-generated then it's absolutely fine.
- shurcooL 13y agoAre browsers exempt? Because there are a few of them there, and they download and execute external JavaScript.
- deleted 13y ago[deleted]
- laureny 13y agoI'm going to withhold my excitement until I get proof that Apple will approve GHC compiled binaries.
- jonsterling 13y agoA formal proof? ;-)
- shelf 13y agoA constructive proof would satisfy!
- dljsjr 13y agoWhat would prevent them? Didn't they relax the cross-compile restrictions like, 3 years ago? Adobe has a cross-compiler, that I know for sure. In fact, I did a quick Google search before submitting this reply. Relevant quote, from an Apple press release in 2010: > In particular, we are relaxing all restrictions on the development tools used to create iOS apps, as long as the resulting apps do not download any code. This should give developers the flexibility they want, while preserving the security we need.
- krichman 13y agoAt least one of Ruby Motion or Xamarin Studio is compiling source code into iPhone apps. Furthermore iPhone apps are definitely allowed to embed interpreters (caveat: no JITC's) and run scripts included with the binary or downloaded as part of an in-app purchase.
- tomasien 13y agoThey won't have a problem with it, I'd bet on it. That's not their concern really at all - the people who look at confirming apps look at human interface guidelines, functionality, crashes (although we've had an app that doesn't even launch it just crashes everytime approved), and if it meets their guidelines.
- carterschonwald 13y ago
- boothead 13y agoThis is brilliant news! Would it be possible to drop a cross compiled Haskell library into a Xamarin project and call into it from the .Net (F#) world? That would be the killer feature for me! Also not much mention of android here - is it possible to target android with Haskell at the moment?
- lukexi 13y agoI believe this is the relevant project: https://github.com/neurocyte/ghc-android https://github.com/neurocyte/ghc-android Joey Hess has been using it to build git-annex for Android. http://git-annex.branchable.com/install/Android/ http://git-annex.branchable.com/install/Android/ And much of the work we did simply improved support for cross-compilation in general, so Android support should be better than ever! : )
- boothead 13y agoAwesome! Any of you guys in London by the way?
- deleted 13y ago[deleted]
- Syssiphus 13y agoBrilliant, Thanks!
- lshemesh 13y agoFinally a chance to learn Haskell and iOS development at the same time! Will I be able to do this all from a Linux machine or do I still need Apple hardware?
- sluu99 13y agoiPhone users rejoice for bug-free code!