News for hackers. Stuff that matters.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by antirez on Monday March 05, 2012 @05:26AM (#3666081)
Hi HN!

this is the result of two days of hacking during the weekend, the obvious inspiration is Codea. I and my son have fun with Codea but we can't use it often (we don't have an iPad at home), so I wrote this code. Later I realized that using an external editor was not working so I added a retro-computing alike editor, and now it is much easier for kids to modify and execute the program.

Everything is currently very work in progress, I hope I'll find more time to invest into this project, but even more I hope to get pull requests by interested parents that have children and are interested into teaching some programming.

EDIT: since I used most of the time hacking on the code I was not able to add some decent example. Please if you write some nice one drop me an email, pull request, whatever.

Re:Codakido, Lua/SDL programming environment for Kids, with ... by badboy on Monday March 05, 2012 @06:07AM (#3666145)
I really like the idea and the code is just great. I had fun by just reading the C code and experimenting a bit.

Now that the editor is included it's even more awesome :)

Re:Codakido, Lua/SDL programming environment for Kids, with ... by antirez on Monday March 05, 2012 @06:18AM (#3666162)
Thanks badboy! The editor was definitely the most fun part to write (but it need more love, there are a few bugs). Since the whole editor only uses setPixel() as basic primitive it will work the same in different operating systems that can be a good point. Probably could be easily extrapolated to be used into games for the same reasons.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by api on Monday March 05, 2012 @11:46AM (#3667121)
If you want kids to use it, do not call it Codakido. Call it something that sounds interesting, and do interesting things with it. Kids don't want to be kids. Kids want to be kids getting ready to be adults. This is essentially instinctive. Things that are "for kids" are things that are labeled as things kids need to transcend, not things they need to grow into.

I learned on a C64, and was inspired by C64 demo-scene demos and the fact that the C64 was used for industrial process control. I started at age five.

Re:Codakido, Lua/SDL programming environment for Kids, with ... by antirez on Monday March 05, 2012 @01:38PM (#3667681)
Good point, I think I'll rename it, and extend it enough to make it more interesting than just drawing a few circles ;) good suggestion thanks.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by seclorum on Monday March 05, 2012 @03:19PM (#3668174)
As a rabid fan of your project, some things I think it needs:

a) cloud storage - somewhere to stash Lua scripts and retrieve them for playback (See moai cloud for inspiration: http://getmoai.com/)

b) sound synthesis - not just .WAV playback, but real synthesis using a small but happy engine. (See sfxr for inspiration: http://www.drpetter.se/project_sfxr.html)

c) some sort of network/multiplayer integration - again, with the cloud, it'd be nice to be able to push messages out to a queue and get messages back

d) 3D primitives .. ermm .. maybe this is going a bit too far. Okay, instead of 3D, how about some .png loading and basic sprites management?

Actually, I guess I'm describing MOAI at this point, but yeah .. you're definitely on the right track! Maybe I should go pester the MOAI guys about making a code-editing IDE for MOAI, in MOAI .. ;)

Re:Codakido, Lua/SDL programming environment for Kids, with ... by antirez on Monday March 05, 2012 @04:23PM (#3668409)
Great stuff! And most are already in my TODO list indeed... The next weekend I'll hack on it a lot again to bring a few of this features.

But I would add another one:

e) Ability to write some kind of assembler or other low-level stuff interleaved with Lua, so that's possible to also do as-fast-as-ASM computations if needed.

I guess this should be a layer translating something like Z80 assembler into x86 code. You call Lua with a string containing the program, it gets translated, and executed. I guess it should not be entirely impossible to provide something that also compiles to something safe (that can't crash the Load81).

Thanks for the suggestions!

Re:Codakido, Lua/SDL programming environment for Kids, with ... by seclorum on Tuesday March 06, 2012 @05:15AM (#3670387)
Inline Assembly, eh? Hmm.. not sure I can get behind that one, given that I've mostly been running codakido on my ARM machines .. but I can certainly understand the desire.

For my purposes, Lua has been quite performant enough!

Well, anyway maybe its time I added some of these features (can't stop thinking about the synth feature!) and do a pull request ..

;)

Re:Codakido, Lua/SDL programming environment for Kids, with ... by virtualritz on Monday March 05, 2012 @09:53AM (#3666649)
Really nice!

But I do not get the C64 editor look stuff. I mean why not add syntax highlighting and make this more eye friendly (neither requires abandoning a cute color scheme)? I never had a C64, I saved 2 years so I could afford a 286, I used GWBASIC and, soon after, TurboC++. Neither had syntax highlighting. I don't think it helps kids who are getting into programming if the looks of these dev environment were regurgitated either. :)

Re:Codakido, Lua/SDL programming environment for Kids, with ... by antirez on Monday March 05, 2012 @10:00AM (#3666682)
For now it's just a start ;) Soon I'll add more features into the editor to make it more user friendly indeed.

I don't want to add completion as IMHO does not help learning.

Re:Codakido, Lua/SDL programming environment for Kids, with ... by virtualritz on Monday March 05, 2012 @10:21AM (#3666767)
Cool. :)

Btw., I assume you know LOEVE? https://love2d.org/ Is is very similar, though the target audience is not kids. :)

Personally, I think time would be well spent making a kids-friendly version of LOEVE (and ofc, porting LOEVE to Android/iOs, finally).

Re:Codakido, Lua/SDL programming environment for Kids, with ... by prof_hobart on Monday March 05, 2012 @09:40AM (#3666595)
I've been playing around with Scratch (http://scratch.mit.edu/) and its slightly extended version BYOB (http://byob.berkeley.edu/) over the past couple of days.

It's simple enough that after an afternoon of basic instruction, my 5 year old managed to create this entirely on her own while I was cooking dinner - http://scratch.mit.edu/projects/hobart/2372941 (try pressing various keys - I know that "g", space, "8", "m", up arrow and the green flag all do something, but there may be more in there as well).

Re:Codakido, Lua/SDL programming environment for Kids, with ... by RobertLysik on Monday March 05, 2012 @10:48AM (#3666878)
Congratulations, that's excellent! I'll have to show this to my daughter. She wants to make her own Hello Kitty game since she's been watching her older brother (8) making games on Scratch :) Its an excellent platform for learning the basics of programming. I was worried that my son wouldn't have the patience to work with Scratch since he sees what's on Wii and XBox and that has set his expectation level. But fortunately he's become very excited by Scratch and can build games with very little or no guidance from me now, w00t!
Re:Codakido, Lua/SDL programming environment for Kids, with ... by prof_hobart on Monday March 05, 2012 @03:43PM (#3668259)
Thanks. I was expecting my daughter to get bored quickly as well. But having watched her, it strikes me as a software version of Lego - you'll never create a toy/game as good as one you could buy in the shops, but the real fun is the fact that you can create pretty much anything your imagination can come up with.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by bob_kelso on Monday March 05, 2012 @10:28AM (#3666802)
That's amazing! I would have loved something like this when I was growing up. If you can do that simple games would be no problem, and who doesn't dream of making their own games.

Also, try 'z' and 'p'.

Re:Codakido, Lua/SDL programming environment for Kids, with ... by prof_hobart on Monday March 05, 2012 @11:06AM (#3666945)
It's absolutely brilliant for kids - and it seems to be avaialble on Linux, so should be runnable on Raspberry Pi - which could be great for the classroom. It's so easy to add new little bits of functionality and see them in action that she never got bored whilst I was showing her the basics - in fact it seems to be her new favourite app at the moment. I can't recommend it highly enough as a first step programming educational tool (the reason I was first looking at it was because my wife's a teacher and was looking at a good app to teach programming to 10 year olds).

It's certainly possible to write very simple games. The tutorial I gave my daughter was a (very clunky) Space Invaders clone, and I'm going to have a go at something a little more advanced tonight - I've got to make sure she doesn't start overtaking me...

The one place it seems to fall down a little is managing multiple identical sprites - I looked at a rather more professional-looking Space Invaders that someone else had written and it looks like they needed a separate sprite with full code behind it for every single alien, although it looks like BYOB may address some of this.

Re:Codakido, Lua/SDL programming environment for Kids, with ... by Zuider on Thursday March 15, 2012 @03:34PM (#3710158)
You may be interested in the Panther project, a modification of Scratch, which adds among other things the ability to clone and delete sprites.

(http://pantherprogramming.weebly.com/)

Re:Codakido, Lua/SDL programming environment for Kids, with ... by owlpic on Monday March 05, 2012 @06:38AM (#3666191)
Has potential on the Raspberry Pi.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by antirez on Monday March 05, 2012 @06:41AM (#3666197)
That's my target, I hope that when the Raspberry PI will be available enough, Codakido will be functional enough to be a good alternative to the BBC micro BASIC.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by kokey on Monday March 05, 2012 @10:59AM (#3666922)
I like the choice of Lua and SDL, not only as a modern LOGO/BASIC alternative. I think it can go much further.

I guess as a minimum you want the editor to function to the level of notepad/pico/nano, and then perhaps have helpers with regards to indenting, and after that error marking similar to that of QBASIC, and after that syntax highlighting.

Re:Codakido, Lua/SDL programming environment for Kids, with ... by gaius on Monday March 05, 2012 @12:35PM (#3667361)
You might be surprised how "modern" BBC Basic is, even today.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by zem on Monday March 05, 2012 @06:12PM (#3668881)
yeah, it had some very well-thought-out features. dijkstra notwithstanding, i am glad it was my first language.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by asb on Monday March 05, 2012 @06:52AM (#3666217)
Hi Salvatore. I'll run it on my alpha board this evening and let you know how it currently performs.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by antirez on Monday March 05, 2012 @06:57AM (#3666231)
That's awesome asb, thanks!
Re:Codakido, Lua/SDL programming environment for Kids, with ... by seclorum on Monday March 05, 2012 @10:30AM (#3666813)
Works great on my Beagleboard already! 10 points to you for using SDL and making it build so cleanly ..

EDIT: just wanted to add, it works fabulously on my Open Pandora console as well!

Re:Codakido, Lua/SDL programming environment for Kids, with ... by antirez on Monday March 05, 2012 @11:11AM (#3666969)
Great :) Thanks you for testing it. Probably adding full screen support makes sense at this point.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by seclorum on Tuesday March 06, 2012 @11:29AM (#3671683)
Annnd .. here's a followup one day later. I released the PND for the Open Pandora console, in case anyone is interested:

http://boards.openpandora.org/index.php?/topic/7405-here-is-...

Added fullscreen support and wrapped it in a launcher for file selection, courtesy of PickleLauncher (helpful utility for precisely this sort of thing in the Open Pandora scene..)

Re:Codakido, Lua/SDL programming environment for Kids, with ... by seclorum on Monday March 05, 2012 @11:30AM (#3667050)
Quite easy to do! :)

BTW, I wanted to say that I think that Lua as a first-programming-language for kids is a great idea! So much easier to explain a Lua table to someone than types and so on .. And quite performant, in the end, eh? I've been using MOAI for cross-platform game development, and now your little project is going to get some love in the homebrew sense, too .. what about adding sound at some point?

Re:Codakido, Lua/SDL programming environment for Kids, with ... by asb on Monday March 05, 2012 @02:01PM (#3667803)
Appears to be painfully sluggish under X (Raspberry Pi doesn't yet have graphics acceleration there, totally not your fault). Somewhat better under SDL on the framebuffer, but I keyboard input doesn't seem to be working there. I only gave this a really quick go and it's on a wheezy rootfs I prepared, but running a rather old version of the RPi kernel. I'll delve into it in more detail later in the week.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by zxdunny on Monday March 05, 2012 @12:17PM (#3667273)
I'm also hoping to port this to the rPI: http://www.specbas.co.uk which is Sinclair BASIC for modern PCs... Seems the PI is going to be spoilt for choice :)
Re:Codakido, Lua/SDL programming environment for Kids, with ... by seclorum on Monday March 05, 2012 @10:26AM (#3666794)
If you like this, you'll love MOAI: http://getmoai.com/

(For when those kids grow up a little more, perhaps..)

Re:Codakido, Lua/SDL programming environment for Kids, with ... by antirez on Monday March 05, 2012 @04:25PM (#3668418)
Project renamed as "Load81", so unfortunately now the link is broken. If an admin could fix this it would be great.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by jamie_ca on Monday March 05, 2012 @04:37PM (#3668460)
Make a new codakido repository with just a readme pointing to the new location.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by antirez on Monday March 05, 2012 @04:54PM (#3668517)
Thank you! done. Github should suggest this in the rename page.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by eterps on Monday March 05, 2012 @04:20PM (#3668393)
The project has moved here: https://github.com/antirez/load81.git
Re:Codakido, Lua/SDL programming environment for Kids, with ... by tluyben2 on Monday March 05, 2012 @06:50AM (#3666212)
Very nicely done!
Re:Codakido, Lua/SDL programming environment for Kids, with ... by gaius on Monday March 05, 2012 @06:10AM (#3666149)
This is exactly what I have been talking about! The way to get kids into programming is exactly the same way we all got into it: the 8-bit micro experience. Top marks!
Re:Codakido, Lua/SDL programming environment for Kids, with ... by seclorum on Monday March 05, 2012 @10:29AM (#3666809)
I agree completely, which is why I have carefully curated my collection of computers over the years, to keep them functioning until the day my sons are ready to code. I've still got my Oric-1 (and now, an Atmos) with all accessories, in fully working order, ready to roll! :)
Re:Codakido, Lua/SDL programming environment for Kids, with ... by cturner on Monday March 05, 2012 @07:29AM (#3666286)
The language here is lua, a structured language, rather than a thin instruction layer over hardware. If it more of an API behind it (e.g. ability to work with sound at a low level) then the result could be better.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by seclorum on Monday March 05, 2012 @11:34AM (#3667068)
I think for sound it would be nice to have a little synthesizer where you can specify attack/decay/sustain/release, oscillator type, frequency and so on .. sort of like the SOUND command in the old 8-bit computers, even.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by antirez on Monday March 05, 2012 @07:54AM (#3666347)
I agree, I want to add low level things like POKE to write to the screen memory. Sound would also be awesome.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by mhd on Monday March 05, 2012 @08:14AM (#3666384)
Sprites are quite fun to move around, even if you're not doing it in a more interactive fashion (like Logo).
Re:Codakido, Lua/SDL programming environment for Kids, with ... by beza1e1 on Monday March 05, 2012 @07:40AM (#3666306)
Reinventing Smalltalk? Nice job.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by klez on Monday March 05, 2012 @09:48AM (#3666622)
Y U NO READ THE README???

No seriously, are you implying that

a) you consider small talk a language for kids or b) this is a complete and dynamic development environment with live debugging etc.?

I wish the OP best luck with the second, but I think he's not quite there (nor he needs to be, since the very nature of this project seems completely different from, say, squeak)

Re:Codakido, Lua/SDL programming environment for Kids, with ... by GeneralMaximus on Monday March 05, 2012 @10:07AM (#3666712)
Offtopic, but Smalltalk was in fact meant to be kid-friendly. Modern Smalltalks are different beasts, though, with all their enterprisey bullcrap. Squeak is an attempt to correct that.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by klez on Monday March 05, 2012 @10:47AM (#3666875)
TIL
Re:Codakido, Lua/SDL programming environment for Kids, with ... by Zhiz0id on Monday March 05, 2012 @07:19AM (#3666265)
From user point of view using flash as GUI is a better idea. http://code.google.com/p/lua-alchemy/

example: http://lua-alchemy.googlecode.com/svn/trunk/demo/index.html

Re:Codakido, Lua/SDL programming environment for Kids, with ... by perfunctory on Monday March 05, 2012 @07:39AM (#3666304)
I'm worried I won't be able to explain to my kid this part:

as3.class.mx.controls.Label.new()

Re:Codakido, Lua/SDL programming environment for Kids, with ... by Zhiz0id on Monday March 05, 2012 @05:55PM (#3668804)
I'm talking about GUI/Editor and library that helps to use lua in a browser. circles/lines/... functions must be coded on lua or as3
Re:Codakido, Lua/SDL programming environment for Kids, with ... by Turing_Machine on Monday March 05, 2012 @08:18AM (#3666393)
I disagree.

Flash won't work on iOS or (soon) any new Android device, nor will it work in the default browser on Windows 8. Despite what Adobe may say in public, I expect Flash to be completely dead (except possibly for maintenance/security updates) by this time next year.

Re:Codakido, Lua/SDL programming environment for Kids, with ... by noonat on Monday March 05, 2012 @09:06AM (#3666501)
Incorrect. The Adobe AIR SDK allows you to package Flash content as native apps for both iOS and Android. Adobe only halted development on the browser plugin for Android.
Re:Codakido, Lua/SDL programming environment for Kids, with ... by Turing_Machine on Monday March 05, 2012 @09:21AM (#3666542)
Apples and oranges. The example to which I was responding shows it running in a browser.

If the kids are going to share their creations, they need to run in the browser, without requiring installations, app stores, and so on.

As much as it sucks, Flash did have the one big advantage of being ubiquitous. That's no longer the case.

Re:Codakido, Lua/SDL programming environment for Kids, with ... by Zhiz0id on Monday March 05, 2012 @06:03PM (#3668840)
iOS/Android devices mostly without a real keyboard.

Have you ever tried to write some code without a real keyboard? It is a big pain.

Re:Codakido, Lua/SDL programming environment for Kids, with ... by Zuider on Thursday March 15, 2012 @05:49PM (#3710793)
But most of the development for such devices is done on a PC and exported to the device.