2014-07-27 00:17 manizzle has quit [Ping timeout: 240 seconds] 2014-07-27 00:20 tautologico has joined #ocaml 2014-07-27 00:20 malo has quit [Remote host closed the connection] 2014-07-27 00:20 zpe has joined #ocaml 2014-07-27 00:23 BitPuffin has quit [Ping timeout: 255 seconds] 2014-07-27 00:24 zpe has quit [Ping timeout: 250 seconds] 2014-07-27 00:25 badon has quit [Ping timeout: 260 seconds] 2014-07-27 00:27 badon has joined #ocaml 2014-07-27 00:31 is camlp4 working with 4.02? 2014-07-27 00:32 yes 2014-07-27 00:34 whitequark: I think there is a lot of parameter attributes missing :/ 2014-07-27 00:34 it compiles 2014-07-27 00:35 (like nonnull, inalloca, dereferencable) 2014-07-27 00:35 huh ? what are you talking about ? 2014-07-27 00:35 how high is the probability that it will just be left to bitrot in the future? if ppx catches on I don't think there'll be a lot of incentives for maintaining it 2014-07-27 00:35 Drup: llvm, apparently 2014-07-27 00:36 jpdeplaix: that is possible 2014-07-27 00:36 whitequark: the transition was abrupt, to say the least :D 2014-07-27 00:36 it will be easy to patch 2014-07-27 00:36 tautologico: It's going to stay in it's sate of only-maintenance for while I think 2014-07-27 00:36 so, no bitroting, but no innovation either 2014-07-27 00:37 (as today) 2014-07-27 00:37 there are quite a few big codebases using camlp4 extensively 2014-07-27 00:37 e.g. js 2014-07-27 00:38 I would have said jst, in fact. 2014-07-27 00:38 (jsoo is not going to be much of an issue) 2014-07-27 00:38 jst, yes 2014-07-27 00:39 (oh, it was a typo for jst, no jsoo, my bad) 2014-07-27 00:40 I wonder how long-lived will ppx turn out to be, ocaml language extension stories have not been very :P 2014-07-27 00:40 ppx is in trunk 2014-07-27 00:40 and I doubt for example coq is ever going to transfer from camlp4 to ppx.. 2014-07-27 00:40 I understand it's actually using it for creating a new language? 2014-07-27 00:41 well, it's easier to improve on ppx than on camlp4 2014-07-27 00:41 coq uses camlp5 actually 2014-07-27 00:41 writing a ppx is *much* easier than writing a camlp4 extension 2014-07-27 00:41 but ppx is not as powerful 2014-07-27 00:42 the whole camlp4/5-thing was bad as well :( 2014-07-27 00:42 yeah 2014-07-27 00:42 flux: well, a cuter is sometimes more useful than a shotgun. 2014-07-27 00:42 hopefully camlp4 will die and camlp5 will remain only used by coq and the like 2014-07-27 00:42 for full metaprogramming there's MetaOCaml 2014-07-27 00:42 flux: and don't forget about the revised syntax :D 2014-07-27 00:43 such a fabulous ideae 2014-07-27 00:43 idea* 2014-07-27 00:43 it's a mess 2014-07-27 00:43 I guess nobody uses that nowadays 2014-07-27 00:43 nobody ever used it, except to write camlp4 extensions 2014-07-27 00:43 and you can't really port it to ppx in a useful fashion can you?-o 2014-07-27 00:44 no 2014-07-27 00:44 thankfully 2014-07-27 00:44 someone should get the good parts and create a new OCaml, like X. Leroy did with "Heavy Caml" -> Caml light 2014-07-27 00:44 Heavy Caml? 2014-07-27 00:44 Caml "Heavy", the old CAML 2014-07-27 00:44 tautologico: bad idea 2014-07-27 00:45 tautologico: that's exactly what the guy behind the revised syntax had in mind, and it's a bad idea, because there are only two outcome to this kind of switch in a language already used 2014-07-27 00:45 1) nobody switch, that's the good case 2014-07-27 00:46 2) half the community switch, that's the very bad case 2014-07-27 00:46 2014-07-27 00:46 F# managed to build a community, though probably because it's mainly comprised of Windows programmers 2014-07-27 00:47 do you know a lot of people in the F# community that are not frustrated C# programmers ? 2014-07-27 00:47 (except jon harrop but ....) 2014-07-27 00:48 basically, F# doesn't predate on ocaml programmers. also, I'm not sure how big it is. 2014-07-27 00:49 yeah, that's what I was saying 2014-07-27 00:50 Windows and OCaml don't mix well, so windows programmers wanting a ML will mostly use F# 2014-07-27 00:50 fascinating, I'm reading on caml light 2014-07-27 00:51 it seems ocamldebug hasn't changed since caml light. 2014-07-27 00:51 at all 2014-07-27 00:51 indeed =') 2014-07-27 00:53 ... or stdlib, for that matter 2014-07-27 00:53 nearly 2014-07-27 00:53 yes 2014-07-27 00:54 that's something people complained about quite a lot... hence extlib, then batteries, core, etc 2014-07-27 00:54 omqal has joined #ocaml 2014-07-27 00:55 for quite a while INRIA's position on OCaml was "we're a research institution and OCaml is not research anymore, it's established technology, so we can't afford to spend too many resources on it"... which is understandable. 2014-07-27 00:55 oh THAT is where Str comes 2014-07-27 00:56 hhugo has quit [Quit: Leaving.] 2014-07-27 00:56 ocaml was so exciting, then it fell off a cliff it seems like :p 2014-07-27 00:58 tautologico: I think inria made a huge mistake on this 2014-07-27 00:58 yes, there was a time when Haskell hadn't yet got much traction and there was a lot of interest in OCaml... but OCaml was evolving glacially and INRIA couldn't really respond to the community's demands (that's not their role anyway) 2014-07-27 00:58 Drup: I agree... although I understand their position, I think it was a lost opportunity 2014-07-27 00:59 research is not only about creating new stuff, after all... impact is important 2014-07-27 01:00 that start to understand that, but they tend to do it through startups and stuff, which are equaly bad if you ask me 2014-07-27 01:00 what about opam prevents it from working on windows? 2014-07-27 01:01 ruzu: nothing, it's just not done yet 2014-07-27 01:02 according to the TIOBE index (I know, not a great indicator, but...) from last year to this year F# went up from #37 to #13... OCaml is in the 51-100 range (they say the difference between #51 and #100 is small so they just list the languages) 2014-07-27 01:02 curiously, "ML" is #26 on the index :) 2014-07-27 01:03 proof that it's probably bullshit =° 2014-07-27 01:03 and I don't believe OCaml is less used than D (#50), Modula-2 (#48) and Prolog (#46) 2014-07-27 01:03 it's search engine popularity index 2014-07-27 01:03 not usage index 2014-07-27 01:03 it doesn't prove something, however 2014-07-27 01:04 not enough buzz on ocaml =/ 2014-07-27 01:04 it does* 2014-07-27 01:04 penglingbo has joined #ocaml 2014-07-27 01:04 I also don't think F# is more used than Ruby (#14) 2014-07-27 01:04 yes 2014-07-27 01:05 I follow some F# people on twitter and they create a lot of buzz about user groups, F# meetups, etc 2014-07-27 01:05 whitequark: I know it's not about usage, but it's meant to be an indicator of that 2014-07-27 01:06 from their site: "The TIOBE Programming Community index is an indicator of the popularity of programming languages." 2014-07-27 01:09 omqal has quit [Quit: omqal] 2014-07-27 01:09 there are 3x more github repos with OCaml as language than F# 2014-07-27 01:10 but I guess Windows people still use that codeplex thing for open source software? I don't know 2014-07-27 01:10 urk, that horror 2014-07-27 01:10 tautologico: well, lot's of ocaml stuff are still on the inria forge too :p 2014-07-27 01:11 i'm semi-windows, mostly due to work :3 if ocaml was a bit more beefy i could probably sneak it into the workplace 2014-07-27 01:11 might be able to anyways 2014-07-27 01:12 I'd like if OCaml had a better story on windows 2014-07-27 01:12 hard to pry people from push-button-c# stuff if the other option's tooling is cranky 2014-07-27 01:12 I've tried to push OCaml on students before and may do it again but not all of them use Unix/OS X 2014-07-27 01:12 oriba has quit [Quit: oriba] 2014-07-27 01:19 eikke__ has joined #ocaml 2014-07-27 01:21 zpe has joined #ocaml 2014-07-27 01:21 I can easily imagine how starting OCaml on Windows in is painful; if you are coming from Unix/Linux and you know OCaml, then you only have the environment to fight with, not Everything 2014-07-27 01:22 and I think most OCaml-on-Windows-users are in the second category.. 2014-07-27 01:24 (I started programming with ocaml, on windows :D) 2014-07-27 01:24 you've since learned better?-) 2014-07-27 01:24 which part ? :p 2014-07-27 01:25 still on windows? 2014-07-27 01:25 nope ;) 2014-07-27 01:25 I used to program on Windows too, I just didn't know better 2014-07-27 01:26 some people get paid to do it :P 2014-07-27 01:26 it's a terrible OS for programming, unless you are paid money to do it 2014-07-27 01:26 sure 2014-07-27 01:26 well, it's still terrible for programming, but if your livelihood depends on it then you don't have a choice :) 2014-07-27 01:28 i see they're using*nix build stuff like autoconf in opam 2014-07-27 01:29 zpe has quit [Ping timeout: 240 seconds] 2014-07-27 01:29 someone should make a portable camlconf :3 2014-07-27 01:30 I think opam itself compiles on cygwin, but some important packages don't 2014-07-27 01:30 hah, i just opened a cygwin term to try 2014-07-27 01:30 even if you make opam completely portable lots of packages are not 2014-07-27 01:31 actually, a good amount of packages are portable 2014-07-27 01:31 because most package authors live on unix, they use unix tools 2014-07-27 01:31 does opam do any of the building logic or just run make? 2014-07-27 01:31 almost everything using oasis is 2014-07-27 01:31 yes 2014-07-27 01:31 but not everything uses oasis 2014-07-27 01:31 ruzu: a build script is given with the package 2014-07-27 01:32 F# has this problem in reverse, it doesn't work so well on unix, but the F# people and the Mono people are working actively to improve this... they're also trying to convince library authors to build for cross-platform compatibility 2014-07-27 01:32 $ ./configure 2014-07-27 01:32 ./configure: line 16: $'\r': command not found 2014-07-27 01:32 well, that was short :P 2014-07-27 01:33 ahah 2014-07-27 01:33 ruzu: https://github.com/ocaml/opam/issues/1515 2014-07-27 01:35 interestingly line 16 is an empty line between two comments, i guess the cyg term may not be well configured 2014-07-27 01:36 (the portability over windows argument is the main reason why adrien is yelling some much about topkg :D) 2014-07-27 01:36 so* ~~ 2014-07-27 01:41 topkg? 2014-07-27 01:41 a packaging system 2014-07-27 01:43 (and if you know enough, you can guess the author just by the name) 2014-07-27 01:48 right 2014-07-27 01:49 I think I saw it a while a go but didn't understand well what it was trying to do, if it was just competing with oasis 2014-07-27 01:56 it's just competing with oasis 2014-07-27 01:58 manizzle has joined #ocaml 2014-07-27 01:59 yeah I don't see the point 2014-07-27 02:06 englishm has joined #ocaml 2014-07-27 02:10 eikke__ has quit [Ping timeout: 240 seconds] 2014-07-27 02:25 englishm has quit [Remote host closed the connection] 2014-07-27 02:25 zpe has joined #ocaml 2014-07-27 02:28 tautologico has quit [Quit: Textual IRC Client: www.textualapp.com] 2014-07-27 02:30 zpe has quit [Ping timeout: 255 seconds] 2014-07-27 02:31 englishm has joined #ocaml 2014-07-27 02:46 fold has joined #ocaml 2014-07-27 03:06 jao has joined #ocaml 2014-07-27 03:06 jao has quit [Changing host] 2014-07-27 03:06 jao has joined #ocaml 2014-07-27 03:18 izaak has joined #ocaml 2014-07-27 03:26 zpe has joined #ocaml 2014-07-27 03:30 zpe has quit [Ping timeout: 250 seconds] 2014-07-27 03:32 q66 has quit [Quit: Leaving] 2014-07-27 03:55 Algebr has joined #ocaml 2014-07-27 03:55 What is the point of defining multiple rules in an ocamllex file? 2014-07-27 03:56 jao has quit [Ping timeout: 264 seconds] 2014-07-27 03:57 this is roughly the same question as "why define multiple functions while you could inline everything ine one" 2014-07-27 03:58 I don't see how that's similiar. Its not like you can like multiple rules running at the same time on a lex buffer 2014-07-27 04:01 no, but you can have one rule conditionally call another 2014-07-27 04:01 ousado_ has joined #ocaml 2014-07-27 04:05 ousado has quit [Ping timeout: 245 seconds] 2014-07-27 04:06 izaak has quit [Ping timeout: 240 seconds] 2014-07-27 04:22 thomasga has joined #ocaml 2014-07-27 04:24 thomasga has quit [Client Quit] 2014-07-27 04:27 zpe has joined #ocaml 2014-07-27 04:29 Algebr has quit [Ping timeout: 272 seconds] 2014-07-27 04:31 zpe has quit [Ping timeout: 250 seconds] 2014-07-27 04:39 hhugo has joined #ocaml 2014-07-27 04:52 hhugo has quit [Quit: Leaving.] 2014-07-27 05:04 fraggle_laptop has joined #ocaml 2014-07-27 05:06 izaak has joined #ocaml 2014-07-27 05:09 I must say, Zed is quite an underrated library in the ocaml ecosystem :O 2014-07-27 05:10 It lacks a manual to get in, but it's *very* nicely done 2014-07-27 05:12 morphles has joined #ocaml 2014-07-27 05:12 penglingbo has quit [Ping timeout: 245 seconds] 2014-07-27 05:13 izaak has quit [Ping timeout: 250 seconds] 2014-07-27 05:13 "Zed is an abstract engine for text edition." 2014-07-27 05:13 just to be sure, i looked up "edition" in the dictionary to check for lesser-known uses 2014-07-27 05:14 but my best guess is that this is supposed to say "...for text editing" 2014-07-27 05:15 french false friend :p 2014-07-27 05:18 ah 2014-07-27 05:20 axiles has joined #ocaml 2014-07-27 05:22 badon has quit [Ping timeout: 272 seconds] 2014-07-27 05:27 zpe has joined #ocaml 2014-07-27 05:30 englishm has quit [Remote host closed the connection] 2014-07-27 05:32 zpe has quit [Ping timeout: 255 seconds] 2014-07-27 05:38 araujo has joined #ocaml 2014-07-27 05:43 hhugo has joined #ocaml 2014-07-27 06:06 izaak has joined #ocaml 2014-07-27 06:10 angerman has joined #ocaml 2014-07-27 06:15 izaak has quit [Ping timeout: 260 seconds] 2014-07-27 06:17 _0xAX has joined #ocaml 2014-07-27 06:18 hhugo has quit [Quit: Leaving.] 2014-07-27 06:20 ggole has joined #ocaml 2014-07-27 06:28 zpe has joined #ocaml 2014-07-27 06:30 sandy1 has joined #ocaml 2014-07-27 06:32 zpe has quit [Ping timeout: 240 seconds] 2014-07-27 06:34 Hannibal_Smith has joined #ocaml 2014-07-27 06:41 BitPuffin has joined #ocaml 2014-07-27 06:53 keen___ has joined #ocaml 2014-07-27 06:55 keen__ has quit [Ping timeout: 240 seconds] 2014-07-27 06:57 BitPuffin has quit [Ping timeout: 240 seconds] 2014-07-27 06:58 morphles has quit [Ping timeout: 240 seconds] 2014-07-27 07:00 aymeric has joined #ocaml 2014-07-27 07:00 aymeric has left #ocaml [#ocaml] 2014-07-27 07:04 Kakadu has joined #ocaml 2014-07-27 07:08 pyon has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"] 2014-07-27 07:10 Simn has joined #ocaml 2014-07-27 07:11 izaak has joined #ocaml 2014-07-27 07:17 izaak has quit [Ping timeout: 240 seconds] 2014-07-27 07:18 ygrek has joined #ocaml 2014-07-27 07:18 _0xAX has quit [Remote host closed the connection] 2014-07-27 07:28 zpe has joined #ocaml 2014-07-27 07:32 zpe has quit [Ping timeout: 245 seconds] 2014-07-27 07:33 ygrek has quit [Ping timeout: 240 seconds] 2014-07-27 07:46 Hannibal_Smith has quit [Quit: Sto andando via] 2014-07-27 07:51 morphles has joined #ocaml 2014-07-27 07:55 zarul has quit [Ping timeout: 245 seconds] 2014-07-27 07:55 BitPuffin has joined #ocaml 2014-07-27 08:08 izaak has joined #ocaml 2014-07-27 08:11 BitPuffin has quit [Ping timeout: 264 seconds] 2014-07-27 08:12 ski has quit [Quit: Lost terminal] 2014-07-27 08:13 BitPuffin has joined #ocaml 2014-07-27 08:14 izaak has quit [Ping timeout: 272 seconds] 2014-07-27 08:29 zpe has joined #ocaml 2014-07-27 08:30 morphles has quit [Ping timeout: 245 seconds] 2014-07-27 08:33 zpe has quit [Ping timeout: 256 seconds] 2014-07-27 08:56 penglingbo has joined #ocaml 2014-07-27 08:57 pminten has joined #ocaml 2014-07-27 09:01 eikke__ has joined #ocaml 2014-07-27 09:07 izaak has joined #ocaml 2014-07-27 09:13 angerman has quit [Quit: Gone] 2014-07-27 09:14 izaak has quit [Ping timeout: 240 seconds] 2014-07-27 09:15 angerman has joined #ocaml 2014-07-27 09:22 rand000 has joined #ocaml 2014-07-27 09:22 hhugo has joined #ocaml 2014-07-27 09:22 eikke__ has quit [Ping timeout: 264 seconds] 2014-07-27 09:29 Anarchos has joined #ocaml 2014-07-27 09:34 angerman has quit [Quit: Gone] 2014-07-27 09:46 BitPuffin has quit [Ping timeout: 264 seconds] 2014-07-27 09:51 morphles has joined #ocaml 2014-07-27 09:52 zpe has joined #ocaml 2014-07-27 09:58 morphles has quit [Ping timeout: 250 seconds] 2014-07-27 09:59 tane has joined #ocaml 2014-07-27 10:00 eikke__ has joined #ocaml 2014-07-27 10:00 yacks has quit [Ping timeout: 255 seconds] 2014-07-27 10:08 izaak has joined #ocaml 2014-07-27 10:11 BitPuffin has joined #ocaml 2014-07-27 10:14 izaak has quit [Ping timeout: 260 seconds] 2014-07-27 10:16 ggole_ has joined #ocaml 2014-07-27 10:19 ggole has quit [Ping timeout: 240 seconds] 2014-07-27 10:26 morphles has joined #ocaml 2014-07-27 10:28 sad0ur has quit [Quit: leaving] 2014-07-27 10:39 ebzzry has quit [Remote host closed the connection] 2014-07-27 10:42 pminten has quit [Remote host closed the connection] 2014-07-27 10:46 ebzzry has joined #ocaml 2014-07-27 10:49 al-maisan has joined #ocaml 2014-07-27 10:50 Denommus has quit [Ping timeout: 250 seconds] 2014-07-27 11:02 dsheets has joined #ocaml 2014-07-27 11:03 https://github.com/eatnumber1/goal fun challenge 2014-07-27 11:03 but kinda no idea how to solve it in ocaml 2014-07-27 11:04 dawidtoton1 has joined #ocaml 2014-07-27 11:05 you would need camlp4 for that 2014-07-27 11:06 I need a list of (exists 'a. (foo -> 'a) -> ( 2014-07-27 11:07 I need a list of (exists 'a. (foo -> 'a) -> ('a list -> bar)) - how do I get this in ocaml? 2014-07-27 11:07 replace () with an optional GADT argument so that it internally counts the "o" and returns itself 2014-07-27 11:08 dawidtoton1: that makes no sense 2014-07-27 11:08 izaak has joined #ocaml 2014-07-27 11:09 you can make such a list but you can't use it other than counting its length. 2014-07-27 11:10 What about List.map (fun (f1, f2) -> f2 [f1 bar1; f2 bar2]) items ? 2014-07-27 11:10 Do I get my quantifier wrong? 2014-07-27 11:10 mrvn: yes, I think there is no other way, since it requires constructor calls :-/ 2014-07-27 11:11 g (O ()) (O ()) (Finish "al") is the best I could come up with 2014-07-27 11:11 I'm sorry I mistyped the pair: what I want is (exists 'a. (foo -> 'a) * ('a list -> bar)) 2014-07-27 11:12 mrvn: oh, ok, I haven't thought of that. interesting. 2014-07-27 11:12 dawidtoton1: then 'a == bar in your abvove code 2014-07-27 11:12 Leonidas: using cps? 2014-07-27 11:13 I hoped to get there with a record wrapper, but it seems that I can have only (forall 'a. (foo -> 'a) * ('a list -> bar)), which is not useful, I think 2014-07-27 11:13 contempt has quit [Ping timeout: 250 seconds] 2014-07-27 11:13 dawidtoton1: since the result of f2 is part of the list the 'a == bar 2014-07-27 11:14 mrvn: so far it doesn't work completely, so I was asking here if there was a really simple solution I may have missed :) 2014-07-27 11:14 izaak has quit [Ping timeout: 240 seconds] 2014-07-27 11:14 SO there exist an 'a, namely bar and only bar 2014-07-27 11:14 Leonidas: what doesn't work? Should work fine with cps style 2014-07-27 11:15 I see, I made quite few mistakes, thanks 2014-07-27 11:15 contempt has joined #ocaml 2014-07-27 11:17 So I need a list of ((foo -> 'a) * ('a list -> bar)) but each element has different 'a, and I need to compose ('a list) pieces of data in a function which doesn't know 'a - is this possible? 2014-07-27 11:18 hmm, i'm looking at ocaml-top 2014-07-27 11:18 So the [f1 bar1; f1 bar2] list shuold be ('a list) made of different pieces of bar, but for each pair (f1, f2) these 'a could be different things 2014-07-27 11:19 is there a way to achieve similar feature as the ~/.ocamlinit with it? 2014-07-27 11:19 for example to automatically have #require "topfind" 2014-07-27 11:19 #use "topfind" * 2014-07-27 11:19 (and thus be able to #require things) 2014-07-27 11:21 George_ has joined #ocaml 2014-07-27 11:22 BitPuffin has quit [Ping timeout: 255 seconds] 2014-07-27 11:22 For example I had "type fol = {a : 'a. (unit -> 'a) * ('a list -> unit)}" and hoped to assign (fun () -> 1), (fun [1] -> ()) to it, but the quantifier seems wrong 2014-07-27 11:26 contempt has quit [Remote host closed the connection] 2014-07-27 11:27 contempt has joined #ocaml 2014-07-27 11:28 BitPuffin has joined #ocaml 2014-07-27 11:28 BitPuffin has quit [Read error: Connection reset by peer] 2014-07-27 11:34 dawidtoton1: so given a foo list you want to map that to 'a list and then bar? 2014-07-27 11:36 You can make a list of tuples of such functions by nesting 2 records with existentials. But much simpler would be to combine the f1 and f2 to give (foo list -> bar) and make a list of those functions. 2014-07-27 11:37 miko has joined #ocaml 2014-07-27 11:38 Leonidas: you can do it nicely by changing the syntax a bit, or horribly with Obj.magic 2014-07-27 11:38 pango has quit [Ping timeout: 264 seconds] 2014-07-27 11:39 I don't know much about Ocaml; I however want to build a programm written in it. There are serveral instances where it depends on zlib, and this causes a error message. I get "Unbound module Zlib", how do i fix this? 2014-07-27 11:39 Yes, but at the point (foo -> 'a) are constructed, the function doesn't know how many elements the list will have, it is much later some foo are produced and combined fo 'a list 2014-07-27 11:39 ggole_ is now known as ggole 2014-07-27 11:39 The libz development package (for c) is installed 2014-07-27 11:40 ggole: maybe I should do that, but that would probably eat the rest of the day (nerdsniping) and I have exams :( 2014-07-27 11:40 miko: did you install ocamlzip? 2014-07-27 11:40 miko: then you need OCaml bindings for zlib installed 2014-07-27 11:40 I put a solution up on the reddit thread if you're interested 2014-07-27 11:41 ggole: Awesome. You could contribute it directly to the repo, for all to see :-) 2014-07-27 11:41 am install libz? 2014-07-27 11:41 pminten has joined #ocaml 2014-07-27 11:41 opam install libz? 2014-07-27 11:42 miko: opam install camlzip 2014-07-27 11:43 or install it from your distributions package manager, it is pretty commonly packaged :) 2014-07-27 11:44 eikke__ has quit [Ping timeout: 260 seconds] 2014-07-27 11:44 ggole: Reading your solution. WAT :-) 2014-07-27 11:44 Yeah, don't do that. 2014-07-27 11:44 I can't see any other way to match the solution char for char, though. 2014-07-27 11:44 "This kills the type" 2014-07-27 11:45 eikke__ has joined #ocaml 2014-07-27 11:45 I wonder if this would be possible with ppx? 2014-07-27 11:45 Passing arguments of the wrong type would indeed be more fun than desired. 2014-07-27 11:46 Ok, libz is installed by OPAM, that seems to have been successfull, the library however is still not found. 2014-07-27 11:46 I have to admit that I like the Haskell solution quite a bit :) 2014-07-27 11:46 *camlzip 2014-07-27 11:47 miko: did you load it? 2014-07-27 11:48 miko: I would look for a file like zlib.mli first on your system, like e.g. /usr/lib/ocaml/zip/zlib.mli 2014-07-27 11:49 miko: un utop: #require "zip";; and then open Zlib works. 2014-07-27 11:50 Leonidas: http://paste.debian.net/111933/ 2014-07-27 11:50 (I just wish utop was a little less ugly looking) 2014-07-27 11:50 Leonidas: you don't even need camlp4 with Obj.magic 2014-07-27 11:51 (truely evil misuse of Obj.magic) 2014-07-27 11:51 That's pretty close to my evil solution. 2014-07-27 11:51 yep 2014-07-27 11:52 TIL: the Obj.repr of unit is int. 2014-07-27 11:52 All nullary constructors, really. 2014-07-27 11:52 Leonidas: () is encoded as 0 2014-07-27 11:52 Check out the RWO chapter on representations sometime, it makes for very interesting reading. 2014-07-27 11:53 (Not today, if you have exams.) 2014-07-27 11:53 Leonidas: I could have checked for is_block and string_tag instead 2014-07-27 11:53 ggole: I told my library to order a paper copy of RWO last week, they are on it :) 2014-07-27 11:53 eikke__ has quit [Ping timeout: 272 seconds] 2014-07-27 11:56 supporting book authors and publishers with tax money :) 2014-07-27 11:56 * ggole thumbs up 2014-07-27 11:56 It's online though, so you could just read it there. 2014-07-27 11:57 I have a problem I'm struggling with enough that I'm pretty sure I'm doing something wrong. 2014-07-27 11:57 I know, I also added some comments. But for reading front to back, I kinda like paper more. 2014-07-27 11:57 ggole: obviosuly one reads it there too 2014-07-27 11:58 So could anybody tell me what quantifier sits in "{a : 'a. (unit -> 'a) * ('a list -> unit)}" ? I'm confused now. 2014-07-27 11:58 The background is that I'm writing an AMQP client, which will involve generaitng a bunch of code from an XML spec. 2014-07-27 11:58 found a (very minor) typo yesterday, turns out it seems to be in the print version as well. 2014-07-27 11:59 The generated code needs to include a type (record full of field values) and wire-format marshalling functions. 2014-07-27 12:00 I'm using a description module (which defines the type and field information) and a functor that builds a module containing the marshalling code. 2014-07-27 12:01 That's working for me so far, except I can't find a way to expose the type from the module. 2014-07-27 12:02 dawidtoton1: universal quantification, eg, 'a . is basically forall a . 2014-07-27 12:02 I have a polymorphic variant type (defined after all the generated modules) that includes an entry for each module. 2014-07-27 12:03 mrvn: could you possibly give me a hint what would be the second record wrapper for "type fol = {a : 'a. (foo -> 'a) * ('a list -> bar)}" you mentioned? 2014-07-27 12:04 I can't find a way to have each module return its own subset of that, though. 2014-07-27 12:07 jerith: so you have a module A "return" `A, B return `B, etc? 2014-07-27 12:07 dsheets has quit [Ping timeout: 255 seconds] 2014-07-27 12:07 fraggle_laptop has quit [Remote host closed the connection] 2014-07-27 12:07 And at the end, type module_tag = [`A | `B | ...]? 2014-07-27 12:08 q66 has joined #ocaml 2014-07-27 12:08 ggole: [`A of A.t | `B of B.t | ...], but otherwise yes. 2014-07-27 12:08 izaak has joined #ocaml 2014-07-27 12:09 That should work 2014-07-27 12:09 A.build_thing returns `A A.t or whatever. 2014-07-27 12:09 For a module A producing `A of int, give it a return type of [`A of int] 2014-07-27 12:10 eikke__ has joined #ocaml 2014-07-27 12:10 And if you like can "glue" all the module types together to make the resulting variant: type module_tag = [A.t | B.t | ...] 2014-07-27 12:11 Er, if you name the variant types, that is. 2014-07-27 12:12 yacks has joined #ocaml 2014-07-27 12:12 shinnya has joined #ocaml 2014-07-27 12:13 araujo has quit [Quit: Leaving] 2014-07-27 12:13 araujo has joined #ocaml 2014-07-27 12:14 izaak has quit [Ping timeout: 256 seconds] 2014-07-27 12:15 eikke__ has quit [Ping timeout: 260 seconds] 2014-07-27 12:15 ggole: I can't seem to expose that polymorphic variant type through the module interfaces. 2014-07-27 12:15 Ok, i installed utop (and with it plenty of other packages that i already installed via the os package manager). #require "zip";; seems to work in utop, the build still fails with "Unbound module Zlib". 2014-07-27 12:16 miko: How are you building? 2014-07-27 12:17 I want to build Patoline, it as it's own make file. 2014-07-27 12:17 *has 2014-07-27 12:19 jerith: I imagine you'll want to expose bits of it per module, like this https://gist.github.com/gsg/e9e5fcf45b755b7d6700 2014-07-27 12:20 miko: did you re-run the configure script? 2014-07-27 12:20 (it should say that he detected camlzip) 2014-07-27 12:20 it* 2014-07-27 12:21 ggole: I'm not sure how to expose that through the abstract interfaces I'm using with my functor. 2014-07-27 12:21 Oops. 2014-07-27 12:21 :) 2014-07-27 12:21 No, I didn't 2014-07-27 12:21 thanks 2014-07-27 12:21 * jerith ponders. 2014-07-27 12:21 Oh, a functor :/ 2014-07-27 12:21 rand000 has quit [Quit: leaving] 2014-07-27 12:21 Erm, good question 2014-07-27 12:24 I could probably skip the functor and just generate the modules I want directly, but I think it's cleaner to use a functor. 2014-07-27 12:26 Can ctypes create a C callback for an ocaml function? 2014-07-27 12:27 ygrek has joined #ocaml 2014-07-27 12:29 Thanks. I found a solution, it looks like I have to 'eliminate a translucent existential' 2014-07-27 12:30 dawidtoton1 has quit [Quit: leaving] 2014-07-27 12:31 and now I am building 4.02 just to find a solution with ppx %) 2014-07-27 12:33 hhugo has quit [Quit: Leaving.] 2014-07-27 12:37 eikke__ has joined #ocaml 2014-07-27 12:42 darkf has quit [Quit: Leaving] 2014-07-27 12:47 angerman has joined #ocaml 2014-07-27 12:48 hhugo has joined #ocaml 2014-07-27 12:49 whitequark: do I understand it correctly that ppx needs to have a proper typesafe input caml code? 2014-07-27 12:52 Leonidas: no 2014-07-27 12:52 ppx needs syntactically correct code, that is all 2014-07-27 12:52 oh, ok. 2014-07-27 13:03 Algebr has joined #ocaml 2014-07-27 13:04 whitequark, Drup: I'm stuck trying to pass a reference. Tips? http://paste.debian.net/111935/ 2014-07-27 13:05 mrvn: you need to allocate a pointer via ctypes 2014-07-27 13:05 whitequark: I can't take the address of a ocaml value? 2014-07-27 13:05 no 2014-07-27 13:06 even if you could, it's pointless for integers 2014-07-27 13:06 because of ocaml's integer representation 2014-07-27 13:06 seems like something like that should be possible. At least for nativeint 2014-07-27 13:06 that's not implemented 2014-07-27 13:06 and I don't see a point anyway 2014-07-27 13:08 pango has joined #ocaml 2014-07-27 13:08 izaak has joined #ocaml 2014-07-27 13:10 whitequark: That then gives me: http://paste.debian.net/111938/ 2014-07-27 13:10 sounds about right 2014-07-27 13:11 ZMQ version 4.1.0 2014-07-27 13:12 Passes the test. :) 2014-07-27 13:12 thx 2014-07-27 13:12 pango has quit [Ping timeout: 240 seconds] 2014-07-27 13:12 In general shouldn't "ref" be usable as ptr? 2014-07-27 13:13 no 2014-07-27 13:13 pango has joined #ocaml 2014-07-27 13:13 it can be moved 2014-07-27 13:13 angerman has quit [Remote host closed the connection] 2014-07-27 13:13 sure. but didn't you solve that problem for strings? 2014-07-27 13:14 izaak has quit [Ping timeout: 250 seconds] 2014-07-27 13:14 angerman has joined #ocaml 2014-07-27 13:14 no 2014-07-27 13:14 they still can be moved 2014-07-27 13:14 pango has quit [Remote host closed the connection] 2014-07-27 13:15 it's just that for strings, the added unsafety and complexity is overweighted by the benefit 2014-07-27 13:15 From the pull request you pasted yesterday it sounded like now ctypes saves the ocaml value in an array and then only takes the address once it is on the C side and the GC can't get invoked anymore. 2014-07-27 13:17 no, that's how the usual "string" works, not "ocaml_string" 2014-07-27 13:17 "string", abstract types, allocations, etc, etc 2014-07-27 13:17 but "ocaml_string" bypasses all that 2014-07-27 13:19 mcclurmc has joined #ocaml 2014-07-27 13:21 huza has joined #ocaml 2014-07-27 13:31 Algebr has quit [Read error: Connection reset by peer] 2014-07-27 13:35 pminten has quit [Quit: Leaving] 2014-07-27 13:36 slash^ has joined #ocaml 2014-07-27 13:36 angerman has quit [Ping timeout: 240 seconds] 2014-07-27 13:39 morphles has quit [Ping timeout: 245 seconds] 2014-07-27 13:41 topher has joined #ocaml 2014-07-27 13:41 topher has left #ocaml [#ocaml] 2014-07-27 13:42 angerman has joined #ocaml 2014-07-27 13:48 eikke__ has quit [Ping timeout: 240 seconds] 2014-07-27 13:59 * jerith gives up on the functor-based approach and starts figuring out how best to do the directly-generated modules. 2014-07-27 14:05 angerman has quit [Remote host closed the connection] 2014-07-27 14:06 angerman has joined #ocaml 2014-07-27 14:08 izaak has joined #ocaml 2014-07-27 14:12 Actually... 2014-07-27 14:12 huza has quit [Quit: WeeChat 0.3.8] 2014-07-27 14:13 * jerith tries again, this time using the functor to build a module to include rather than a replacement. 2014-07-27 14:18 George_ has quit [Ping timeout: 246 seconds] 2014-07-27 14:20 Actually, that's not going to help me. 2014-07-27 14:20 manizzle has quit [Ping timeout: 260 seconds] 2014-07-27 14:22 I think I've figured out where I'm going wrong, but not how to go right. 2014-07-27 14:25 In the code that's calling the functions in my module, I don't know (or care, ideally) which module I have. 2014-07-27 14:27 So I have no way to get at type information specific to individual modules. 2014-07-27 14:27 ... I just discovered this in hash.c 2014-07-27 14:27 case Forward_tag: /* PR#6361: we can have a loop here, so limit the number of Forward_tag links being followed */ 2014-07-27 14:28 does this mean that depending on heap state, polymorphic hash can return different values? O_o 2014-07-27 14:28 whitequark: I implemented hashing over mutable data structures in Topaz. 2014-07-27 14:28 (Topaz being a Ruby implementation.) 2014-07-27 14:28 yes, I know! it's neat 2014-07-27 14:28 It's probably the most terrifying code I've ever written. 2014-07-27 14:29 It never got merged because nobody could understand it. :-/ 2014-07-27 14:29 huh 2014-07-27 14:30 (That was about the time the project started losing momentum for various reasons, which is probably a contributing factor.) 2014-07-27 14:30 ohh, no, Forward_tag and Lazy_tag are for lazy 2014-07-27 14:30 jerith: why did it lose momentum? 2014-07-27 14:30 it seemed promising 2014-07-27 14:31 whitequark: I think the maintainers were busy with other things, mostly. 2014-07-27 14:31 It seems to be picking up a little now. 2014-07-27 14:32 There are commit messages in the IRC channel, at least. 2014-07-27 14:32 dsheets has joined #ocaml 2014-07-27 14:33 I was only working on it because it seemed interesting. I don't really have any need for Ruby. 2014-07-27 14:36 thomasga has joined #ocaml 2014-07-27 14:37 Back to my AMQP code, I think I'm going to have to generate a big wrapper function that knows about all the different modules for each thing I want to do with the data. :-/ 2014-07-27 14:37 izaak has quit [Ping timeout: 250 seconds] 2014-07-27 14:38 angerman has quit [Ping timeout: 272 seconds] 2014-07-27 14:39 angerman has joined #ocaml 2014-07-27 14:40 * jerith tries that. 2014-07-27 14:45 ygrek has quit [Ping timeout: 245 seconds] 2014-07-27 14:51 thomasga has quit [Quit: Leaving.] 2014-07-27 14:57 Guest81403 has joined #ocaml 2014-07-27 14:57 Or maybe I want a locally abstract type, now that I've remembered that they exist. 2014-07-27 14:58 Guest81403 is now known as lostman_ 2014-07-27 15:00 tane has quit [Quit: Verlassend] 2014-07-27 15:04 slash^ has left #ocaml [#ocaml] 2014-07-27 15:04 thomasga has joined #ocaml 2014-07-27 15:11 leowzukw has joined #ocaml 2014-07-27 15:17 leowzukw has quit [Quit: leaving] 2014-07-27 15:17 thomasga has quit [Quit: Leaving.] 2014-07-27 15:17 leowzukw has joined #ocaml 2014-07-27 15:23 izaak has joined #ocaml 2014-07-27 15:25 caseyjames has joined #ocaml 2014-07-27 15:27 hi. I'm struggling to get consistent OCaml coloring in gnu emacs. I can run Mx global-fontlock enable which will colorize most of the code but as I scroll things go back to black and white. Here is the init https://gist.github.com/caseybasichis/64ccf8eec991e5ff1cf5 2014-07-27 15:29 angerman has quit [Ping timeout: 256 seconds] 2014-07-27 15:31 angerman has joined #ocaml 2014-07-27 15:32 whitequark: How do I pass an intnat to a function and how do I say the function returns a Bigarray.Array1.t? 2014-07-27 15:34 shinnya has quit [Ping timeout: 264 seconds] 2014-07-27 15:37 mrvn: http://ocamllabs.github.io/ocaml-ctypes/Ctypes.html 2014-07-27 15:44 caseyjames has quit [Ping timeout: 246 seconds] 2014-07-27 15:47 A lot of code just to get a the data of a message: http://paste.debian.net/112020/ 2014-07-27 15:47 hhugo has quit [Quit: Leaving.] 2014-07-27 15:48 your point being? 2014-07-27 15:49 Nothing. Just wanted to share since you (the channel) where interested in how to allocate a bigarray from existing data. 2014-07-27 15:49 ah, I see 2014-07-27 15:51 tane has joined #ocaml 2014-07-27 15:56 angerman has quit [Remote host closed the connection] 2014-07-27 15:56 madroach has quit [Quit: leaving] 2014-07-27 15:57 angerman has joined #ocaml 2014-07-27 16:01 angerman has quit [Ping timeout: 240 seconds] 2014-07-27 16:02 dsheets has quit [Ping timeout: 272 seconds] 2014-07-27 16:08 angerman has joined #ocaml 2014-07-27 16:09 leowzukw has quit [Quit: leaving] 2014-07-27 16:14 tautologico has joined #ocaml 2014-07-27 16:16 thomasga has joined #ocaml 2014-07-27 16:23 caseyjames has joined #ocaml 2014-07-27 16:23 _0xAX has joined #ocaml 2014-07-27 16:32 morphles has joined #ocaml 2014-07-27 16:37 eikke__ has joined #ocaml 2014-07-27 16:42 izaak has quit [Ping timeout: 240 seconds] 2014-07-27 16:52 NoNNaN has quit [Remote host closed the connection] 2014-07-27 16:53 tautologico has quit [Quit: Textual IRC Client: www.textualapp.com] 2014-07-27 16:54 NoNNaN has joined #ocaml 2014-07-27 16:55 mrvn: I would avoid foreign inside a function call, if I were you 2014-07-27 16:57 foreign is dlopen 2014-07-27 16:57 mrvn: but, if you do it in a function call and not a module, you lose cstubs integration 2014-07-27 16:57 tane has quit [Quit: Verlassend] 2014-07-27 16:57 and it redo the dlopen everytime the function is called, instead of doing it "statically" once 2014-07-27 16:58 oh, right, that's stupud 2014-07-27 16:58 yes :p 2014-07-27 16:58 That sounds pretty cheap. 2014-07-27 16:58 ... 2014-07-27 16:59 caseyjames: http://bpaste.net/show/IDRSd3AnT3Pr2fb0ax7Y/ what I have in my .emacs 2014-07-27 17:01 I don't think recent emacsen need anything at all to get font-lock working fairly well. 2014-07-27 17:03 just loading tuareg correctly 2014-07-27 17:04 eikke__ has quit [Ping timeout: 256 seconds] 2014-07-27 17:04 Drup: I get this error: File mode specification error: (file-error "Cannot open load file" "no such file or directory" "tuareg") Making completion list... 2014-07-27 17:05 also does anyone here use Merlin? 2014-07-27 17:05 caseyjames: you probably have a path issue 2014-07-27 17:05 you're on mac ? 2014-07-27 17:05 Yes 2014-07-27 17:05 Taureg mode was working with the other script, it just that the coloring was acting erractically 2014-07-27 17:05 that's ... weird. 2014-07-27 17:06 I don't know a thing about mac, and I think it's a path or instalation issue so, sorry :( 2014-07-27 17:06 toggling global-fontlock twice on a file seems to get the whole thing colorized 2014-07-27 17:06 thanks anyway 2014-07-27 17:06 do you know anything about Merline? 2014-07-27 17:06 Merlin rather 2014-07-27 17:07 sure 2014-07-27 17:07 there are instructions on their wiki 2014-07-27 17:08 caseyjames: start an emacs -Q and load (just) tuareg and see if the problem persists 2014-07-27 17:08 I know, I'm trying to figure out how I specify a root directory for the project. How do I load a specific .merlin 2014-07-27 17:09 merlin will search for it. 2014-07-27 17:09 caseyjames: I think it just walks up the path until it finds one. 2014-07-27 17:09 By walking up the... yea 2014-07-27 17:11 caseyjames: on an unrelated note, your auto-mode-alist entries should probably end with \\' (or at least $) 2014-07-27 17:11 Urgs, what is this? Fatal error: exception Static.Unsupported("Unsupported return type") 2014-07-27 17:11 Raised at file "string.ml", line 172, characters 25-34 2014-07-27 17:11 Called from file "string.ml", line 195, characters 13-32 2014-07-27 17:11 -Q switches into Taureg but doesn't fix the color issue 2014-07-27 17:11 caseyjames: what is your emacs version ? 2014-07-27 17:12 24.4.5 2014-07-27 17:14 Seems like I can't have a function returning a bigarray. 2014-07-27 17:16 Ideas how to rewrite http://paste.debian.net/112037/ so it works? 2014-07-27 17:16 caseyjames: hmm. :( 2014-07-27 17:17 Are you still getting the "cannot open" thing? 2014-07-27 17:17 mrvn: how would you return a bigarray from C? 2014-07-27 17:17 you can't return length and size at once. 2014-07-27 17:17 morphles has quit [Ping timeout: 255 seconds] 2014-07-27 17:17 oh, I see your paste 2014-07-27 17:17 open a ctypes issue 2014-07-27 17:18 Well, I switched back to the init.el file so it working again. I gotta run back to my house be back in 5 min 2014-07-27 17:23 caseyjames has quit [Ping timeout: 246 seconds] 2014-07-27 17:24 whitequark: I want to return an ocaml value as is. 2014-07-27 17:24 yep, ctypes doesn't have support for that 2014-07-27 17:24 So he has a working config after all? O_o 2014-07-27 17:24 but, it's easily added 2014-07-27 17:28 ygrek has joined #ocaml 2014-07-27 17:28 penglingbo has quit [Ping timeout: 245 seconds] 2014-07-27 17:31 caseyjames has joined #ocaml 2014-07-27 17:31 BitPuffin has joined #ocaml 2014-07-27 17:34 whitequark: For a quick hack what if I say it returns voidp and Obj.magic that to Bigarray? 2014-07-27 17:35 you love your Obj.magic way too much, mrvn x) 2014-07-27 17:35 Cmon, it's the best 2014-07-27 17:37 Fatal error: exception Dl.DL_error("/home/mrvn/src/ocaml-zmq/ocaml-tzmq/_build/test/test.native: undefined symbol: caml_ba_alloc_dims") 2014-07-27 17:37 :(( 2014-07-27 17:38 % objdump -t _build/test/test.native | grep caml_ba_alloc_dims 2014-07-27 17:38 00000000004469c9 g F .text 00000000000000a0 caml_ba_alloc_dims 2014-07-27 17:38 mrvn: no, Obj.magic won't work there 2014-07-27 17:38 hm 2014-07-27 17:38 wrong args to dlopen 2014-07-27 17:38 Why doesn't it find that symbol? 2014-07-27 17:39 https://github.com/ocamllabs/ocaml-ctypes/blob/master/src/ctypes-foreign-base/dl.mli 2014-07-27 17:39 try playing with that 2014-07-27 17:39 and determine which flags you need 2014-07-27 17:40 gargaml has joined #ocaml 2014-07-27 17:42 pyon has joined #ocaml 2014-07-27 17:47 BitPuffin has quit [Ping timeout: 240 seconds] 2014-07-27 17:47 oriba has joined #ocaml 2014-07-27 17:48 BitPuffin has joined #ocaml 2014-07-27 18:01 oriba_ has joined #ocaml 2014-07-27 18:04 WraithM has joined #ocaml 2014-07-27 18:05 oriba has quit [Ping timeout: 255 seconds] 2014-07-27 18:05 eikke__ has joined #ocaml 2014-07-27 18:07 squiggnet has quit [Ping timeout: 260 seconds] 2014-07-27 18:17 hhugo has joined #ocaml 2014-07-27 18:22 angerman_ has joined #ocaml 2014-07-27 18:22 angerman_ has quit [Client Quit] 2014-07-27 18:23 rand000 has joined #ocaml 2014-07-27 18:23 angerman has quit [Ping timeout: 260 seconds] 2014-07-27 18:24 englishm has joined #ocaml 2014-07-27 18:27 George_ has joined #ocaml 2014-07-27 18:29 I am trying to define an exeption in this way: exception e = mymodule.e' where "exception e'" is defined in mymodule 2014-07-27 18:29 it looks that it is not possible, is there any way to do that? 2014-07-27 18:31 it is not 2014-07-27 18:31 what do you want to achieve? 2014-07-27 18:33 maattdd has joined #ocaml 2014-07-27 18:33 I have a functor with a module mymodule constructed from its parameter 2014-07-27 18:34 I want to catch the exception that my module throws 2014-07-27 18:34 mymodule 2014-07-27 18:34 thomasga has quit [Quit: Leaving.] 2014-07-27 18:34 any suggestion? 2014-07-27 18:35 try .. with Mymodule.E' -> ... ? 2014-07-27 18:36 let me make it more clear 2014-07-27 18:36 troydm has quit [Ping timeout: 250 seconds] 2014-07-27 18:38 assume that I have a functor "func", which accepts module "f" as its parameter, and builds "mymodule" using "f". That is, there is a definition "module mymodule = ...(f)" inside func 2014-07-27 18:38 mymodule throws exception e' 2014-07-27 18:39 dsheets has joined #ocaml 2014-07-27 18:39 now, I create a module "m = func f", and I would like to catch the exception e' 2014-07-27 18:39 tautologico has joined #ocaml 2014-07-27 18:41 you'll either have to expose mymodule in the signature of func, or re-raise it inside the implementation of func 2014-07-27 18:41 hi 2014-07-27 18:42 let me see if the first suggestion works 2014-07-27 18:42 does anyone know if it is possible to force the installation of a package with opam ? 2014-07-27 18:43 "opam install foo" ? 2014-07-27 18:43 manizzle has joined #ocaml 2014-07-27 18:43 hellome has joined #ocaml 2014-07-27 18:43 yeah but for instance camlp5 is not ready for 4.02 trunk 2014-07-27 18:44 then it will not install 2014-07-27 18:44 jao has joined #ocaml 2014-07-27 18:44 jao has quit [Changing host] 2014-07-27 18:44 jao has joined #ocaml 2014-07-27 18:44 and no way I can force it ? 2014-07-27 18:44 it will not compile. 2014-07-27 18:45 ok 2014-07-27 18:45 how can I expose my module in the signature? 2014-07-27 18:45 George_: module F : ... 2014-07-27 18:45 I may be doing it wrong 2014-07-27 18:46 hellome has quit [Remote host closed the connection] 2014-07-27 18:47 gargaml: if you really want to, dl the source of camlp5 and pin it, opam should accept it 2014-07-27 18:47 but I'm pretty sure camlp5 will not compile on 4.02 2014-07-27 18:47 hellome has joined #ocaml 2014-07-27 18:48 Drup: ok, thanks 2014-07-27 18:48 WraithM has quit [Ping timeout: 255 seconds] 2014-07-27 18:48 George_: there are two usual solution in this kind of situation, "module Func (F : S) = struct include F .... end 2014-07-27 18:48 or "module Func (F : S) = struct module F = F .... end" 2014-07-27 18:49 Or declare the exception outside the module (if types allow it) 2014-07-27 18:51 maattdd has quit [Ping timeout: 245 seconds] 2014-07-27 18:53 WraithM has joined #ocaml 2014-07-27 18:53 englishm has quit [Remote host closed the connection] 2014-07-27 18:54 In ocaml I have a "void ptr" returned from some function and in a C stub I need the address that points to. What's the best way to get that? I don't seem to grok the memory representation of a void ptr. 2014-07-27 18:54 is it taht you have a C API that just hands void*'s around and you want to hold on to it? 2014-07-27 18:54 does ctypes support this? 2014-07-27 18:55 _0xAX has quit [Remote host closed the connection] 2014-07-27 18:56 Thanks Drup, is what you wrote the module declaration in the signature? 2014-07-27 18:56 I have the definition of the module, but would like to expose it into signature 2014-07-27 18:56 sad0ur has joined #ocaml 2014-07-27 18:57 so, I can refer to the exception 2014-07-27 18:57 orbitz: I have a C API that gives me a void* and size to a block of data and I want to put that into a Bigarray 2014-07-27 18:58 WraithM has quit [Ping timeout: 250 seconds] 2014-07-27 18:58 maattdd has joined #ocaml 2014-07-27 18:58 George_: compile the module with ocamlc -i and paste the output into module.mli 2014-07-27 18:58 George_: for the second choice, "module Func (F : S) : sig module F : S .... end with module F = F 2014-07-27 18:58 mrvn: no. 2014-07-27 18:58 mrvn: do you know the type of the block of data? 2014-07-27 18:58 George_: for the first choice "module Func (F : S) : sig exception bla = Truc .... end" 2014-07-27 18:59 Submarine has joined #ocaml 2014-07-27 18:59 Submarine has quit [Changing host] 2014-07-27 18:59 Submarine has joined #ocaml 2014-07-27 18:59 orbitz: could be anything. I'm going for an uint8 arrays currently. 2014-07-27 18:59 be aware that with the seconde choice, the exceptions F.e and Func(F).e will be distinct 2014-07-27 19:00 (I think) 2014-07-27 19:00 then onceptually you can just cast teh void* to a uint8_t* 2014-07-27 19:01 if he just wants to expose an exception, why use a functor? 2014-07-27 19:01 so, the first is a better choice for me, since I would like them to be the same 2014-07-27 19:01 probably 2014-07-27 19:02 hum 2014-07-27 19:02 with the first choice* 2014-07-27 19:02 orbitz: and that helps me how? 2014-07-27 19:04 mrvn: https://github.com/Drup/ocaml-lmdb/blob/master/src/lmdb.ml#L208 here's how I do it, except I'm using a string, not a big array 2014-07-27 19:05 hmmm whitequark, you discovered the future of parsers? 2014-07-27 19:05 Drup: you are copying the data. I need a Bigarray OF the data. 2014-07-27 19:05 oh, right 2014-07-27 19:05 But I figured it out. 2014-07-27 19:05 companion_cube: apparently 2014-07-27 19:05 companion_cube: ? 2014-07-27 19:05 http://matt.might.net/articles/parsing-with-derivatives/ Drup 2014-07-27 19:06 whitequark: kudos if you make a small parser generator with it, that handles non-blocking input :) 2014-07-27 19:06 maybe 2014-07-27 19:06 Drup: void ptr is a "'a cptr = {reftype : 'a typ; raw_ptr : Ctypes_raw.voidp; ... } and Ctypes_raw.voidp is an Int32 or Int64 containing the actual address. 2014-07-27 19:06 "it seems to be efficient in practice; and that it should eventually be efficient in theory too" <3 2014-07-27 19:06 jeroud has joined #ocaml 2014-07-27 19:07 would have been nicer with Nativeint. 2014-07-27 19:08 so much performance masturbation in here 2014-07-27 19:08 ZMQ version 4.1.0 2014-07-27 19:08 send 'Hello' 2014-07-27 19:08 recv 'Hello' 2014-07-27 19:08 jippey. 2014-07-27 19:08 are you making your own zmq bindings? 2014-07-27 19:08 mrvn: \o/ 2014-07-27 19:08 whitequark: well performance does matter for a parser :) 2014-07-27 19:08 companion_cube: talking about mrvn's zmq thing 2014-07-27 19:08 morphles has joined #ocaml 2014-07-27 19:08 to avoid a copy :p 2014-07-27 19:09 :D 2014-07-27 19:09 well, not copying message data *is* the key to zmq performance, it matters significantly 2014-07-27 19:09 the rest is what I said above 2014-07-27 19:09 the primary objective for *any* binding is readability, because it's tricky non-memory-safe code 2014-07-27 19:10 granted, ocaml-zmq doesn't score high on that too 2014-07-27 19:10 does ocaml-zmq do a lot of copying? 2014-07-27 19:10 it copies message daya 2014-07-27 19:10 data* 2014-07-27 19:10 orbitz: not if you tell it not to 2014-07-27 19:10 mrvn: are you modifying ocaml-zmq or find it lacking somehow? 2014-07-27 19:11 orbitz: I'm rewriting it 2014-07-27 19:11 err 2014-07-27 19:11 is the API poor or is there some deeper flaw? 2014-07-27 19:11 orbitz: I'm writing a thin binding with Ctypes and full bindings on top of that. 2014-07-27 19:11 orbitz: the insides of ocaml-zmq are gnarly 2014-07-27 19:11 rewriting it is not a bad idea 2014-07-27 19:11 orbitz: seemed like a good example to learn Ctypes. 2014-07-27 19:12 mrvn: sounds reasonable 2014-07-27 19:12 "gnarly" didn't know that word 2014-07-27 19:12 I can now send and receive messages over a socket: 2014-07-27 19:12 Totals grouped by language (dominant language first): 2014-07-27 19:12 ml: 5839 (99.29%) 2014-07-27 19:12 ansic: 42 (0.71%) 2014-07-27 19:12 Not sure if that counts as success 2014-07-27 19:13 what's the C code doing? 2014-07-27 19:13 mrvn: HOW MUCH ml lines?! 2014-07-27 19:13 six thousand? 2014-07-27 19:13 orbitz: create a bigarray for a void* + size. 2014-07-27 19:13 the whole ocaml compiler is smaller than that 2014-07-27 19:13 Original ocaml-zmq is only ml: 6057 (90.92%) ansic: 605 (9.08%) 2014-07-27 19:13 are you counting oasis in? 2014-07-27 19:14 args, yes 2014-07-27 19:14 oscar_ has joined #ocaml 2014-07-27 19:14 it counds the myocamlbuild.ml and the _build dir too 2014-07-27 19:14 huh, how large is the compiler ? 2014-07-27 19:15 Let me redo that in src/: ml: 437 (95.41%) ansic: 21 (4.59%) vs. original: ansic: 605 (61.48%) ml: 379 (38.52%) 2014-07-27 19:16 those numbers sound nicer 2014-07-27 19:16 maattdd has quit [Ping timeout: 255 seconds] 2014-07-27 19:16 okay no, the compiler is bigger 2014-07-27 19:16 My Raft implementation is almost ready for some testing 2014-07-27 19:16 $ sloccount asmrun/ asmcomp/ byterun/ bytecomp/ stdlib/ otherlibs/ parsing/ typing/ 2014-07-27 19:16 ml: 74419 (68.10%) 2014-07-27 19:16 ansic: 31460 (28.79%) 2014-07-27 19:16 asm: 3385 (3.10%) 2014-07-27 19:16 yeah ... 2014-07-27 19:16 6000 sounded really small 2014-07-27 19:17 1798 8638 64757 src/ZMQ.ml 2014-07-27 19:17 Lots and lots of comments 2014-07-27 19:17 Drup: I merged Enum and Bounded 2014-07-27 19:17 they basically do same thing 2014-07-27 19:17 oh, cool 2014-07-27 19:17 not surprised 2014-07-27 19:17 now doing Iter, Map and Fold 2014-07-27 19:17 I need to split that file 2014-07-27 19:17 because that's simple 2014-07-27 19:17 until you try to map/iter/fold over negative instances 2014-07-27 19:17 and reading sexplib source causes heartburn to me 2014-07-27 19:18 Drup: wtf is a negative instance? 2014-07-27 19:18 type 'a foo = 'a -> int 2014-07-27 19:18 ... 2014-07-27 19:18 I error out on functional values 2014-07-27 19:18 :D 2014-07-27 19:18 who would want *that*? 2014-07-27 19:19 I've seen valid use cases. 2014-07-27 19:19 -ENOTHASKELL 2014-07-27 19:19 ahah xD 2014-07-27 19:19 whitequark: FYI my design should allow receiving messages, getting a bigarray of that data part, using zmq_msg_gets on the message, dropping the message from scope, running the GC and the bigarray should remain valid. 2014-07-27 19:19 I said valid, not simple :3 2014-07-27 19:19 well, you're welcome to contribute support for that 2014-07-27 19:20 mrvn: I figured 2014-07-27 19:20 it'll play very well with my new sodium design 2014-07-27 19:20 which is based around Bigstrings 2014-07-27 19:21 what's sodium? 2014-07-27 19:21 (Bigstring is a nicer name for a Bigarray.Array1 of char 2014-07-27 19:21 nacl bindings 2014-07-27 19:21 ah of course 2014-07-27 19:21 whitequark: the zero-copy approach has one problem though. You can make a bigarray, create a msg for it, send it over inproc://, recv the msg, make a bigarray out of it and then modifying the original bigarray changes the other too. 2014-07-27 19:22 urk 2014-07-27 19:22 that's ugly 2014-07-27 19:22 It's zero-copy. 2014-07-27 19:22 mrvn: that's very bad 2014-07-27 19:22 because when one of them is freed, the other is freed too, I think 2014-07-27 19:22 so is the idea you just have a big pool of these Bigstring's taht the zmq bindins allocate on startup 2014-07-27 19:22 the storage 2014-07-27 19:22 orbitz: no 2014-07-27 19:22 you make a bigstring around zmq's internal buffer 2014-07-27 19:23 and pass it around 2014-07-27 19:23 ok 2014-07-27 19:23 madroach has joined #ocaml 2014-07-27 19:23 I think zero-copy would be terrible for lmdb anyway since : "Values returned from the database are valid only until a subsequent update operation, or the end of the transaction. Do not modify or free them, they commonly point into the database itself." 2014-07-27 19:24 whitequark: No. that part needs to work. 2014-07-27 19:24 * Drup is not interested anymore 2014-07-27 19:24 mrvn: huh? 2014-07-27 19:24 oh, on the other hand, zmq_msg_t are refcounted and own the buffer 2014-07-27 19:24 so it will probably be fine 2014-07-27 19:24 whitequark: sending a message takes over ownership of the buffer so the bigarray does not free it when it gets out of scope. 2014-07-27 19:25 sounds like you need some linear types! 2014-07-27 19:27 If any of you have a minute or two, can you offer some clarification on the following from 'OCaml from the Very Beginning': 'Clearly append (h :: t) b is equal to h :: append t b.' To me, the former will recurse infinitely, which is very different from the latter. For full context: http://pastebin.com/yM49rHyf 2014-07-27 19:27 whitequark: you are half right. When the receving bigarray and msg and sending msg go out of scope the sending bigarray breaks I think. Need to check and fix that. 2014-07-27 19:28 Drup: by what? 2014-07-27 19:28 I need to increment the refcount in the sending message for the bigarray and drop it in Gc.finalise 2014-07-27 19:28 mrvn: check whether zmq increases the refcount itself 2014-07-27 19:29 shinnya has joined #ocaml 2014-07-27 19:29 companion_cube: the zero-copy approach to get the value from a struct containg pointer to data + size 2014-07-27 19:29 oscar_ why do you think append (h :: t) b will recurse infinitely? 2014-07-27 19:29 flux, just git pushed the fix for ocurl bug exposed by webcamviewer, thanks for reporting 2014-07-27 19:29 whitequark: It calls the ffn callback when it is done with the data. 2014-07-27 19:29 it's the same as append a b where a = (h :: t) 2014-07-27 19:30 whitequark: actually, maybe I could expose an interface with that, instead of the ctypes stuff 2014-07-27 19:30 ygrek, great! 2014-07-27 19:30 Drup: for lmdb you mean? 2014-07-27 19:30 yes 2014-07-27 19:30 aww 2014-07-27 19:30 Yeah, that's why I'd think it'd recurse infinitely. I am sending the same input into the function as it received initially. 2014-07-27 19:30 flux, please check %) 2014-07-27 19:30 oscar_: why do you think that? 2014-07-27 19:30 btw, is that your working place on the webcam? 2014-07-27 19:31 If I call append a b, split a into h :: t and call append (h :: t) b, it is the same as append a b, isn't it? 2014-07-27 19:31 oscar_ I see what you mean 2014-07-27 19:31 oscar_: that isn't waht the thing you pasted says though 2014-07-27 19:31 oscar_ the thing is to think of equational reasoning 2014-07-27 19:31 ygrek, no, it's a computer club at the local university 2014-07-27 19:31 oscar_ equationally, append (h :: t) b = h :: apend t b 2014-07-27 19:31 oscar_: what you pasted says h :: (append t b) = append (h::t) b 2014-07-27 19:32 ygrek, I suppose the new version is not yet available via opam? 2014-07-27 19:32 oscar_ the book is not saying that you should call append (h :: t) b when passed append (h :: t) b 2014-07-27 19:32 nope, will give it some testing before that 2014-07-27 19:32 companion_cube: why "aww" ? :D 2014-07-27 19:32 pin for the rescue %) 2014-07-27 19:33 oscar_ so because append (h :: t) b = h :: append t b, this is what the second arm of the match should do 2014-07-27 19:33 there are 4 lines of ruby in js_of_ocaml's sources 2014-07-27 19:33 wtf 2014-07-27 19:33 (and 41 lines of lisp) 2014-07-27 19:33 gargaml has quit [Quit: WeeChat 0.4.3] 2014-07-27 19:33 ygrek, bad makefile, make -j didn't work :) 2014-07-27 19:33 Drup: it sounds useful 2014-07-27 19:33 but well, you can provide a one-copy API 2014-07-27 19:33 companion_cube: that's what I have currently 2014-07-27 19:35 hmm, did I find a bug in ocamlbuild?-o ocamlbuild -clean takes ages for a little project (infact so long I think it's in infinite loop) 2014-07-27 19:35 aaah, no 2014-07-27 19:35 flux, please report :) 2014-07-27 19:35 it checks of course the files in the current directory hierarchy 2014-07-27 19:35 I happen to have 5 million of them 2014-07-27 19:35 in 'output' directory 2014-07-27 19:35 and btw webcamviewer doesn't have a Makefile at all! 2014-07-27 19:36 I suppose I could add one 2014-07-27 19:36 ygrek in NetHack, they just say : "hey, our machines are so fast, just do gcc *.c -o nethack , get rid of makefile !" 2014-07-27 19:37 tautologico/orbitz: So it's saying to think of sort of the "destination" when thinking about the problem? 2014-07-27 19:37 oscar_ kinda... do you agree that append (h :: t) b = h :: append t b ? 2014-07-27 19:37 so I added : -traverse to _tags and it still traverses output 2014-07-27 19:37 I suppose it only prunes the files afterwards, quite annoying.. 2014-07-27 19:38 Yeah, according to the way the function is written. 2014-07-27 19:38 Anarchos, seems I never gonna have machine that fast! 2014-07-27 19:38 oscar_ not really about how it's written but how it should be written 2014-07-27 19:39 * ygrek wishes ccache for ocaml 2014-07-27 19:39 oscar_ think of concrete lists... append (1 :: [2; 3; 4]) [5; 6] = 1 :: (append [2; 3; 4] [5; 6]) ? 2014-07-27 19:39 if people are willing, I would like testers for that : https://github.com/OCamlPro/ocp-index/pull/43 2014-07-27 19:39 "opam pin add ocp-index https://github.com/Drup/ocp-index.git" 2014-07-27 19:39 * ygrek off 2014-07-27 19:39 Yeah, I get that fine. 2014-07-27 19:40 oscar_ so, this equation append (h :: t) b = h :: append t b says what the function append must do when a = (h :: t) 2014-07-27 19:41 oscar_ you're writing a function over a list so you must be able to say what's the result for an empty list, and for a cons of h and t 2014-07-27 19:41 the empty list case is easy because append [] b = b (another equation) 2014-07-27 19:41 and the h :: t case comes from the above equation 2014-07-27 19:42 OK, I think I first just misunderstood this in thinking he meant the code could be swapped, then way overthought it. 2014-07-27 19:43 oscar_ this part of the book is about looking at functional code in two ways: 1) as the specification of an algorithm (a sequence of steps); 2) as establishing equations between program expressions 2014-07-27 19:44 oriba_ has quit [Quit: oriba_] 2014-07-27 19:48 ygrek, works! without modifications to webcamviewer. also you got your Makefile to WebcaViewer ;) 2014-07-27 19:48 OK, I got it now. Guess I'll read up a bit on equational reasoning. 2014-07-27 19:48 maattdd has joined #ocaml 2014-07-27 19:49 Thanks, tautologico/orbitz. 2014-07-27 19:50 oscar_ most books on functional programming have something about this idea of transforming program expressions algebraically, but it's only valid for pure functional code 2014-07-27 19:51 Yeah, I'm seeing a lot of Haskell results looking around on it, so that makes sense. 2014-07-27 19:53 let fn _ _ = match free_fn with | None -> () | Some fn -> fn data in ... Does that keep data alive as long as fn lives when free_fn is None or could the compiler optimize that? 2014-07-27 19:54 Algebr has joined #ocaml 2014-07-27 19:55 Why does exit return a type variable rather than ()? 2014-07-27 19:55 Algebr: because: if done then exit 0 else "foo" 2014-07-27 19:55 same reason failwith does 2014-07-27 19:55 or fail in Haskell 2014-07-27 19:55 Sim_n has joined #ocaml 2014-07-27 19:55 I mean error in Haskell 2014-07-27 19:56 that's kind of a hack. 2014-07-27 19:56 not really 2014-07-27 19:56 no. these functions never return, so what's their return type? 2014-07-27 19:56 mcclurmc_ has joined #ocaml 2014-07-27 19:56 why isn't it just () 2014-07-27 19:57 is it an action? 2014-07-27 19:57 Algebr: see the example mrvn posted 2014-07-27 19:57 thinking the other way: how can exit/failwith break the assumption that it returns a value of type 'a for any 'a ? 2014-07-27 19:57 ygrek has quit [Ping timeout: 240 seconds] 2014-07-27 19:57 yes, and it side steps the type system, but I guess since no one gets their value, it doens't matter? 2014-07-27 19:57 algebr, but is it really sidestepping? 2014-07-27 19:58 let hd l = match l with [] -> failwith "hd: Empty list" | h :: _ -> h 2014-07-27 19:58 Algebr: yes it does 2014-07-27 19:58 thomasga has joined #ocaml 2014-07-27 19:58 otherwise you can't write this List.hd function 2014-07-27 19:59 no0y` has joined #ocaml 2014-07-27 19:59 algebr, also, why it would rather be () than, say, number 5? 2014-07-27 19:59 () is a value just as well 5 is 2014-07-27 20:00 yes 2014-07-27 20:00 it never returns, so it can potentially be anything... () is no more valid than anything else 2014-07-27 20:00 isomorph1smes has joined #ocaml 2014-07-27 20:00 but being a type variable makes it much more flexible to use in real functions 2014-07-27 20:00 chris2_ has joined #ocaml 2014-07-27 20:00 and it doesn't break type soundness in any way 2014-07-27 20:01 also, you want exit to return a type with no inhabitant 2014-07-27 20:01 then is there any point to exit? Does any OS actually care about exit values? 2014-07-27 20:01 orbitz_ has joined #ocaml 2014-07-27 20:01 whitequa1k has joined #ocaml 2014-07-27 20:01 Algebr: of course OS cares about exit values O_o 2014-07-27 20:02 acieroid` has joined #ocaml 2014-07-27 20:02 what a function returns and what the operating system returns as the return code of the process are two different things :) 2014-07-27 20:02 Youri_ has joined #ocaml 2014-07-27 20:02 exit is from process to OS... the process doesn't see what exit returns, it sends the exit value to the OS 2014-07-27 20:02 milosn_ has joined #ocaml 2014-07-27 20:02 kerneis_ has joined #ocaml 2014-07-27 20:03 numeo_ has joined #ocaml 2014-07-27 20:03 lostman__ has joined #ocaml 2014-07-27 20:03 you could of course have it like there's a single function, like C's main, and its return value would be the process return value 2014-07-27 20:03 OCaml doesn't have such a single entry function 2014-07-27 20:03 hnrgrgr_ has joined #ocaml 2014-07-27 20:04 vbmithr_ has joined #ocaml 2014-07-27 20:04 chris2 has quit [Disconnected by services] 2014-07-27 20:04 chris2_ is now known as chris2 2014-07-27 20:05 pjdelport_ has joined #ocaml 2014-07-27 20:05 al-maisan_ has joined #ocaml 2014-07-27 20:07 girrig_ has joined #ocaml 2014-07-27 20:11 lostman_ has quit [*.net *.split] 2014-07-27 20:11 mcclurmc has quit [*.net *.split] 2014-07-27 20:11 Simn has quit [*.net *.split] 2014-07-27 20:11 whitequark has quit [*.net *.split] 2014-07-27 20:11 fraggle_ has quit [*.net *.split] 2014-07-27 20:11 Youri has quit [*.net *.split] 2014-07-27 20:11 pjdelport has quit [*.net *.split] 2014-07-27 20:11 no0y has quit [*.net *.split] 2014-07-27 20:11 girrig has quit [*.net *.split] 2014-07-27 20:11 al-maisan has quit [*.net *.split] 2014-07-27 20:11 hnrgrgr has quit [*.net *.split] 2014-07-27 20:11 acieroid has quit [*.net *.split] 2014-07-27 20:11 milosn has quit [*.net *.split] 2014-07-27 20:11 vbmithr has quit [*.net *.split] 2014-07-27 20:11 kerneis has quit [*.net *.split] 2014-07-27 20:11 isomorphismes has quit [*.net *.split] 2014-07-27 20:11 numeo has quit [*.net *.split] 2014-07-27 20:11 orbitz has quit [*.net *.split] 2014-07-27 20:11 algoriddle has quit [*.net *.split] 2014-07-27 20:11 lostman__ is now known as lostman_ 2014-07-27 20:11 algoriddle has joined #ocaml 2014-07-27 20:11 pjdelport_ is now known as pjdelport 2014-07-27 20:12 fraggle_ has joined #ocaml 2014-07-27 20:12 morphles has quit [Ping timeout: 255 seconds] 2014-07-27 20:14 izaak has joined #ocaml 2014-07-27 20:15 but even C has exit(). it just gets implicitly called when main returns. 2014-07-27 20:16 oriba has joined #ocaml 2014-07-27 20:18 tautologico has quit [Quit: My MacBook has gone to sleep. ZZZzzz…] 2014-07-27 20:20 fold has quit [Ping timeout: 272 seconds] 2014-07-27 20:23 maattdd has quit [Ping timeout: 255 seconds] 2014-07-27 20:25 dsheets has quit [Ping timeout: 245 seconds] 2014-07-27 20:27 companion_cube: just read the article about derivative, didn't know about it, it's interesting 2014-07-27 20:33 numeo_ is now known as numeo 2014-07-27 20:34 tautologico has joined #ocaml 2014-07-27 20:35 tobiasBora has joined #ocaml 2014-07-27 20:38 izaak has quit [Ping timeout: 260 seconds] 2014-07-27 20:38 axiles has quit [Remote host closed the connection] 2014-07-27 20:42 tautologico has quit [Quit: My MacBook has gone to sleep. ZZZzzz…] 2014-07-27 20:43 izaak has joined #ocaml 2014-07-27 20:45 zpe has quit [Remote host closed the connection] 2014-07-27 20:48 tautologico has joined #ocaml 2014-07-27 20:48 al-maisan_ is now known as al-maisan 2014-07-27 20:49 hhugo1 has joined #ocaml 2014-07-27 20:50 hhugo has quit [Read error: Connection reset by peer] 2014-07-27 20:52 orbitz_ has quit [Quit: Reconnecting] 2014-07-27 20:52 orbitz has joined #ocaml 2014-07-27 20:54 WraithM has joined #ocaml 2014-07-27 20:54 maattdd has joined #ocaml 2014-07-27 20:54 for the lexbuf in "let lexbuf = Lexing.from_channel stdin in lexbuf, do I always have to name lexbuf, lexbuf? I read that all the rules in my .mll have a handle on lexbuf, but does the naming matter? 2014-07-27 20:56 you mean setting the file name? 2014-07-27 20:56 I mean setting the name of the handle of what Lexing.from_channel returns, do I always have to name it lexbuf? 2014-07-27 20:56 no 2014-07-27 20:56 you pass it to Lexer.token 2014-07-27 20:56 or however is your lexing function named 2014-07-27 20:57 right, it can even be an anonymous function 2014-07-27 20:57 right, my main rule in my .mll 2014-07-27 20:57 * companion_cube didn't understand the question 2014-07-27 20:57 one moment. 2014-07-27 20:58 http://lpaste.net/108246 2014-07-27 20:58 I read that all rules in ocamllex have a handle on an implicit variable named lexbuf 2014-07-27 20:58 awwww, don't put a main() in a lexer :s 2014-07-27 20:58 Which XML parser do I want to use? 2014-07-27 20:58 yes, they do 2014-07-27 20:58 its just a small example 2014-07-27 20:58 jerith: Xmlm 2014-07-27 20:59 whitequa1k: your nick is fuzzed 2014-07-27 20:59 yes, they do -> That's to each rule in a .mll has a handle on an implicit variable named lexbuf? 2014-07-27 20:59 whitequa1k is now known as whitequark 2014-07-27 21:00 yes 2014-07-27 21:00 within the rules, not within the leading/trailing {} 2014-07-27 21:00 (where you put the main()) 2014-07-27 21:00 Ah, so the main entry rule gets passed what Lexing.from_channel returns, but the name doesn't matter as the rules all refer to it as lexbuf, regardless of what it was originally named 2014-07-27 21:02 once you'e in the "rule" it's always named lexbuf, yes 2014-07-27 21:02 Leonidas: I have g()()(F"al") 2014-07-27 21:02 (by abusing the fact that () is a constructor and overloading it) 2014-07-27 21:03 tobiasBora has quit [Quit: Konversation terminated!] 2014-07-27 21:03 Drup: Neat. I was fiddling a bit with ppx but then it was taking too much time 2014-07-27 21:03 whitequark: Thanks. 2014-07-27 21:04 sheijk has joined #ocaml 2014-07-27 21:05 Leonidas: it's going to be hard to do much better without string overloading 2014-07-27 21:07 Leonidas: what are you doing? 2014-07-27 21:07 https://github.com/eatnumber1/goal 2014-07-27 21:07 silly exercise :p 2014-07-27 21:08 whitequark: I was trying to replace () by o (a function application) and "at" (a string) by at (another function application) 2014-07-27 21:08 yes, super silly exercise :-) 2014-07-27 21:08 WraithM has quit [Ping timeout: 245 seconds] 2014-07-27 21:08 maattdd has quit [Ping timeout: 245 seconds] 2014-07-27 21:08 anyone here running ocaml on arm? how stable is this stuff on a regular debian (when not using mirage), do things like c bindings, ctypes, gdb debugging, etc. work well? 2014-07-27 21:08 earlier today ggole and mrvn posted solutions with Obj.magic, so I was wondering for something more type safe :-) 2014-07-27 21:09 sheijk: I haven't seen any problems on raspberry pi, but admittedly, haven't used it all that much 2014-07-27 21:09 Leonidas: do you have a pastebin with the Obj.magic solution ? 2014-07-27 21:09 Leonidas: did you use c bindings and gdb? 2014-07-27 21:10 but actually raspberry pi is a good point, i have one sitting here so i can just try it myself now that you mention it :) 2014-07-27 21:10 raspberry pi has a silly old arm though 2014-07-27 21:10 Drup: sure, http://www.reddit.com/r/programming/comments/2btrvt/gal/cj8yj2k and http://paste.debian.net/111933/ 2014-07-27 21:11 you mean "slow as molasses" ;-) 2014-07-27 21:11 pretty much nothing else uses armv6 2014-07-27 21:11 sheijk: C bindings yes, gdb no. 2014-07-27 21:11 Drup: there's one in the repo itself: https://github.com/eatnumber1/goal/blob/master/solutions/complete/ocaml/VictorNicollet/solution.ml 2014-07-27 21:11 Leonidas: molasses can be quite fast, https://en.wikipedia.org/wiki/Boston_Molasses_Disaster 2014-07-27 21:12 but only really trivial C bindings on ARM, the more involved stuff I did on x86, because it compiles faster 2014-07-27 21:12 whitequark: ok, noted. Heh. 2014-07-27 21:13 (things one can learn in #ocaml) 2014-07-27 21:13 izaak has quit [Ping timeout: 250 seconds] 2014-07-27 21:14 Drup: I proposed https://github.com/eatnumber1/goal/pull/113/files 2014-07-27 21:15 Ok, "al" is not a string, I could add a unary operator 2014-07-27 21:15 def`: yeah, my version is the same as your second 2014-07-27 21:15 Kakadu has quit [Quit: Konversation terminated!] 2014-07-27 21:16 Submarine has quit [Quit: Leaving] 2014-07-27 21:16 (except I use a constructor taking a string :p) 2014-07-27 21:17 print_endline (g()()()()!"al") 2014-07-27 21:17 with a constructor taking a string 2014-07-27 21:17 :p 2014-07-27 21:17 ggole has quit [] 2014-07-27 21:17 I have a version using -rectypes, but it doesn't work :( 2014-07-27 21:17 what is the point of -rectypes 2014-07-27 21:18 subtlety in the typechecker :/ 2014-07-27 21:18 ... subtlety? 2014-07-27 21:18 "it doesn't work"… that's not subtle 2014-07-27 21:19 oh I see, you can have type a = A of a, but not type a = a 2014-07-27 21:20 def`: it doesn't work because of a subtlety :p 2014-07-27 21:20 so when would one use -rectypes? 2014-07-27 21:20 or recursive types? 2014-07-27 21:20 of that form 2014-07-27 21:21 I'm not sure when to use rectype, expect when you want to blow your head off, actually 2014-07-27 21:22 ... 2014-07-27 21:23 * companion_cube never needed rectypes 2014-07-27 21:23 there are some places where it's used in batteries though 2014-07-27 21:23 like in Queue? 2014-07-27 21:23 or was that Obj.magic? 2014-07-27 21:24 it's just a Obj.magic 2014-07-27 21:25 (the goal with my solution with rectype was to use Obj.repr but no Obj.magic) 2014-07-27 21:27 def`: http://bpaste.net/show/wvj6pRCy9g48RaawzJ5d/ if you can figure out that :p 2014-07-27 21:29 a solution with Obj is not a solution :P 2014-07-27 21:29 depends 2014-07-27 21:30 (arguably, there is Obj.magic hided in my code, so you are right x) 2014-07-27 21:30 hidden* 2014-07-27 21:33 Drup: why does 'a. 'a in records not constitute an existential? 2014-07-27 21:33 so like 2014-07-27 21:33 type 'a foo = 'a * 'a -> int;; type bar = { foo : 'a. 'a foo } 2014-07-27 21:34 it's a forall, not an exist 2014-07-27 21:35 oh. 2014-07-27 21:36 there are actually several (interesting) inhabitant for "forall 'a . 'a * 'a -> int" 2014-07-27 21:37 const 0 ? 2014-07-27 21:37 you mean forall 'a . 'a * ('a -> int) 2014-07-27 21:37 or no/ 2014-07-27 21:37 companion_cube: "fun x y -> if x == y then 0 else 1", for example 2014-07-27 21:37 oh, I typoed 2014-07-27 21:37 BitPuffin has quit [Ping timeout: 255 seconds] 2014-07-27 21:37 (assuming purity and no poly comparison cheating) 2014-07-27 21:38 fun (x,y) -> ... you mean 2014-07-27 21:38 yes 2014-07-27 21:38 poly comparison sucks :D 2014-07-27 21:39 hhugo1 has quit [Quit: Leaving.] 2014-07-27 21:39 this isn't a total function, it will fail on functions 2014-07-27 21:39 companion_cube: that's why I didn't use it as example :D 2014-07-27 21:39 whitequark: so, you meant forall 'a . 'a * ('a -> int) ? 2014-07-27 21:39 that's going to be harder to find an inhabitant for that :D 2014-07-27 21:40 hhugo has joined #ocaml 2014-07-27 21:40 yeah 2014-07-27 21:41 exist would be like that : type foo = Bla : 'a * ('a -> int) -> foo 2014-07-27 21:41 yes, I know :S 2014-07-27 21:41 ok :) 2014-07-27 21:42 it would be cool having https://botbot.me/ in the channel 2014-07-27 21:42 their irc logs are incredibly neat 2014-07-27 21:42 Leonidas: http://irclog.whitequark.org/ocaml 2014-07-27 21:42 ok 2014-07-27 21:42 that's not too bad either 2014-07-27 21:43 a proper log tool should be able to take logs in plain text and display them 2014-07-27 21:43 "plain text" is a myth 2014-07-27 21:43 however, irclog.wq.org exports in it: http://irclog.whitequark.org/ocaml/2014-07-27.txt 2014-07-27 21:43 the point is having live updates and a good search 2014-07-27 21:43 irclog.wq.org has live updates, but search sucks 2014-07-27 21:44 although it's fully indexed by google, so here's that 2014-07-27 21:44 yeah, it'd be nice to be able to jump to a hit 2014-07-27 21:44 oh, it works 2014-07-27 21:44 :) 2014-07-27 21:44 the search engine itself sucks 2014-07-27 21:44 I use MySQL builtin search currently 2014-07-27 21:44 it is horrible 2014-07-27 21:45 it is just slightly better than rand() 2014-07-27 21:45 I am not exaggerating 2014-07-27 21:48 Sim_n has quit [Quit: Leaving] 2014-07-27 21:49 BitPuffin has joined #ocaml 2014-07-27 21:50 And I want to build another (Proably very old and bitrusted) ocaml software. Omake has this error. http://paste.ubuntu.com/7878669/ 2014-07-27 21:50 jao has quit [Ping timeout: 245 seconds] 2014-07-27 21:50 was looking at the network activity, you use the same technique as botbot :-) 2014-07-27 21:50 But this looks like a error in a new package 2014-07-27 21:51 this looks like an incompatible campl4 2014-07-27 21:51 miko: what are you trying to build? 2014-07-27 21:52 Incompatible with itself? For me it looks like the error is in /usr/lib/ocaml/camlp4/camlp4lib.cmxa, witch is brand new. 2014-07-27 21:52 ANT 2014-07-27 21:52 http://sourceforge.net/projects/ant.berlios/ 2014-07-27 21:53 A very, very obsure, but very promissing TeX alternative with a haskell alike scripting language. 2014-07-27 21:56 tautologico has quit [Quit: My MacBook has gone to sleep. ZZZzzz…] 2014-07-27 21:57 This is the whole output: http://paste.ubuntu.com/7878752/ 2014-07-27 21:59 Is it true pa_Num.cmx and pa_extensions.cmx are depending on outdated camlp4 ? 2014-07-27 21:59 (or likely?) 2014-07-27 21:59 izaak has joined #ocaml 2014-07-27 22:00 rand000 has quit [Quit: leaving] 2014-07-27 22:02 whitequark: it would be nice to have global search on it, not only for the day 2014-07-27 22:03 ( miko : doesn't answer your question, but you might be interested by patoline) 2014-07-27 22:03 Drup: it has global search 2014-07-27 22:04 oh, indeed 2014-07-27 22:04 for some reason, I only used the "filter" box, never the search one :> 2014-07-27 22:04 Drup: Check out that earlier that day. It looks very nice and alread better then TeX (I really don't like it), but this looks even better. 2014-07-27 22:04 Still, thanks for the hint. 2014-07-27 22:08 tautologico has joined #ocaml 2014-07-27 22:09 it seems to be very similar to TeX, just less insane on the macro side 2014-07-27 22:13 shinnya has quit [Ping timeout: 240 seconds] 2014-07-27 22:15 BitPuffin has quit [Ping timeout: 264 seconds] 2014-07-27 22:16 zpe has joined #ocaml 2014-07-27 22:16 patoline is a system written in and scriptable in OCaml 2014-07-27 22:16 patoline.org 2014-07-27 22:16 seems interesting 2014-07-27 22:19 never took the time to actually try it 2014-07-27 22:19 shinnya has joined #ocaml 2014-07-27 22:20 it requires camlimages 2014-07-27 22:20 zpe has quit [Ping timeout: 264 seconds] 2014-07-27 22:21 it's not an optional dependency ? 2014-07-27 22:21 no 2014-07-27 22:21 well, there is a patch to make it work, so ... 2014-07-27 22:22 someone should put it on opam 2014-07-27 22:22 currently it doesn't install. 2014-07-27 22:22 avsm has joined #ocaml 2014-07-27 22:23 Armael: is the fix compatible with older libgif versions ? 2014-07-27 22:25 camlimages or patoline? I think patoline is on opam 2014-07-27 22:25 camlimages 2014-07-27 22:25 depends: ocamlfind & camomile & camlimages & dypgen & sqlite3-ocaml & camlzip 2014-07-27 22:25 this is from opam info patoline 2014-07-27 22:26 is the camlimages on opam broken? 2014-07-27 22:27 yes 2014-07-27 22:28 oh, some genius decided to build it with -Werror 2014-07-27 22:28 so it doesn't compile on 4.02 2014-07-27 22:29 classic 2014-07-27 22:30 hm 2014-07-27 22:30 I want to be able to do this: 2014-07-27 22:30 assert_equal ~printer:[%derive.Show: int list] [1;2;3] !lst 2014-07-27 22:30 should extend deriving to work like that 2014-07-27 22:31 doesn't look much better than simply applying printing combinators 2014-07-27 22:32 hm? 2014-07-27 22:32 ~printer:(List.print Int.print) 2014-07-27 22:32 well, you can do the same with combinators 2014-07-27 22:32 but with deriving and very little work, you can do the same for any existing deriver 2014-07-27 22:32 List.sort ~cmp:[%derive.Ord: int list] 2014-07-27 22:33 sort ~cmp:[%derive.Ord] ? 2014-07-27 22:33 yes 2014-07-27 22:33 ah, too late :D 2014-07-27 22:33 same, I have combinators for orderings 2014-07-27 22:33 or even iter! 2014-07-27 22:33 but I see your point 2014-07-27 22:33 I have combinators for iterating :> 2014-07-27 22:33 (did I tell you about sequence?) 2014-07-27 22:33 uh? 2014-07-27 22:35 I meant that combinators are generally already powerful enough 2014-07-27 22:36 it might be useful to generate those, but I'm not so sure about generating code at use point 2014-07-27 22:36 it's mostly to have a single mechanism for both 2014-07-27 22:36 Guest58938 has quit [Remote host closed the connection] 2014-07-27 22:36 you could even do 2014-07-27 22:36 so what would it look like for iterating? 2014-07-27 22:36 avsm has quit [Quit: Leaving.] 2014-07-27 22:37 Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!] 2014-07-27 22:37 [%derive.Iter: 'a list] (printf "%d") [1;2;3] 2014-07-27 22:37 englishm has joined #ocaml 2014-07-27 22:39 oh, using polymorphism 2014-07-27 22:39 I prefer being explicit for iteration 2014-07-27 22:39 uhm? 2014-07-27 22:39 because it's a choice 2014-07-27 22:39 well, if you have an int list list, you can iterate on int, or on int list 2014-07-27 22:39 the idea behind Iter is that it calls a function for every free type variable 2014-07-27 22:40 you could probably say 2014-07-27 22:40 [%derive.Iter: (int as 'a) list] 2014-07-27 22:40 if you have several type variables, what happens? 2014-07-27 22:40 a separate function is accepted for each 2014-07-27 22:40 but how does the iteration proceed? 2014-07-27 22:40 hm? 2014-07-27 22:41 what do you mean? 2014-07-27 22:41 show me an example 2014-07-27 22:41 pyon has quit [Quit: ERC Version 5.3 (IRC client for Emacs)] 2014-07-27 22:42 (for instance: [%derive.Iter: ('a * 'b) list] fa fb list ? 2014-07-27 22:42 pyon has joined #ocaml 2014-07-27 22:42 yes 2014-07-27 22:42 companion_cube: "[%derive.Iter: 'a list]" would iterate on the outer list, and "[%derive.Iter: 'a list list]" on the inside 2014-07-27 22:42 it generates: let rec iter_foo poly_b poly_a = List.iter (fun (a0,a1) -> poly_a a0; poly_b a1);; 2014-07-27 22:43 sounds nice, but not as much as [%derive.sequence] :> 2014-07-27 22:43 what would that do? 2014-07-27 22:43 companion_cube: not the same use 2014-07-27 22:44 whitequark: well it's a flip of [%derive.iter], which is better for composition 2014-07-27 22:44 example? 2014-07-27 22:45 [%derive.sequence: int list] [1;2;3] |> Sequence.flat_map foobar |> Sequence.to_list ? 2014-07-27 22:45 so, basically, CPS'd iter 2014-07-27 22:46 you can write that as an exercise ;D 2014-07-27 22:46 when 4.02 is released :p 2014-07-27 22:47 what prevents you from doing it now? 2014-07-27 22:48 merlin :p 2014-07-27 22:49 git checkout merlin2 2014-07-27 22:49 it works on 4.02. 2014-07-27 22:51 englishm has quit [Remote host closed the connection] 2014-07-27 22:53 well I'm in no hurry 2014-07-27 22:55 excuses 2014-07-27 22:59 yep :D 2014-07-27 22:59 pyon has quit [Quit: stupid urxvt] 2014-07-27 22:59 sheijk_ has joined #ocaml 2014-07-27 23:00 pyon has joined #ocaml 2014-07-27 23:01 troydm has joined #ocaml 2014-07-27 23:02 sheijk has quit [Ping timeout: 260 seconds] 2014-07-27 23:04 izaak has quit [Ping timeout: 264 seconds] 2014-07-27 23:06 oscar_ has quit [Ping timeout: 246 seconds] 2014-07-27 23:11 darkf has joined #ocaml 2014-07-27 23:13 algoriddle has quit [Quit: Connection closed for inactivity] 2014-07-27 23:14 miko has quit [Ping timeout: 260 seconds] 2014-07-27 23:16 zpe has joined #ocaml 2014-07-27 23:19 thomasga has quit [Quit: Leaving.] 2014-07-27 23:21 zpe has quit [Ping timeout: 256 seconds] 2014-07-27 23:22 sillyotter has joined #ocaml 2014-07-27 23:24 sillyotter has quit [Client Quit] 2014-07-27 23:33 madroach has quit [Ping timeout: 250 seconds] 2014-07-27 23:33 oriba has quit [Quit: oriba] 2014-07-27 23:35 madroach has joined #ocaml 2014-07-27 23:38 WraithM has joined #ocaml 2014-07-27 23:40 NoNNaN has quit [Remote host closed the connection] 2014-07-27 23:40 penglingbo has joined #ocaml 2014-07-27 23:41 NoNNaN has joined #ocaml 2014-07-27 23:42 tautologico has quit [Quit: Textual IRC Client: www.textualapp.com] 2014-07-27 23:42 WraithM has quit [Ping timeout: 240 seconds] 2014-07-27 23:56 izaak has joined #ocaml