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

I design on paper a lot too. A new feature or big refactoring has to be absolutely clear in my mind before I start coding.

ActionScript classes are syntax-incompatible with JavaScript, how did you solve this? An AS to JS mini-translator seems to be the simplest way, no?



I don't use ActionScript classes. Everything's done with closures and literal objects. Can't even use prototypes; MTASC doesn't allow standalone functions or prototype declarations (instead requiring that everything live inside a class), so that falls outside the common subset. We namespace things the way it's done in JavaScript, with objects serving as namespaces, so there's a notion of libraries that're imported at compile time. My Scheme experience certainly comes in handy.

I haven't ruled out doing a mini-translator; this is very obviously a hack, and if the common codebase grows much larger we'll probably appreciate it. (We've also considered rewriting the whole thing in pure Flash, but there're certain user benefits that the dual-language architecture gives us that we're not quite ready to give up.) This approach is "good enough" for now though, so we're hoping that it'll get us to an initial launch, and then we can decide whether it needs a rewrite based on what users want to do with it.




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

Search: