fraggle_laptop has quit [Remote host closed the connection]
csakatoku has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 248 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
osnr1 has joined #ocaml
darkf has joined #ocaml
osnr has quit [Ping timeout: 256 seconds]
ygrek has joined #ocaml
csakatok_ has joined #ocaml
amiller_ has joined #ocaml
Asmadeus_ has joined #ocaml
vbmithr_ has joined #ocaml
tchell_ has joined #ocaml
rks`_ has joined #ocaml
adrien_ has joined #ocaml
csakatoku has quit [*.net *.split]
skchrko has quit [*.net *.split]
Asmadeus has quit [*.net *.split]
amiller has quit [*.net *.split]
tchell has quit [*.net *.split]
vbmithr has quit [*.net *.split]
rks` has quit [*.net *.split]
adrien has quit [*.net *.split]
zpe has joined #ocaml
skchrko has joined #ocaml
bobry_ has joined #ocaml
pootler has quit [Ping timeout: 246 seconds]
orbitz_ has joined #ocaml
thelema_ has joined #ocaml
Brocoli_ has joined #ocaml
pootler_ has quit [Ping timeout: 268 seconds]
patronus_ has joined #ocaml
maxibolt has joined #ocaml
bobry has quit [Ping timeout: 264 seconds]
Armael has quit [Ping timeout: 264 seconds]
orbitz has quit [Ping timeout: 264 seconds]
patronus has quit [Ping timeout: 264 seconds]
thizanne has quit [Ping timeout: 264 seconds]
PM has quit [Ping timeout: 264 seconds]
Arthur_ has quit [Ping timeout: 264 seconds]
thelema has quit [Ping timeout: 264 seconds]
Arthur has joined #ocaml
yroeht has quit [Ping timeout: 264 seconds]
PM has joined #ocaml
bobry_ is now known as bobry
yroeht has joined #ocaml
Neros_ has joined #ocaml
BiDOrD_ has joined #ocaml
zpe has quit [Ping timeout: 248 seconds]
hyperbor1ean has joined #ocaml
gbluma_ has joined #ocaml
pootler has joined #ocaml
pootler_ has joined #ocaml
jpdeplaix` has joined #ocaml
ollehar has quit [Ping timeout: 248 seconds]
noplamodo_ has joined #ocaml
gnuvince- has joined #ocaml
skchrko has quit [*.net *.split]
Neros has quit [*.net *.split]
cdidd has quit [*.net *.split]
hyperboreean has quit [*.net *.split]
noplamodo has quit [*.net *.split]
jpdeplaix has quit [*.net *.split]
BiDOrD has quit [*.net *.split]
gbluma has quit [*.net *.split]
deavid has joined #ocaml
orbitz has joined #ocaml
cthuluh_ has joined #ocaml
orbitz_ has quit [*.net *.split]
gnuvince has quit [*.net *.split]
willb1 has quit [*.net *.split]
transfinite has quit [*.net *.split]
brendan has quit [*.net *.split]
deavidsedice has quit [*.net *.split]
cthuluh has quit [*.net *.split]
whitequark has quit [*.net *.split]
alang has quit [*.net *.split]
zorun has quit [*.net *.split]
cdidd has joined #ocaml
osnr1 has quit [Quit: Leaving.]
brendan has joined #ocaml
willb1 has joined #ocaml
transfinite has joined #ocaml
anemator has joined #ocaml
<anemator>
does anyone know a good of way of handling ~/.ocamlinit on a system with multiple ocaml installs (courtesy of opam)?
zpe has joined #ocaml
<anemator>
basically i have certain i have third-party libraries installed on one ocaml install and no third party libraries installed on another ocaml install, so the the '#use', '#require', etc. lines crap out on the latter
pootler_ has quit [Ping timeout: 248 seconds]
pootler has quit [Ping timeout: 248 seconds]
pootler has joined #ocaml
pootler_ has joined #ocaml
osnr has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
iZsh has quit [Ping timeout: 245 seconds]
whitequark has joined #ocaml
alang has joined #ocaml
zorun has joined #ocaml
ggole has joined #ocaml
Neros_ has quit [Ping timeout: 268 seconds]
zpe has joined #ocaml
iZsh has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
osnr has quit [Quit: Leaving.]
ben_zen has quit [Quit: leaving]
watermind has quit [Quit: Konversation terminated!]
chrisdotcode has quit [Ping timeout: 264 seconds]
anemator has quit [Quit: Page closed]
zpe has joined #ocaml
zpe has quit [Ping timeout: 256 seconds]
csakatoku has joined #ocaml
csakatok_ has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
zpe has quit [Ping timeout: 276 seconds]
adrien_ is now known as Guest61291
Arthur is now known as Guest79661
ygrek is now known as Guest14175
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
introom has joined #ocaml
zpe has joined #ocaml
weie has quit [Read error: Connection reset by peer]
weie has joined #ocaml
zpe has quit [Ping timeout: 276 seconds]
Asmadeus_ is now known as Asmadeus
introom has quit [Remote host closed the connection]
introom has quit [Remote host closed the connection]
osnr has quit [Quit: Leaving.]
zpe has quit [Ping timeout: 256 seconds]
zpe has joined #ocaml
hto has quit [Quit: Lost terminal]
dfarmer has quit [Ping timeout: 245 seconds]
Arsenik has joined #ocaml
bobry has quit []
bobry has joined #ocaml
milosn has quit [Ping timeout: 246 seconds]
raichoo has joined #ocaml
<whitequark>
is there uhh.. a way to get the memory address of an object in ocaml?
<whitequark>
considering it, I think, does not use a moving GC?
<whitequark>
I'm not actually going to do anything with it; it's just a visual way to represent object identity in pretty-printing
csakatoku has quit [Remote host closed the connection]
Arsenik has quit [Remote host closed the connection]
introom has joined #ocaml
introom has quit [Remote host closed the connection]
<whitequark>
seems like let addr : int = Obj.magic obj; works
<ggole>
Don't do that
<ggole>
Addresses are not stable in OCaml
<whitequark>
ah I see
domsj has quit [Read error: Operation timed out]
csakatoku has joined #ocaml
<ggole>
Also, Obj.magic is evil
<whitequark>
so?
<whitequark>
if one understands it constraints, it's safe to use
<whitequark>
> If you have files that must elude the hygiene squad, just tag them with precious or not_hygienic.
<whitequark>
precious
<whitequark>
lol.
introom has joined #ocaml
thomasga has joined #ocaml
csakatoku has quit [Remote host closed the connection]
csakatoku has joined #ocaml
introom has quit [Remote host closed the connection]
eikke has joined #ocaml
<flux>
it is the same as in GNU Make
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
zpe has quit [Remote host closed the connection]
ben_zen has joined #ocaml
ttamttam has joined #ocaml
csakatoku has quit [Remote host closed the connection]
yezariaely has joined #ocaml
<yezariaely>
I want to introduce smart constructors to built ctors of an algebraic data type but still want to allow pattern matching. Is it possible to only disallow direct creation but still allow pattern matching somehow?
<thomasga>
look at 'private' types
<flux>
it's nice when there are language features that directly respond to one's needs ;)
beckerb has joined #ocaml
ontologiae_ has joined #ocaml
introom has joined #ocaml
<yezariaely>
thomasga: a very nice!
<yezariaely>
a = ah
domsj has joined #ocaml
Kakadu has joined #ocaml
Simn has joined #ocaml
introom has quit [Ping timeout: 264 seconds]
Kakadu_ has joined #ocaml
Kakadu has quit [Read error: Connection reset by peer]
snearch has joined #ocaml
wwilly has joined #ocaml
csakatoku has joined #ocaml
<wwilly>
bonjour
<yezariaely>
wow private types are cool
Snark has joined #ocaml
ontologiae has joined #ocaml
ontologiae_ has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
zpe has joined #ocaml
<yezariaely>
just curious: what is the advantage of requiring to annotate recursive functions with rec? over just handling all of them as recursive functions? Couldn't one just "check" if they are used recursively?
Arthur_ has joined #ocaml
<gasche>
non-recursive bindings can use previous bindings of the same name before shadowing them
<gasche>
let length x = normalize (length x)
<gasche>
yezariaely: you can't do that if you assume implicit "rec" everywhere
<yezariaely>
ah sure. thanks for the pointer.
<gasche>
I believe that any binding form should have *both* a non-recursive and a recursive variant (the recursive one only when it makes sense, of course)
<yezariaely>
yes, that makes sense
<gasche>
whichever is the least-effort syntactic default is a style question; you could make "let" recursive and have "let nonrec"
introom has joined #ocaml
Kakadu_ has quit []
noplamodo has joined #ocaml
milosn_ has joined #ocaml
Neros_ has joined #ocaml
cthuluh has joined #ocaml
eikke_ has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
milosn has quit [*.net *.split]
eikke has quit [*.net *.split]
Neros has quit [*.net *.split]
cthuluh_ has quit [*.net *.split]
noplamodo_ has quit [*.net *.split]
Guest79661 has quit [*.net *.split]
snearch has quit [Quit: Verlassend]
UncleVasya has joined #ocaml
eikke_ is now known as eikke
<ggole>
I admit, I curse a little every time I forget the 'rec'.
<ggole>
Happens all the time :/
<yezariaely>
that was the origin of my question ;-)
<whitequark>
use coffeescript!
<whitequark>
it doesn't have shadowing. at all.
<yezariaely>
lol
<whitequark>
the author thinks it is unnecessary and confusing.
<Armael>
: d
<yezariaely>
i.e. one cannot define the same variable twice or what is the semantics?
<whitequark>
yeah. if a variable is defined in some outer scope, then consequental bindings will just mutate it
<whitequark>
(and close over it)
<yezariaely>
that is like in imperative languages?
<flux>
hmm, I suppose to do 'caml_failwith' with a dynamically allocated string you need to allocate an ocaml string etc?
<gasche>
flux: caml_failwith from fail.h takes a C string as parameter
<flux>
yes, but if I dynamically allocate it with (say) strdup, it will introduce a memory leak?
<flux>
as I have no opportunity to release the string
<flux>
caml_(failwith|invalidarg|etc)_printf would fill that niche nicely ;)
<gasche>
you can also use caml_raise_with_arg to pass a ocaml-side value directly
<flux>
uh, stupid me
<flux>
I can just use a normal automatically allocated buffer
<flux>
I was something thinking malloc() or static is the only way to go...
<gasche>
you could also use the GC functions to build the ocaml-string from your input
<flux>
yes, but that doesn't sound like the lowest-effort-approach
introom has quit [Remote host closed the connection]
spearalo1 has quit [Ping timeout: 260 seconds]
spearalot has joined #ocaml
mcclurmc has joined #ocaml
<whitequark>
sooo the stock menhir does not offer *any* details of the error in exception Parse.Error? O_o
<gasche>
well you should have the error position as well
<gasche>
what kind of other details do you think would be appropriate?
<whitequark>
gasche: I don't see the error position there.
<whitequark>
*even* error position
<whitequark>
other appropriate details would include the error'd rule, offending token, maybe a set of possible tokens at that position... bison offers some of that data and the stacks, through I never found the stacks actually useful
<whitequark>
menhir's mli has just this: "exception Error
<asmanur>
whitequark: you can have that by hacking around the lexer so that to store last viewed token in a reference, and display the token when an error occurs
<whitequark>
asmanur: I see
<yezariaely>
I want to create an interface from the union of two interfaces. How can I do that? I have a name collision on type t
hyperbor1ean has quit [Quit: leaving]
hyperboreean has joined #ocaml
<companion_cube>
whitequark: you should use the info in your Lexing.lexbuf
<companion_cube>
yezariaely: include Foo include Bar with type t := t
<yezariaely>
companion_cube: what is the difference between := and = ?
<wmeyer>
haha: Delirium Tremens - that's something when adrien will move on to the patches
csakatoku has joined #ocaml
<eikke>
that's a belgian beer
<adrien>
faro is very sweet, yeah
<adrien>
nice one
<eikke>
(one of the many)
<adrien>
good night :P
<wmeyer>
adrien: night!
<wmeyer>
eikke: yes, Belgian beers are very good
<eikke>
sure they are
<whitequark>
ugh. ocaml's `open' does not compose
<whitequark>
open Sexplib.Std
<whitequark>
open ExtHashtbl
<whitequark>
and now I can have either of two extensions of Hashtbl
<wmeyer>
so what would you expect, may I ask?
<wmeyer>
and what does that mean it does not compose
<whitequark>
what I want is to use both `Hashtbl.sexp_of_t`, provided by Sexplib.Std; and `Hashtbl.find_option`, provided by ExtHashtbl.
<wmeyer>
surely open just concatenates environment with the paths removed first component
<eikke>
monkey-patching! having 2 modules with the same name in scope means merging them into 1 :P and for same-named module members, pick one randomly
<whitequark>
eikke: yes, something like that
<wmeyer>
you can rename them before you open new one
<wmeyer>
the module, type or value
<whitequark>
wmeyer: as I said: does not compose.
<wmeyer>
and open actually overrides in case of colisions
csakatoku has quit [Ping timeout: 268 seconds]
<whitequark>
I want both extensions for the same module.
<wmeyer>
you can then include them
<wmeyer>
in the local module
<whitequark>
hm
<wmeyer>
and then open that module
Zerker has quit [Remote host closed the connection]
<whitequark>
right
<whitequark>
thanks
<wmeyer>
you are welcome
Zerker has joined #ocaml
<wmeyer>
and I am not sure if you can do it without functorsied interfaces in both of your extensions
<wmeyer>
ExtLib was designed to work on top the stdlib
<wmeyer>
where core has own Hashtbl
<whitequark>
oh, I don't use Core
<whitequark>
just Sexplib.
<wmeyer>
ah ok
<whitequark>
both Sexplib and Extlib work fine with js_of_ocaml, whereas Core doesn't
<whitequark>
and I don't actually need most of Core features anyway
Zerker has quit [Remote host closed the connection]
Zerker has joined #ocaml
<pippijn>
wmeyer: I split my baselib into a corelib and baselib
<pippijn>
corelib doesn't use batteries and doesn't have C code
<pippijn>
so it works with js
Yoric has quit [Ping timeout: 252 seconds]
Zerker has quit [Remote host closed the connection]
speredenn has quit [Quit: Leaving]
Zerker has joined #ocaml
<pippijn>
so, extlib works with js, that's good, maybe I can use it
<whitequark>
it also has UTF8 routines
emmanuelux has joined #ocaml
<pippijn>
yeah
tane has quit [Quit: Verlassend]
<pippijn>
so maybe I can get rid of mine
ben_zen has joined #ocaml
ollehar has joined #ocaml
Zerker has quit [Read error: Connection reset by peer]
<whitequark>
yours is more extensive
<whitequark>
it has various conversion stuff and I probably going to need utf-16
<whitequark>
not sure yet; need benchmarks
Zerker has joined #ocaml
smondet has quit [Quit: Weekend!]
Zerker has quit [Remote host closed the connection]
Zerker has joined #ocaml
Zerker has quit [Remote host closed the connection]
eikke has quit [Ping timeout: 264 seconds]
osa1_ has quit [Ping timeout: 264 seconds]
eikke has joined #ocaml
<wmeyer>
pippijn: good stuff, you would tell me when you can draw nice dependency graphs of your projects in the pub here :-)
<bji>
I want to use an integer that increments for every list element within do_some_stuff
<bji>
what is the way to accomplish this?
<bji>
Yeah I'm a c++ guy and I tried
<bji>
"let counter = ref 0 in ..."
<bji>
and then "counter++" within the do_some_stuff
<wmeyer>
ousado: even Coq become boring, I have to find my corner, thinking about next generation of hardware (from prism of software), and what recently my couleague described me :-) but that's a secret
<bji>
but that doesn't work of course !
<wmeyer>
bji: so what exactly you want to do in the body of the closure?
<wmeyer>
describe your problem, not in terms of code
<bji>
let's say that I just want to print out a number for every element in the list
<bji>
and have that number be one greater than the last for every list element
<wmeyer>
so there are several options:
<ousado>
bji: let i = !counter in counter := !counter + 1;
<ousado>
for the ref stuff
<wmeyer>
seasoned Haskeller would generate an another list with indicies, zip it and then print it
<wmeyer>
experienced OCaml would use stdlib and and fold_left combinator
<wmeyer>
practical OCamler would use Core or Batteries to do this task, to generate the first list
<wmeyer>
and seasoned OCamler would use reference, and update it inside the closure as you want to do
<bji>
ok so something like this?
<wmeyer>
so there is no recipe for it, I'd probably resort to last one
<wmeyer>
this is a common problem in fact, I wrote this code quite few times.
<bji>
List.iter (fun (v, e) -> let counter = ref 0 in begin output(counter); counter := !counter + 1; end) my_list;
<wmeyer>
no good
<bji>
sorry
<wmeyer>
counter should be outside the closure
<bji>
I realy know nothing about counter
<bji>
I mean
<bji>
nothing about ocaml
<ousado>
lol
<bji>
I am "learning" it just by modifying this code:)
<wmeyer>
bji: that's fine, you are learning
<bji>
OK so now I have
<bji>
let counter = ref 0 in List.iter (fun (v, e) -> begin output(counter);
<bji>
counter := !counter + 1; end) my_list;
troydm has joined #ocaml
<bji>
is that better?
<wmeyer>
you don't beed begin and end, but yes, that should work in principle
<bji>
cool beans
ben_zen has quit [Ping timeout: 248 seconds]
<wmeyer>
and why you want list, you if you don't use any of `v' or `e'
<bji>
I use v
<bji>
I just condensed the example
<bji>
I don't use e though
<wmeyer>
so have fun with ocaml bji :-)
<bji>
thank you
<wmeyer>
i came from C++ too
<wmeyer>
and these days ended up not doing any C++
<wmeyer>
and quite happy
<bji>
quick question
<bji>
how to convert that counter to a string?
<wmeyer>
string_of_int, Printf.sprintf
<bji>
cool thanks
<wmeyer>
you are welcome
jyeo has quit [Remote host closed the connection]
ggherdov has quit [Write error: Broken pipe]
davekong has quit [Remote host closed the connection]
lopex has quit [Remote host closed the connection]
IbnFirnas has quit [Read error: Connection reset by peer]
bobry has quit [Write error: Broken pipe]
<ousado>
wmeyer: any special reason for that being a secret?
bji has quit [Remote host closed the connection]
<wmeyer>
ousado: yes, I don't know yet what I am talking about =)
<wmeyer>
need to drop all my projects which steal my time at the moment, and do the stuff which fits the bill :-)
<wmeyer>
anyway, I will go for sleep, have a great rest of the day everybody! :-)
<ousado>
hm. interesting. I tend to not like that kind of books in general
<wmeyer>
ousado: try
<wmeyer>
well, the writer does iteratively, plus he is focused on psychology and subconciounous reasons of the procrastination
<wmeyer>
and offers solution for this
<wmeyer>
in a form of simple exercises, to show what's happening in our minds, and highlight how to fight with that, and introduce methods for dealing with tasks in timely basis, at the same time having a time to be creative
<ousado>
sounds good.
<wmeyer>
it also, shows a system how to manage the backlog
<wmeyer>
it's very important for people for us, OCamlers who want to carry on with the stuff
<wmeyer>
some people have it out of the box
<ousado>
indeed.
<wmeyer>
unfortunately I am not kind of person who is good at it
<wmeyer>
but i maybe brilliant after implementing his system
<ousado>
this was my first week writing more ocaml than anything else, btw
<wmeyer>
what he is saying is very clever
<wmeyer>
ousado: good luck.
<wmeyer>
and please don't forget to extend your knowledge to other corners
<wmeyer>
don't do just OCaml
<ousado>
I'm not
chrisdotcode has joined #ocaml
<wmeyer>
my last discovery was K framework
<ousado>
I'm helping to write a new backend for haxe, actually
<ousado>
so this is ocaml+haxe+C
<wmeyer>
great, is it for which language?
<ousado>
C
<wmeyer>
pure C?
<ousado>
it's going to be a C target
<wmeyer>
that's great I'd like to see a C target
<wmeyer>
in Haxe
<ousado>
yes, me too
<ousado>
there's already quite some things in shape
ollehar has quit [Ping timeout: 264 seconds]
<wmeyer>
I don't use anything else from lolw level language, just C
<ousado>
but the GC is a problem, still
<wmeyer>
GC is a problem
<wmeyer>
but you can reuse OCaml GC for this? :-)
<wmeyer>
good idea?
<ousado>
I want to try a combination of region inference and GC
<ousado>
hmm.. maybe?
<wmeyer>
why not just reuse OCaml runtime or Boehm
<ousado>
ah no, license
<wmeyer>
Q
<wmeyer>
then use Boehm
<wmeyer>
or Mono GC
<ousado>
yes, boehm will be one option
<ousado>
and maybe SGen, yes
<ousado>
but it's an interesting part of the project
chrisdotcode has quit [Remote host closed the connection]
<ousado>
and with all the static information, I think it should be possible to do better than boehm
<wmeyer>
ousado: surely runtimes take time and effort to get to the right shape
<ousado>
which doesn't know anything about the types
<ousado>
yes, definitely
<ousado>
as long as boehm is an option, all is fine
<ousado>
since I'm not an expert in the field, it would be crazy to assume to get something better done quickly anyway
<wmeyer>
I don't believe you need anything else than just good GC, so bohem allows you to stay in C
<wmeyer>
it's not crazy, but it would take time
<ousado>
yes, and it will, but since all code is generated, there's no problem with having pluggable GCs
<ousado>
the static analysis part makes my brain hurt, but it's really fun.
<Simn>
Oh right, I kind of forgot about the whole GC thing... :)
<ousado>
hehe
<wmeyer>
some people still remember =)
<ousado>
wmeyer: Simn is one of the two haxe compiler core developers
<wmeyer>
ousado: nice to hear, I hope you will find a generic solution for your gc problems. A backend for C language is a bit special you see
<wmeyer>
for any language that does have no option for automatic management is difficult when you compile from a higher level language that does have this option
<wmeyer>
did you think about a assembler backend for Haxe?
* wmeyer
hides
<ousado>
hehe
<ousado>
actually as I skimmed the paper you linked above, I did
<ousado>
but I'm not really worried about the GC, to be honest
<wmeyer>
you should not be, but that's very time consuming part
<Simn>
You are allowed to worry about GC once higher order functions and dynamic dispatching works. :D
<ousado>
.. and the type parameter stuff
osnr has quit [Quit: Leaving.]
Simn has quit [Quit: Leaving]
UncleVasya has quit [Quit: Leaving]
eikke has quit [Ping timeout: 248 seconds]
gnuvince has quit [Ping timeout: 264 seconds]
lopexx has quit []
csakatoku has joined #ocaml
csakatoku has quit [Ping timeout: 276 seconds]
<ousado>
is it possible to have default implementations for parts of a functor?
bkpt has quit [Quit: Leaving]
ollehar has joined #ocaml
<wmeyer>
ousado: what do you mean by `default implementations for parts of a functor`?
<ousado>
a function implementation
<wmeyer>
still does not ring, functor in OCaml sense or C++ sense?
<wmeyer>
function implementations, you can always include some module inside a functor
<wmeyer>
in particular:
<wmeyer>
module Foo (Default : BAR) (Argument : BAZ) = struct include Default ... end
<wmeyer>
so this allows you to build a Functor with default implementation
<ousado>
hmm
<wmeyer>
however you can't parametrise the interfaces in OCaml
Neros has joined #ocaml
raichoo has quit [Quit: leaving]
<ousado>
wmeyer: interesting
<wmeyer>
(means you can't exchange to something different then BAR once you supply this syntacticaly)
<wmeyer>
I suppose you can do it in Coq with dependent records
<ousado>
I shouldn't be too greedy I guess
<ousado>
I really like modules
<wmeyer>
default modules are perfectly fine in OCaml