- Clone https://github.com/MLstate/opalang
- Install bld with
make install-bld - In the opalang root directory, compile opa_scheduler.ml with
bld opa_scheduler.native - Run it with
_build/opa_scheduler.native
- Clone https://github.com/MLstate/opalang
- Install bld with
make install-bld - In the opalang root directory, compile opa_http_server.ml with
bld opa_http_server.native - Run it with
_build/opa_http_server.native
You can disable:
- Install OPA: http://opalang.org
- Compile:
opa opa_hello.opa - Run:
./opa_hello.exe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Server.start( | |
| Server.http, | |
| [ { register : { doctype : { html5 } } }, | |
| { title : "hello", page : View.page } | |
| ] | |
| ) |
- Follow the tutorial: https://github.com/MLstate/opalang/wiki/Hello%2C-reCaptcha%2C-and-the-rest-of-the-world
- Read the source of the demo: https://github.com/MLstate/hello_recaptcha
Note: the demo uses the old bypass syntax, but you can use the new one with
opa --js-bypass-syntax jsdoc(we will release it in a future version). Example: https://github.com/MLstate/opalang/blob/master/lib/plugins/opabsl/jsbsl/bslClient.js
3 plugins:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| basket = Reactive.List.cloud([], Template.table_item, Template.table_empty) | |
| basket_summary = Reactive.List.clone(basket, Template.list_item, Template.list_empty) | |
| items_initial = [ "item1", "item2" ] | |
| items = items_initial ++ [ "item3", "item4 ] | |
| function fill(_) { List.iteri({ function(i,v) basket.add(make_item(i,v), i) }, items_initial) } | |
| function random() { | |
| cart_pos = Random.int(List.length(items_initial)) |