[Caml-list] Transition to OCaml 3.11.1 in Ubuntu Karmic Koala completed!

2009-08-19 Thread David MENTRE
Hello,

I am very pleased to announce that transition to OCaml 3.11.1 in
Ubuntu Karmic is now completed!
  
http://bentobako.org/ubuntu-ocaml-status/transition_monitor/ocaml_transition_monitor.html

Many thanks to (in order of appearance):

 * Ubuntu side:
   James Wetsby
   Andrea Gasparini
   Michael Bienia
   Steve Kowalik
   Jonathan Riddell
   Stefan Lesicnik

 * Debian side:
Stefano Zacchiroli
Stéphane Glondu
Mehdi Dogguy
Sylvain Le Gall

And of course all the Debian and Ubuntu developers that work so hard
on OCaml support and have helped me doing this transition!

Currently, most of OCaml packages is Debian unstable are available in Karmic:
  http://bentobako.org/ubuntu-ocaml-status/raw/compare-unstable-karmic.html

[ I have requested a synchronization for react and pgocaml. ]

Sincerely yours,
d.

___
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] Jane Street is hiring (as if you didn't already know)

2009-08-19 Thread Florian Hars
Erik de Castro Lopo schrieb:
 The Linux kernel which is the one I am interested in is C only.

The kernel I linked to is in C, too (well, 7500 lines of C accompanied 
by 20 lines of proof that the C actually implements the formal
specification automatically generated from the Haskell prototype).
And it can more or less run Linux as a personality.

- Florian.

___
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] ocaml for the Semantic Web

2009-08-19 Thread Sebastien Ferre

Hi,

I am also interested in processing semantic web languages in OCaml,
and I haven't found anything yet.
Some months ago, I wrote a parser for RDF files (using Xml-light).
This cannot be considered as an API for RDF, but the hard work of
analysing the RDF-XML is done (source file as attachment).

Sébastien

tumenjargal tsagaan wrote:

Hi,

(1) is there any specialized APIs for processing RDF as well as OWL file?
(2) is there any similar API in Ocaml like XML-parsers from Java world?

Thank you.

Tumee.





___
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
(*
   Extracting RDF statements from the XML structure
   generated by the library 'xml-light'.

   Author: Sébastien Ferré fe...@irisa.fr
   Creation: 11/02/2009

*)

type uri = string
type id = string
type lang = string
type datatype = Plain of lang | Typed of uri
type thing = URI of uri | XMLLiteral of Xml.xml | Literal of string * datatype 
| Blank of id
type property = uri

type tree = Node of thing * (property * (uri option * tree)) list
type rdf = {
xmlns : (string * string) list;
trees : tree list
  }

(* accessors *)

let subject (Node (s, _)) = s

let properties (Node (_, ps)) = ps

let all_objects (Node (_, ps)) p = List.fold_right (fun (p', (_,o')) res - if 
p' = p then o'::res else res) ps []

