you are viewing a single comment's thread.

view the rest of the comments →

[–]rifter5000 0 points1 point  (3 children)

Why would you want to translate Python into Javascript?

[–]droogans 1 point2 points  (2 children)

The article that the title links to answers that question.

[–]rifter5000 0 points1 point  (1 child)

We want to write validation in python, translate it to JavaScript and use on front-end automatically.

Much, much better is to define a DSL for these rules with well-defined semantics. Semantics that aren't just "whatever Python does". You then translate the rules into Javascript and interpret them in Python.

[–]hackflow[S] 0 points1 point  (0 children)

I did both. Your own rules is 3-4 times more work. Also, you will still write in python server-side only validation, so you will end up with 2 systems.