After reading the story I just have to recall stories from the guys who flew and serviced F4s, they joked they could fly without either wing simply because it was just a rocket sled.
We had one guy knicknamed Major Cablecutter as he "clipped" the guidelines of a radio tower one time. He also had come back more than once with branches stuck to his F4. Being that they were only "Recon" they tended to be aggressive during war games and this game guy over stressed his airframe turning into some F18s trying to tag him.
So many military planes have such high thrust to weight ratios I do not doubt that wings merely become the means to stable flight
I'm the author. I wrote the game and engine using the wonderful, and fast, Gambit Scheme (http://gambitscheme.org/).
I needed a lisp to manipulate the puzzles, because they aren't based in a strict grid. It ended up being way more natural to program the block structures as lists rather than traditional matrices.
Gambit compiles the Scheme code down to C, which I can then link to Objective-C for iOS, or port to Android or any other platform that Gambit supports.
Thanks for posting this, but the link is rather anemic for this audience; any possibility of a writeup (even a quick and short one) of how you did it? I've been looking at cross-platform solutions for apps, and the best I've come up with so far is Kivy (http://kivy.org) and haXe (http://haxe.org), which both still require a machine running OSX to package for iOS.
Thanks, that's a good point. I am definitely planning on writing up everything I learned in the process. It just launched a few days ago so I'm still focused on handling that at the moment.
If you like I can e-mail you in the future when the article is out. There's contact info on my website: http://asivitz.com/cloudbreaker/
Eh, no pressure; I'll keep an eye on your website and HN, but I'd be curious if anyone here has found ways to do cross-platform (Android, iOS, Linux, OSX, Win, etc) apps from the environment of their choosing. I'm not looking to monetize, so arguments of "investing" into platforms I don't already have are moot; this is mostly a hobby/side "what could I do if . . . " sort of thing right now, and just having scheme as another option is awesome :)
I've recently spend quite some time trying to figure out what's the best way to use a Lisp in order to write multi platform games. I'm still in the researching phase, but if you need to support more than iOS & Android, then ClojureScript on top of a Javascript Game Engine (possibly with native extensions) is the best bet.
I could be mistaken (as I haven't actually researched this), but I don't think there is any way around needing OSX to package for iOS. Even tools like cordova/phonegap hook into a base Xcode project when it comes to compiling and packaging.
Yeah, that seems to be the consensus. I don't want to exclude anyone, but since I'm a Linux guy, I don't run any OSX, and quite frankly it seems like an unnecessarily high barrier to entry to require a single platform to develop for a device. Android, for instance, has SDKs for the three major desktop platforms, plus I can sideload without rooting or having to pay a yearly fee.
If you're making games for the fun of it, your advice is spot on. But it's a terrible way to make a business decision if revenue matters. It's really more of a question of whether he has good reason to believe that 70% of the revenue is enough to cover an investment in a Mac + Developer Program. I don't much like Windows, but the investment in a license for Windows and Visual Studio has been returned many times over. Nevertheless, Android is a great place to start—on any platform.
1) What I want to do is create apps that scratch itches I've had for years, and they're all outside of work, and even if there was something available off the shelf, I'd kind of like to be able to hack on it (have source), just for practicality and fun's sake.
2) I don't want these apps to be restricted to any one platform.
3) I never plan to monetize these apps.
You're right - if I was going in this to make money, it's a simple decision. Pitted against my time and potential revenue, a Mac + Developer Program is dirt cheap.
OTOH, I develop in Emacs and Linux for a reason, even when I'm developing software for Windows. Since investing in a Mac + Developer Program would be a net loss by definition, I'm looking for any way to still be able to make these apps available for iOS. Looks like Apple doesn't want that kind of hobbyist input to their ecosystem (and yes, while I'm a professional in that I get paid for same at the day job, I consider these apps as hobby projects).
The nice thing about both Kivy and haXe is that web apps are a strong possibility, and one I was thinking of doing anyway. Of course, with enough dev time, I could take any language/framework and make a web app from it. I wouldn't be surprised if there is already a library (or it's trivially easy) to generate JS or HTML5 from Scheme or some other Lisp :)
Works great? Show me some apps please! They all are garbage compared to native imho. Not even really usable, again, in my opinion. I wouldn't recommend Cordova for anything at this point, not because of Cordova per se but rather because of the state of HTML5 on these devices. And I have built a lot of Cordova apps because clients demanded it; now we downright refuse as it's bad for your portfolio to do so. Even if it looks nice it will take weeks (months) to get it working really smooth (stuff you get for free native) and then it breaks suddenly because of some update (especially on Android, but also on iOS, for instance after the 7 update) and you are right back in hell. For every app I have seen which was 'ok' on Cordova you could build it great 3 times native for ANdroid,iOS and WP8 in less time.
It doesn't work so great on Android, but I wouldn't go so far as saying that every Cordova app is garbage :). For some apps it works reasonably well, for others simply doesn't work.
Would really like an end-to-end guide on compiling C with objective C (and possibly some example code in gambit that shows the interfacing you did).
I'd love to be able to do this with ECL (http://ecls.sourceforge.net/) to build apps in common lisp for iOS (possibly android). I know about MOCL, but I'm a pretty cheap guy, so would rather stick to open technologies and do the work myself.
I'm not a scheme guy, but until you get a writeup done, would you mind posting any info you have on interfacing gambit with iOS?
The standard Gambit distribution actually comes with an example iOS project. It also has a script for building the Gambit runtime for ARM (the phone) and x86.
It's definitely not a 10 minute process, but shouldn't be too hard.
I think I also remember some projects popping up the Gambit mailing list to make all of this easier. It might be worth searching the archives.
Oh? How do you traverse vertical and horizontal structures that are wider than one block? If you have vertical lists, following a horizontal row wild involve lots of find-nth-position calls, which I wouldn't call "natural"
My lisp experience has been largely restricted to writing elisp. I would really love to write something in Scheme though. How well maintained and diverse are the GambitScheme libraries? I see three different sets on their packages page, do you have any experience with those or would you have some better suggestions?
> How well maintained and diverse are the GambitScheme libraries?
The library situation in Gambit is.... very bad. Last time I tried it (~6 months ago) you had to compile from a different branch to get Blackhole to work.
Chicken Scheme has a much better ecosystem. It also compiles to C and is fast. Gambit is known for its speed so I won't say Chicken is as fast but it is "fast enough" and the ecosystem is worth the difference IMO.
Seconded. I recently evaluated quite a few Scheme implementations for a very simple web scraping project and found Chicken to be both fast and great with its packages. chicken-install feels almost like pip or npm and it works really well. The packages are many and most of them are nicely documented. If you need a Scheme with compile-to-C capability and a bunch of batteries included then Chicken Scheme is the way to go.
I didn't use many libraries. It's pretty straightforward to interface with C code, so instead of writing a whole OpenGL wrapper, I just call into some C code to handle the rendering.
I hope to contribute back what I learned and make it easier for others to use it for games in the future. It's seriously a great language for game writing.
I agree. I would love to someday be able to build on mobile using games. It would be amazing if you could share a writeup or maybe a hello world starter template on running Gambit on iOS or android. This seems like a lovely project. Congratulations and good luck.
chm: Lucky... it would be awesome to do a compiler class in Scheme! Could you please tell Feely that some people on Hacker News would be thrilled if he made his lectures available online?
Any chance you'd write a technical article on your algorithms? I'm in love with puzzle manipulation code. Seeing the sort of things you're doing would be a lot of fun.
Yea, I'd love to write about some of that stuff. There's unfortunately a big problem with indie games getting cloned out of existence by some big publishers, so I'm a little hesitant to put all of the logic out there. I do think it would be pretty hard to implement in a traditional OO language though.
There's a basic explanation of the method in another comment I've written here though.
I had trouble getting the server based repl working, so here's the in-game repl I ended up implementing as a Quake-type dev console: http://imgur.com/J6ozzT6
(Obviously disabled in the App Store version.)
I may be getting ahead of myself, but I think it's a GREAT language for writing games, and is going to take off at some point.
Very cool! Hooking up the internal gambit REPL was finicky because it never got much love. I think Marc polished it up somewhere though. Still, a quick in-game REPL like that goes a long way.
The cool thing about having a real Gambit REPL was that you could use the Gambit debugger in real-time. So if an error ever occurred, the debugger REPL would pop up and you could step around. You also get all the builtin stuff for inspecting cooperative threads and such.
Anyway, it would be a great minimalistic environment if it was fleshed out more. Part of my mission in the JavaScript world is to bring these concepts to more people, and hopefully lead them to Clojure/Scheme/etc.
Did you use a module system? Last I remember Black Hole was getting really advanced. Did that ever take off within Gambit?
Yea, I don't have the debugger hooked up for catching exceptions. It's just a simple repl. That shouldn't be too tough to add in game though. It could just pull down the console upon error.
I couldn't get Black Hole to install and gave up. I remember the docs being pretty bad, even for Gambit. I use the builtin namespacing system, which works pretty well. Hopefully R7RS will make the whole scheme world a bit more user friendly.
I would love to hear more about what you're working on to bring these concepts to the Javascript world, since we at famo.us are interested in the same.
You can see a few things on my blog: http://jlongster.com/. Recently I've been helping out with the sweet.js project (http://sweetjs.org/) to implement macros in JS. People really need to understand how macros transform a language. It's going really well so far.
I'm also working on the idea of live evaluation. Most devs are used to writing code and refreshing the page. There are tools that help with live evaluation, but they all suck. I am working on something that will give you a better connection with your code, and fully support the idea of incrementally coding up an app.
I'm not focusing on specific Lisp/Scheme features, but more about the philosophy behind them. Any project I do I try to expose the good stuff that I learned from Scheme.
Interesting. How much of the JS infrastructure do you need for this stuff to work?
I'm in the middle of creating a JS port for embedded systems (yes, I know about Espruino. It made some fundamental decisions about object implementation that I find unacceptable) and it would be nice to be able to lean into something like this to avoid implementing huge chunks of the more advanced language bits.
Side note: I'm the person who did the first Nintendo DS port of Gambit so its interesting to see how all this comes full circle.
I remember hearing about the Nintendo DS work. Great stuff!
What I'm working on relies on a full JS implementation. Performance is a critical feature so I need to implement as little as possible. I basically implemented a very small VM that controls JS code using exceptions. What I've done lets you run JS code with a 3-4x perf hit, but you get full stepping and debugging abilities in user-land. I'm going to release it in a few weeks!
It sounds like it's not quite what you're looking for though. You're project sounds cool!
Outlet and Outlet-Machine look like what you're describing but the docs on those say they are deprecated/frozen and the last commits are 1-2 years ago.
No, not yet. I was exploring this indeed with outlet but discovered that wasn't the right way to do it. My technique came together very recently and I plan on releasing it soon.
Interesting. I may have to look at your exception usage and see if I can emulate the same thing faster with some hooks directly into my VM. No point in running a VM on a VM if I can just implement the hooks directly.
Your code probably isn't what I'm looking for right now. But single stepping and debugging in user-land is exactly what embedded systems need.
You sound like you know how to code. Can you talk a little more about how the algorithm you were confronting made the effort of getting a Scheme platform working worthwhile? Understood if the answer is "not that big an effort". :)
Part of my question is that a solid lisp (of any ilk) programmer can program non-lispy languages in a lispy way.
I have been tempted to try your stuff many times. But ultimately no experience with Scheme or ios (and lets face it the time to motivation ratio wasn't good enough either).
It is great work, and I think there's value in making other languages that don't require huge runtimes viable for ios development.
James those posts were disruptive and inspiring I know several people that were attracted to LISP and functional languages because of them (myself included). I think its a great strategy to intro and highlight these functional aspects in Javascript like what you're doing with sweet.js. It will bring more developers into the functional domain. Now we just need a scheme environment that is as robust as node.js and npm
If you could update it so you could make the scripts edit fields full screen that would be awesome! it is really hard editing then in the tiny boxes they are at the minute.
Thanks for the feedback. The intent in that version was to mimic Marc's (Gambit author Marc Feeley) past iOS version as closely as possible (via webview) - I'll see what he's doing with his latest iOS version and also try to include a full screen option.
Good stuff. Interestingly, the very first programming language offered in introductory CS class at my college was Scheme at the time (2000). The power of 'car' and 'cdr' still resonates in my head. At times, the parenthesis used to give me dyslexia but good old days of doing stuff like:
One of the best CS classes I took in college was an introduction to scheme that used 'The Little Schemer' as its text book. Having only worked in imperative languages it really opened my head up!
The MIT course on youtube from the 80s using SCIP and Scheme was the single best time investment I've made since learning programming. It still blows my mind how much it changed my perspective on programming.
I just read the chapter about fixed point combinator (aka Y). It's great, not only for kids.
I tried reading the book a few years ago, I remember being irritated by the QA style it uses and dumping it because of it. On my second attempt I realized that it's only irritating if you know the answers very well and skipped to the chapter I didn't have so much confidence in understanding. And it was very pleasant experience, especially when I stopped to think a little before reading the answers. It felt like I was having fun.
So I'd advise to give a book a go, even if you are confident in your Scheme and FP skills. Just skip the parts which seem too obvious to you and get to the interesting stuff, you won't be disappointed.
Now it's time for The Seasoned Schemer, I guess :)
but that takes the fun out saying "car of the cudar of the cudar of...". Seriously though, such a simple concept of list manipulation can be used to solve so many problems. I never realized the power of this until a long time after.
Great work! :) Congratulations!
For those who want to try developing in Scheme, I'm working on a project that could help you get started. Currently only Android is available, but as soon as possible iOS will be as well. http://schemespheres.org
That was in the rules and quickly abandoned. What they care about is that you don't load new code from the Internet. Ostensibly, the reason is security, but the real reason is they don't want you to make an app store.
JavaScript in webviews is excepted because you couldn't show a website without that.
If you don't get new code from the Internet (for example, someone types it in) that's ok. It's even ok to copy and paste it from the Internet.
"Gambit compiles the Scheme code down to C, which I can then link to Objective-C for iOS, or port to Android or any other platform that Gambit supports."
Tried your game, was not disappointed. :-) It's almost spooky that your post came at this time, for I have read a lot about Scheme->C systems this week. This PDF made a great impression on me of the gambit scheme system. http://www.iro.umontreal.ca/~gambit/Gambit-inside-out.pdf
I have a few questions for you:
1. I installed Gambit-Scheme via Brew and compiling any scheme file results in a clang segfault. How did you get around this? For now I use gcc instead. :-/
2. Why Gambit-Scheme and not Chicken-Scheme? I can't really decide which is the better choice for writing a game.
3. Do you use continuations to make coroutines in your game?
Basically, the problem is with the version of llvm/clang that Apple uses in Xcode 5.
Some of the newer Xcode betas might fix it. I personally use the Xcode 4 compiler. You could probably also build your own clang from their SVN.
For more info you could probably ask the mailing list.
2. I definitely looked at chicken, and I can't remember my exact reason for going with gambit, but it was a practical one. I don't think I could get chicken up and running on the iphone for some reason. Chicken did seem to be better documented with better libraries. Gambit may be faster though.
(I started working on this about a year ago. The situation may be completely different now.)
My game isn't too complex, compared to, say, a first person shooter. I'm not sure if the GC implementation would start to matter in that circumstance. I recommend trying one and then if you're happy with it, great. If not, most of the code will be portable.
3. No. I don't have much experience with them (besides learning the basics in school). I did use a lot of closures, anonymous lambdas, and lambda builder functions.
Somewhere, deep in Lindley Hall at Indiana University, is an old professor exclaiming, "I told them people used it!"
I wonder if I'd have taken more to Scheme if I were learning it now. At the time, I was double majoring CS and Telecom, but the world of open source hadn't been as friendly to Mac as it is now, and Macs were a prereq for TCom. Getting Scheme running on my old iBook was a pain in the ass, let alone the assignments (which still didn't match the untouchable stability of our automated grading system). I conceptually understood why I needed to learn it, and even grasped many of the concepts of what I was learning, but it wasn't the language for me.
I play around with this a bit, a few things I learned is that XCode 5.0's llvm crashes when compiling Gambit-C 4.7.0's generated C code. The beta for 5.1 has a fix. Here are a few demos that might help a few people:
I just downloaded the game. Very cool! I wish I has written it... oh wait... given that I wrote Gambit, in a sense I wrote most of the game! It gives me a warm fuzzy feeling!
Your in game REPL is neat. For developing games, where there's a need to explore variations quickly, it is a powerful tool. I'm currently working on a remote REPL for Gambit-JS, so that you can remotely debug Scheme code (possibly games) running in the browser.
It's truly inspiring to see a project like this completed. I've been wanting to combine mobile (specifically Android) and some sort of Lisp dialect for a while.
Am I interpreting correctly from some of the other components that doing the programming in a language-once-removed (ie Scheme instead of Obj-C) opens an easier path to compiling for both iOS and Android?
That was part of my motivation for using Scheme, yes. Many indie developers are using the Unity engine which can compile to many different targets. (But that uses C# as far as I know.)
Very cool! I always like seeing when something is built using a typically non-traditional language for the environment. I downloaded the game to see how well it performed, and I gotta say, it's a lot of fun. Great job!
Wow, I've been thinking about this a lot lately. I would pay for a good series of tutorials or an ebook on this topic maybe implementing something well known like Tetris etc.
We had one guy knicknamed Major Cablecutter as he "clipped" the guidelines of a radio tower one time. He also had come back more than once with branches stuck to his F4. Being that they were only "Recon" they tended to be aggressive during war games and this game guy over stressed his airframe turning into some F18s trying to tag him.
So many military planes have such high thrust to weight ratios I do not doubt that wings merely become the means to stable flight