Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Taxa – A tiny language inside JavaScript to enforce type signatures (github.com/dmotz)
3 points by dmotz on Sept 7, 2014 | hide | past | favorite | 3 comments



Lately I've seen on HN a few attempts to add runtime type checking to JavaScript. I'm happy with that, as in my experience adding a bunch of asserts in strategic places can really speed up prototyping and development, you become more confident, and chances are that you can catch bugs earlier. In the same vein I wrote a library that adds runtime type checking based on type combinators [1], check it out, we can share some ideas.

[1] https://github.com/gcanti/tcomb


It would be nice if there were a drop-in, pass-through replacement for Taxa to use in production environments. It might even just be a configuration flag: t(true) or t(false), for example.

That way, while debugging, I could use Taxa's type-checking. Then by changing one line or setting the flag differently, I could disable it in production.


I was thinking along the same lines and just pushed up an addition to do so. (t.disable())




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: