Other languages! Especially JavaScript

My opinion is that Lua is a nicer language than Javascript: fewer warts, less unexpected behaviour. That makes it easier to learn than Javascript – I picked it up in a couple of commutes, including the metatable stuff. And it’s widely used in games programming, making Codea more useful as a game prototyping tool.

I still haven’t learned all the ways that Javascript can help me shoot myself in the foot!

So, I think Lua is a great choice for Codea.

Every time I get frustrated with Codea - or rather, frustrated with Apple’s arbitrary restrictions on it - I go back to javascript and the web for a day or so, and that tends to reset reality. Javascript and the web, even saying “this will target ipad only”, is… complex. And ugly. And there’s still no good way to do the dev on the ipad. And it has other weird restrictions (try reading the keyboard without a text box up - works in any browser except mobile safari).

Plus, compared to Codea, performance sucks - especially graphical. that’s changing, but meh.

Yeah, I think the biggest things I like about Codea are it’s relative cleanness compared to JavaScript or C++, it’s relatively nonsense-free syntax when compared to Objective C, and it’s graphics focus. Put the three together, and you just pick it up and code.

"And there’s still no good way to do the dev on the ipad. " -@Bortels
I like to use Textastic A LOT. It may not be the best coder, but it is wonderful in my opinion.

My experience with javascript on iOS is that it tends to be fairly slow. Only Mobile Safari has access to JIT compiling, any other app cannot execute data pages (ie, anything not in the signed binary), so you can’t do JIT. That means even if we used a Webview, the javascript it ran would be significantly slower than Lua (which is a speedy little language even without JIT, unlike javascript.) Not to mention the overhead of Webkit’s renderer compared to our direct access to the graphics hardware.

As you can see in the iProcessing demo video, it is struggling with a few solid filled circles. Doing anything remotely interesting would probably cause significant slowdowns.

Just an idea @Dylan - You could have an in-app preview and then say “Test in safari”. Safari can read the app’s files if you allow it, right? But anyways, you would make an engine for the Lua part of it. But first, I really want sprite packs.

And working out sockets with apple

guys, check out www.becomekodiak.com - it has PHP and looks pretty neat

cute. I’m taking a look, will report back.

So - it’s cute. It’s just what you’d think it is; a WebUI, with a PHP interpreter built-in. You can do html pages, and javascript, but it clearly is intended to be used for php mainly. It does not use the itunes document import/export, and I don’t see any import/export, so it looks like it’s in the cut/paste regime as well, although it comes with some binary images - so maybe I’m missing something, I don’t see a way to import new ones.

I’ll bet money it’s javascript support is identical to the regular safari support - ie. no access to the photo roll or camera or such, ditto php.

Here’s something that may be of interest: Riq over at cocos2d has been adding JavaScript bindings to cocos2d 2: http://www.cocos2d-iphone.org/forum/topic/31640

I’d be lying if I said that I haven’t considered the possibility over the last couple of weeks of making a cocos2d-based iPad app similar to Codea that would take advantage of the JavaScript bindings. One awesome benefit of such an app is that anything done through that app could work on the web, iOS, and Android, essentially for “free” (I know, I know, “write once, run everywhere” typically ends up being “write once, debug everywhere”, but given that cocos2d has already been ported to virtually every platform of consequence and has a massive community, plus other aspects like native rendering, menuing systems, batched rendering/sprite sheets, particles, physics, and a wealth of already available tools, it’s very hard to ignore).

Their keyboard is worth a look - I like the five-way keys.

This discussion is rather old, but i’ll add my opinion of casual programmer. A few days ago i wrote in another discussion:

‘’ I am always amazed how natural and smooth it is to program in lua: i just copied you code, typed a few lines and it works directly as expected, no bug! I’ve done quite some programming in Javascript, that’s a different story: i almost get one error for each line of code and it takes the hell of a time to have something that finally works. I worship LUA! ‘’

if you really want to program in Javascript, then buy textastic it is an excellent dev platform, and and i have made rather complex javascript programs there (including a small offline web-app for ipad). But there are limitations put by big brother on IOS: he won’t let you cache locally more than 1 mp3 file, so it makes it very tedious to program an offline game with sound. Also saving images locally after processing in not possible (at least in javascript, maybe in pearl or…?) so it is very limited compared to codea. I have experienced touches, canvas, sounds, orientations in this offline webapp ( a touch timer at http://jmv38.comze.com/ for those interested).

So my wish would be: keep focused on improving LUA in CODEA, add libraries and fonctionnality but don’t go to other langages, LUA is fine. Just my opinion.