4

I am recently interested in learning a new language called Opa which seems to be promising when I read about it. As far as wikipedia describes it, it is capable of client-side,server-side scripting as well as can also be used for database (correct me if wrong). My question is: How does the OPa compiler know, which side the script should be executed? Should it be user defined?

tomdemuyt
  • 4,572
  • 2
  • 31
  • 60
Jack_of_All_Trades
  • 10,942
  • 18
  • 58
  • 88

1 Answers1

4

You can annotate a function to force it to be on one specific side. But it is not mandatory, you can let the compiler decide.

For example, a DOM access is on client side, a database query is on server side. But when possible, a function is compiled for both side.

Read http://doc.opalang.org/manual/Developing-for-the-web/Client-server-distribution for further information.

Cédrics
  • 1,974
  • 11
  • 13