Re: [Caml-list] optional functions in modules

2012-05-10 Thread Yaron Minsky
Core's approach to this is to use options. (Technically, we use a type called Or_error.t, which has a useful error message in the error-variant, but it's the same idea.) On Thu, May 10, 2012 at 2:44 PM, Goswin von Brederlow goswin-...@web.de wrote: Yitzhak Mandelbaum yitzh...@cs.princeton.edu

Re: [Caml-list] Non-blocking IO interface design

2012-04-10 Thread Yaron Minsky
On Tue, Apr 10, 2012 at 4:21 AM, Daniel Bünzli daniel.buen...@erratique.ch wrote: Anil, Thanks for the analysis. The I/O loop is being called twice for the non-blocking version, as it receives the `Await signal, does the Unix syscall, and then jumps into decode_src. Presumably a full

Re: [Caml-list] concerning using of `deriving' syntactic plugin

2012-03-07 Thread Yaron Minsky
Are you familiar with type-conv and the family of syntax-extensions that go along with it? You can do thinks like: type t = { foo: int; bar: string } with sexp, compare, bin_io and automatically get sexp-conversion functions, a comparison function, and binary protocol converters. And

Re: [Caml-list] Custom let bindings

2012-01-20 Thread Yaron Minsky
We use monads quite a bit, and the lack of a monadic syntax has been a long-running issue for us at Jane Street. I'd love to see some kind of monadic syntax land. I've seen the proposal, and it seems highly plausible. Also, having a special operator (let!) has been proposed as part of this I

[Caml-list] Core (and associated libraries) on bitbucket!

2012-01-06 Thread Yaron Minsky
For those who are interested in getting a look at a development version of the next release of the Core suite of OCaml libraries, Core is now hosted on bitbucket. http://bitbucket.org/yminsky/ocaml-core/wiki/Home We're still working on making installation smoother and easier, as well as

Re: [Caml-list] Examples where let rec is undesirable

2012-01-03 Thread Yaron Minsky
For what it's worth, my feeling is that even if there weren't technical reasons to require the rec'' marking for recursive functions, I would want it as a language feature. Recursive definitions are harder to understand than non recursive ones, and it's helpful to have the static guarantee that

Re: [Caml-list] Hashtbl and security

2011-12-30 Thread Yaron Minsky
For just this reason, the hashtables in Core have been reimplemented to use an AVL tree in the buckets. That way, even when you have pathological collisions, you degrade gracefully to O(log n) per operation, instead of O(n), where n is the number of keys in the hashtable. y On Fri, Dec 30, 2011

Re: [Caml-list] Hashtbl and security

2011-12-30 Thread Yaron Minsky
, David Allsopp dra-n...@metastack.comwrote: Yaron Minsky wrote: For just this reason, the hashtables in Core have been reimplemented to use an AVL tree in the buckets. That way, even when you have pathological collisions, you degrade gracefully to O(log n) per operation, instead of O(n

Re: [Caml-list] [ANN] Async, a monadic concurrency library

2011-10-26 Thread Yaron Minsky
, 20:32 -0400 schrieb Yaron Minsky: While we're in the announcing mood, I wanted to announce the first public release of Async, Jane Street's monadic concurrency library. You can find out more about Async here: http://ocaml.janestreet.com/?q=node/100 y

Re: [Caml-list] [ANN] Async, a monadic concurrency library

2011-10-26 Thread Yaron Minsky
It's an excellent question, and one I don't yet have a good feel for. It would be great to find some kind of modus vivendi which would allow the libraries to interoperate. For now, it hasn't been too big of an issus, since the external libraries we've needed haven't been Lwt-based. But it would

Re: [Caml-list] [JOB] OCaml Developer at Jane Street

2011-10-25 Thread Yaron Minsky
Whoops. The link to the post on Async was busted, but it is now fixed. On Tue, Oct 25, 2011 at 6:25 PM, Yaron Minsky ymin...@janestreet.comwrote: Jane Street is looking to hire functional programmers for our offices in New York, London and Hong Kong. We're looking for both interns

[Caml-list] [ANN] Async, a monadic concurrency library

2011-10-25 Thread Yaron Minsky
While we're in the announcing mood, I wanted to announce the first public release of Async, Jane Street's monadic concurrency library. You can find out more about Async here: http://ocaml.janestreet.com/?q=node/100 y -- Caml-list mailing list. Subscription management and archives:

Re: [Caml-list] Dependent types ?

2011-09-26 Thread Yaron Minsky
As written, the behavior of the types might not be what you expect, since addition of two 16 bit ints may result in an int that requires 17 bits. When using phantom types, you need to be especially careful that the types mean what you think they mean. On Sep 26, 2011 8:13 AM, Denis Berthod

Re: [Caml-list] A limitation of with type declarations for first-class modules

2011-09-20 Thread Yaron Minsky
On Tue, Sep 20, 2011 at 5:03 PM, Alain Frisch alain.fri...@lexifi.comwrote: The important point is that package types (the ... in a type expression (module ...) or in an expression (module M : ...)) are not module types. Syntactically, they are indeed a subset of module types, but it is a

[Caml-list] A limitation of with type declarations for first-class modules

2011-09-19 Thread Yaron Minsky
For some reason, 1st-class modules have more restrictive with syntax, which turns out to be a practical problem. The main constraint is that with constraints do not seem to be able to refer to sub-modules. Consider the following code snippet: module type Foo = sig type t end module