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

It looks neat. Reminds me of a lot of ideas I had of making a way to tightly couple classes/logic between PHP (server side) and JS (client side) when making websites and web apps.

It came up a lot when making HTML-based forms. I’d define them all in PHP, but the experience is best without a page load, so typically I define some typescript object to send the form via Ajax. I got tired of having to define all the field names in both places (awful for maintenance), so instead typescript uses AJAX to ask the server for the list of inputs it needs to grab and send.

It sounds like Haxe could be a much nicer way to do stuff like that: https://haxe.org/use-cases/web/



> I got tired of having to define all the field names in both places (awful for maintenance)

Haxe might be overkill for that. Usually (unless youre doing a SPA) you use PHP or a templating language to dynamicly render the form server side based on either data or metadata.

Haxe can indeed be useful for more complicated versions of that situation, where you need a complicated state machine or algorithm in more than one language.


Sounds like a job for HTMX




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

Search: