Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Eh, I'm not sure the level editor/scripting comes from the language so much as the nature of game dev. I've written a hobby 2d engine + game before, level design is a hell of a lot easier if you build an editor to do it in. Same with scripting for enemy behaviors. I wrote one in c++ and another in Java, both ended up with level editors and a limited scripting language designed for my own benefit. Once you have them, it speeds up actual game development immensely.


Yeah I agree. But what I was saying is that implementing the level editor / scripting engine is a class of application where pure FP tends to shine.


This is an interesting point. As a humble pythonist I would like to hear more about why that is... thanks!


For language design, fp tends to make things a lot easier to represent. Any parser-type application is going to be a recursive structure with a lot of continuations which is the natural way of coding in a functional lang. If you ever look into language design or compilers, you'll see that things are generally written as sum types in bnf, cnf, etc [0]. Basically all fp langs implement sum types, so you can practically translate theory 1-1 into code. I guess you could think of a level editor as a type of language, it's just so minimal that I don't.

[0] http://www.cs.man.ac.uk/~pjj/farrell/comp2.html




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: