
Codify: native coding environment for iPad - fdb
http://twolivesleft.com/Codify/
======
stephth
This could effectively be a programming sketchbook - which is not a new idea
(see the Processing IDE), but this integrates within a device that's basically
the digital equivalent of a notebook. This is such an amazing and beautiful
concept.

Say hello to the future. We don't have _hoverboards_ , but we have _codebooks_
\- where sketches come to interactive life within its pages!

~~~
bliss
Who doesn't have hoverboards?! [http://www.smartplanet.com/blog/thinking-
tech/a-hoverboard-p...](http://www.smartplanet.com/blog/thinking-
tech/a-hoverboard-powered-by-quantum-levitation-video/9065?tag=nl.e660)

------
jonbro
yes yes, a thousand times yes. There is some serious misinformation in this
thread though. Apple has allow interpreters on the phone for a while, and the
remaining restriction is that you can't download code or bring code in through
the app document directory. This app breaks neither of these restrictions. In
fact, there have been other lua interpreters running on the ios for a while
now, see: <http://www.mobileappsystems.com/products/iluabox>

The difference with this app is that the ide is really a labor of love, and it
is super fun to code in. Not that iLuaBox isn't, but all of the little
features for tweaking colors and editing sprites are brilliant. The graphics
and audio engine don't hurt either.

For those complaining that there isn't a companion engine that you can take
the code out of codify and release actual games, you should take a look a
corona. The api in codify is not so big that you wouldn't be able to clone
anything that you made in it to another platform relatively easily. I do agree
that there should be more lua based gl engines for iphone though. I am working
on one, but as of yet it is totally for my own use, but only by virtue of the
fact that it doesn't come with nice build scripts.

The other thing that some commenters miss is that you can use copy and paste
in this app. That will open the gates to sharing code, it is as easy as:
select all, copy, switch to safari, go to pastebin, send link to someone else.
I suspect that some of the time the app spent in approval was them thinking
about that.

\-- edit for not being a jerk to iluabox

~~~
gernb
"3.3.2 An Application may not download or install executable code. Interpreted
code may only be used in an Application if all scripts, code and interpreters
are packaged in the Application and not downloaded. The only exception to the
foregoing is scripts and code downloaded and run by Apple's built-in WebKit
framework, provided that such scripts and code do not change the primary
purpose of the Application by providing features or functionality that are
inconsistent with the intended and advertised purpose of the Application as
submitted to the App Store."

There NO EXCEPTIONS for scripts typed in by users period.

Both iLuaBox and Codify are breaking this rule. Of course Apple has a history
of ambiguously enforcing their rules.

For those thinking that Apple relaxed the rules the rule above is the current
license dated 10/4/2011. Apple had a more strict rule at one point that said
that apps themselves could only be written in C/C++/ObjC/JavaScript. That rule
was relaxed.

~~~
nickmain
The last sentence makes it clear that the intent behind this rule is to
prevent circumvention of the App Store approval process, not to ban executable
code itself.

The rule can be read as ambiguous when it comes to executable content that is
not part of an app, just the document type that an app edits and displays. For
example - you could think of calculating a formula in a spreadsheet as an
example of interpreted code. Apple has no reasonable interest in preventing
such apps.

When the documents that an app handles become more app-like, such as games,
then Apple might decide to step in. They have left themselves enough slack in
the wording of the rule to allow that.

I hope that they make the rule more explicit in a future version of the
agreement.

------
greggman
This app goes against the iOS Devloper Program License Terms.

They specifically state no code or scripts may be executed period unless (a)
they bundled in the application's package or (b) use WebKit and WebKit's
JavaScript

If Apple is relaxing their policies it would be good to know. Lots of others
would like to write apps like this but were told they would be banned.

Maybe they are getting around it by running Lua in JavaScript in WebKit?

~~~
thought_alarm
Rewards go to those who take the risks.

The app did sit in review for quite some time, according to a quick look at
their blog. Either the interpreter is implemented entirely in JavaScript and
Webkit (it's not terribly speedy), or Apple is now comfortable enough with Lua
to let something like this fly.

Either way, it's really great that there's an app like this for the iPad.

Edit: After poking around the app package, it looks like a real Lua
interpreter rendered inside a EAGLView, and not some WebKit/Javascript hack.

~~~
victim
I heard from the guys that work for Apple that Apple has accepted Lua as a
language for many of the apps and realise that it can be sandboxed, so do
expect that before approving it. Yes Apple is comfortable with Lua.

------
greatquux
I thought Apple would never approve any type of simulator, virtual machine, or
app creation platform for iOS itself, since it could be used to generate apps
that might not conform with their guidelines. How did they get around this?

~~~
nickmain
Sharing games with others would be the problem, as acknowledged by the creator
- <http://twitter.com/#!/TwoLivesLeft/status/129304975623995395>

~~~
d5tryr
Understandable too. I don't want code that hasn't been curated breaking my
ipad...

------
cageface
It's great to see tools like this start to emerge on iOS but the new 11" MBA
is only slightly more trouble to lug around but is infinitely more useful as a
development tool than I suspect a tablet will ever be.

~~~
djacobs
I bought the iPad 2 the day it came out and was thrilled to use it for about
two months.

But over the last four, I've realized: the reason I keep coming back to
computers is that I enjoy computers. Learning more about their internals,
harnessing that for my own ends, creating solutions to real problems I have,
without frameworks or IDEs or buzzwords. I don't so much care for anything
about the iPad but iBooks.

I bought the Macbook Air when Apple upgraded it, and now I carry it with me
everywhere. There's plenty I can do on it, even without a network connection
(i.e., all my coding), and I really feel attached to my featherweight
computer.

Mobile coding is really fulfilling, yes. But I will never want to code by
touch typing. Since buying the MBA, I haven't once thought about touching the
iPad. And I don't see that changing.

~~~
seltzered_
Good for your adult self. If I was an upper-middle-class 10 year old kid who
couldn't afford a nice computer, but could coax my parents into buying an iPad
over a game console, I'd be so thrilled to have something that guided me into
developing fun little games.

When I was 10-12, I had a freaking AIX PowerPC machine because my dad could
get one easily. Did I learn programming with such a fancy machine? absolutely
not, I ended up just installing windows NT on it so I could record and play
with sounds.

~~~
djacobs
A very good point, and I don't disagree with you. I used RPGEditor and
GameEditor when I was a kid and couldn't figure out how to use plain C++ to
build a game.

The authors of this software have done a really amazing job, that's
undeniable.

But I'm thinking here about two things:

\- There is a notion that the only thing stopping tablets from overtaking
computers is the fact that you can't develop software on tablets. Under that
model of the world, this is a major breakthrough for tablets. But I'm not sure
it actually solves the problem of high-quality development.

\- There is also a notion that the iPad is a distillation of the best parts of
a computer, the things that give people joy, and it removes "cruft" that
people don't want to think about: filesystems, command line access, and the
like. I wanted to take this opportunity to say that this isn't the case for a
lot of people and that the ability to code on an iPad doesn't mean the iPad
can give as much joy to a developer as a real computer can.

My comment was less manifesto, more musing about why I can't get rid of real
computers.

~~~
victim
the biggest issue with tablets is the lack of a compiler and the processing
power. With cloud computing and technologies like dropbox, developers can
queue their apps and get it to compile on machine with grunt, package it and
upload it to testflight and then download it to the mobile devices again...
and test it.

True development on a mobile platform.

~~~
cageface
I think the bigger issues are the coarse resolution of the touch interface and
lack of usable keyboard. The former prevents the kind of dense, widget-rich
UIs you need for a tool as complex as a real IDE. The latter can be
ameliorated with an external keyboard but then you've got a combination that's
actually more awkward and less portable than a laptop.

To try replace a laptop with a tablet (or vice-versa) is to misunderstand the
strengths and limitations of each, IMO.

------
gojomo
Notably, this fits into YC's "Request for Startups #5: Development on
Handlhelds":

<http://ycombinator.com/rfs5.html>

~~~
alexhaefner
Only partially. This code isn't portable. This is more analogous to a game
engine, it's a development engine. Along with not being portable, the code
can't be distributed. If the developer offered some package with their
rendering engine for purchase outside the app store, then other devs could
publish games using this development engine.

~~~
tswicegood
It looks like this is something that the developer is already thinking about.
<https://twitter.com/twolivesleft/status/129304975623995395>

~~~
alexhaefner
Oh no I am speaking of licensing the graphics engine underneath to devs so
they can distribute their own standalone games in the app store, without users
having to download this app.

~~~
nl
Is there a particular reason why you think this won't happen at some point in
the future, too?

~~~
alexhaefner
Any particular reason? I'm not working on this particular project, I have no
idea what the dev has planned. I like imagination, but I don't like
speculation. So I'm just not in the mood to speculate on it.

------
karpathy
I made a simple particle simulation in Codify in around 30 minutes:
<http://www.youtube.com/watch?v=QEqTvRd8qMM>

That is, 30 minutes, plus few more minutes pouring over the examples learning
LUA syntax (I've never worked in it before but it's basically Python but
lazier and more forgiving)

At times it felt a bit frustrating, as some of the code, such as p[i].x =
p[i].x + p[i].vx takes forever to write because of the brackets, which are 3
taps each. I think this can be improved upon in the future.

Many examples are provided which is very nice. The graphics is done using
opengl-like stack with pops and pushes of transformations.

Overall, the app is very impressive and I'd love to see these kinds of apps
used in education. Kids could use it to learn programming, without having to
suffer the overhead of file system etc., as on a real computer. Excellent
stuff with bright future.

~~~
colomon
Woah, I never expected you would be able to get that kind of performance out
of an iPad (2?) with only 30 minutes' work.

Nice sound effects, too. :)

------
pshc
Some gorgeous work there on making a native code-structure editor rather than
a text editor. But it's still text in the end. Baby steps!

------
CyberFonic
Chill !!!

This is for FUN! You're not likely to write the next Microsoft Office with
Codify, but a lot of kids are going to have heaps of fun! Anyone remember Alan
Kay's vision for SketchBook? This has to be the closest yet to that vision.

------
thepumpkin1979
I can hear a Keyboard in the background... So I guess is not that easy to type
code on iPad soft keyboard. It's very interesting though.

~~~
angelbob
Not at the speed you're seeing there. Also, obviously you're not seeing the
keyboard come up blocking the environment :-)

------
killion
Somebody forgot to tell these guys that iPads are for content consumption, not
creation.

~~~
alexhaefner
I'm just curious, do you feel like this was a meaningful contribution to this
discussion? 0 added value, and virtually no insight in your post. Your post
has nothing to do with what they've created.

~~~
nl
It has a huge amount of insight.

When the iPad came out it was (naively) decried as a device that segmented
computing into "content consumption" and "content creation". Apps like this
continue to prove that wrong.

~~~
prayag
Actually it's true. Apple removed Scratch from their app-store because "Apple
wants to focus on consuming media using these devices, not producing
media."[1]

[1] [http://computinged.wordpress.com/2010/04/15/apple-removes-
sc...](http://computinged.wordpress.com/2010/04/15/apple-removes-scratch-from-
ipadiphoneitouch/)

~~~
nl
That's Scratch users speculating on the reason, not an Apple statement. At the
time Apple policies were very restrictive about non-approved languages (Flash,
etc), but they have since been relaxed.

Ironically I just posted asking if Apple would allow it now:
<http://news.ycombinator.com/item?id=3161245>

~~~
jonbro
also, it wasn't really scratch that they didn't approve, it was a scratch
player. The player downloaded and played scratch programs from the website.
This continues to be something that is not allowed. I would like to see apple
reverse this decision though.

------
psychotik
<aside> Diehard VI/Emacs fans are still getting over their aversion to IDEs -
now you're going to make them TOUCH! That'll make their heads explode!
</aside>

~~~
satiani
I'm a diehard vi fan and I loved what I saw. That IDE makes me want to get an
iPad.

~~~
varjag
Don't. iPad is kinda useless gadget for developers, unless you develop for
iPad and use it as test target.

Am getting back to my linux netbook.

------
softbuilder
That looks pretty cool. Real programs tend to require an awful lot of input
and tweaking though. I wonder what the development cycle is like? How fast do
things compile on an iPad?

~~~
alexhaefner
I would assume compile is very quick, as the only thing happening is the Lua
the user writes is being added to the game logic and interpreted. Everything
else, the rendering engine and such, comes already done with the app. Lua has
very fast execution.

------
seclorum
I've been using moai recently, which is a cross-platform Lua-based environment
for developing (mostly) 2D style games for Android and iOS, and just last
night was talking to a co-developer buddy of mine about the very real
possibility that we could use moai to build a moai development environment on
the iPad .. and now: this.

So, it looks like this is very feasible, and I have to admit to instantly
buying this application the moment I read this HN article .. but I haven't had
any chance to grok it yet.

If it works out, this could be the start of a new era for iPad/iOS development
- certainly my iPad is good enough for editing lua scripts, and with a
delicious framework like moai around (I really, really like it) I think it
would be very viable. What an exciting future we iOS developers have!