let statement (Node (_, ps)) p o =
  let (_, (uri, _)) = List.find (fun (p', (uri', Node (o', _))) - p' = p  o' 
= o) ps in
  uri

(* RDF vocabulary *)

(* namespace *)
let namespace = http://www.w3.org/1999/02/22-rdf-syntax-ns#;
(* classes *)
let _XMLLiteral = rdf:XMLLiteral
let _Property = rdf:Property
let _Statement = rdf:Statement
let _Bag = rdf:Bag
let _Set = rdf:Set
let _Alt = rdf:Alt
let _List = rdf:List
(* properties *)
let _type = rdf:type
let _first = rdf:first
let _rest = rdf:rest
let _value = rdf:value
let _subject = rdf:subject
let _object = rdf:object
let _predicate = rdf:predicate
let _n n = rdf:_ ^ string_of_int n
(* ressources *)
let _nil = rdf:nil

(* parsing *)

type parse_ctx = { base : string; lang : string}

exception Failure
exception Error

let parse_list p l =
  List.rev
(List.fold_left
   (fun res x - try p x :: res with _ - res)
   [] l)

let default_ctx = { base = ; lang = }

let get_ctx previous_ctx e =
  { base = (try Xml.attrib e xml:base with _ - previous_ctx.base);
lang = (try Xml.attrib e xml:lang with _ - previous_ctx.lang)}

let resolve ctx rel =
  if String.contains rel ':'
  then rel
  else ctx.base ^ rel

let resolve_tag ctx tag =
  if String.contains tag ':'
  then tag
  else ctx.base ^ # ^ tag

let isCoreSyntaxTerm x =
  List.mem x [rdf:RDF; rdf:ID; rdf:about; rdf:parseType; 
rdf:resource; rdf:nodeID; rdf:datatype]

let isSyntaxTerm x =
  isCoreSyntaxTerm x || List.mem x [rdf:Description; rdf:li]

let isOldTerm x = List.mem x [rdf:aboutEach; rdf:aboutEachPrefix; 
rdf:bagID]

let isNodeElementURI x = not (isCoreSyntaxTerm x || x = rdf:li || isOldTerm x)
let isPropertyElementURI x = not (isCoreSyntaxTerm x || x = rdf:Description 
|| isOldTerm x)
let isPropertyAttributeURI x = not (isCoreSyntaxTerm x || x = rdf:Description 
|| x = rdf:li || isOldTerm x)

let rec parse_RDF e =
  if Xml.tag e = rdf:RDF
  then {
xmlns =
  List.fold_right
  (fun (a,v) res -
let i = try String.index a ':' with _ - String.length a in
if String.sub a 0 i = xmlns
then
  let ns =
if i = String.length a
then 
else String.sub a (i+1) (String.length a - (i+1)) in
  (ns,v)::res
else res)
  (Xml.attribs e) [];
trees =
  let ctx = get_ctx default_ctx e in
  parse_list (parse_nodeElement ctx) (Xml.children e)
  }
  else raise Failure

and parse_nodeElement previous_ctx e =
  let tag = Xml.tag e in
  let ctx = get_ctx previous_ctx e in
  if isNodeElementURI tag
  then
let subject =
  try URI (resolve ctx (# ^ Xml.attrib e rdf:ID)) with _ -
  try Blank (Xml.attrib e rdf:nodeID) with _ -
  try URI (resolve ctx (Xml.attrib e rdf:about)) with _ -
  Blank  in
let properties =
  (if tag = rdf:Description then [] else [(_type, (None, Node (URI 
(resolve_tag ctx tag), [])))]) @
  parse_list (parse_propertyAttr ctx) (Xml.attribs e) @
  parse_list (parse_propertyElt ctx (ref 0)) (Xml.children e) in
Node (subject, properties)
  else raise Failure

and parse_propertyAttr ctx (a,v) =
  if isPropertyAttributeURI a
  then
if a = _type
then (a, (None, Node (URI (resolve ctx v), [])))
else (a, (None, Node (Literal (v, Plain ctx.lang), [])))
  else raise Failure

and parse_propertyElt previous_ctx cpt e =
  incr cpt;
  let tag = match Xml.tag e with rdf:li - _ ^ 

[Caml-list] Re: OCaml and kernels

2009-08-19 Thread Alexander Danilov

Richard Jones пишет:
[skip]

There are some missing features to really make it possible though:

 - inline assembly

 - support for ELF (eg. putting code/data directly into named sections)

 - bit fields / bit twiddling (can probably be done with macros)

 - better optimization of int32 and int64 types


[skip]

+ out of box support for native executables creation for win32/mingw

+ convenient compiler interface, example - ghc --make main.hs

Because of these two missing features, today I choose sbcl over ocaml to create
small I/O and calculation intensive task, unfortunately.

___
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: OCaml and kernels

2009-08-19 Thread Richard Jones
On Wed, Aug 19, 2009 at 09:43:18PM +0900, Alexander Danilov wrote:
 + out of box support for native executables creation for win32/mingw

Not sure what you mean here, because I've built Win32 native
executables from OCaml using both the INRIA-supplied binaries and our
cross-compiler.  Works perfectly well out of the box.

 + convenient compiler interface, example - ghc --make main.hs

?  ocamlfind?

Anyway, GCC lacks both of these features and yet is still used
to compile the Linux kernel, so I'm not sure what this has to
do with kernels.

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] Re: OCaml and kernels

2009-08-19 Thread Alain Frisch

Richard Jones wrote:

On Wed, Aug 19, 2009 at 09:43:18PM +0900, Alexander Danilov wrote:

+ out of box support for native executables creation for win32/mingw


Not sure what you mean here, because I've built Win32 native
executables from OCaml using both the INRIA-supplied binaries and our
cross-compiler.  Works perfectly well out of the box.


I guess Alexander means that ocamlopt requires external tools (assembler 
and linker). This can be an issue since masm/link cannot be 
redistributed (and cannot be found in a standalone package, not embedded 
in a full Visual Studio installation) and some people are reluctant to 
redistribute or install gas/ld (for whatever reason).


FWIW, we faced this problem at LexiFi, so we developed a direct COFF/x86 
backend for ocamlopt (just a straightforward replacement for emit_nt.mlp 
that produces x86 opcodes and put them in a .obj file). This avoids the 
need for an external assembler. We also extended flexlink with a 
stand-alone mode in order to produce DLLs from COFF files without 
relying on an external linker. This is enough to build .cmxs files from 
OCaml code, and this was enough for our needs. To produce an executable, 
more work would be needed on flexlink.



-- Alain


___
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