
Codakido, Lua/SDL programming environment for Kids, with C64-alike editor - antirez
https://github.com/antirez/codakido
======
antirez
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.

~~~
badboy
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 :)

~~~
antirez
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.

------
api
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.

~~~
antirez
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.

~~~
seclorum
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 .. ;)

~~~
antirez
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!

~~~
seclorum
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 ..

;)

------
virtualritz
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. :)

~~~
antirez
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.

~~~
virtualritz
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).

------
prof_hobart
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).

~~~
RobertLysik
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!

~~~
prof_hobart
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.

------
owlpic
Has potential on the Raspberry Pi.

~~~
antirez
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.

~~~
kokey
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.

~~~
gaius
You might be surprised how "modern" BBC Basic is, even today.

~~~
zem
yeah, it had some very well-thought-out features. dijkstra notwithstanding, i
am glad it was my first language.

------
seclorum
If you like this, you'll love MOAI: <http://getmoai.com/>

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

------
antirez
Project renamed as "Load81", so unfortunately now the link is broken. If an
admin could fix this it would be great.

~~~
jamie_ca
Make a new codakido repository with just a readme pointing to the new
location.

~~~
antirez
Thank you! done. Github should suggest this in the rename page.

------
eterps
The project has moved here: <https://github.com/antirez/load81.git>

------
tluyben2
Very nicely done!

------
gaius
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!

~~~
cturner
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.

~~~
antirez
I agree, I want to add low level things like POKE to write to the screen
memory. Sound would also be awesome.

~~~
mhd
Sprites are quite fun to move around, even if you're not doing it in a more
interactive fashion (like Logo).

------
beza1e1
Reinventing Smalltalk? Nice job.

~~~
klez
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)

~~~
GeneralMaximus
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.

~~~
klez
TIL

------
Zhiz0id
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>

~~~
Turing_Machine
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.

~~~
noonat
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.

~~~
Turing_Machine
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.

