Very interesting, and a good way to learn the basics and get the feel
of the language. Maybe Shen can have something like this once the
Javascript target is ready.
--
BD
--
You received this message because you are subscribed to the Google Groups "Qilang" group.
To post to this group, send email to qil...@googlegroups.com.
To unsubscribe from this group, send email to qilang+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/qilang?hl=en.
Hey Willi. The results are on the second line, what you mentioned is
the auto-correction you get from your inputs.
# 1;;
- : int = 1
# 1 + 2;;
- : int = 3
# arse;;
Characters 0-4:
Error: Unbound value arse
# let arse = 1;;
val arse : int = 1
# arse + arse;;
- : int = 2
The reason 12345678910 doesn't work is that OCaml numbers aren't
arbitrary precision (those are part of the standard library, but
"normal" numbers are limited)
To start the with the lessons type: lesson 1.
But don't worry about OCaml!! it was the in-browser REPL that I wanted
to show. Here are more examples of the same concept:
http://tryruby.org/
http://tryhaskell.org/
http://tryclj.com/
http://tryarc.org/
http://www.tryerlang.org/
http://tryjavascript.devfu.com/
http://www.trypython.org/ (this one requires silverlight)
What is interesting about the OCaml one is that what you see there is
the same REPL you get when running OCaml locally, but this one runs
completely in-browser. It was compiled with js_of_ocaml[1], which is a
tool that compiles OCaml bytecode to Javascript, and seems to work
pretty well. Because Shen will target Javascript too, the same should
be doable.
Others just launch a REPL on the server and interact with it,
something that doesn't convince me (because of security issues, and
because it needs more resources).
[1] http://ocsigen.org/js_of_ocaml/
--
BD
They use this tool: http://ocsigen.org/js_of_ocaml/
It compiles bytecode generated by the OCaml compiler (the one that
doesn't generate native code) to Javascript.
--
BD
Oh, but thats a float. You can't do the same with integers unless you
are using the Num module.
http://caml.inria.fr/pub/docs/manual-ocaml/libref/Num.html
--
BD
--
BD