Hiya!
I'm thinking about writing a simple, 2D, sprite-oriented games engine, with a really accessible API.
This would be aimed at teaching kids (and maybe adults) a Functional Programming style - whilst having fun!
It will be written in C and GLES, and of course will be open source on GitHub.
Anyone here find that an interesting idea? Happy to elaborate on what exactly I have in mind..
Cheers!
Duncan
-
- Posts: 6
- Joined: Thu Dec 08, 2016 10:08 pm
- Location: London
-
- Posts: 36
- Joined: Tue Jan 10, 2012 11:16 am
Re: Teaching a Functional Programming style via 2D game dev
Isn't that what Raylib is designed for?
Re: Teaching a Functional Programming style via 2D game dev
As Morphology state, that's the idea of raylib (http://www.raylib.com). It's been in development for more than 3 years and it's been used with more than 250 students to teach the basis of videogames programming. 

-
- Posts: 6
- Joined: Thu Dec 08, 2016 10:08 pm
- Location: London
Re: Teaching a Functional Programming style via 2D game dev
Thanks to you both for the pointer, but Raylib isn't about helping non-programmers to program!
As you said yourself, it's designed "to teach the basis of videogames programming", not programming itself.
My idea is to help people of all ages and abilities learn to write satisfying programs in a very high level language, with instant feedback - which is what you can get with making games.
Somewhat like Roblox or Kodu, but with a better programming language.
And as a bonus, it will be easy to create multiplayer games, too!
I've written or prototyped a lot of the code in Java - it's called 'NetMash' - I want to rewrite it in C for speed and portability.
Cheers!
Duncan
As you said yourself, it's designed "to teach the basis of videogames programming", not programming itself.
My idea is to help people of all ages and abilities learn to write satisfying programs in a very high level language, with instant feedback - which is what you can get with making games.
Somewhat like Roblox or Kodu, but with a better programming language.
And as a bonus, it will be easy to create multiplayer games, too!
I've written or prototyped a lot of the code in Java - it's called 'NetMash' - I want to rewrite it in C for speed and portability.
Cheers!
Duncan
Re: Teaching a Functional Programming style via 2D game dev
I'm intrigued by the idea of a Functional Programming style in C, especially since C isn't a Functional Programming language.
She who travels light — forgot something.
Please note that my name doesn't start with the @ character so can people please stop writing it as if it does!
Please note that my name doesn't start with the @ character so can people please stop writing it as if it does!
Re: Teaching a Functional Programming style via 2D game dev
I think the unspecified new functional language Duncan is proposing is probably interpreted, with the interpreter written in C.Paeryn wrote:I'm intrigued by the idea of a Functional Programming style in C, especially since C isn't a Functional Programming language.
C was chosen for portability and speed.
My problem with these languages is that when it comes down to it, the new language is abandoned and a traditional language chosen instead - to do the real work.
OK perhaps bootstrap it in C because C is always available, but then write the interpreter in the new language.
If the new language is incapable of the task, or too slow, then perhaps its a bad choice.
-
- Posts: 6
- Joined: Thu Dec 08, 2016 10:08 pm
- Location: London
Re: Teaching a Functional Programming style via 2D game dev
Sorry - I have been a big vague!
I did say 'API' in the first posting, then 'language' in the second!
You can do Functional Programming style in C - it's a bit of a trick, but possible. That plus a high-level gaming API such as in Raylib, can give what I want.
But I also have a proper Functional Programming language - that is interpreted in the Java code I wrote. It would indeed, also be interpreted in the C implementation.
Sorry for the confusion.
I don't think I'm explaining this too well - or did I?
I did say 'API' in the first posting, then 'language' in the second!

You can do Functional Programming style in C - it's a bit of a trick, but possible. That plus a high-level gaming API such as in Raylib, can give what I want.
But I also have a proper Functional Programming language - that is interpreted in the Java code I wrote. It would indeed, also be interpreted in the C implementation.
Sorry for the confusion.
Yup - so I'd have both an API with everything high level, plus the new language, and hope that my language takes over the world and all that.My problem with these languages is that when it comes down to it, the new language is abandoned and a traditional language chosen instead - to do the real work.
The new language interpreter is written in C.OK perhaps bootstrap it in C because C is always available, but then write the interpreter in the new language.
If the new language is incapable of the task, or too slow, then perhaps its a bad choice.
I don't think I'm explaining this too well - or did I?
Re: Teaching a Functional Programming style via 2D game dev
Yes that's fine!Duncan Cragg wrote: I don't think I'm explaining this too well - or did I?
That's common and should work well.Duncan Cragg wrote: The new language interpreter is written in C.
I was just questioning why it isn't written in the "new language", why resort to another, very old, language?
Unless the older language does a better job, in which case the need for a new language is in doubt

I guess the new language may be specific to games programming and not general purpose like C.
In that case how useful is it for your students to learn?
-
- Posts: 6
- Joined: Thu Dec 08, 2016 10:08 pm
- Location: London
Re: Teaching a Functional Programming style via 2D game dev
Um, well my plan is only to take the Java interpreter for my FP language and rewrite it in C. You could program games over the gaming engine in that FP language.I was just questioning why it isn't written in the "new language", why resort to another, very old, language?
Unless the older language does a better job, in which case the need for a new language is in doubt![]()
Alternatively, program everything in C over a high-level API. That's the bit I probably need to explain better..
Well the new language is general purpose, not specific to games. But it would still only be useful to learn if it teaches valuable principles. I'm hoping that its FP nature will give that.I guess the new language may be specific to games programming and not general purpose like C.
In that case how useful is it for your students to learn?
There are four pieces to the whole idea:
- the FP language
- the P2P networking
- the high-level 2D/3D drivers or C API (which I think may be satisfied by Raylib)
- this high-level C API I'm talking about for writing in C but in a Functional style
.
Re: Teaching a Functional Programming style via 2D game dev
Do publish your work when its complete!
-
- Posts: 6
- Joined: Thu Dec 08, 2016 10:08 pm
- Location: London
Re: Teaching a Functional Programming style via 2D game dev
Have you heard of "README-Driven Development"?jahboater wrote:Do publish your work when its complete!
I've started a GitHub repo here https://github.com/DuncanCragg/Onex!
.
Re: Teaching a Functional Programming style via 2D game dev
No I have not, but it sounds a good idea.Duncan Cragg wrote:Have you heard of "README-Driven Development"?