nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
nojb has quit [Quit: nojb]
SomeDamnBody has joined #ocaml
badon has joined #ocaml
ontologiae has joined #ocaml
madroach has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
struktured has joined #ocaml
q66 has quit [Quit: Leaving]
Simn has quit [Quit: Leaving]
shinnya has quit [Ping timeout: 258 seconds]
serge has joined #ocaml
shinnya has joined #ocaml
darkf has joined #ocaml
serge has quit [Ping timeout: 255 seconds]
Submarine has joined #ocaml
samrat has joined #ocaml
samrat has quit [Ping timeout: 244 seconds]
tnguyen has quit [Quit: tnguyen]
samrat has joined #ocaml
sheijk has joined #ocaml
sheijk has quit [Client Quit]
samrat has quit [Ping timeout: 258 seconds]
sheijk_ has quit [Ping timeout: 244 seconds]
samrat has joined #ocaml
ontologiae has quit [Ping timeout: 245 seconds]
samrat has quit [Ping timeout: 265 seconds]
<mcc>
so... here's a question. i am trying to build an ocaml program at the command line. it uses a ppx (sedlex)
samrat has joined #ocaml
<mcc>
i am trying to use scons, which has a ocaml "tool" on their website-- in other words the ocaml module for it is slightly old and only semi-supported.
<mcc>
when i was recommended to build before, i was told to let ocamlfind perform the compilation.
inf-groupoid is now known as pyon
<mcc>
the scons tool wants to compile stuff like: ocamlopt -o build/test -ccopt -L/Users/mcc/.opam/system/lib/sedlex -I /Users/mcc/.opam/system/lib/sedlex /Users/mcc/.opam/system/lib/sedlex/sedlexing.cmxa build/test.ml
<mcc>
I find, experimentally, i can get it to build if i say: ocamlopt -o build/test -ccopt -L/Users/mcc/.opam/system/lib/sedlex -I /Users/mcc/.opam/system/lib/sedlex -ppx /Users/mcc/.opam/system/lib/sedlex/ppx_sedlex /Users/mcc/.opam/system/lib/sedlex/sedlexing.cmxa build/test.ml
<mcc>
what is that ppx_sedlex program, and how can i predict its name? That is, how would ocamlfind have found it?
<mcc>
there's a -ppxopt argument to ocamlfind mentioned in the man page, but it is not documented
<Drup>
please, ditch this thing or make it use ocamlfind.
<mcc>
haha
<mcc>
i'm interested in that second option.
badon has quit [Quit: Leaving]
argp has quit [Ping timeout: 240 seconds]
<mcc>
the "ocaml module" is a pretty short python script.
samrat has quit [Ping timeout: 265 seconds]
<Drup>
but really, you should use one of the ocaml build systems ...
<mcc>
what do people normally use for build systems with ocaml? omake? make?
<Drup>
you are learning the language, make yourself a favor by not reinventing the tool to make the language easier to use.
<mcc>
maybe so, but at a later stage this project might pick up c++ components or have self-hosting stages or whatever.
<Drup>
since you are doing a simple project and starting, I would say, use oasis
<mcc>
but i guess i could delay using a general build system until i need one.
<mcc>
ok.
<Drup>
if you really want to use a general purpose one, you can look up OCamlMakefile
<whitequark>
it's simpler / less powerful / easier to get up and running
kakadu has joined #ocaml
WraithM has joined #ocaml
<companion_cube>
MercurialAlchemi: what would you use the rose tree for?
<flux>
whitequark, look fun. no LICENSE/COPYING, though ;)
<MercurialAlchemi>
companion_cube: If you know ledger-cli, I want to process data from a CSV export, and since categories are organized in a tree, my report needs to store data in a rose tree
<flux>
ah, there is _oasis which mentions it
<companion_cube>
MercurialAlchemi: just defining the datatype is so easy in OCaml that no one has packaged it, I guess
<companion_cube>
zippers are another problem
jonludlam has joined #ocaml
<MercurialAlchemi>
companion_cube: well, I'll just steal the Haskell implementation, I guess
<MercurialAlchemi>
companion_cube: maybe package it while I'm at it
<whitequark>
flux: yeah
<MercurialAlchemi>
I saw there was a library with generic data structures (but not rose trees) made during an old Summer of Code, but it doesn't seem to be maintained
AltGr has joined #ocaml
<companion_cube>
yes, I stumbled upon it too
hausdorff has joined #ocaml
<companion_cube>
MercurialAlchemi: do you have a link? I lost it again
lordkryss has joined #ocaml
<flux>
ocaml really could use a nice data structures library. there is reins, but it's not maintained either, afaik.
<companion_cube>
ah, thanks
<companion_cube>
I remember why I didn't steal code from reins: license
<flux>
LGPL with the linking exception?
<companion_cube>
yes
<tangentstorm>
cool, whitequark... looks like this evaluates anything eval.in supports, too, right?
<flux>
right, not suitable for copying verbatim
<whitequark>
tangentstorm: yes
<companion_cube>
it's fine, but I have a BSD-licensed library
jonludla` has joined #ocaml
<flux>
and you don't want to just depend on it?
toolslive has joined #ocaml
WraithM has quit [Ping timeout: 265 seconds]
jonludlam has quit [Ping timeout: 255 seconds]
<companion_cube>
flux: oh, I meant, copying some code into my own library, which doesn't have a compatible license
<companion_cube>
I'd have scavenged the AVL trees, for instance
<flux>
but could you not have just used the AVL trees without copying the code in?
<MercurialAlchemi>
companion_cube: yes, that was reins
<companion_cube>
flux: to maintain the code you need to copy it, I think
shinnya has quit [Ping timeout: 256 seconds]
<companion_cube>
I have my own data-structure library, in some sense (although I miss some things in reins)
<companion_cube>
I should cleanup the misc/ dir -_-
_andre has joined #ocaml
* MercurialAlchemi
wishes that OCaml could standardize on at least the most common data structures
<flux>
what I like about C++ containers is than in principle I can store elements in multiple data structures by storing iterators inside them (though you need to be careful about invalidation)
<flux>
too bad this library apparently lets all data live its own island ;)
<whitequark>
bleargh
<whitequark>
llvm bindings segfault on 4.02 because of some wackiness in the runtime wrt caml_local_roots
<whitequark>
I don't want to bisect :(
<companion_cube>
flux: what do you mean "in multiple data structures"?
<companion_cube>
in ocaml too you can do fun x -> [x], [|x|]
<flux>
companion_cube, well I mean that I could have two lists, for objects that are < 100 and objects that are < 10000
<flux>
if I find the object in the first list, I can remove it from the second list in constant time
<companion_cube>
oh, that
<companion_cube>
well it's totally incompatible with OCaml's persistent structures
<flux>
yes.
<flux>
I suppose the functional way is to use maps from identifiers to objects
<companion_cube>
you can write a custom recursive function though
<companion_cube>
if lists are sorted
jonludla` has quit [Ping timeout: 245 seconds]
<companion_cube>
in linear time
<companion_cube>
flux: I like the tradeoff between safety and efficiency OCaml provides
<companion_cube>
"though you need to be careful about invalidation
<companion_cube>
" <---- this is very dangerous and error-prone
<flux>
well, you already need to be careful when you have double-linked lists
<companion_cube>
exactly
<flux>
in c++ making mistakes can introduce crashes, in ocaml only infinite loops :)
Simn has joined #ocaml
<companion_cube>
mostly, yes
<whitequark>
and exceptions
psy_ has joined #ocaml
AltGr has left #ocaml [#ocaml]
<whitequark>
jpdeplaix: r221139 in LLVM is of interest to you
<whitequark>
I made it so that setting any environment variables is never needed and LLVM build is still relocatable, but you need to alter META slightly
zpe has joined #ocaml
marynate has quit [Read error: Connection reset by peer]
\u has quit [Ping timeout: 255 seconds]
\q has joined #ocaml
tane has quit [Quit: Verlassend]
\q has quit [Ping timeout: 240 seconds]
<ggherdov>
uh, I just read LLVM weekly #44 and it talks a lot about ocaml bindings. Is there a specific homepage/wiki/whatever about llvm ocaml bindings?
<whitequark>
the latter needs some severe rewriting unfortunately
<ggherdov>
whitequark: thanks. You're the guy LLVM weekly is talking about, correct?
<whitequark>
yes
<ggherdov>
ok. cheers!
<companion_cube>
I still don't remember where to find the paper(s) that describe whole-set operations on AVL trees
<companion_cube>
which is apparently used for standard Map/Set
dsheets has joined #ocaml
hausdorff has quit [Remote host closed the connection]
hausdorff has joined #ocaml
ingsoc has joined #ocaml
hausdorff has quit [Ping timeout: 244 seconds]
WhatElse has joined #ocaml
<WhatElse>
hi guys
<WhatElse>
is it possible to run an ocaml application without compiling it? (I’m really newbie)
<whitequark>
you can run a single .ml file using $ ocaml foo.ml
<WhatElse>
I have a lot of .ml files, and if I run the main one (main.ml) it complains about dependencies in other ml
<WhatElse>
but I can’t figure out an “order” between all those files
<whitequark>
you should really compile it, in that case.
nojb has joined #ocaml
<WhatElse>
ok, I was asking because application is big and compiling it requires a lot of time
<whitequark>
you can compile it to bytecode
<WhatElse>
with ocamlc, right?
<whitequark>
mmm, yes
<whitequark>
usually you'd have a buildsystem
<WhatElse>
yes it uses make
<WhatElse>
I was even trying to use ocamldebug, but it ends unexpectedly
<whitequark>
ocamldebug is ... well ... don't use it
_whitelogger has joined #ocaml
<WhatElse>
wow.. but people really use ocaml?! I’m finding out that is very.. ugly.. to work with in big projects
<rom1504>
WhatElse: and people even uses C ;) ;)
<whitequark>
WhatElse: you can use gdb with ocamlopt
<whitequark>
on linux it puts the source mapping in debug info, though you can't examine any values
<whitequark>
generally it depends on mindset, for example I only use a debugger in extreme cases, eg segfaults. Most of the time well-designed APIs, tests and debug prints solve everything
<WhatElse>
I see, but ocamlopt seems even more slow than ocamlc
<WhatElse>
ok I’ll try that way, but I feel so ‘90s
<whitequark>
are you using ocamlc with ocamlfind or just ocamlc?
<whitequark>
if the latter, invoke ocamlc.opt instead of ocamlc, it will be much faster
<Drup>
WhatElse: and if you are in 4.02.0, upgrade
<WhatElse>
actually I’m using make so I didn’t know
<WhatElse>
Drup: yes I am
<Drup>
there is a compiler performance bug in 4.02.0, fixed in 4.02.1
<WhatElse>
Drup: ok, thank you I’ll try
<Drup>
ocamlc is quite fast, so if your build is really really slow, there is something wrong :p
<rom1504>
ocamlc stuff.ml && sleep 1000
govg has joined #ocaml
<WhatElse>
ooook I’ll check, I’ve just downloaded a project and I’m trying to understand how it works
<Drup>
calm down guys. WhatElse: what do you want to print ?
<WhatElse>
Drup: I have to place some printf in the code to see what is inside function’s parameters
<Drup>
what types.
<Drup>
It's an old project, I'm pretty sure they defined printers for everything
<WhatElse>
Drup: I don’t know yet. I’ve seen that there is a Printf module, should I use a specific function for any type or there is some “magical” printf I can use for everything?
<Drup>
nothing magical
<WhatElse>
whitequark: I’ll try it
<MercurialAlchemi>
I guess there could be something "magical" when modular implicits become mainstream
<Drup>
I like the fact there are literally no mli in this project
<whitequark>
MercurialAlchemi: it still doesn't help if you have records
<whitequark>
or variants
<WhatElse>
Drup: what does it mean?
<whitequark>
or parametric types
<whitequark>
really, you will still need ppx_deriving :P
<Drup>
whitequark: you still need the deriving to create the printer, but the invokation is more magical :p
<whitequark>
yeah
<Drup>
WhatElse: ".mli" is the type of file for interfaces
<Drup>
and it's the common way to put documentation, too.
<WhatElse>
Drup: oh, okay, so are you saying that it is architecturally a mess?
<whitequark>
gdsfh: you lose a lot of info after typechecking though
<gdsfh>
thanks, cap!
<whitequark>
now I know you're russian.
reynir is now known as facedesk
facedesk is now known as reynir
<gdsfh>
it was obvious from my previous messages, where i gave a link to some rus lang blog entry.
<whitequark>
meh, that's no fun at all
<gdsfh>
being a russian? agreed.
<whitequark>
inferring primary language from figures of speech seeping through unintentionally though? now that's interesting
<whitequark>
well, that too, yes
<WhatElse>
anyway thank you for help guys :)
mort___ has joined #ocaml
govg has quit [Quit: leaving]
<toolslive>
well, you can for example infer that ocaml was designed by french speaking people.
<toolslive>
just from looking at the syntax of the language.
<whitequark>
you can?
<toolslive>
yes.
<whitequark>
how?
<toolslive>
the pattern matching syntax is a dead give-away
<toolslive>
.... when .....
<gdsfh>
look at the syntax of parametrized types, int list for example.
<toolslive>
"quand"
<toolslive>
a native speaker would say "where"
mort___ has quit [Quit: Leaving.]
<reynir>
sometimes I forget it's not "with"
<whitequark>
hm
<reynir>
what does that say about my language :)
<toolslive>
you're probably not a native french speaker ;)
<Drup>
toolslive: you don't need to look that far
<reynir>
haha :)
<Drup>
let's open the ocaml manual
<Drup>
"Xavier Leroy, Damien Doligez, Alain Frisch, Jacques Garrigue, Didier Rémy and Jérôme Vouillon "
<Drup>
:]
q66[lap] has quit [Read error: Connection reset by peer]
q66[lap] has joined #ocaml
<toolslive>
yes, but I was limiting it to the syntax of the language itself. the manual is full of typos that only native french speakers would make.
<Drup>
:D
<Drup>
(some people would say "patch welcome" ;)
<Drup>
gdsfh: the reversed type application comes from ML, which wasn't designed by frenchs :p
<toolslive>
so is the documentation... Actually I once did send a patch for these things, but got completely ignored.
<toolslive>
that's ok, it's not important
<whitequark>
toolslive: you can send a PR on github.com/ocaml/ocaml and it won't be ignored
<Drup>
ocaml-manual probably, in fact
<toolslive>
that was before the github days...
<whitequark>
sure
<whitequark>
I'm just saying that now it's easier to keep these things visible
<toolslive>
yes! you're absolutely right....
<whitequark>
sigh~~
<whitequark>
Drup: why did I let you write C
<Drup>
I don't know, but I can only say I warned you.
ggole has joined #ocaml
<whitequark>
it segfaults somewhere else, but only if I execute the float_of_const thingies in test_constant
oscar_toro has quit [Ping timeout: 244 seconds]
<whitequark>
so I have a pretty good idea of what's the issue
<whitequark>
now, I *did* review the code.
<whitequark>
so I'm as much to blame.
<Drup>
what did I do wrong ?
<whitequark>
I don't know yet
<Drup>
(you know the best point ?)
<whitequark>
oh
<whitequark>
I actually introduced the bug myself
<Drup>
(I'm supposed to teach intro to programming in a few month, for first year students)
<whitequark>
... lol
<Drup>
(and it's in C)
<Drup>
so, what's the bug ? :D
<whitequark>
mismatched CAMLparam/CAMLreturn leaves garbage in caml_local_roots
<whitequark>
and it crashes somewhere else in caml_raise.
<Drup>
oh, you removed the one I put because it was not allocating or something ?
<whitequark>
no, I added some
<Drup>
ah
<whitequark>
but only for 2 of 3 returns
<Drup>
:D
<whitequark>
... after removing some
<whitequark>
I think?
mort___ has joined #ocaml
<whitequark>
why did I add them at all?
<whitequark>
was I on drugs when I committed that?
<Drup>
bah, it happens
<whitequark>
... the commit message doesn't mention the change.
<whitequark>
probably fatfingered.
<whitequark>
oh, no, there's an allocation in the middle.
gustav___ has quit [Ping timeout: 264 seconds]
<Drup>
you're talking about "llvm_float_of_const", right ?
<whitequark>
yeah
gustav___ has joined #ocaml
<whitequark>
yay, no segfaults anymore.
<Drup>
:)
hausdorff has joined #ocaml
anders has joined #ocaml
<anders>
I have a program written in ocaml on OS X. using ocaml from homebrew. if I compile it on my laptop with a haswell CPU, then move the resulting binary to an older sandy bridge PC it crashes: "invalid instruction"
<anders>
(i'm using ocamlopt.opt)
hausdorff has quit [Ping timeout: 260 seconds]
<whitequark>
yes.
<anders>
how can I prevent that? i want binaries that run on any 64-bit mac
<Drup>
whitequark, you would make a good prolog interpreter.
<whitequark>
anders: try passing -ccopt -arch x86_64 to ocamlopt
serge has quit [Remote host closed the connection]
serge has joined #ocaml
siddharthv is now known as siddharthv_away
<anders>
whitequark: nope, also tried -ccopt -march=x86-64
<whitequark>
odd
<anders>
yes indeed
<anders>
i compiled with -verbose now, and I don't see anything odd passed to clang that would cause this
<nojb>
how can I convert an int32 to a float *as an unsigned integer* ?
<whitequark>
nojb: opam install uint
<anders>
oh! i know what the problem is. it's homebrew. because it links with some static library, that must be the cause. the homebrew ocaml is compiled with too fancy optimizations
<anders>
thanks anyway
<nojb>
whitequark: yes, I know about uint - I was wondering if there was another way …
<whitequark>
nojb: no
<whitequark>
what's the issue with uint?
kakadu has quit [Quit: Konversation terminated!]
kakadu has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
<nojb>
whitequark: nothing in particular - I would prefer not to have the additional dependency …
<whitequark>
small and self-contained, I don't see the problem
<whitequark>
*facedesk*
<whitequark>
I spent a few hours trying to figure out why the dependency is not linked into dllllvm.so.
<whitequark>
-lx is in the ldflags.
<whitequark>
well, it was because the linker doesn't link in whatever is not referenced, and the only place it was referenced was in the OCaml code... which, obviously, does not go into dllllvm.so.
<whitequark>
I bet there are a few more fun bugs with the same signature.
mort___ has quit [Quit: Leaving.]
<whitequark>
oh, yeah, it's chock-full of these.
BitPuffin has joined #ocaml
elfring has joined #ocaml
serge has quit [Remote host closed the connection]
mort___ has joined #ocaml
serge has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
larhat1 has joined #ocaml
thomasga has joined #ocaml
hausdorff has joined #ocaml
gnzh has joined #ocaml
hausdorff has quit [Ping timeout: 244 seconds]
ocp has joined #ocaml
larhat1 has quit [Ping timeout: 264 seconds]
oscar_toro has joined #ocaml
_5kg has quit [Ping timeout: 265 seconds]
Thooms has joined #ocaml
jgjl has joined #ocaml
psy_ has quit [Remote host closed the connection]
larhat has joined #ocaml
shinnya has joined #ocaml
oscar_toro has quit [Ping timeout: 245 seconds]
bytbox has quit [Remote host closed the connection]
<WhatElse>
how can I downgrade to ocaml 4.01.0? opam switch 4.01.0 fails