------
brianobush
somehow my idea of the ultimate coding platform for touch interfaces would be
more symbolic/graphical (eg a few of wouter's languages, see
<http://strlen.com/language-design-overview> or scratch from MIT). I know
there are many limitations in that approach, but nonetheless it would be neat
to push (or nudge) the boundaries of the modern development style.

~~~
shashashasha
Definitely - Grasshopper (<http://www.grasshopper3d.com/>) has kind of taken
over the architecture world for being graphical / patch based.

------
sidjha
Even though, my introduction to programming was through vi and notepad, often
I find that when I'm trying to teach kids how to program, they're turned off
by the 'clunkiness' of IDEs and compiling.

Imagine how amazing of an introduction to the world of programming Codify
would enable for kids. Teaching computer science in elementary schools will
become so much easier and fun. This looks like something kids would love to
use. And perhaps, it'll enable a new wave of young hacker/entrepreneurs who'll
go on to make more awesome products.

~~~
tikhonj
I think this is exactly the idea behind projects like BYOB/Scratch
(<http://byob.berkeley.edu/>). I think it's pretty successful at introducing
people with no previous experience at all to programming at Berkeley, at the
very least.

Coincidentally, making a Scratch app for tablets (I suspect Apple may not
cooperate, but it could be for Android) would be really neat.

------
nl
I wonder if Squeak will be allowed back in the AppStore now?

~~~
nl
Could someone explain the downvotes?

------
mwexler
Game dev is great, but I'd love to see tools like this that let do more
advanced scripting in a visual fashion without the emphasis on the visual
aspect, such as sprites or animation. Processing is great at displaying
things, but not so great at, you know, processing.

Similarly, I long for an easy to use scripting language environment on the
tablet itself that doesn't require one to know HTML, CSS, JQuery, etc. and is
not so focused on visualization and sprites, but instead just lets you create
a page or tabs, get some data, do something with the data, and display a
result while impacting another service. This would empower people to create
their own experiences on the tablet instead of hoping some developer hits on
their exact combination of needs.

I know, all HN readers are super-programmers, but I think back to the old days
when folks wrote simple basic programs on their C64/Atari/Apple/etc. to solve
simple problems... and how that's so difficult today on PCs, but could be
brought back to life in the consumer-friendly world of tablets...

~~~
tammer
Hypercard for iPad? Brilliant!

~~~
mwexler
It's very sad that I wrote that entire comment and didn't think of Hypercard.
I agree, it would be interesting to have Hypercard "The Next Gen" on iOS
devices... it did have a very good approach to solving what I mentioned above.

~~~
soapdog
Check out <http://www.runrev.com>, they have a product called LiveCode which
is a modern day HyperCard. It can compile to iOS, Android, Windows, Macs and
Linux.

------
aboodman
Beautiful work. Seems like this would be great for teaching kids to program.

~~~
guygurari
My thoughts exactly. I've been trying to figure out the best way to introduce
my kid to programming, when it becomes relevant. Games are probably the most
engaging type of software for children.

This app is just what I've been looking for. On a PC, even the best
educational programming environment can't get rid of all the PC-related
overhead. You can't beat an iPad for simplicity; no need to learn about
filesystems, your app runs full screen by default so there are no
distractions, etc. You can just pick it up, dive right in and make a game.

------
yread
I think that touchdevelop on wp7 feels much more natural for coding on
touchscreen. I hate to write on soft keyboards

~~~
pstuart
Or use a bluetooth keyboard?

~~~
seclorum
Bingo! Apple Wireless keyboard works wonderfully on iPad.

------
mcdaid
Just finished porting a javascript fractal tree generator, the javascript
version is at

<http://www.mcdaid.eu/labs/codify1>

and the code to run in codify is in the textarea (small)

~~~
seclorum
Brilliant! Nice work .. I like the fact that we've got 'typeins' for this
already. Just like the good ol' days of waiting for 'new software' to arrive
in the mail, in the form of a ZAP magazine or so ..

------
nextparadigms
I was thinking before that something like this needs to come to Android, too.
Instead of emulating ARM hardware on x86 chips, you could directly build your
app on an ARM machine. I suppose you'd still have to emulate other ARM
devices, but I think it will work a lot better than on x86 chips.

Maybe Google can work with Eclipse to port it over to ARM/Android. Developers
could get hybrid devices like the Asus Transformer to code on them.

~~~
seclorum
The moment that moai (<http://getmoai.com>) gets an onboard editor, this will
be a reality. I give it a few weeks. :)

------
socialist_coder
Wow, this looks pretty awesome. Nice job twolivesleft!

~~~
Michael_K
+1

------
jayfuerstenberg
The color picker - IDE integration is really slick!

------
rbxbx
"Wouldn't it be nifty to have that color picker in Vim?" a friend posed the
question after my showing him the video.

Maybe: [http://www.supaspoida.com/2011/10/26/a-short-story-about-
a-t...](http://www.supaspoida.com/2011/10/26/a-short-story-about-a-tweet-a-
video-an-idea-and-its-execution.html)

(note: I didn't develop this, just sharing it with you all)

------
evo_9
Codify's talks about import/export functionality via email coming in an update
already submitted to Apple in this thread:

<http://forums.toucharcade.com/showthread.php?p=1975221>

It will be interesting to see if Apple allows them to do this.

------
bstar77
Reminds me of Klick & Play back in the early 90's:
<http://en.wikipedia.org/wiki/Klik>

This app looks like the perfect thing for prospective obj-c devs to get that
"I gotta make something cool now" monkey off my back.

------
dmix
As a side note. Is Lua as a language any good? Will it continue to be used in
the future?

~~~
cageface
Lua is pretty well established in the gaming world as a lightweight but fast
scripting engine. It seems to be gaining some momentum in other domains lately
too. It's somewhat similar to Python but without the extensive standard
library.

It's not going away but it's hard to say how much bigger it will grow. It
seems like a good fit for mobile devices. It's used in Corona, for example.

Edit: corrected Cocos2D -> Corona. Thanks!

~~~
catch23
I think you mean Corona, not Cocos2D. The last time I used cocos, it was
strictly an objc library to make opengl dev easy.

------
openbear
Played around with it a bit, very cool.

I would love to see iCloud support and a desktop version. It would be awesome
to have something like the Processing IDE with a sketchbook that automatically
syncs between my devices (e.g. my iPad and MacBook).

------
jonbro
this app also brought out some other options, check out paragraf where you can
write glsl pixel code.
<http://itunes.apple.com/us/app/paragraf/id422685475?mt=8>

It is the complete opposite in terms of ease of use, but it is still executing
code. Also broken glsl code is way more likely to hard crash your phone than
broken lua code.

There are some other options mentioned here:
[http://digitaltools.node3000.com/blog/3310-coding-ipad-
coder...](http://digitaltools.node3000.com/blog/3310-coding-ipad-coders-
paragraf)

------
jbrennan
This is fantastic. How lovely would it be if Apple bought this up for iOS
Xcode. I have a feeling some day there will be a way to write iOS apps on iOS,
provided by Apple.

------
antimora
I just bought the app and it is pretty simple and cool. My wish came true. I
was wondering if I could script without going to learn c objective.

------
efnx
Why not go all the way and create a graphical programming environment? I've
felt that this is long overdue.

~~~
satiani
The problem with graphical programming is that it is inefficient when it comes
to using a large API. There are only so many icons and graphical objects you
can fit on a screen, while still making it easy for users to find them.

That's why they are restrictive, they have to choose only a narrow set of
methods to expose to the users. By narrowing their available functionality
they also become useful for a smaller domain of problems.

Codify does not try to replace text-based programming, but instead to make it
easier and sometimes more efficient for graphics-intensive programming. For
example, the easy to reach color selector is much faster than having to use a
separate tool to get the numbers for the color you want. Same thing for the
image selector.

~~~
cageface
The Max/MSP environment gets around this problem by representing most of its
rich library of objects as simple rectangles with descriptive names. People do
manage to build some pretty sophisticated programs with it.

<http://www.cycling74.com>

------
leafo
I've love to see <http://moonscript.org> support.

~~~
reustle
I'd love to see something like this for javascript

------
the_mat
I can't see writing text-based Lua scripts on an iPad as anything other than
an anachronism.

------
navs
This looks fun. Would be great in schools, even entry level Computer Science
classes in Uni.

------
senthilnayagam
Examples are good,would teach my 8 year old daughter to program in a fun way

~~~
senthilnayagam
One word, Impressed :)

Since it is about programming, I would love to have version control do that my
kid starts using it as well.

How to share code ? Dropbox integration would be nice

Heroku style deploying the code in server would make it awesome

------
socialist_coder
My #1 feature request- support sprite sheets for animated sprites!

------
mojdril
Seems a smalltalk IDE-like intention. With fingers, though.

------
nedwin
Beautifully simple single product page. I've recently become a convert to no
gradients, flat buttons etc.

------
jshowa
Great, now I need to do a bunch of screen touching along with my typing. What
a waste of time.

------
sandieman
would be cool if it had github support

------
mkramlich
Speaking as someone who's been around a few decades... Oh look, yet another
way to create graphical games! I'll just add that to the list, near the end.
It's a long list. :)

Purty looking, but color me not impressed. I already can sense what the
constraints will be, and they aren't good. And I've gained really nothing new
I couldn't already do before.

------
ddelony
How long until Apple shuts it down for using a language other than
Objective-C?

~~~
XLcommerce
Apple already allows JS (and other) interpreters to be embedded as used in
projects such as Titanium and Impact game engine.

