Re: ocamlopt LLVM support (Was: [Caml-list] OCamlJIT2 vs. OCamlJIT)
On Dec 5, 2010, at 23:34 , Erik de Castro Lopo wrote: Benedikt Meurer wrote: Using a different data representation within OCaml would indeed be possible, but one has to ask what it's worth? Is it necessary to use a different data representation? What does that buy you? Read my mail again please, it was all about the data representation issues. the standard library and the bytecode interpreter (already a massive amount of work), Why? Because you want to keep the bytecode interpreter in sync, otherwise you can no longer share any piece of C code between ocamlopt and ocaml/ocamlrun. but you also loose compatibility with almost every existing OCaml library binding, since the native function interface will be different. That's a hell of a lot of work for many people. Again, why? When the GHC haskell compiler gained an LLVM backend, the LLVM project accepted changes to allow a new GHC specific calling convention. Couldn't the same be done for Ocaml? This is not about calling conventions, and also not about LLVM. This is about data representation. 3. The current garbage collector is mostly straight-forward because of There is no need to use LLVM's GC if something better already exists. LLVM does not provide a GC. Two main areas for now: The GC interface and the exception handling. If the Ocaml versions of these are already better than what LLVM can provide, here is no reason to use the LLVM versions. It isn't as simple. With LLVM you are no longer in control of the code generation. The ocaml versions use special registers and stack layout, which will not work with LLVM's code generation unless LLVM is patched appropriately. Erik Benedikt ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] GADT constructor syntax
Hi, On Sat, Dec 04, 2010 at 08:25:07PM +0100, Jacques Le Normand wrote: option a) type _ t = TrueLit : bool t | IntLit of int : int lit option b) type _ t = TrueLit : bool t | IntLit : int - int lit For a: A little bit easier to parse (as a Camlp5 designer), which is just a parse of the 'of' part followed (or not) with the ':' and another type. In the option b), in the revised syntax version, I decided to also separate the constructor parameters with arrows, which forced me to add a function separating the ending type, the parsing being therefore more complicated. For b: 1/ The difference between normal constructors and constructors with GADT is very visible. All examples given here are often with definitions which are relatively short, but I tried an example with constructors with several long types and I like the idea of seing immediately that they are GADTs, rather at the end of the definition line (or lines). 2/ I like the idea of defininig them with a syntax like the one of functions definitions, like 'val'. In the revised syntax version, where the constructors parameters are in curried form, this is even more readable (even if partially applied parameters are not accepted in the OCaml compiler). PS The latest version of Camlp5 works with Jacques' version. You can download it at: http://pauillac.inria.fr/~ddr/camlp5/ PPS The version with GADT is very interesting to parse parsing rules. I is what I was searching for many years. In Camlp[45], the EXTEND statement generates calls to Obj.magic and types constraints to extend the OCaml type system. (This cannot be simulated by first class modules.) -- Daniel de Rauglaudre http://pauillac.inria.fr/~ddr/ ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: ocamlopt LLVM support (Was: [Caml-list] OCamlJIT2 vs. OCamlJIT)
On Sun, Dec 05, 2010 at 05:37:32PM +0100, Benedikt Meurer wrote: 1. You will have to rewrite not only the compiler, the standard library and the bytecode interpreter (already a massive amount of work), but you also loose compatibility with almost every existing OCaml library binding, since the native function interface will be different. That's a hell of a lot of work for many people. It might kick-start efforts to automatically generate bindings, at least to C code, which wouldn't be a bad thing. camlidl is clumsy and doesn't handle a very important case (pointers to handles) so it's not really useful for this. I do agree with the rest of your points though, and it's good to have intelligent discussion of the real issues at long last. Rich. -- Richard Jones Red Hat ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
RE: [Caml-list] help with regular expression
zaid Khalid wrote: Hi Folks I want some help in writing regular expressions in Ocaml, as I know how to write it in informal way but in Ocaml syntax I can not. For example I want to write a* | (aba)* . This question would better be posted on the beginners' list - http://caml.inria.fr/resources/forums.en.html#id2267683 Regular Expressions can be done using the Standard Library with the Str module (as you've found) - see http://caml.inria.fr/pub/docs/manual-ocaml/libref/Str.html so your expression above (assuming you have loaded/linked str.cm[x]a) is Str.regexp a*\\|\\(aba\\)*. The language of regexps is given in the docs for Str.regexp function. Remember to escape backslash characters as the regular expression is given in an OCaml string (so to escape a backslash in your regexp you have to write ). Another question if I want the string to be matched against the regular expression to be matched as whole string not as substring what symbol I need to attach to the substring, i.e if I want only concrete strings accepted (like ( , a , aa , aaa, aba, abaaba), but not ab or not abaa). Use ^ and $ at the beginning and end of your regexp to ensure that it matches the entire string only - ^\\(a*\\|\\(aba\\)*\\)$ Hint I am using (Str.regexp) There are other libraries (e.g. pcre-ocaml) which provide different (I would say more powerful, rather than strictly better!) implementations. David ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
[Caml-list] Re: help with regular expression
On 06-12-2010, David Allsopp dra-n...@metastack.com wrote: zaid Khalid wrote: Hint I am using (Str.regexp) There are other libraries (e.g. pcre-ocaml) which provide different (I would say more powerful, rather than strictly better!) implementations. There is also syntax extension like mikmatch, that helps to write regexp in a very meaningful syntax: match str with | RE bol a* | ab* eol - true | _ - false http://martin.jambon.free.fr/mikmatch-manual.html http://martin.jambon.free.fr/mikmatch.html You can use pcre and str with mikmatch. Regards, Sylvain Le Gall ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
[Caml-list] International Workshop on Intermediate Representations (WIR 2011)
Dear functional friends Here's the Call for Papers for a new Workshop on Intermediate Representations. I expect it to get a lot of papers about the JVM and program dependence graphs, but the Chair explicitly wants papers about intermediate representations for functional programs, both typed and untyped. So, do me a favour :-) and submit your paper, lest I get landed with a mountain of SSA papers to review. (Yes, SSA is just CPS in disguise. But the disguise is heavy.) The deadline is rather short: Jan 21. Happy Christmas! Simon == Call for Papers International Workshop on Intermediate Representations (WIR 2011) Co-located with CGO 2011, April 2/3 2011 in Chamonix, France http://researchr.org/conference/wir-2011 Description === The intermediate representation is the core of any program transformation tool. Its design has a significant impact on the simplicity, efficiency, and effectiveness of program transformations. The developments in concurrent programming, integrated development environments, and domain-specific languages pose new requirements on intermediate representations. This workshop provides a forum to discuss current trends and experiences in the design, implementation, and application of intermediate representations. Topics of Interest == The list of topics includes, but is not limited to: * intermediate representations for o parallelism and concurrency o instrumentation o JIT compilation o compiler verification o domain-specific languages o refactoring o integrated development environments * functional intermediate representations for imperative programs * translation to, and code generation from an IR * modeling low-level machine details in IRs * impact of IR on the precision of static analyzers * representing static analysis results in an IR * origin tracking Submission == We solicit submission of original papers on topics relevant to intermediate representations. Papers should be formatted in SIGPLAN Proceedings Format, 9 point font, and be at most 8 pages in length. * http://www.acm.org/sigs/sigplan/authorInformation.htm Selected papers will be published in the ACM digital library (to be confirmed). Papers should be submitted electronically with easychair: * http://www.easychair.org/conferences/?conf=wir2011 Important Dates === * Submission: January 21, 2011 * Notification: February 25, 2011 * Camera-ready: March 18, 2011 * Workshop: April 2/3, 2011 Organizers == * Florent Bouchez * Sebastian Hack * Eelco Visser Program Committee = * Florent Bouchez (chair) * Martin Bravenboer * Albert Cohen * François de Ferrière * Robert Fuhrer * Sebastian Hack (chair) * Andrew Kennedy * Sorin Lerner * Nathaniel Nystrom * Simon Peyton Jones * Tijs van der Storm * Eelco Visser (chair) ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
[Caml-list] Memory management job
Dear Haskellers and Camlers I'm posting this job ad on behalf of Richard Brooksby at Ravenbrook. They do cool stuff, and I thought some of you might be interested. Simon Ravenbrook is seeking a developer to work with us on the Memory Pool System (MPS), a mature, open source, high reliability, high performance memory management system with a unique and innovative architecture. You can read an overview here http://www.ravenbrook.com/project/mps/doc/2002-01-30/ismm2002-paper/ismm2002.html. The MPS is a highly engineered Swiss watch of a system with an extremely low bug rate. We're looking for someone who can support our commercial clients with customisations, but also develop the MPS for new opportunities. It could be a half-time position (or subcontract), paying about £35k pro rata. This could grow if you are successful in developing new commercial opportunities for the MPS. We have several other options for work structure and payment that we can discuss with you. There can be a great deal of flexibility and a higher rate of pay depending on what kind of risk/reward tradeoff you need. Ask! This is an excellent opportunity for someone interested in memory management and garbage collection research. We are keen to promote research, and the flexible nature of this work would allow time for it. It's also an excellent opportunity for someone interested in developing commercial applications for memory management and garbage collection. There would also be an opportunity to get involved with our other consulting work, or even video game development. Essential requirements: * you will mostly need to work at our office in Cambridge, UK * you will need to start early in 2011 * highly professional attitude to quality, reliability, and commercial relationships * able to self-start, plan, and manage yourself * excellent verbal and written technical communication skills * excellent knowledge of ISO/IEC 9899:1990 and ISO/IEC 9899:1999. (Oh OK then, I mean C.) * good understanding of operating systems and memory management * understanding of processor architectures and assembly language Also very useful: * some compiler and language run-time development experience * good understanding of threads, concurrency, and race/hazard issues * some low level systems and embedded systems experience * low-level Unix (including Mac) and Windows programming * some experience in soft real-time systems * keen interest in programming languages, compilers, provability Address in sig. Do get in touch. PLEASE NOTE: Generic CVs and resumes as Word document attachments will be trashed. Explain why you might be good for us, in plain text or on the phone. Thanks! --- Richard Brooksby r...@ravenbrook.commailto:r...@ravenbrook.com Director Ravenbrook Limited http://www.ravenbrook.com/ PO Box 205, Cambridge CB2 1AN, United Kingdom Voice: +44 777 9996245 Fax: +44 1223 750036 ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] Pre-compiled ocaml binary for windows
Hello, On 2010-12-03, at 21:06, José Romildo Malaquias wrote: Hello. I am looking for a binary release of the latest ocaml compiler for Windows. From the OCaml home page I can find only an older version (3.11.0). Where can I find the latest version? It depends on which port you want. For Cygwin, there is an up-to-date cygwin package. For the other ports, we are looking for volunteers to compile and publish the binaries. -- Damien ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
[Caml-list] Re: Pre-compiled ocaml binary for windows
Hello, On 06-12-2010, Damien Doligez damien.doli...@inria.fr wrote: Hello, On 2010-12-03, at 21:06, José Romildo Malaquias wrote: Hello. I am looking for a binary release of the latest ocaml compiler for Windows. From the OCaml home page I can find only an older version (3.11.0). Where can I find the latest version? It depends on which port you want. For Cygwin, there is an up-to-date cygwin package. For the other ports, we are looking for volunteers to compile and publish the binaries. There is a start a .msi packaging of OCaml + flexdll + findlib: https://forge.ocamlcore.org/projects/ocaml-installer/ http://hg.ocamlcore.org/cgi-bin/hgwebdir.cgi/ocaml-installer/ocaml-installer/ There are still problem and we are lacking a bit of time to finish it. But hopefully, it will be finished one day. If anyone have time/knowledge, we will be happy if he joins the OCaml Windows Installer project. Regards, Sylvain Le Gall ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] Re: Pre-compiled ocaml binary for windows
Hello, There are still problem and we are lacking a bit of time to finish it. could you explain the problems remaining? Thanks for all your efforts Matt ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
RE: ocamlopt LLVM support (Was: [Caml-list] OCamlJIT2 vs. OCamlJIT)
Richard Jones wrote: It might kick-start efforts to automatically generate bindings, at least to C code, which wouldn't be a bad thing. camlidl is clumsy and doesn't handle a very important case (pointers to handles) so it's not really useful for this. Yes, LLVM is ideal for this. Using LLVM to JIT compile OCaml-C interop stubs should be quite easy. I did a bit of this in some of the OCaml Journal article that were on LLVM. You could also kill two birds with one stone by creating an OCaml-HLVM bridge with it. That would make it easier to create a bigarray from OCaml and call into high-performance parallel numerical code to chomp on it. Cheers, Jon. ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs
Re: [Caml-list] Re: help with regular expression
On 12/06/10 05:11, Sylvain Le Gall wrote: On 06-12-2010, David Allsopp dra-n...@metastack.com wrote: zaid Khalid wrote: Hint I am using (Str.regexp) There are other libraries (e.g. pcre-ocaml) which provide different (I would say more powerful, rather than strictly better!) implementations. There is also syntax extension like mikmatch, that helps to write regexp in a very meaningful syntax: match str with | RE bol a* | ab* eol - true | _ - false If I understand correctly the original problem, the solution is: match str with | RE (a* | aba*) eos - (* matches always the beginning of the string, eos enforces a match at the end of the string, and the vertical bar has the lowest priority and so parentheses are needed. *) true | _ - false http://martin.jambon.free.fr/mikmatch-manual.html http://martin.jambon.free.fr/mikmatch.html You can use pcre and str with mikmatch. I would recommend the pcre variant mostly for one feature that is not provided by str: lazy quantifiers, i.e. repeat as little as possible before trying to match what comes next. Martin ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs