Questions tagged [metaocaml]

"MetaOCaml is a multi-stage extension of the OCaml programming language, and provides three basic constructs called Brackets, Escape, and Run for building, combining, and executing future-stage computations, respectively. ... MetaOCaml is a compiled dialect of MetaML." - from the MetaOCaml home page

MetaOcaml is a language based on OCaml that provides additional support for metaprogramming. It works with the concept of "staged computing," where each stage is more abstract than the stage below it. For example, most programming languages produce only single-stage programs, but a two stage program would be a program that takes some input and uses that to generate a single-state program. Related in some ways to macros, but with a type system. MetaOCaml includes a type system that is stage-aware.

The MetaOCaml homepage is http://www.metaocaml.org/

9 questions
9
votes
0 answers

Run MetaOCaml code

I have just installed BER MetaOCaml with the following : $ opam update $ opam switch 4.02.1+BER $ eval `opam config env` and I am not able to run MetaOCaml code in tuareg toplevel or simply ocaml toplevel. Following code : let a =…
8
votes
1 answer

Another limitation of F# quotations?

Earlier today I encountered a limitation of F# quotations, and asked a question about it here: F# quotations: variable may escape scope Now, I may have encountered another limitation when converting examples appearing in…
Lasse Espeholt
  • 17,622
  • 5
  • 63
  • 99
7
votes
1 answer

Concoqtion (Coq + MetaOCaml) - why abandoned?

Before bugging people on the OCaml mailing list, I thought I might post my question here. I just discovered this beauty (link to Concoqtion website). Concoqtion is an extension of MetaOCaml which allows indexed types (and perhaps a lot more). With…
Olle Härstedt
  • 3,799
  • 1
  • 24
  • 57
5
votes
1 answer

F# quotations: variable may escape scope

I have this bit of code: let rec h n z = if n = 0 then z else <@ (fun x -> %(h (n - 1) <@ x + %z @>)) n @> converted from a MetaOcaml example in http://www.cs.rice.edu/~taha/publications/journal/dspg04a.pdf In the paper there is…
Lasse Espeholt
  • 17,622
  • 5
  • 63
  • 99
3
votes
1 answer

Is it possible to set up Merlin environment for MetaOCaml?

Is it possible to set up Merlin environment for MetaOCaml?
objmagic
  • 1,028
  • 1
  • 9
  • 18
2
votes
1 answer

MetaOCaml : Can't run code from brackets

I am trying MetaOCaml, so I have made this fantastic code : #let a = .<1>.;; val a : int code = .<1>. # let b = !. a;; Error: Unbound value !. # let b = .!a;; Error: Syntax error Why doesn't it work ? Also, I have tried !. and .! because I have…
1
vote
1 answer

Inserting let to bind a local variable

I'm working through Oleg Kiselyov's tutorial Reconciling Abstraction with High Performance: A MetaOCaml approach. One exercise (exercise 23) asks for a let-insertion to bind an array index access to a local variable. The function of question is…
rem
  • 893
  • 4
  • 18
1
vote
0 answers

MetaOCaml staging annotation syntax highlighting in Emacs using tuareg-support-metaocaml

TL:DR; I would like MetaOCaml syntax highlighting in Emacs, but the relevant option has no effect. What can I do? I'm pretty new to Emacs, but have been using MetaOCaml for a while. I installed opam 1.3.1-r1 and emacs 25.2 through my distribution's…
Alex
  • 121
  • 4