5 ms·
Scheme hits the App Store
- futuremint 17y agoGood news to hear. Objective-C is alright as a language, but I'm excited to hear about some of my favorite languages running on the platform, like this Scheme and Smalltalk (http://isqueak.org/ http://isqueak.org/). I suppose I have no excuse to NOT make an app in my spare time anymore...
- stuntmouse2 17y agoMIRROR (site appears to be down): I believe I have got the first Scheme application past Apple review into the iTunes App Store. It is yet another Reversi clone, called Reverso. It is a combination of 90% Scheme and 10% Objective-C, written with Gambit-C Scheme. James Long has already shown how to compile Gambit-C for the iPhone, and I started from there. My Scheme code is compiled to C by Gambit and later by GCC to produce native ARM code, bundled in a static library, which is ok with the iPhone SDK license agreement. The Objective-C then calls the library as a pure C library. The Scheme code deals with position evaluation, alpha-beta pruning, transposition tables, move legality, different strategies and so on. The Objective-C code deals with sound, animations, GUI, user preferences, basically everything that calls the iPhone OS API. Reversi was chosen because I like strategy games and it is much more algorithmic than artistic, and I am no artist. The performance of the code is excellent. I used some Gambit-specific declarations, only fixnum arithmetic, pre-allocated a large heap, and called the garbage-collector every time the user needed to think. The search is not memory intensive, but the transposition tables are. I did not write a specific hash function but relied on Gambit-C’s table type. The boards used during search were retrieved from a pool (the newest Gambit-C has made subu8vector-move! a public API), so they did not put pressure on the garbage-collector. In the end it was a very successful experiment. Developing with Scheme is orders of magnitude more productive than with most other languages. Gambit-C is also one of the best Scheme compilers out there, and made my job a lot easier.
- jjs 17y ago> The Scheme code deals with position evaluation, alpha-beta pruning, transposition tables, move legality, different strategies and so on. For some reason, those sound like compiler optimizations instead of game calculations...
- deleted 17y ago[deleted]
- stuntmouse2 17y agoLINKS: Reverso: http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=334979538&mt=8 http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftwa... Gambit Scheme: http://dynamo.iro.umontreal.ca/~gambit/wiki/index.php/Main_Page http://dynamo.iro.umontreal.ca/~gambit/wiki/index.php/Main_P... James Longster - Scheme on the iPhone: http://jlongster.com/blog/2009/06/17/write-apps-iphone-scheme/ http://jlongster.com/blog/2009/06/17/write-apps-iphone-schem...
- stuntmouse 17y agoCorrection: That should read 'James Long' instead of 'James Longster'.
- stuntmouse 17y agoMost important software launch of the week.
- morphir 17y agohow is Gambit compared to Chicken?
- stuntmouse 17y agoIn what respect? Benchmarks by Marc Feeley of Gambit: http://www.iro.umontreal.ca/~gambit/bench.html http://www.iro.umontreal.ca/~gambit/bench.html
- morphir 17y agoIn general. Who has the best performance? Who has the best ffi support? The most and best library support? Does anyone have a success story (case study)? Does anyone offer a painfree setup? Chicken is BSD, while Gambit i GPL - so chicken maybe preferred for its less restrictive lisence?
- stuntmouse 17y agoI have to prefix this with the fact that I've only barely touched Chicken. I've been using Gambit for a few months. Performance: See benchmarks above. FFI: Gambit's is very clean. I've used this extensively, and people that are doing iPhone/Objective-C stuff with it are using the FFI. I can't comment on Chicken's FFI. Libraries: I'm guessing Chicken wins here. The egg system seems more developed and has more packages than Gambit's Black Hole. Installation: I know Gambit is painless on Linux and Mac. I can't speak to Windows nor to which Linux distros package it. Licensing: I have to correct you here. Gambit is dual licensed: LGPL 2.1 and Apache 2. Support: Chicken's community and IRC room seem active. Gambit's are too; detailed answers are rapid on the mailing list.
- stuntmouse 17y agoInstallation: For the record, I looked into prebuilt binaries for Gambit. The support is quite extensive for Mac and Windows. Mac: installers provided for G3, G4, G5, X86, X86-64, and universal binaries. Windows: installers for Gambit compiled with MSVC and mingw. The latest version (4.5.2) is available here: http://www.iro.umontreal.ca/~gambit/download/gambit/v4.5/prebuilt/ http://www.iro.umontreal.ca/~gambit/download/gambit/v4.5/pre... Canonical download link: http://dynamo.iro.umontreal.ca/~gambit/wiki/index.php/Distributions http://dynamo.iro.umontreal.ca/~gambit/wiki/index.php/Distri...
- pistoriusp 17y agoI have no idea why everyone wants to get around objective-c, it's really not complicated to learn.
- elai 17y agoBecause dictionaries, object-arrays, strings and other fundamentals are way more verbose than they should be: someDictionary["bla"][3] vs. [[someDictionary objectForKey:@"bla"] objectAtIndex:3]; someDictionary["bla"] = 5 vs.[someDictionary setObject:[NSNumber numberWithInt:5] forKey:@"bla"]; "%@ - %@" % (date, name) vs. [NSString stringWithFormatString:@"%@ - %@",date,name]; Smalltalk is a lot better than objective-c even, because you can define binary & unary operators with singular symbols to make a far more concise syntax. You think you have done alot of work sometimes in objective-c when you find out that you were just extracting some values out of variables and putting it into this or that dictionary or array.