myx has quit [Read error: Connection reset by peer]
ontologiae has quit [Ping timeout: 255 seconds]
Oejet has quit [Quit: Leaving.]
<Qrntz>
I am getting «Invalid_argument("Random.int")» with the bound being both positive and fairly low (0-100) which should fully satisfy the range check the function does
<Qrntz>
this only happens when the function calling Random.int is located in a shared object that's dynamically loaded
<Qrntz>
am I overlooking something or is this a legitimate bug report?
madroach has quit [Ping timeout: 240 seconds]
madroach has joined #ocaml
<thelema>
is it possible that a negative number is being passed in?
<Qrntz>
03:12:36 < Qrntz> I am getting «Invalid_argument("Random.int")» with the bound being both positive and fairly low (0-100) which should fully satisfy the range check the function does
<Qrntz>
a positive constant only ever gets passed
<Qrntz>
it was originally 100 but I tried it with values of the 0-100 range and it fails unconditionally
<Qrntz>
a minimal example I just wrote doesn't seem to fail, but I suspect it's too minimal
mye_ has joined #ocaml
weie has joined #ocaml
mye has quit [Ping timeout: 240 seconds]
mye_ is now known as mye
<thelema>
Can you call a non-dynamically loaded wrapper that prints the argument?
technomancy has left #ocaml []
jbrown has joined #ocaml
q66 has quit [Quit: Quit]
<Qrntz>
thelema, the argument to Random.int?
darkf has joined #ocaml
<darkf>
So what's the best way to have a main function? I have an a.ml and a b.ml where b.ml has a let () = printf "hi\n" and a.ml doesn't have a let (), but when I run `ocaml a.ml b.ml` it doesn't execute it.
<thelema>
Qrntz: yes
<thelema>
darkf: let main () = ...;; let () = main ();;
<darkf>
thelema: Would love to if the let () would execute
<thelema>
I'm not sure why let () = printf "hi\n" isn't working; it should.
<Qrntz>
buffered output?
<darkf>
No, it works on single file programs
<thelema>
wait, 'ocaml a.ml b.ml'? do you mean ocamlc?
<darkf>
No, just ocaml :\
<darkf>
Huh, works with ocamlc
<Qrntz>
thelema, I'm not sure I saw the point but it's late here and I followed your advice — everything goes fine with a non-dynlinked function
<Qrntz>
if that matters, the piece of code that calls Random.int looks like «if Random.int 100 < !probability then … else ()» where !probability is a regular int ref; I really don't know where to look for clues because that's an odd failure
<Qrntz>
sorry, I probably should be going to bed before it gets any more weird
<Qrntz>
see you later!
<thelema>
darkf: ocaml only takes one script file argument
<darkf>
ah, nevermind; better diagnostics would be nice
<thelema>
assert()
<thelema>
although I'd expect a type error, not a syntax error
<darkf>
yeah, it binds weird, it wants assert((Hashtbl.length genv.sym) = 0)
<thelema>
hmm, you shouldn't need the () before =
<thelema>
bu assert is definitely unusually high priority.
hongboz has quit [Ping timeout: 276 seconds]
Yoric has quit [Ping timeout: 252 seconds]
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 248 seconds]
emmanuelux has joined #ocaml
mgodshall has joined #ocaml
nickmeharry has quit [Quit: Leaving.]
emmanuelux has quit [Quit: emmanuelux]
tac has quit [Ping timeout: 245 seconds]
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
lolcathost has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: Operation timed out]
ulfdoz_ is now known as ulfdoz
gnuvince has quit [Ping timeout: 272 seconds]
lolcathost has quit [Ping timeout: 255 seconds]
gnuvince has joined #ocaml
lolcathost has joined #ocaml
lolcathost has quit [Client Quit]
lolcathost has joined #ocaml
Yoric has joined #ocaml
lolcathost has quit [Ping timeout: 246 seconds]
lolcathost has joined #ocaml
gour has joined #ocaml
RagingDave has joined #ocaml
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
lolcathost has joined #ocaml
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
chambart has joined #ocaml
<adrien>
morning :-)
<adrien>
I've been tring to understand a commit by Jacques Garrigues from 2002 titled "acceleration des Makefiles" (Makefiles speedup) (rev 4758) which introduces shell scripts to run ocamlc and ocamlopt during ocaml's build (ocamlcomp.sh and ocamlcompopt.sh)
<adrien>
I don't understand how going through an additional thing to execute is going to be faster than using variables in a shell script
<adrien>
s/shell script/makefile/
chambart has quit [Ping timeout: 246 seconds]
milosn has joined #ocaml
lolcathost has quit [Ping timeout: 276 seconds]
mye has quit [Quit: mye]
tane has joined #ocaml
q66 has joined #ocaml
<fasta>
adrien: you are right about that.
<fasta>
adrien: it seems to be a rather poor commit in general, because the commit message doesn't reflect all of the changes.
<flux>
maybe it can switch the contents of the .sh files during compilation for faster versions?
lolcathost has joined #ocaml
<fasta>
The only advantage I see it is that it is easier to understand.
<fasta>
It's not going to be faster.
<fasta>
But overall it still seems fairly poor, since there are still multiple places in which the same information is defined.
<adrien>
flux: I'll have to check that
<adrien>
it's bothering me because with "Makefile.nt" it doesn't use that and also because I need to have two "ocamlrun" in the boot/ directory: ocamlrun-build and ocamlrun-target
<adrien>
(host, not target)
<fasta>
ocamlcomp.sh is also garbage code.
<fasta>
Look at the lack of quotes.
<adrien>
(but I don't think we'll see canadian cross with ocaml that soon :P )
<adrien>
fasta: it's generated from a .in file
<fasta>
Also look at the non-portable use of ``.
<fasta>
adrien: ocamlcomp.sh?
<adrien>
from what I've gathered, for some time, `` has been more portable that $() because of bugs in some shells
<adrien>
fasta: there's ocamlcomp.sh.in somewhere
<fasta>
adrien: even if that's the case, then ocamlcomp.sh.in is doing the wrong thing, unless it accounts for directories containing spaces.
<adrien>
agreed; I meant that quoting in a file that is generated through search-replace from a shell script is very difficult
<fasta>
adrien: $() is a POSIX standard. Is `` also?
<adrien>
anyway, I think I'll try to get rid of this
<adrien>
not sure; I think $() was problematic in bash years ago
<flux>
I would be very surprised if `` wasn't POSIX
<adrien>
I'll check as soon as I've managed to make my laptop lose 1°C and slow down its fan
xavierm02 has joined #ocaml
<fasta>
adrien: very difficult is not ever an excuse for doing the wrong thing, IMHO.
<fasta>
Bash wiki: `...` is the legacy syntax required by only the very oldest of non-POSIX-compatible bourne-shells. There are several reasons to always prefer the $(...) syntax:
<fasta>
adrien: how can you fix this? Can you just commit to the OCaml tree?
<adrien>
I cannot but I'm working on cross-compiler support
<adrien>
so I send patches
nickmeharry has joined #ocaml
<adrien>
my reference for shell scripting is SUSv2, from 1997
<xavierm02>
and get no error but I can't replace LazyList.Nil by l0?
<xavierm02>
>_<
jewel has joined #ocaml
<xavierm02>
wait
<xavierm02>
it's the right part that dosn't work >_<
tane has joined #ocaml
ontologiae has quit [Ping timeout: 248 seconds]
<xavierm02>
never mind
<xavierm02>
I think I found it
<xavierm02>
had to use LazyList.next on the right side
philed has quit [Remote host closed the connection]
chambart has joined #ocaml
Yoric1 has joined #ocaml
Yoric has quit [Ping timeout: 246 seconds]
chambart has quit [Ping timeout: 246 seconds]
jewel has quit [Quit: Leaving]
<adrien>
considering how the Sys module seems to be done, I think ocaml bytecode is portable between word sizes and endianness
ontologiae has joined #ocaml
thomasga has joined #ocaml
thomasga has quit [Client Quit]
darkf has quit [Quit: Leaving]
Qrntz has quit [Changing host]
Qrntz has joined #ocaml
lolcathost has quit [Read error: Operation timed out]
chambart has joined #ocaml
lolcathost has joined #ocaml
flixr has left #ocaml []
jamii has joined #ocaml
<fasta>
adrien: what do you mean by portable?
<fasta>
adrien: in theory?
<fasta>
adrien: because in practice, it is not.
<adrien>
it's portable for a given ocaml version
<adrien>
which is already pretty nice
Cyanure has joined #ocaml
ski has quit [Ping timeout: 246 seconds]
ski has joined #ocaml
emmanuelux has joined #ocaml
sgnb has quit [Read error: Connection reset by peer]
sgnb has joined #ocaml
sgnb has quit [Read error: Connection reset by peer]
sgnb has joined #ocaml
avsm has left #ocaml []
avsm has joined #ocaml
<Qrntz>
thelema, just letting you know I resolved that issue with Random.int; the function which called it with an invalid argument was very near in the call graph but not the one I was suspecting
<Qrntz>
I shan't try debugging late in the night/morning ever again
<adrien>
usually the issue is being stubborn ;-)
<adrien>
(when debugging I mean)
<Qrntz>
probably
sgnb has quit [Read error: Connection reset by peer]
sgnb has joined #ocaml
sgnb has quit [Ping timeout: 272 seconds]
ontologiae has quit [Ping timeout: 246 seconds]
sgnb has joined #ocaml
gnuvince_ has joined #ocaml
gnuvince has quit [Ping timeout: 272 seconds]
RagingDave has quit [Quit: Ex-Chat]
RagingDave has joined #ocaml
weie_ has joined #ocaml
weie has quit [Ping timeout: 276 seconds]
mattrepl has joined #ocaml
jamii has quit [Read error: Operation timed out]
mye_ has quit [Quit: mye_]
hongboz has joined #ocaml
RagingDave_ has joined #ocaml
RagingDave has quit [Ping timeout: 255 seconds]
hongboz has quit [Remote host closed the connection]
<flux>
I wonder though what the api looks like, or is it simply "here's a list of updates, merge these"
<flux>
which would be just one function more to map/set/etc
sivoais has joined #ocaml
Anarchos has joined #ocaml
pkrnj has joined #ocaml
lolcathost has joined #ocaml
Automorphism has quit [Ping timeout: 276 seconds]
watermind has quit [Ping timeout: 260 seconds]
troydm has quit [Read error: Operation timed out]
troydm has joined #ocaml
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
lolcathost has joined #ocaml
benmachine has joined #ocaml
<benmachine>
I'm trying to ocaml odb.ml netclient and finding that it keeps failing because it tries to install a whole list of libraries but some of them are already installed
<benmachine>
can it... not do that, instead?
<benmachine>
(just install the ones I haven't got)
<Qrntz>
this makes me wonder if odb is relevant anymore now that there's OPAM
<Qrntz>
but I have no idea
lolcathost has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
lolcathost has joined #ocaml
<benmachine>
sigh, and now it's trying to install stuff in /usr/bin, this is at least two different kinds of wrong
<Qrntz>
benmachine, try OPAM, it aims to be a full-fledged package manager (as opposed to odb.ml's 80%)
<thelema>
Qrntz: odb is having much less work put into it than opam
<Qrntz>
thelema, is development on it going to be continued though?
<thelema>
benmachine: in general, odb shouldn't install libraries that are already installed, unless you're doing --force
<thelema>
Qrntz: The real work in in curating the package archive; making sure things are tested and pushing bug fixes upstream
watermind has joined #ocaml
<thelema>
especially since odb doesn't have a provision for patching (intentionally; the right solution is to fix upstream)
<Qrntz>
ah, I see
<benmachine>
thelema: right, but what I'm doing is trying to install netclient, which tries to install several libraries, and fails
<benmachine>
thelema: and if it fails installing halfway through, I seemingly have to nuke everything and start again
<thelema>
benmachine: which library fails?
<benmachine>
thelema: I can't remember now, I've worked around it
<benmachine>
thelema: possibly more than one of them failed
<benmachine>
one tried to install stuff in /usr/bin, but I'm installing unprivileged so that doesn't work
<thelema>
netclient's 'make install' is problematic for odb because it can partially succeed, meaning that it can leave the system in a state where the whole thing isn't installed, but it will fail at an early step because some part of it is already installed
<benmachine>
at that point I gave up and started hacking files -_-
<benmachine>
thelema: yes, that's what I've observed
<thelema>
yes, auto-installing netclient is troublesome.
* thelema
looks at what opam does
<thelema>
ok, no support for netclient in opam
<thelema>
so it looks like godi is the only thing that can auto-install netclient
<benmachine>
oh gosh what is godi
<thelema>
under perfect conditions, odb can, but as you noticed, it breaks easily
<benmachine>
how many of these things are there ._.
<thelema>
part of the reason I wrote odb is that godi was just *too* complex.
<thelema>
(and I couldn't get it to work)
<benmachine>
:)
<benmachine>
odb is yours?
<benmachine>
presumably just odb and not the whole oasis thing?
<thelema>
just odb, not all of oasis
<thelema>
but yes, it's mine. If you have improvements, please suggest.
Reventlov has joined #ocaml
<benmachine>
oh, then I can't complain to you about how the oasis syntax is /so close/ to Cabal syntax but not quite it
Reventlov is now known as Guest8861
<benmachine>
is ODB the thing that Jane Street are also working on?
<thelema>
I take that back, opam can install ocamlnet.
<thelema>
ah, they pass -bindir
<thelema>
odb only supports --prefix
Guest8861 has quit [Client Quit]
<Qrntz>
OPAM passes -bindir to every package
<thelema>
Qrntz: really?
<Qrntz>
at least every one from the ones I installed
<thelema>
benmachine: no, odb isn't worked on by jane street at all
<Qrntz>
it passes OPAM-specific directories to the configure scripts
Reventloff has joined #ocaml
<thelema>
Qrntz: yes, like --prefix
<Qrntz>
I find that very similar to rvm's behavior except rvm is way easier to confuse
<thelema>
odb runs on heuristics instead of having a config file with patterned command lines for every application.
<thelema>
design decision; maybe the wrong one.
<benmachine>
good grief, finally compiled ocaml.org successfully
lolcathost has quit [Ping timeout: 272 seconds]
weie_ has quit [Quit: Leaving...]
PM has quit [Ping timeout: 246 seconds]
<watermind>
is it possible to simulate SML's type annotations? in the sense that annotations must instatiations of the respective inferred type for it to typecheck?
<thelema>
watermind: can you give an example?
<thelema>
It sounds like phantom types
<thelema>
or do you mean just declaring that functions have a given type?
<watermind>
thelema: no no
<watermind>
thelema: I mean this, let f (x : 'a ) : 'a = x + 1
<watermind>
it typechecks, and it wouldn't in either SML nor haskell
<watermind>
since int is not an instance of a
<thelema>
ah, yes. Type annotations in ocaml are restrictions on the type of the function, i.e. they can only narrow
<flux>
watermind, let f : 'a. 'a -> _ = x + 1
<thelema>
iirc, what you want has just been added; being able to instist a function be polymorphic
<thelema>
and flux has the syntax before I.
<flux>
watermind, or with older ocaml: module Foo : sig val f : 'a -> 'b = struct let f x = x + 1 end
<flux>
(and maybe include Foo afterwards)
<thelema>
basically you have to introduce a universal quantification: "'a."
<thelema>
otherwise ocaml will just unify your type with the inferred type
<watermind>
flux: yes I know I can do these sorts of annotations... maybe I'm not being clear, I'd like all of those to NOT typecheck
<watermind>
in OCaml, it typechecks because 'a->'b and 'a->'a all unifiy with int -> int,
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
<watermind>
another approach is to require the annotations to be instances of the inferred type
<watermind>
and 'a -> 'a is not an instance of int -> int
tac has joined #ocaml
<thelema>
watermind: the "'a." addition will make it not typecheck
<watermind>
thelema: flux: ohhhh
<thelema>
it insisits that the resulting type be polymorphic
<watermind>
flux: sorry I misunderstood you, thank you that is fantastic
<thelema>
# let f : 'a . 'a -> 'a = fun x -> x + 1;;
<thelema>
Error: This definition has type int -> int which is less general than 'a. 'a -> 'a
<thelema>
also doing the same thing with modules will make it not typecheck, as module signatures aren't just unified
<watermind>
thelema: so does OCaml support rank N polymorphism?
<watermind>
let me try
<thelema>
no, ocaml's type inference is decidable.
<watermind>
right
Cyanure has quit [Remote host closed the connection]
tac has quit [Quit: Page closed]
lolcathost has joined #ocaml
gour has quit [Quit: WeeChat 0.3.8]
emmanuelux has quit [Ping timeout: 272 seconds]
jamii has quit [Ping timeout: 255 seconds]
emmanuelux has joined #ocaml
Yoric1 has quit [Ping timeout: 260 seconds]
RagingDave has joined #ocaml
tani has joined #ocaml
tane has quit [Ping timeout: 272 seconds]
<xavierm02>
I'm about to letting lazy lists go and just waste tons of memory
<xavierm02>
unless someone can tell me why the compiler cries