emmanuel__ has quit [Remote host closed the connection]
imperator has joined #ocaml
imperator has left #ocaml []
<Drakken>
Can modules in a .mlpack file refer to previously mentioned modules in the same file?
ulfdoz has joined #ocaml
Tobu has joined #ocaml
mjonsson has quit [Remote host closed the connection]
ulfdoz has quit [Ping timeout: 252 seconds]
Tobu has quit [Ping timeout: 272 seconds]
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx has quit [Read error: Operation timed out]
Tobu has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
diego_diego has joined #ocaml
<flux>
I would like to say "yes", how else would it make any sense
<flux>
could be that the modules are automatically topologically sorted, I haven't used mlpack that much that I would've given a thought to that :)
testcocoon has joined #ocaml
ftrvxmtrx_ has quit [Quit: Leaving]
BiDOrD_ has joined #ocaml
eni has joined #ocaml
BiDOrD has quit [Ping timeout: 245 seconds]
<Drakken>
flux I think I found the problem. ocamlbuild is compiling the modules out of order. I put Utils first because AST uses it, but AST is being compiled first.
<adrien>
hmmm
<adrien>
that sounds very wrong
<adrien>
there's something else
<adrien>
you might have a conflict somewhere and you might be using the module inside the pack without going through the pacl
<adrien>
k
roha has joined #ocaml
cdidd has quit [Remote host closed the connection]
tufisi has joined #ocaml
roha has quit [Read error: Operation timed out]
ftrvxmtrx has joined #ocaml
Snark has joined #ocaml
<Drakken>
What else could it be? There's no reference to AST in Utils, and the command line is ocamlbuild foo.cmo, where Utils and AST are in foo.mlpack.
djcoin has joined #ocaml
cago has joined #ocaml
<adrien>
you're using Foo.Utils and Foo.AST or "AST" and "Utils"
<Drakken>
AST and Utils
<Drakken>
foo.mlpack reads "Utils\nAST\n..."
<Drakken>
AST.ml says "open Utils" and uses stuff in Utils, but the compiler says the stuff is unbound.
<adrien>
but in your .ml code of other files
<Drakken>
Actually, the third file in foo.mlpack isn't up to date. It tries to open FooAST instead of AST.
<Drakken>
What difference does it make what's in other files?
ankit9 has joined #ocaml
<flux>
drakken, try what ocamldep says
<flux>
although, I think ocamlbuild itself should also produce a warning if there are loops in dependencies..
<Drakken>
"open Foo.Utils" generates a "circular build" message.
Tobu has quit [Ping timeout: 272 seconds]
<Drakken>
ocamlbuild doesn't echo all of its compiler commands, only the (first) one that has an error.
<Drakken>
So I guess it wasn't compiling AST first unless it thought Utils was up to date. I deleted _build and the error disappeared.
Tobu has joined #ocaml
avsm has quit [Ping timeout: 244 seconds]
avsm has joined #ocaml
Cyanure has joined #ocaml
Tobu has quit [Quit: No Ping reply in 180 seconds.]
eni has quit [Quit: Leaving]
Tobu has joined #ocaml
larhat has quit [Quit: Leaving.]
roha has joined #ocaml
silver has joined #ocaml
guru has joined #ocaml
guru is now known as Guest54012
<Guest54012>
trying to use jane street's ocaml-core -- get error during linking 'gcc: error: lib/libcore.a: No such file or directory' -- how to fix ?
<Guest54012>
im a happy user of oasis + batteries so far -- puzzled why ocaml-core doesnt work
Tobu has quit [Ping timeout: 272 seconds]
mika1 has joined #ocaml
mononofu has joined #ocaml
iZsh has quit [Quit: Coyote finally caught me]
Tobu has joined #ocaml
diego_diego has quit [Quit: diego_diego]
Guest54012 has quit [Read error: Connection reset by peer]
guru_ has joined #ocaml
cyphase has quit [Read error: Connection reset by peer]
avsm has quit [Quit: Leaving.]
letrec has joined #ocaml
Hussaind has joined #ocaml
Hussaind has left #ocaml []
larhat has joined #ocaml
guru_ has quit [Quit: leaving]
cyphase has joined #ocaml
sgnb has quit [Remote host closed the connection]
mfp has quit [Remote host closed the connection]
avsm has joined #ocaml
roha has quit [Ping timeout: 260 seconds]
avsm has quit [Client Quit]
avsm has joined #ocaml
err404 has joined #ocaml
sgnb has joined #ocaml
snearch has joined #ocaml
_andre has joined #ocaml
ankit9 has quit [Ping timeout: 260 seconds]
Tobu has quit [Ping timeout: 272 seconds]
mfp has joined #ocaml
roha has joined #ocaml
emmanuelux has joined #ocaml
Tobu has joined #ocaml
pango has quit [Remote host closed the connection]
pango has joined #ocaml
snearch has quit [Quit: Verlassend]
ankit9 has joined #ocaml
ski has quit [Ping timeout: 250 seconds]
err404 has quit [Remote host closed the connection]
pango has quit [Ping timeout: 252 seconds]
oriba has joined #ocaml
emmanuelux has quit [Ping timeout: 264 seconds]
pango has joined #ocaml
cago has quit [Quit: Leaving.]
cago has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
mononofu has quit [Remote host closed the connection]
Tobu has joined #ocaml
<hcarty>
thelema: I can install the packages file, but it was my impression that packages was an optional thing
<hcarty>
thelema: And more importantly that it is intended for customization, not as something included by default.
<hcarty>
thelema: If this is not the case then I can update ocamlbrew to stick the packages file wherever it should go
<hcarty>
I'm a little reluctant to do that though, since not being on oasis-db implies (perhaps incorrectly) a less cleanly integrated package.
<hcarty>
That's not something I want to provide out of the box
sgnb has quit [Remote host closed the connection]
sgnb has joined #ocaml
<thelema>
hcarty: true, I (or someone) should really upload these packages that work to oasis-db
<thelema>
packages is definitely an optional thing
<thelema>
Did I ever tell you about the --package option for odb? to download a remote package list and install all the packages inside?
<thelema>
(it works on local package lists too, of course)
Tobu has quit [Ping timeout: 272 seconds]
<hcarty>
thelema: I saw that patches were applied that implied a feature like that, but I don't think we've discussed it
<hcarty>
thelema: Sounds really nice
ankit9 has quit [Ping timeout: 260 seconds]
<hcarty>
Oh - is this the ripping off good ideas from barbra thing? :-)
ankit9 has joined #ocaml
kakadu has joined #ocaml
ankit9 has quit [Client Quit]
<thelema>
hcarty: actually, this was the simplest way I could figure to have an automated oasis install by a single command, with a guaranteed stable dependency chain
<hcarty>
thelema: Even better.
<hcarty>
thelema: Right, so you have fixed versions through packages. That avoids the potential issue of a package on oasis-db being updated to an incompatible version.
<hcarty>
Very nice
<hcarty>
incr thelema
<thelema>
exactly.
Tobu has joined #ocaml
gnuvince has quit [Read error: Operation timed out]
smondet has joined #ocaml
caj has joined #ocaml
caj has left #ocaml []
gnuvince has joined #ocaml
cdidd has joined #ocaml
* mrvn
needs to design the network protocol for his game soon.
<mrvn>
I wonder how much I need to coordinate events between server and client. Can I just send a "unit X goto Y" or do I need to send updates for every tile the unit crosses to ensure server and client remain in sync.
jonafan has quit [Ping timeout: 265 seconds]
chambart has quit [Read error: Operation timed out]
<mrvn>
Anyone done this sort of thing before?
gnuvince_ has joined #ocaml
mika1 has quit [Quit: Leaving.]
gnuvince has quit [Read error: Connection reset by peer]
cago has quit [Quit: Leaving.]
oriba has quit [Quit: oriba]
<adrien>
tcp?
<thelema>
mrvn: no, but think about eventual consistency if you're not using TCP, as dropped packets can cause desync, but this desync shouldn't be permanent
mononofu has joined #ocaml
<hcarty>
mrvn: The goto should be enough if you trust the client and/or validate all requests from the client on the server.
Tobu has quit [Ping timeout: 272 seconds]
<flux>
mrvn, is it a real time game?
<flux>
mrvn, if you want to make it work properly, perhaps it is worth doing the protocol in UDP. I had a similar case where I used TCP though, it introduced a bit latency due to windowing I think.
<mrvn>
yes
<flux>
it passed timestamps, object locations and object velocities to the server
<flux>
and it then passed them to other clients, if I recall
<flux>
some information about client latencies were also passed
<flux>
you can grep for 'latency' in goba :)
<mrvn>
I'm not sure loosing packets is a good idea. Loosing a tile change for a unit might be trivial but loosing a packet saying a building was errected changes a lot.
<flux>
you can have two kinds of packets, ones you can loose and ones you cannot
<adrien>
you will lose packets one day anyway
<adrien>
or get lag
<flux>
it might not matter if a building was erected a second ago or now
<flux>
but it might matter if an object moves now or after one second
<mrvn>
Latency shouldn't be much of a problem I think. Events should be timestamped so the situation might skip but should get back in sync.
<flux>
also same for bullets: it doesn't matter where it was a second ago if we know where it is now
<mrvn>
flux: It matters if there is a unit walking through the building or around it. :)
<flux>
mrvn, depensd who interprets the world
<flux>
if might just be a rare visual glitch
<mrvn>
If the server walks around it and the client through it they get awfully out of sync.
<mrvn>
And then other units walk around that unit so you get ripple effects.
<hcarty>
mrvn: If you server's interpretation is considered 'truth' then there will be visual differences any time lag or syncronization issues come up
<hcarty>
mrvn: Unless you stick with TCP and don't allow the display to update until an update has been sent
<mrvn>
The server is always right[tm]. Otherwise you get cheating clients.
kakadu has quit [Quit: Page closed]
<adrien>
but it's pretty hard to do it that way
<adrien>
it's definitely better but it's a lot of things to pay attention to
<mrvn>
I want to have the client to some extrapolation. So baring updates from the server units should keep moving the way the client thinks they will.
<adrien>
anyway, good luck :-)
<mrvn>
Main checston will be how predictable do I make unit moves. Things look better if you roll a dice when you have multiple choices. Maybe I will use an adaptive algorithm and send a unit update every time the unit needs to roll a dice.
<mrvn>
s/checston/decision/
<mrvn>
Or precompute a number of dice rolls and send them from server to client ahead of time.
<mrvn>
For a wild idea there could be a udp and tcp connection. Important events like buildings and start/end of a goto and such via tcp and unit updates during gotos via udp.
Tobu has joined #ocaml
jarray52 has joined #ocaml
jarray52 has quit [Changing host]
jarray52 has joined #ocaml
smondet` has joined #ocaml
Cyanure has quit [Remote host closed the connection]
<jarray52>
How does one list the modules available for import from the OCaml interpreter command line?
<mrvn>
can you?
<rixed>
"#list;;" with batteries.
<hcarty>
rixed: That's not batteries, it's findlib
<hcarty>
#list shows findlib package names rather than module names
<rixed>
hcarty: I stand corrected. I never know what's belonging to findlib in the repl.
<jarray52>
hcarty: I want to thank you for suggesting http://try.ocamlpro.com/ yesterday. That was a great tutorial.
<mrvn>
Unknown directive `list'.
<mrvn>
No findlib in the default toplevel here
<rixed>
#use "topfind";; then ?
smondet has quit [Ping timeout: 245 seconds]
<mrvn>
# #list;;
<mrvn>
aio (version: 0.0.3)
<mrvn>
Even works for my own package. :)
diego_diego has joined #ocaml
<hcarty>
jarray52: You're welcome. The ocamlpro folks (and ocsigen folks) did a nice job with it.
<jarray52>
mrvn: I have to run #use "topfind";; before running #list;;
<rixed>
jarray52: you may want to add this to your ~/.ocamlinit
<hcarty>
Does anyone here use cmdliner? I'm getting some weird formatting from some of its output.
<jarray52>
rixed: I don't seem to have a ~/.ocamlinit file.
mononofu has quit [Ping timeout: 260 seconds]
thomasga has joined #ocaml
<jarray52>
rixed: I just created the file and added #use "topfind";;
Tobu has quit [Remote host closed the connection]
Tobu has joined #ocaml
roha has quit [Ping timeout: 248 seconds]
thomasga has quit [Ping timeout: 265 seconds]
<jarray52>
How do I import ExtLib.ExtList.List?
srcerer_ has joined #ocaml
<hcarty>
jarray52: #require "extlib";; I think
srcerer has quit [Ping timeout: 245 seconds]
<hcarty>
jarray52: That said, it's probably better to use Batteries than extlib - as far as I know, extlib is not being actively maintained.
cyphase has quit [Ping timeout: 245 seconds]
mononofu has joined #ocaml
<jarray52>
hcarty: thanks. #require "batteries";; did the trick.
<bjorkintosh>
jarray52, did rlwrap work out?
letrec has quit [Ping timeout: 252 seconds]
<jarray52>
bjorkintosh: rlwrap worked out amazingly well. Thanks.
<jarray52>
bjorkintosh: My distro has an interactive development environment for Ocaml called cameleon. Any thoughts on it?
jamii has joined #ocaml
<bjorkintosh>
i've never used it or even heard of it.
<bjorkintosh>
i just use my text editor, tmux, and repler ...
<bjorkintosh>
each time i save, it automatically compiles and runs in the next window over.
<bjorkintosh>
so i can see what's going on immediately.
Cyanure has joined #ocaml
thomasga has joined #ocaml
<jarray52>
bjorkintosh: tmux looks useful.
* ssbr_
is using xmonad to similar effect
<thelema>
hcarty: actually, extlib is being maintained, although just barely
silver has quit [Remote host closed the connection]
<thelema>
hcarty: that said, I think its authors consider it like TeX - Perfect because any bugs are intended.
cyphase has joined #ocaml
<jarray52>
bjorkintosh: Do you use anything for autocompletion?
<bjorkintosh>
vi has an autocompletion package. i just use that.
<bjorkintosh>
jarray52, are you on a mac or linux?
<jarray52>
Bjorkintosh: Linux
<bjorkintosh>
ah. which text editor do you use? emacs?
<ssbr_>
the camlp4 docs aren't actually that bad. I was linked to a wiki that was supposed to be better, but often it just repeated what the official tutorial said, in unreadable contextless bullet-point form...
<jarray52>
bjorkintosh: gedit...sometimes kate... sometimes vi... but haven't really gotten use to vi yet.
<thelema>
Hmm, maybe transpose should go into BatList...
<thelema>
I'm a bit worried about the second case in that code - [] :: xss -> transpose xss
<thelema>
eh, it seems to work.
ulfdoz has joined #ocaml
<hcarty>
thelema: I have a transpose that could be added to BatArray... but I expect a BatMatrix (or BatArray2d?) would be a better target for something like that.
<thelema>
we can Experimental that. I like BatMatrix
<hcarty>
thelema: Ulib has a Matrix/2D-array module which could be pulled from.
<mrvn>
Uses twice as deep a recursion so fails at half the size of the matrix.
<thelema>
mrvn2 (178.28 ns) is 2.7% faster than
<thelema>
sepp2k (183.23 ns) which is 25.4% faster than
<thelema>
mrvn1 (245.49 ns)
<thelema>
for the 3x3 example in your first paste
<mrvn>
try 10x10 or 100x100
<thelema>
for 10x10:
<thelema>
mrvn1 (2.13 us) is probably (alpha=9.11%) same speed as
<thelema>
mrvn2 (2.20 us) which is 2.4% faster than
<thelema>
sepp2k (2.25 us)
<thelema>
for 100x100:
<thelema>
sepp2k (369.89 us) is 12.3% faster than
<thelema>
mrvn2 (421.81 us) which is 34.7% faster than
<thelema>
mrvn1 (645.70 us)
<mrvn>
1000x1000?
<mrvn>
I think you get some GC runs in some of your tests but not others.
<thelema>
with 500x500:
<thelema>
mrvn2 (50.36 ms) is probably (alpha=6.49%) same speed as
<thelema>
sepp2k (51.28 ms) which is 4.5% faster than
<thelema>
mrvn1 (53.71 ms)
<thelema>
I've turned on Gc between tests, new 500x500 results coming
emmanuelux has joined #ocaml
<thelema>
sepp2k (49.64 ms) is 1.8% faster than
<thelema>
mrvn2 (50.58 ms) which is 7.5% faster than
<thelema>
mrvn1 (54.68 ms)
<mrvn>
Why can't I write ( :: ) or why isn't there a List.cons?
<thelema>
mrvn: in batteries there is.
<thelema>
(::) isn't a function, it's technically a variant constructor
<mrvn>
List.map2 ( :: ) x (transpose xs) would look good
<thelema>
type 'a list = (::) of 'a * 'a list | []
<mrvn>
thelema: yeah. I want first class constructors. :)
<thelema>
mrvn: the dev team had them but decided that they weren't worth the extra compiler complexity, so they got removed between caml special light and ocaml
<mrvn>
thelema: Since batteries has mutable lists internally you could change mrvn1 to use append int the List.map2 call and remove the List.rev
larhat has quit [Quit: Leaving.]
<thelema>
actually, we don't have an efficient append.
<thelema>
at least we don't expose one
<thelema>
we just hide it internally
<thelema>
I guess we could do the same for this code...
<thelema>
except we'd have to... hmm...
<alpounet>
yeah this is quite a pitty not to have first class constructors...
<thelema>
alpounet: only a slight pity
<alpounet>
well, it would just happen to be really convenien for OCaml programmers
jarray52 has left #ocaml []
eni has joined #ocaml
mononofu has quit [Remote host closed the connection]
<thelema>
mrvn: good call, here's numbers on 500x500:
<thelema>
w/append (23.94 ms) is 52.2% faster than
<thelema>
sepp2k (50.12 ms) which is probably (alpha=22.40%) same speed as
<thelema>
mrvn2 (50.50 ms) which is 9.1% faster than
<hcarty>
mrvn: I'm heading off for a while, but if you have any questions about the module I can answer them when I get back.
<mrvn>
hcarty: That won't completly optimize away if I want to turn debugs off.
<thelema>
mrvn: you basically need macros for that, or to have the logging function compiled into your code and triggered off a non-ref value.
<mrvn>
does ocamlopt remove unreachable code as in let level = 5 ... if (9 < level) ....?
<thelema>
yes
<mrvn>
So making level not a ref should help.
<mrvn>
And then I think all arguments need to be lazy so they only evaluate when needed.
gnuvince_ has quit [Ping timeout: 256 seconds]
<thelema>
you need the level to be declared as part of your project before the logging code for that to work
<mrvn>
thelema: yes.
<thelema>
ok then, I guess we have another logging module in the world
<mrvn>
thelema: make logging a functor that takes the level as argument or something.
<mrvn>
Would be nice to have a Lazy.printf
gnuvince has joined #ocaml
<mrvn>
Maybe I should learn camlp4 for that. It could remove the debug statements at compile time depending on the level.
Tobu has joined #ocaml
j2d2j2d2_ is now known as j2d2j2d2
eni has quit [Quit: Leaving]
err404 has quit [Remote host closed the connection]
Anarchos has joined #ocaml
jamii has joined #ocaml
snearch has quit [Quit: Verlassend]
Xizor has quit []
Tobu has quit [Ping timeout: 272 seconds]
Snark has quit [Quit: Quitte]
rly has left #ocaml []
gnuvince has quit [Ping timeout: 244 seconds]
Tobu has joined #ocaml
oriba has joined #ocaml
Submarine has quit [Ping timeout: 245 seconds]
gnuvince has joined #ocaml
xcvd has joined #ocaml
jamii has quit [Read error: Operation timed out]
_andre has quit [Quit: leaving]
Cyanure has quit [Remote host closed the connection]
joelr has joined #ocaml
joelr has quit [Client Quit]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
roha has joined #ocaml
<pippijn>
how can I get context dependent keywords with ocamlyacc/ocamllex?
Tobu has quit [Ping timeout: 272 seconds]
bjorkintosh has quit [Read error: Operation timed out]
patronus has joined #ocaml
<mrvn>
you can't. they are for context free grammaers
patronus_ has quit [Read error: Connection reset by peer]
BiDOrD_ has quit [Ping timeout: 260 seconds]
BiDOrD has joined #ocaml
<pippijn>
ok
<pippijn>
so I need to use dypgen?
<ssbr_>
blagagh. Is this the place to ask about camlp4 stuff?
<ssbr_>
I'm having trouble dealing with the grammar of things that can be of the form "Foo(a:b)" versus "Foo(a).". camlp4 complains that it was expecting a ":" in the latter case, whereas I want it to realize that if it encounters a ')' (or ','), then things are of the second form, not the first
<ssbr_>
I _think_ this should be possible for LL(1), right? I'm not too sure of the theory, but you only need that one next character: if it's ":" it's the first case, if it's "," or ")" it's the second or third case (and then you distinguish based on ":" or ".")
<ssbr_>
oh, maybe I can hack around this using a first required thing and then LIST0? I assume it's LIST1 that's confusing camlp4
smondet` has quit [Ping timeout: 245 seconds]
xcvd has quit [Quit: Leaving]
<ssbr_>
well that changed the error to ":" or "," or "," expected after [variable] (in [expr])
<ssbr_>
instead of just ":". So something else is also broken. Wooo.
roha has quit [Ping timeout: 265 seconds]
<ssbr_>
I really wish it'd say something like "found <x> instead". I don't know how to debug this.