adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
ollehar has quit [Quit: ollehar]
johnelse is now known as johnel_away
pgiarrusso has quit [Quit: pgiarrusso]
pgiarrusso has joined #ocaml
pgiarrusso has quit [Client Quit]
sh0t has joined #ocaml
segmond has quit [Ping timeout: 250 seconds]
teknozulu has quit [Ping timeout: 256 seconds]
jeffmo has quit [Quit: jeffmo]
Stalkr has quit [Quit: Leaving...]
dksong has joined #ocaml
pgiarrusso has joined #ocaml
shinnya has quit [Ping timeout: 240 seconds]
Stalkr has joined #ocaml
damason has quit [Ping timeout: 248 seconds]
Stalkr has quit [Read error: Connection reset by peer]
segmond has joined #ocaml
raphaelss has joined #ocaml
foolishmonkey has quit [Quit: Leaving]
kakadu has quit [Remote host closed the connection]
darkf has quit [Ping timeout: 240 seconds]
darkf has joined #ocaml
theblatt1 has joined #ocaml
theblatte has quit [Ping timeout: 245 seconds]
sh0t has quit [Ping timeout: 250 seconds]
jeffmo has joined #ocaml
pgiarrusso has quit [Quit: pgiarrusso]
ygrek_ has joined #ocaml
pgiarrusso has joined #ocaml
ygrek has quit [Ping timeout: 256 seconds]
struk|desk|away is now known as struk|desk
mspo has left #ocaml [#ocaml]
raphaelss has quit [Ping timeout: 240 seconds]
Algebr2 has joined #ocaml
pgiarrusso_ has joined #ocaml
pgiarrusso has quit [Ping timeout: 252 seconds]
pgiarrusso_ is now known as pgiarrusso
sh0t has joined #ocaml
sh0t has quit [Remote host closed the connection]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
dksong has quit [Quit: Leaving.]
struk|desk is now known as struk|desk|away
hcarty has joined #ocaml
ygrek_ has quit [Ping timeout: 240 seconds]
pierpa has quit [Ping timeout: 248 seconds]
struk|desk|away is now known as struk|desk
teknozulu has joined #ocaml
SomeDamnBody has joined #ocaml
<SomeDamnBody> I have three sequences that I want to iterate over in conjunction. I know about zip, but is there a version of zip that will take arbitrarily many sequences and produce ('a * 'b... *z)?
<dmbaturin> SomeDamnBody: This is theoretically possible, but it's definitely not in the standard library.
<SomeDamnBody> dmbaturin, I'm using core_kernel
<SomeDamnBody> How would I do it with that
<dmbaturin> Or any library I know of, for that matter. :)
dksong has joined #ocaml
<dmbaturin> Well, it would need quite a bit of type magic.
<SomeDamnBody> mmm ...
<SomeDamnBody> is there any module that is designated for iterator magic?
<SomeDamnBody> I mean, the alternative is to nest the zip, but then you end up with (('a * 'b) * 'c)
<SomeDamnBody> which is different I think
<SomeDamnBody> Does ocaml support variadic signatures?
<SomeDamnBody> I would think that if the signature of the zip function were variadic, then so too the return type could be as well
<dmbaturin> SomeDamnBody: It supports generalized algebraic datatypes, which can be used to emulate variadic signatures in some cases. The alternative to it is specific use of curried functions, like here: http://baturin.org/code/files/unparsing.ml
<SomeDamnBody> hmm. I was thinking that unless an arbitrary number of arguments could be passed to a function that I would need something like ppx to generate what I wanted
<dmbaturin> Personally I find zip problematic, because without dependent types it's impossible to guarantee that all lists are the same length and nothing will be truncated.
pgiarrusso has quit [Quit: pgiarrusso]
hcarty has quit [Ping timeout: 264 seconds]
<SomeDamnBody> Well, you can do a version of zip that will give you the left and right if one of them is longer than the other
<SomeDamnBody> but in this case, I'm working on multiple data sets produced by evaluating a set of files in a pair of directories
<SomeDamnBody> I have 3 functions, and two directories
<SomeDamnBody> The two directories should have the same number of files in them, but that is utility assumption in my binary; I can code for that easily by testing.
teknozulu has quit [Read error: Connection reset by peer]
teknozulu has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
luigy has quit [Excess Flood]
luigy has joined #ocaml
johnel_away has quit [Ping timeout: 272 seconds]
johnel_away has joined #ocaml
johnel_away has quit [Ping timeout: 245 seconds]
dksong has quit [Quit: Leaving.]
pgiarrusso has joined #ocaml
johnel_away has joined #ocaml
jeffmo has quit [Ping timeout: 240 seconds]
pgiarrusso has quit [Quit: pgiarrusso]
Sorella has quit [Quit: Connection closed for inactivity]
nicholasf has quit [Ping timeout: 240 seconds]
MercurialAlchemi has joined #ocaml
pgiarrusso has joined #ocaml
nicholasf has joined #ocaml
struk|desk is now known as struk|desk|away
struk|desk|away is now known as struk|desk
pgiarrusso has quit [Quit: pgiarrusso]
nicholasf has quit [Ping timeout: 240 seconds]
MercurialAlchemi has quit [Ping timeout: 245 seconds]
pgiarrusso has joined #ocaml
Madars has quit [Ping timeout: 250 seconds]
Madars has joined #ocaml
MercurialAlchemi has joined #ocaml
struk|desk is now known as struk|desk|away
darkf has quit [Quit: Leaving]
nicholasf has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
djellemah_ is now known as djellemah
teknozulu has quit [Ping timeout: 276 seconds]
Algebr2 has quit [Ping timeout: 260 seconds]
jacquev6 has joined #ocaml
malc_ has joined #ocaml
tautologico has quit [Quit: Connection closed for inactivity]
Haudegen has quit [Ping timeout: 245 seconds]
freehck has joined #ocaml
pgiarrusso has quit [Quit: pgiarrusso]
nkhodyunya has joined #ocaml
nkhodyunya has quit [Client Quit]
ygrek_ has joined #ocaml
kansi has joined #ocaml
pgiarrusso has joined #ocaml
pgiarrusso has quit [Client Quit]
Maxdamantus has joined #ocaml
Anarchos has joined #ocaml
Simn has joined #ocaml
Haudegen has joined #ocaml
sepp2k has joined #ocaml
nkhodyunya has joined #ocaml
nkhodyunya has quit [Ping timeout: 240 seconds]
silver has joined #ocaml
malc_ has quit [Quit: leaving]
dsheets has joined #ocaml
SomeDamnBody has quit [Ping timeout: 240 seconds]
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
demus has joined #ocaml
kansi has quit [Remote host closed the connection]
warp has joined #ocaml
nkhodyunya has joined #ocaml
warp_ has joined #ocaml
warp has quit [Ping timeout: 240 seconds]
kolko has joined #ocaml
nkhodyunya has quit [Ping timeout: 276 seconds]
lmaury has joined #ocaml
dsheets has joined #ocaml
vincenzoml has joined #ocaml
Lis has joined #ocaml
<vincenzoml> hi there, I am loading a Bigarray.Genarray.t of variable dimensions, and then would like to process it cell by cell in a function that accepts a Bigarray.Array1.t, without copying
jwatzman|work has joined #ocaml
lolisa has joined #ocaml
<vincenzoml> thus I would need a "cast" function and index conversions for indexes of different dimensions, that I'm sure I could compute myself (thus I could in principle only use Array1.t), but would be great if I could use the already implemented functions in OCaml
pgiarrusso has joined #ocaml
pgiarrusso has quit [Quit: pgiarrusso]
johnel_away is now known as johnelse
johnelse is now known as Guest20805
Guest20805 is now known as johnelse
jgjl has joined #ocaml
kansi has joined #ocaml
larhat1 has quit [Quit: Leaving.]
pgiarrusso has joined #ocaml
pgiarrusso has quit [Client Quit]
pgiarrusso has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
ygrek_ has quit [Ping timeout: 250 seconds]
vincenzoml has quit [Ping timeout: 252 seconds]
warp has joined #ocaml
warp_ has quit [Read error: Connection reset by peer]
warp_ has joined #ocaml
octachron has joined #ocaml
warp has quit [Ping timeout: 248 seconds]
yegods has quit [Remote host closed the connection]
yegods has joined #ocaml
kakadu has joined #ocaml
dsheets has quit [Remote host closed the connection]
AlexRussia_ has quit [Ping timeout: 245 seconds]
octachron has quit [Ping timeout: 240 seconds]
sillyotter has joined #ocaml
sillyotter has quit [Client Quit]
jwatzman|work has quit [Quit: jwatzman|work]
jwatzman|work has joined #ocaml
yegods has quit [Remote host closed the connection]
jave has quit [Ping timeout: 250 seconds]
dsheets has joined #ocaml
yegods has joined #ocaml
jave has joined #ocaml
rand__ has joined #ocaml
nkhodyunya has joined #ocaml
nkhodyunya has quit [Ping timeout: 256 seconds]
yawnt has joined #ocaml
Stalkr has joined #ocaml
octachron has joined #ocaml
Stalkr has quit [Remote host closed the connection]
Stalkr has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
dhil has joined #ocaml
nkhodyunya has joined #ocaml
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
M-Illandan has quit [Quit: node-irc says goodbye]
Haudegen has quit [Ping timeout: 245 seconds]
tane has joined #ocaml
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
nkhodyunya has quit [Quit: Leaving.]
Haudegen has joined #ocaml
dsheets has quit [Remote host closed the connection]
fluter has quit [Ping timeout: 264 seconds]
dksong has joined #ocaml
fluter has joined #ocaml
dksong has quit [Ping timeout: 272 seconds]
jwatzman|work has joined #ocaml
jgjl has joined #ocaml
dksong has joined #ocaml
lolisa has quit [Quit: KVIrc 4.9.1 Aria http://www.kvirc.net/]
Sorella has joined #ocaml
elfring has joined #ocaml
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jgjl has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
jwatzman|work has joined #ocaml
demus has quit [Quit: Leaving]
hcarty has joined #ocaml
copy` has joined #ocaml
aantron has quit [Quit: Leaving...]
edwin has quit [Ping timeout: 250 seconds]
edwin has joined #ocaml
wilco__ has joined #ocaml
dsheets has joined #ocaml
M-Illandan has joined #ocaml
<kakadu> It's time for silly questions again! Can I map a tuple without any insafe crazy stuff? At the moment types are not OK...
<flux> kakadu, you mean they are not polymorphic?
<flux> oh, no
<kakadu> I expect that they should be different
BitPuffin has joined #ocaml
<kakadu> That idea was that mmm intospects ('a logic) where it doesn't bother the real structure of 'a
<flux> maybe you should write also the PolyPairs signature to make it an error
<Drup> That obj.magic stuff is pure non sens and completely unecessary
<Drup> Kakadu: I think it's time you learn about GADTs :)
<kakadu> The real question is:
<kakadu> Is it possible?
<hcarty> Drup: Slight improvement to location reporting - still not correct or precise enough: https://gist.github.com/hcarty/2e817c5541b5f2758686
MercurialAlchemi has quit [Remote host closed the connection]
<Drup> nah, don't use default loc
<kansi> trying to follow this https://github.com/mirage/mirage/tree/master/lib_test/fat to attach fat formatted disk but can't find make-example-image.sh
<Drup> just add [@metaloc now.pexp_loc] after [%expr ... ] in make_defer
<kansi> does anyone know what command is the shell script executing
<Drup> And yes, it should be the location of now.
badon has quit [Disconnected by services]
badon_ has joined #ocaml
MercurialAlchemi has joined #ocaml
badon_ is now known as badon
<Drup> (also, you still have the identifier issue)
<Drup> You probably wan't to make the location ghost, though
<hcarty> Drup: Thanks... I hadn't used that variation. I thought I somehow needed to attach the [@metaloc ...] attributes to the now and later inside of [%expr ...]
<hcarty> Drup: ghost?
<Drup> yeah, the loc_ghost field in Location.t
<Drup> It tells the compiler and tools that this code is generated
<hcarty> Oh nice, thanks
<hcarty> I'm not sure how to get around the identifier issue. How do I reorder expressions without using a temporary named value?
<Drup> (Side not, I think lwt's [@finalize] does what you want)
<hcarty> Drup: Updated with @metaloc and setting loc_ghost after creating the [%expr ...]
<hcarty> And I'll take a look
crass has joined #ocaml
<Drup> well, I don't know about the version with exception
<octachron> Kakadu, what do you mean by maping tuple? A function (a_1 * ... * a_n ) → (a_1 → b_1 ) → .. → (a_n → b_n) → (b_1 * ... * b_n) ?
<hcarty> Drup: If I use that as a reference do you mind if I release ppx_defer under MIT? It's a small amount of code, so once I figure this out I'd like to write it up and put it on opam in case it's useful for others.
<Drup> Well, your thing already work. lwt's license don't influence what you already wrote
pierpa has joined #ocaml
kakadu has quit [K-Lined]
<Drup> kansi: I'm wondering if this readme is not outdated, and you just need to do "mirage configure" and so on
<hcarty> Drup: Either way, thank you so much for your help. This is a new area for me and I appreciate the guidance.
dsheets has quit [Remote host closed the connection]
freehck has quit [Remote host closed the connection]
th5 has joined #ocaml
dksong has quit [Quit: Leaving.]
aantron has joined #ocaml
dsheets has joined #ocaml
yawnt has quit [Ping timeout: 260 seconds]
<kansi> Drup this example creates a raw block device ... i need to create a fat formatted file
<kansi> i know i need to use mkfs.fat but no sure about the args
yawnt has joined #ocaml
<Drup> Ah.
freehck has joined #ocaml
<Drup> kansi: open a bug report
BitPuffin has quit [Ping timeout: 252 seconds]
kakadu_ has joined #ocaml
kakadu_ is now known as Kakadu
<Kakadu> octachron: IRC server banned my IP after your message. :)
<Kakadu> okay, mapping a tuple
<Kakadu> I can write functions like '_c logic -> '_b logic -> '_a logic -> '_c * ('_b * ('_a * unit))
<Kakadu> and I want to do something with these type variables
<Kakadu> for example I want to convert them to 'a lists
sh0t has joined #ocaml
nkhodyunya has joined #ocaml
accname has joined #ocaml
ggole has joined #ocaml
FreeBirdLjj has joined #ocaml
<accname> Hi there, does anyone has experience with profiling interactive ocaml programs?
shinnya has joined #ocaml
<accname> to be precise HOL Light
FreeBirdLjj has quit [Remote host closed the connection]
<Drup> then the script is indeed emited by configure.
AlexRussia_ has joined #ocaml
kansi has quit [Remote host closed the connection]
kansi has joined #ocaml
mrvn has joined #ocaml
<th5> @accname you might want to try in #coq
<octachron> Kakadu, so a function like 'integer → ('a * ( 'b * ... ) ) → ('a list * ('b list * ... ) ?
<aantron> ladies and gentlemen, the new bisect_ppx is out. enjoy code coverage analysis :) https://github.com/rleonid/bisect_ppx
<mrvn> I have a game board with 5x7 tiles, each tile can hold one of " ABCDE". I need to hold millions of them in memory. Any suggestions how to best store and manipulte them? I'm thinking Int128 using 3 bit per tile or bitstrings so far.
<Kakadu> octachron: mmm, not really
<Kakadu> It seems taht I don't understand what I want
<Kakadu> I have `state list` where state has binding to logic variables
<Kakadu> An I want a function fun var -> List.map (fun state -> var_of_state var state) states
<Kakadu> I mean I can write it for single variable
<mrvn> that sounds like you already have it
<octachron> mrvn, since 5 ** 3 = 125 ≈ 128 would it not be more efficient to store 3-tile configuration in 7 bits?
<Kakadu> but when i have 'var1 -> 'var2 -> 'var3 -> ('var1,('var2,(var3',()))))
<mrvn> octachron: 6 states
<Kakadu> I can't understand how to get 'var1 -> 'var2 -> 'var3 -> ('var1 lsit,('var2 list,(var3' list,()))))
<Kakadu> oh, and asterisks
<Kakadu> wee are not yet in #haskell :)
<mrvn> octachron: 3 tiles in 8 bit. Gives 12 byte total vs 14 byte with 3 bit per tile.
<octachron> mrvn, ah I missed the blank state :)
<th5> Would it really be that much of a hit to have a more naive approach? Square array of union type?
<mrvn> octachron: 6^(5*7) < 2^91 = 11.375 byte. 12 byte seems the smallest it can be without going below the byte granularity.
<mrvn> th5: 5*7 array or union is 35 * 8 + 8 = 288 bytes
<mrvn> th5: I'm hitting out of memory on a 64GB ram system.
Mercuria1Alchemi has joined #ocaml
<th5> Ah ok. Had been wondering if you were pre-maturely optimizing.
<mrvn> tile array array would be even more but boards could share subarrays when they didn't change from one move to the next.
<mrvn> Not enough to compete with a 12 byte per board compaction though.-
<th5> May want to hash cons
ergo has joined #ocaml
<mrvn> th5: All boards are unique. I actually build a huge hashtbl and only add boards not already present.
nopf has quit [Ping timeout: 276 seconds]
<octachron> Kakadu, if I understand correctly, you want to lift the whole function: ( 'var_1 → ... → var_n → (var_1 * ... var_n ) ) → (var_1 → var_1') → ... (var_n → var_n' ) → (var_1' * (.. var_n') )?
<octachron> argh, sorry I mean ( → ( var_1 → ... → var_n) → (var_1'* (... var_n') )
<octachron> If that is the case, it sounds both possible and at the limit of pure type madness
<mrvn> hmm, maybe I should use a Bigarray, use 12 bytes per board in there and build a hashtable (hash board) -> (offset in bigarray). Would be half the size of a 12byte string per board.
<hcarty> Drup: https://github.com/hcarty/ppx_defer -- thank you again for your help!
<octachron> mrvn, another point do you expect your board set to be compressible?
<mrvn> octachron: every board has 5 A, 5 B, 5 C, 5 D, 5 E and 10 " ". Might be compressible. Not sure if that would help though since I need the board to check for equality a lot.
silver has quit [Quit: rakede]
FreeBirdLjj has joined #ocaml
phonzbm has joined #ocaml
<octachron> mrvn, at least you can save 1 byte by not storing the state of the last tile
nekrodesk has joined #ocaml
<mrvn> octachron: right, that gives < 2^88 states or 11 bytes per board.
<octachron> it should be possible to go a little bit further with variable lenght and stopping when the board is fully determined
<mrvn> octachron: the " " can only be at the top of the board.
<mrvn> octachron: It's 5 colums of 7 spaces with letters A-E in them. I guess I should count the number of free slots per colum instead of storing " " tiles.
BitPuffin has joined #ocaml
wilco__ has quit [Quit: leaving]
Kakadu has quit [Ping timeout: 240 seconds]
slash^ has joined #ocaml
<mrvn> Wow, that gets me down to 2^70
<mrvn> correction. I don't need to store the number of spaces in the last column, so 7^4*5^24 < 2^67
<th5> nice! thats huge
<mrvn> now, if I could 3 more bits ....
<th5> this is a fun packing problem - had me on the whiteboard for a few minutes - like i was back in school learning to lay out arrays of structs
warp_ has quit [Ping timeout: 260 seconds]
dsheets has quit [Remote host closed the connection]
accname has quit [Quit: Leaving]
<octachron> mrvn, if I am not mistaken the theoretical number of configuration is 25!/5!**5 < 2**58 so the ideal is 8 bytes by board
<octachron> beyond you will need additional correlations in your data
elfring has quit [Remote host closed the connection]
elfring has joined #ocaml
jgjl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nekrodesk has quit [Max SendQ exceeded]
<mrvn> octachron: I'm thinking of swithing to https://en.wikipedia.org/wiki/SMA* instead of pure A*. Then I need to store 2 costs (between 22-37 I think so 4 bit each) and which of 40 moves was used.
troydm has quit [Ping timeout: 248 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
troydm has joined #ocaml
dsheets has joined #ocaml
octachron has quit [Quit: Leaving]
<mrvn> hmm, or maybe not. I don't think that will work well given that cost can only be between 22 and 37 and I quickly have only nodes with cost 37 left.
<pierpa> mrvn: is it a game? is it a known game?
<pierpa> aha! k.
<mrvn> You have 5 colums of stones (lettered A-E) with a mximum height of 7 and you can move 1 or 2 equal stones from one column to another each move.
<mrvn> Start and goal configuration are given and I need a sequence of moves to get from start to gaol.
<pierpa> k
<pierpa> now the constraints are much clearer
struk|desk|away is now known as struk|desk
<pierpa> a brute force solution seems impossible, however much you compress the positions...
<mrvn> I have a heuristic of how many moves it still takes to solve a position that's never to high.
<pierpa> k
<mrvn> Means I can prune a lot of branches that go in the wrong direction.
<pierpa> yes, yes
<mrvn> For most level this works great but this one has too much "bad" moves you have to make to solve it. The heuristic says 22 but you need 37. Lots of wiggle room.
<pierpa> yes
<mrvn> maybe someone has an idea for a different heuristic?
ygrek_ has joined #ocaml
nekrodesk has joined #ocaml
nekrodesk has quit [Max SendQ exceeded]
nekrodesk has joined #ocaml
nekrodesk has quit [Max SendQ exceeded]
sh0t has quit [Quit: Leaving]
yawnt has quit [Ping timeout: 250 seconds]
nekrodesk has joined #ocaml
nekrodesk has quit [Max SendQ exceeded]
nekrodesk has joined #ocaml
nekrodesk has quit [Max SendQ exceeded]
Haudegen has quit [Ping timeout: 245 seconds]
silver has joined #ocaml
nekrodesk has joined #ocaml
nekrodesk has quit [Max SendQ exceeded]
yawnt has joined #ocaml
rand__ has quit [Quit: leaving]
ggole has quit []
Algebr2 has joined #ocaml
nekrodesk has joined #ocaml
ygrek_ has quit [Ping timeout: 264 seconds]
malc_ has joined #ocaml
ygrek_ has joined #ocaml
malc_ has quit [Quit: leaving]
malc_ has joined #ocaml
th5 has quit [Ping timeout: 256 seconds]
struk|desk is now known as struk|desk|away
Haudegen has joined #ocaml
nkhodyunya has quit [Quit: Leaving.]
struk|desk|away is now known as struk|desk
Haudegen has quit [Ping timeout: 240 seconds]
darkf has joined #ocaml
nkhodyunya has joined #ocaml
yawnt has quit [Ping timeout: 248 seconds]
ygrek_ has quit [Ping timeout: 250 seconds]
jacquev6 has quit [Quit: jacquev6]
dsheets has quit [Remote host closed the connection]
dhil has quit [Ping timeout: 248 seconds]
dsheets has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
yawnt has joined #ocaml
th5 has joined #ocaml
Haudegen has joined #ocaml
kdas_ has joined #ocaml
kushal has quit [Ping timeout: 252 seconds]
lokien has joined #ocaml
<lokien> how to compile my code which uses core? ocamlc gives "unbound module Core"
<lokien> I asked it before, but I forgot it. I have to write it down somewhere :(
<yawnt> corebuild ?
struk|desk is now known as struk|desk|away
<Algebr2> could use corebuild or something like: ocamlfind ocamlc -package core -linkpkg file.ml
jeffmo has joined #ocaml
<lokien> corebuild doesn't give me a runnable file. do I have to do ocamlc again?
<Algebr2> corebuild presumably would before something like corebuild foo.native
<Algebr2> or corebuild foo.byte, i think, I haven't used corebuild in a long time
<Algebr2> but you should be able to use ocamlfind as well
ygrek_ has joined #ocaml
<lokien> ohh, .native! thank you very much man :D
<Algebr2> yay
dsheets has quit [Remote host closed the connection]
nkhodyunya has quit [Quit: Leaving.]
nekrodesk has quit [Max SendQ exceeded]
Mercuria1Alchemi has quit [Ping timeout: 260 seconds]
larhat1 has joined #ocaml
Kakadu has joined #ocaml
<lokien> easy way to print a variable? I don't need printf, just something like print(x)
<yawnt> print_*
<yawnt> where * is: int, char, float, whatever
<ygrek_> I wonder how do you get variable in ocaml code in the first place
<lokien> value! :D
<lokien> thanks yawnt, works like a charm
<yawnt> ygrek_: ref?
<yawnt> :P
nekrodesk has joined #ocaml
nekrodesk has quit [Max SendQ exceeded]
<lokien> by the way, do you consider ocaml as a big language? like c++/scala big?
<yawnt> no
<lokien> thank god :D
<lokien> since I'm too silly to reason about big ecosystems
lokien_ has joined #ocaml
<Drup> More importantly, the complicated part are well compartimented
<Drup> Even if there is an object system, the fact that it exists doesn't polute the rest of the feature and you can safely ignore it if you don't want to use it
<Drup> the same is true for most "advanced features"
<lokien> I can even write purely functional
<lokien> right?
<Drup> nothing ensures that it's pure, but yes
<lokien> I'm in love
malc_ has quit [Quit: leaving]
lokien has quit [Remote host closed the connection]
nekrodesk has joined #ocaml
Mercuria1Alchemi has joined #ocaml
BitPuffin has quit [Ping timeout: 252 seconds]
lobo has joined #ocaml
<ergo> is there a good resource to learn how to properly structure ocaml code?
<hcarty> ergo: Some basic style guidelines are here: https://ocaml.org/learn/tutorials/guidelines.html
<ergo> and beyond that? i tried to look at some open-source projects, but so far, it takes a lot of time to understand
<hcarty> There may be something in OCaml From the Very Beginning - http://ocaml-book.com/
<ergo> thank you
<hcarty> Are there specific things you are looking for? If the content is missing from ocaml.org it would be good to know so the site can be updated.
<hannes> ergo: a module is in the best case a self-sufficient unit -- such as "Set" -- and includes all useful functions.. I try to grow my modules mostly around a single type, and evolve from there..
<ergo> i'm having trouble understanding when to separate things into modules, when using a functor is a good idea and such
<ergo> alright thank you, i'll read the book and continue to read some projects. I just started with ocaml, so i guess i just need more experience
<Drup> also, don't hesitate to make submodules
<hannes> ergo: the "more OCaml" (from the same author as 'OCaml from the very beginning' has some nice chapters about the module system in it... definitively worth reading and doing the exercises)
<ergo> i'll definitely read the books
idegen has joined #ocaml
idegen has left #ocaml [#ocaml]
yegods has quit [Remote host closed the connection]
<ergo> also which build system is prefered these days?
slash^ has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
<dmbaturin> ergo: If you are familiar with OOP, you can think of modules similar to classes.
<th5> you can get very far in ML with just the basics - functions + adts + pattern matching - often wont need to use modules
<ergo> i know that's true, but i imagine it gets ugly as the project grows so i want to learn best practices right from the beginning
<dmbaturin> ergo: As ML supports abstract types, modules are often used for encapsulation.
<ergo> unfortunately i'm only familiar with assembly and C. But i thing i understood the explanation by hannes
<dmbaturin> But the simplest module is just a collection of functions.
koshmar has quit [Ping timeout: 240 seconds]
<lobo> ergo: regarding build systems i found this blog post as a beginner very useful http://hyegar.com/blog/2015/10/19/so-you're-learning-ocaml/
<ergo> alright, thank you all for your help, much appreciated
nekrodesk has quit [Max SendQ exceeded]
ersatz has joined #ocaml
<mrvn> What do you think of this range encoder for my board state? http://paste.debian.net/379662/
Haudegen has quit [Ping timeout: 272 seconds]
koshmar has joined #ocaml
Anarchos has joined #ocaml
<_berke__> lobo: from that page "ocamlbuild is a tool that helps build OCaml programs, many people have strong opinions on it." - does anyone have a positive opinion of ocamlbuild?
<mrvn> _berke__: oasis uses it and I don't have to care about it.
<_berke__> oasis is great, it takes 99% of the headaches away
<mrvn> but if you do it is a steep learning curve and you basically start writing your own build system in ocaml to add features.
<mrvn> s/do/do have to care/
<_berke__> I usually end up having to put in a few myocamlbuild lines, for example for o-bus interface files
<_berke__> but I never understood (or really tried) the rule system
<mrvn> same here. was hard enough to add the little I needed.
<_berke__> anyway looks like people are taking good care of ocamlbuild now that it has its own repo
<_berke__> maybe someone will even write some comprehensive documentation
<mrvn> it realy isn't extensible for the faint of heart. It stops being a black box when you have to.
<mrvn> unlike e.g. GNU make where adding rules is trivial.
<_berke__> the philosophy was that we didn't want another mini-language...
<_berke__> is it omake that reimplements lambda calculus
<mrvn> instead now every source has a full copy of the whole build system and many have some extra lines added in the middle.
<_berke__> hmm but that's more of an _oasis thing
freehck has quit [Remote host closed the connection]
<mrvn> _berke__: not realy. you have myocambuild.ml in every source
<_berke__> not necessarily, it can be absent, or it can be only a few lines
<mrvn> all the sources I've seen had the full thing there.
<_berke__> I'm not sure what you mean by the full thing?
<mrvn> It should just be something like "include Ocamlbuild \n let rules = rules @ ... let () = build args"
<mrvn> _berke__: a big long file with tons of lines
<_berke__> mrvn: like this? http://pastebin.com/drWEsyMr
<zozozo> /b #ocaml-fr
<Drup> mrvn: that's an oasis thing
<zozozo> sorry
Haudegen has joined #ocaml
<mrvn> _berke__: yeah, like that except readable for the novie
<mrvn> Drup: nah, seen that without the "open ..." tons of times
<Drup> ah, you are mentioning the dispatch stuff
<Drup> yeah, OCamlbuild's API is awful, that's not a revelation
<_berke__> I agree it's a bit too verbose. but it's not easy to design an API that is super simple in the general case but is flexible enough.
<_berke__> the verbosity is ugly, but that's not the biggest problem. the biggest problem is that the way it works is impenetrable
<Drup> _berke__: I'm sorry, but ocamlbuild's API has few redeeming quality
<_berke__> drup: I'm not disagreeing
<mrvn> _berke__: exactly. Where is the docu that tells you what all those things in your dispatch call mean?
<Drup> mrvn: they didn't wrote one
<_berke__> if the API was... understandable, having the mlis might have been enough
<_berke__> not as good as having proper documentation of course
<Drup> because apparently, documentation is the work of users
<Drup> _berke__: no, the mli are not enough, in the case of ocamlbuild
<mrvn> _berke__: and why do you add sexplib with ocaml_lib but tepe-cpnf with flags?
<mrvn> type-conf
<_berke__> drup: I know, that's what I'm saying. some APIs are good enough so that you can just go by the mli
<_berke__> mrvn: you're talking about that example myocamlbuild? I have no idea, it's some old stuff that was floating around. I probably copied-and-pasted the rules.
aphprentice_ has joined #ocaml
<_berke__> drup: obviously not the case with ocamlbuild
lmaury has quit [Read error: Connection reset by peer]
<mrvn> _berke__: yeah. it's horribly confusing and lots of people blindly copy something till it works without understanding.
<mrvn> When you look at an _oasis file on the other hand you basicaly see what's intended without knowing anything about it.
<_berke__> yep. it's sweet
<_berke__> but if what you need is not implemented... tough luck
<mrvn> then you have to add chunks to _tags and myocambuild.ml
<_berke__> _tags is OK I think. but if you have to touch the myocamlbuild.ml then yeah it's all the problems we've been talking about
<_berke__> maybe if someone developed a layer above myocamlbuild... either another ocaml API, or maybe a little language...
<mrvn> luckily modern oasis has a mode where it has just your stuff in the _tags and myocamlbuild and adds the internal stuff when it copies the files to _build.
<_berke__> so that you don't have the #OASIS_TAG business?
<mrvn> _berke__: you mean a language like _oasis? :)
bugabinga has left #ocaml ["Boredom."]
<mrvn> _berke__: yep.
<_berke__> mrvn: shut up and take my money! where do I sign up?
<mrvn> much nicer for commiting to git (or other).
<_berke__> yeah the merge problem was the first thing my new co-worker who started on ocaml complained about
<_berke__> mrvn: oasis is still a bit too rigid, but maybe with the plugins
<Drup> _berke__: oasis setup -setup-update dynamic
<Drup> note that it means you need oasis to compile
<mrvn> Hmm, say I have an interval [<low>, <high>[ split into <num> pices (with the remainder evenly distributed accross the pices) and a value <x>. How do I get the pice number where the number is in?
Simn has quit [Read error: Connection reset by peer]
nekrodesk has joined #ocaml
nekrodesk has quit [Max SendQ exceeded]
<_berke__> drup: it seems to work, but I have to open a few modules in myocamlbuild.ml
<Drup> also, oasis emits far less stuff when you restrict the ocamlbuild version
<Drup> (or the ocaml version)
<_berke__> do I still have to call the dispatch_default hook? because I can't seem to find it
<mrvn> Since we now have Bytes that is probably needed a lot anyway.
<mrvn> apropo Bytes. What the .[x] for Bytes?
<mrvn> .(x) is array and .{x} is bigarray
<pierpa> in the docs is used always Bytes.set, I think
<mrvn> they all have get/set but somehow it's not the same. :)
<pierpa> yes
<pierpa> I mean, since they use Bytes.set, I assumed there's no syntactic sugar
<pierpa> I suggest .«x» :)
nekrodesk has joined #ocaml
<mrvn> I suggest .(x), you don't need to write to strings anyway and String.get s x is always there
<mrvn> let ( @ ) = String.get s@17
<pierpa> you mean .[x] ?
<mrvn> pierpa: aeh, yes.
<pierpa> I'm using .[] on strings a lot, though
<mrvn> too bad we don't have type classes and can't use .[x] for everything
<pierpa> hmmm
<mrvn> n8
f[x] has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 272 seconds]
l1x_ has joined #ocaml
rand__ has joined #ocaml
crass__ has joined #ocaml
struk|desk has joined #ocaml
ygrek_ has quit [Ping timeout: 250 seconds]
ski____ has joined #ocaml
ergo__ has joined #ocaml
Asmadeus_ has joined #ocaml
_2can_ has joined #ocaml
gustav__1 has joined #ocaml
hbar_ has joined #ocaml
stomp_ has joined #ocaml
jerith_ has joined #ocaml
jtmcf_ has joined #ocaml
_berke_ has joined #ocaml
f[x] has quit [Ping timeout: 240 seconds]
oskarth_ has joined #ocaml
keteim_ has joined #ocaml
ergo has quit [*.net *.split]
crass has quit [*.net *.split]
struk|desk|away has quit [*.net *.split]
msch has quit [*.net *.split]
oldmanistan_ has quit [*.net *.split]
l1x has quit [*.net *.split]
jtmcf has quit [*.net *.split]
rfv has quit [*.net *.split]
jeroud has quit [*.net *.split]
hbar has quit [*.net *.split]
jun has quit [*.net *.split]
jyc has quit [*.net *.split]
rbocquet has quit [*.net *.split]
_berke__ has quit [*.net *.split]
_2can has quit [*.net *.split]
Asmadeus has quit [*.net *.split]
yminsky has quit [*.net *.split]
myst|fon has quit [*.net *.split]
oskarth has quit [*.net *.split]
stomp has quit [*.net *.split]
jerith has quit [*.net *.split]
ski has quit [*.net *.split]
nekrodesk has quit [Max SendQ exceeded]
<hcarty> There is work to add both customer indexing operators and potentially type-dismbiguated indexing
<hcarty> s/customer/custom/
<hcarty> We almost got custom indexing operators in 4.03 but the type-disambiguation approach came up and conflicted enough that a decision was made to wait for 4.04
l1x_ is now known as l1x
oskarth_ is now known as oskarth
jun has joined #ocaml
rbocquet has joined #ocaml
MasseR has joined #ocaml
ergo__ has quit [Quit: leaving]
jyc has joined #ocaml
msch has joined #ocaml
sspi has joined #ocaml
jeroud has joined #ocaml
strmpnk has joined #ocaml
rfv has joined #ocaml
nicholasf has quit [Remote host closed the connection]
jerith_ is now known as jerith
oldmanistan_ has joined #ocaml
myst|fon has joined #ocaml
elfring has quit [Quit: Konversation terminated!]
lokien_ has quit [Quit: Connection closed for inactivity]
nicholasf has joined #ocaml
andreypopp_ has joined #ocaml
yminsky has joined #ocaml
* pgiarrusso thought he was stupid for being confused about Ocaml build tools.
<pgiarrusso> Thanks to the chatroom for disabusing me of the idea.
<Drup> pgiarrusso: don't worry, everyone is confused. :D
jeffmo has quit [Quit: jeffmo]
jeffmo has joined #ocaml
<hcarty> oasis/topkg/jenga/omake/OCamlMakefile/ocamlbuild/obuild/make is clearly the best choice
<pgiarrusso> hcarty: ROTFL
<pgiarrusso> OTOH, coming from Haskell, I envy `opam uninstall` and miss Opam hell, so you can still brag :-)
<pgiarrusso> (miss Opam hell = didn’t run into any analogue to “Opam hell” and I’ve been very mean to Opam)
<pgiarrusso> hcarty: feels like https://xkcd.com/927/ (XKCD “Standards”)
<pippijn> omake is the best
<pippijn> maybe jenga, but I don't understand jenga well enough, yet
<groovy2shoes> I'm a fan of TMk myself ¬_¬
nicholasf has quit [Remote host closed the connection]
<pippijn> omake is objectively the best
<pippijn> (the best I know anyway)
<groovy2shoes> pippijn, care to elaborate for me?
<pippijn> groovy2shoes: it's a fairly strict and simple system that gives you all the tools to create maintainable and powerful build scripts
<pippijn> it provides tools to do anything you may need to do related to build systems
<pippijn> the resulting recipes are composable due to them being scoped
Algebr2` has joined #ocaml
Algebr2` has quit [Remote host closed the connection]
<pippijn> it's easy to create and reuse components
<groovy2shoes> I've used it before, but I didn't really see many advantages over just using make... is there anything in particular that would make it worth another look?
Algebr2` has joined #ocaml
oldmanistan__ has joined #ocaml
Sorella_ has joined #ocaml
SomeDamnBody has joined #ocaml
<pippijn> it has a wealth of useful utilities to operate on dependency graphs, creating dynamic rules, etc.
<pippijn> groovy2shoes: yes, it's nothing like make
<groovy2shoes> TMk can do dynamic rules, too
<pippijn> it just has a surface syntax that looks somewhat similar
<groovy2shoes> is there more than one omake? the omake I used was very much like make
_2can has joined #ocaml
<groovy2shoes> yeah that's the one
<groovy2shoes> though it's hosted at ocamlcity now
<Drup> pippijn: can you distribute plugins independently ?
<pippijn> Drup: yes
<groovy2shoes> pippijn, I'll give it another look, thanks
<pippijn> https://github.com/pippijn/obuild/tree/master/rules <- some example omake code
<pippijn> I wrote it some years ago, so it's probably not great
smondet_ has joined #ocaml
<pippijn> groovy2shoes: it does everything right and doesn't get in the way
<groovy2shoes> omake looks like it's not really maintained anymore
<pippijn> you don't need to think hard to get build system things done
<Drup> Err, it's using the same baroque symbols than make >_>
<pippijn> groovy2shoes: yes, that, and because it doesn't quite scale to 50k files
<pippijn> but there was some development, someone said
<pippijn> I don't know where
<groovy2shoes> example TMk TMakefile: https://github.com/baguette/tmk/blob/master/TMakefile
th5 has quit [Quit: Textual IRC Client: www.textualapp.com]
OnkV has joined #ocaml
<pippijn> groovy2shoes: is that TCL?
<groovy2shoes> yup
<pippijn> it is TCL..
<pippijn> omake is dynamically but strongly typed
oldmanistan_ has quit [Ping timeout: 240 seconds]
Sorella has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 240 seconds]
_2can_ has quit [Ping timeout: 240 seconds]
hcarty has quit [Ping timeout: 240 seconds]
Haudegen has quit [Ping timeout: 240 seconds]
Algebr2 has quit [Ping timeout: 240 seconds]
keteim_ has quit [Ping timeout: 240 seconds]
maker has quit [Ping timeout: 240 seconds]
smondet has quit [Ping timeout: 240 seconds]
keteim has joined #ocaml
oldmanistan__ is now known as oldmanistan_
<pippijn> omake is the only system I know of that I could use to build complex build systems without losing my mind and it turning into an unmaintainable mess (hello autotools)
<groovy2shoes> yeah, autotools is pretty bad
nicholasf has joined #ocaml
Sorella_ is now known as Sorella
koshmar has quit [Ping timeout: 256 seconds]
<groovy2shoes> and GNU make is pretty bad compared to BSD make
<pgiarrusso> groovy2shoes: is TMk commonly used in Ocaml projects? I’m trying to *not* add Tcl to my skillset
maker has joined #ocaml
<Drup> I've never seen anyone use it for OCaml until now
<groovy2shoes> pgiarrusso, no, it's not commonly used at all... it's not even feature complete yet
<pippijn> make(1) doesn't do shell execution well
<pippijn> and it doesn't involve variable expansions in dependency analysis
<pippijn> it also doesn't know anything about scoping
<pippijn> apart from sub-make invocations
shinnya has joined #ocaml
<pippijn> but then recursive make is horrible, so if you want a fast build based on make(1), you need to include everything in a main makefile
<groovy2shoes> BSD make has a .include directive which makes avoiding recursive make pretty painless
<pippijn> and then you have no scoping, so you end up with macros producing long names with prefixes
<pippijn> groovy2shoes: yes
<groovy2shoes> TMk also has an include directive
<pippijn> and it still doesn't know about scopes
<groovy2shoes> how is scoping handled by omake? does each file have its own scope?
<pippijn> yes, all names are dynamically scoped
<pippijn> a directory is a scope
<groovy2shoes> oh neat
<pippijn> a function also creates a scope, and you can export names to the enclosing scope explicitly
<pippijn> Drup: as of 0.9.8.6 (or something), you can use a different syntax that looks less like make
<pippijn> it's a kind of inverted make, so names don't need $(), and instead you use "" for strings explicitly
<groovy2shoes> except for the whole tab thing, I don't mind make's syntax
<pippijn> omake it is whitespace-sensitive, but you can use tabs or spaces as you like
* pgiarrusso is scared after reading of *two* Ocaml build systems modeled after Cabal O_O
<pippijn> which two?
<pippijn> I think those cabal-like build systems are great if all you want is build simple ocaml code
<pippijn> as soon as you want anything custom, it starts getting painful
<pgiarrusso> pippijn: obuild and oasis
<pippijn> pgiarrusso: ok
<pippijn> not my obuild I guess
<pippijn> right
<pippijn> jenga seems pretty nice
yegods has quit [Remote host closed the connection]
koshmar has joined #ocaml
<pgiarrusso> yeah, I currently just need to build Ocaml projects of > 1 file, and settled on ocamlbuild because Real World Ocaml mentioned that.
<icicled> is ppx_fail supposed to rewrite `failwith` to include location info?
nekrodesk has joined #ocaml
yegods has joined #ocaml
f[x] has joined #ocaml
sepp2k has quit [Quit: Leaving.]
<icicled> if so I don't see it happening
<icicled> using ocamlbuild -use-ocamlfind -pkgs ppx_fail <src>
crass__ has quit [Remote host closed the connection]
<pgiarrusso> icicled: no deep clue, but don’t you want failwiths?
<pgiarrusso> (OTOH, what do I know, I’m new here and just googled a bit)
<Drup> icicled: ^
ersatz has quit [Ping timeout: 272 seconds]
crass_ has joined #ocaml
<icicled> so it's an issue at the moment?
<icicled> pgiarrusso: failwiths has type string -> string according to merlin, but when I go to build it the symbol is not found
<Drup> icicled: that's because it's in Core.Std.
sepp2k has joined #ocaml
lobo has quit [Quit: leaving]
<pgiarrusso> Seems Core.Std.Error.failwiths, and takes an (optional?) here parameter: https://ocaml.janestreet.com/ocaml-core/113.24/doc/core/Std/Error.mod/
<icicled> Drup: oh ok, so currently there is a dependency on Core and that's why it is not re-writing/working ?
<Drup> icicled: this ppx only rewrites failwithS, not failwith
<icicled> gotcha
<icicled> it's not particulary clear about that and the opam package (as you linked) doesn't describe the relationship
<icicled> ok, guess I won't worry about it if its not independent of Core
<icicled> would be a nice feature to have though =]
<Drup> icicled: well, that's kind of what backtraces are for anyway
Stalkr_ has joined #ocaml
pgomes has joined #ocaml
Stalkr has quit [Ping timeout: 272 seconds]
yawnt has quit [Ping timeout: 240 seconds]
jeffmo has quit [Quit: jeffmo]
SomeDamnBody has quit [Ping timeout: 256 seconds]
ersatz has joined #ocaml
pgomes has quit [Ping timeout: 264 seconds]
<icicled> got it - I just tried out the backtrace - works as expected
<icicled> w/o source code of course but its a start
nkhodyunya has joined #ocaml
yegods has quit [Remote host closed the connection]
silver has quit [Quit: rakede]
yegods has joined #ocaml
yegods has quit [Read error: Connection reset by peer]
yegods has joined #ocaml
rand__ has quit [Quit: leaving]
ersatz has quit [Ping timeout: 256 seconds]
SomeDamnBody has joined #ocaml
dksong has joined #ocaml