flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
troydm has quit [Ping timeout: 264 seconds]
troydm has joined #ocaml
hellome has quit [Remote host closed the connection]
Nahra has quit [Ping timeout: 245 seconds]
Nahra has joined #ocaml
watermind has quit [Quit: Konversation terminated!]
chrisdotcode has quit [Ping timeout: 264 seconds]
csakatoku has joined #ocaml
demonimin has quit [Remote host closed the connection]
demonimin has joined #ocaml
hellome has joined #ocaml
Neros has quit [Ping timeout: 264 seconds]
avsm1 has joined #ocaml
q66 has quit [Quit: Leaving]
avsm has quit [Ping timeout: 260 seconds]
madroach has quit [Ping timeout: 264 seconds]
ygrek has joined #ocaml
madroach has joined #ocaml
chrisdotcode has joined #ocaml
Nahra has quit [Ping timeout: 245 seconds]
dsheets has quit [Ping timeout: 248 seconds]
Nahra has joined #ocaml
walter|r has joined #ocaml
walter has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 245 seconds]
manud has joined #ocaml
walter|r has quit [Read error: Connection reset by peer]
Nahra has quit [Quit: leaving]
avsm1 has quit [Quit: Leaving.]
travisbrady has joined #ocaml
ygrek has joined #ocaml
darkf has joined #ocaml
avsm has joined #ocaml
shinnya has quit [Ping timeout: 264 seconds]
BiDOrD_ has joined #ocaml
BiDOrD has quit [Read error: Operation timed out]
demonimin has quit [Ping timeout: 246 seconds]
avsm has quit [Quit: Leaving.]
ollehar has joined #ocaml
introom has joined #ocaml
yacks has quit [Ping timeout: 264 seconds]
travisbrady has quit [Quit: travisbrady]
yacks has joined #ocaml
ollehar has quit [Ping timeout: 260 seconds]
avsm has joined #ocaml
ollehar has joined #ocaml
introom has quit [Ping timeout: 246 seconds]
avsm has quit [Ping timeout: 256 seconds]
manud has quit [Ping timeout: 246 seconds]
ollehar has quit [Ping timeout: 264 seconds]
avsm has joined #ocaml
manud has joined #ocaml
milosn has joined #ocaml
milosn_ has quit [Ping timeout: 240 seconds]
cdidd has quit [Ping timeout: 248 seconds]
introom has joined #ocaml
ollehar has joined #ocaml
yacks has quit [Quit: Leaving]
cdidd has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
manud has quit [Ping timeout: 268 seconds]
lifeng has quit [Quit: Ex-Chat]
wmeyer has joined #ocaml
<wmeyer> pin adrien
bobry has quit [Ping timeout: 240 seconds]
<levi> wmeyer: Heya
<wmeyer> levi: hey, I just wanted to ping you too
* adrien hides :P
<adrien> morning
<adrien> I've started rebasing some of the patches and I still need to rebase one and apply two others (which should apply without issue)
<wmeyer> morning
<levi> wmeyer: I've been working on the configuration stuff. It turns out the failure on my machine was not related to the config file at all. :)
<wmeyer> do it gradualy, package of 3 is fine usually adrien
<adrien> however I'm going to rework the remaining patches; some needs to be merged and some need to be split
<wmeyer> levi: possibly I may did i see that before, but I don't remember what was it, have you pinned that down the problem?
<levi> wmeyer: It was actually due to my machine's hostname not showing up in /etc/hosts, so gethostbyname was bailing.
<wmeyer> !
<wmeyer> yes
<adrien> I'll be swimming this evening so I won't have much time but I'll probably send something on tomorrow
<adrien> almost done :P
<wmeyer> i remember this kind of problem, but i have to admit didn't get to the root of the problem levi
<wmeyer> so thanks for finding this out
<wmeyer> we may want to raise a bug for ocaml unix module or add this information to Indigo wiki
<levi> I found it through moving a printf around until I figured out exactly which call was the last to execute.
<wmeyer> levi: good job, thanks.
<levi> I don't think it's actually a bug; it's throwing an exception because the underlying call failed, which is what it says it'll do.
<levi> It just needs to be wrapped in a lwt_try
<wmeyer> the user definitely neesds to know
<wmeyer> if you can provide a nice error message would be good
<levi> Speaking of which, what problem did you experience with Bolt?
<wmeyer> I don't clearly remember
<wmeyer> it was long time ago
<wmeyer> we need to talk a bit, what needs to be done in Indigo
<levi> I wonder if it was a bad interaction with lwt?
<wmeyer> yes, that's possible
<levi> I haven't looked in depth at how lwt is being used overall, but if something else starts making blocking system calls it can mess up lwt's monadic thread switching.
<levi> lwt has a logging facility built into it; Bolt seems a lot more featureful, but I'm not sure how much logging you really want.
<wmeyer> maybe dropping this dependency would be OK and use Lwt logging, because we always tend to stay in Lwt anyway
<wmeyer> adrien: no problem, when you have your patches ready just let me know
<wmeyer> I am glad somebody is interested in Indigo :-)
<wmeyer> ping def-lkb_ :-)
<wmeyer> levi: I have to admit the bulk of huge work is behind us, especially custom drawn gui
<wmeyer> i'd like to use reactive programming for this
<wmeyer> other maybe difficult part is to provide a really nice API for scripting
<wmeyer> so maybe one of the first things would be to port few modules from Vassal engine
<levi> What kind of 'things' do you want to be placed on the 'tabletop'?
<wmeyer> the candidates are clear: "Bucket of Dice", "Carcassone" at least first two
<levi> Maybe decks of cards for card games, too.
<wmeyer> board games, maps, whiteboards (interactive maps), dice, cards
<wmeyer> yes
<wmeyer> notes, character sheets
<wmeyer> tables
<wmeyer> tokens
<wmeyer> has to be very generic, and at the same time convenient
<levi> Yeah.
<wmeyer> :)
<wmeyer> I have a detailed spec and know guy who knows what he is doing
<wmeyer> but it's a big document in Polish
<wmeyer> i am going to raise mantis issue and try to translate at least partially
<levi> I can at least work on things like command line parsing and logging infrastructure. :)
<wmeyer> the spec is not complete but rather a nice collection of ideas
<wmeyer> (mantis=github)
<wmeyer> levi: that's good, thanks, but we will definitely have much more interesting work than this too!
<wmeyer> i am scared about gui at the moment
<levi> I have put together a prototype of a cmdliner-based command line reader for both client and server, and a means for merging config from files and the command line.
<wmeyer> levi: I really want Indigo to be used to full extent :-)
<wmeyer> oh cmdliner, great!
<wmeyer> i was just thinking to propose it ...
<levi> Though it probably will need to be replaced with something more general when there's actual game stuff that needs configuration too.
<levi> Or maybe that would be entirely separate config. Who knows?
<wmeyer> levi: I think it would be good to allocate some time on the weekend, and try together VASSAL engine, to show you what it is
<levi> Sounds good.
<wmeyer> levi: there might be some input for game plugins through command line, you are right
<wmeyer> but I'd like to avoid too much command line at least on client side
<wmeyer> and just use it for the stuff that allows to quikclu operate
<adrien> what's Indigo?
<levi> At the moment, it has default for everything and also has provisions for reading overrides to the defaults from either a config file or the command line.
<wmeyer> I know you are different time zone levi, what time you are now?
<levi> 11:35 pm right now.
<wmeyer> levi: yes, i tried my best to implement it propery
<wmeyer> so it's 7h as I though
<wmeyer> Ok, maybe your late night and my early morning would be good
<wmeyer> adrien: it's a tabletop engine
<levi> Well, I was referring to my new cmdliner-based prototypes.
<wmeyer> ah ok
* wmeyer still sleeping
<adrien> you have a link? :P
<wmeyer> levi: I'd like to use as much libraries as we need/want
<adrien> you have a link?
<levi> I am still getting my bearings in OCaml-land again.
<levi> It's changed a bit!
<wmeyer> levi: definitely you have a really good start!
<adrien> thanks
<levi> I'm pretty sure there were no polymorphic variants last time I used it, and certainly not GADTs. Probably not any monad libraries, either, not that I had any idea what a monad was back then.
<wmeyer> levi: sounds like it was long time ago
<wmeyer> at least polymorphic variants have been around quite some time
<wmeyer> levi: I am sure you like OCaml more now :-)
manud has joined #ocaml
<wmeyer> feel free to use any feature you think it's reasonable
<wmeyer> (including GADTs)
<wmeyer> for monads you can use (berware, self advertising): https://github.com/danmey/omonad - it works with the trunk compiler
<whitequark> wmeyer: what does it require from the compiler?
<wmeyer> whitequark: just -ppx rewriters support
<wmeyer> (and compilerlibs)
ggole has joined #ocaml
<wmeyer> levi: I think we can quickly run VASSAL engine on saturday
<wmeyer> I still have to fix my desktop
<whitequark> wmeyer: what could I use omonad for?
<wmeyer> so tentatively saturday evening, or other time you wish
<wmeyer> sunday is good too, but i am going for a beer later in the evening
<wmeyer> whitequark: any monadic programming
<whitequark> wmeyer: sure. I just wonder about practical use cases in ocaml.
<wmeyer> whitequark: not as many as in Haskell but still!
<levi> whitequark: monads are useful for modeling and composing kinds of 'computation' as separate from pure values.
<whitequark> levi: well, I kind of understand that in theory it is
<levi> They were first used in CS not directly in programming languages but in denotational semantics.
<whitequark> can you show any examples where it's more convenient for some relatively common task?
<levi> Well, consider the 'option' type constructor. It can (with the proper 'return' and 'bind' operations) form a monad, and in the option monad you can work with values without having to explicitly check for failure all the time.
<whitequark> right
<whitequark> but can't I use the Option.map from extlib for pretty much the same result?
<wmeyer> list comprehension monad, it allows to construct and enumerate lists, including simple constraint solving
<whitequark> and yeah, I understand that option/Option implement a monadic interface
<whitequark> I just don't get what would you need a dedicated library for
<wmeyer> you need a syntax actually not a library
<whitequark> hm
<wmeyer> is much more convenient
<whitequark> so it just provides a syntax which is the same for all monadic interfaces?
ygrek has quit [Ping timeout: 264 seconds]
<wmeyer> yep
<whitequark> like option
<whitequark> ah I see, thanks
<wmeyer> you say
<wmeyer> levi: when you are done with your stuff, just submit a pull request
<wmeyer> I will review, test it, and merge it ASAP
<whitequark> wmeyer: I say?
<wmeyer> you say:
<levi> wmeyer: Sure. I'm going pretty slow at the moment, as I am still spending a lot of time scratching my head and reading code.
manud has quit [Ping timeout: 264 seconds]
<wmeyer> x <-- foo ();
<wmeyer> y <-- return "bar";
<wmeyer> z <-- x ++ y;
<wmeyer> return z
<wmeyer> you see, no explicit option handling
<wmeyer> but when foo returns None
<wmeyer> the whole sequence of assigments will return none
<wmeyer> before it gets the next statement
<wmeyer> so it's like an exception
* whitequark nods
<wmeyer> levi: certainly the code is not obvious in many place
<wmeyer> i am happy to see any (even small) improvements too
<levi> whitequark: Monadic programming is kind of like programming in continuation-passing style, but with 'bind' stuck between each function and its continuation. This lets you reprogram the semantics of your monadic code block. The syntactic support 'un-CPSs' it.
<levi> This is what is meant when people say that monads are like 'programmable semicolons'.
manud has joined #ocaml
<whitequark> interesting interpretation
<levi> In fact, you can easily make a continuation monad that lets you capture and invoke delimited continuations in your monadic block.
ggole has quit [Read error: Connection timed out]
ggole has joined #ocaml
ben_zen has joined #ocaml
lopex has quit [Ping timeout: 264 seconds]
wmeyer has quit [Ping timeout: 260 seconds]
wmeyer has joined #ocaml
<wmeyer> whitequark: I will add that monads are generic interface to computation
<wmeyer> whitequark: the return operation allows you to include more information and abstract the
<wmeyer> data type
<wmeyer> whitequark: and bind allows to customize how the computation behaves
davekong has quit [Ping timeout: 264 seconds]
<whitequark> I see
IbnFirnas has quit [Ping timeout: 276 seconds]
<wmeyer> whitequark: http://danmey.org/omonad.html
<levi> Another interesting thing is the idea of the 'free monad' for a monadic type. This is the minimal form of a monad, which doesn't provide any additional structure beyond that required by the monad laws. What it typically ends up giving you is a data structure representing the 'shape' of the computation in your monadic code block, which you can later interpret via a fold-like operation.
csakatok_ has joined #ocaml
<whitequark> so, in the case of ocaml, if I write a code block using a free monad, it'll turn into a list of thunks?
<levi> A 'free' structure is the simplest thing that obeys that structure's laws. So the 'free monoid' for basic types is a type isomorphic to the list type.
ben_zen has quit [Quit: zonk]
csakatoku has quit [Ping timeout: 256 seconds]
<wmeyer> levi: if you get something work I may have time to review now or later
* wmeyer eagers to start playing with Indigo
manud has quit [Ping timeout: 260 seconds]
Kakadu has joined #ocaml
<levi> The shape of a free monad depends on the shape of the functor (in the general sense, not the more restricted ML functor sense) it's built from.
<levi> In the categorical sense, a functor maps both the objects and arrows of a category to another category such that structure is preserved. List can also be a functor in this sense; it maps type a to list of a, and it maps functions a->b to a list -> b list.
ttamttam has joined #ocaml
<levi> Anyway, the free monad for the list functor is exactly the list monad, where return wraps an element in a list and bind maps the function over the list parameter and then concatenates the results into a single list.
Drup has quit [Quit: Leaving.]
<levi> You could also define a tree type, and make it a functor by supplying a 'fmap' operation that applies a function uniformly over the tree. The free monad for your tree would then just be the monad instance that uses bind to call fmap on the argument and then merge the resulting trees by replacing the evaluated leaves with the new trees.
<levi> If that makes any sense.
<wmeyer> levi: what is your github id?
zpe has joined #ocaml
<levi> wmeyer: pinealservo
<wmeyer> interesting, you forked the project, but can't see anything on my dashboard
<levi> whitequark: So, to answer your question, you don't get a list of thunks, you get an abstract syntax tree based on the structure of the data type your monad is parameterized with.
<wmeyer> levi: thanks
<wmeyer> levi: I am going to work now
bobry has joined #ocaml
<wmeyer> levi: so see you a bit later
wmeyer has quit [Remote host closed the connection]
ygrek has joined #ocaml
<levi> OK. I will probably be going to sleep soon.
zpe has quit [Ping timeout: 260 seconds]
cago has joined #ocaml
mika1 has joined #ocaml
<whitequark> hm, the AST part went somewhat over my head
<whitequark> I understand that conceptually it makes sense, but not how all parts combine together to product this effect
thomasga has joined #ocaml
manud has joined #ocaml
ocp has joined #ocaml
Simn has joined #ocaml
wwilly has joined #ocaml
<wwilly> Bonjour :)
gnuvince has quit [Remote host closed the connection]
<rixed> Mes hommages :)
rixed has quit [Quit: SSL here I am!]
zpe has joined #ocaml
Yoric has joined #ocaml
rixed has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
<ygrek> regarding mli produced both by ocaml and ocamlopt - are those cmi the same?
<ygrek> argh, read "regarding cmi produced ..."
<mrvn> yes
Neros has joined #ocaml
chrisdotcode has quit [Ping timeout: 248 seconds]
Yoric has quit [Read error: Connection reset by peer]
chrisdotcode has joined #ocaml
<ygrek> mrvn, and what is exactly the problem with parallel compilation?
<ygrek> that somebody reads the file while it is written to?
<mrvn> why do you ask me?
<ygrek> cause you answered my previous question :)
<ygrek> so I assume you have some clue on the topic?
<mrvn> I might have a clue. I don't see a problem though.
tane has joined #ocaml
ggole_ has joined #ocaml
<ygrek> they say some tool may read a partial cmi and error out when this happens
<ygrek> the obvious fix is writing out cmi file atomically
<ygrek> temp->sync->rename
<mrvn> no.
Kakadu has quit []
<ygrek> why?
<mrvn> That would cause the other thing to build against an obsolete cmi file.
ggole has quit [Ping timeout: 245 seconds]
<ygrek> the idea is that previous cmi was written out previously by ocamlc
<ygrek> identical cmi that is
<mrvn> Get the dependcies straight. If something needs the cmi then it needs to have a prerequisite on it and make will only build it after the cmi is done.
<ggole_> Why the sync?
Xom has quit [Quit: ChatZilla 0.9.90.1 [Firefox 22.0/20130618035212]]
<mrvn> If it is identical then you should replace it. causes unneccessary rebuilds.
<ygrek> mrvn, yes, and that rules asks ocamlc to generate ocamlc
<mrvn> shoudn't
<ygrek> that's the problem I don't want to solve
zpe has joined #ocaml
<ygrek> it is happening now with ocamlbuild I think
<mrvn> I have no idea what your problem is. But if you are using a cmi before it is finished building then you are missinf a prerequisite.
<ygrek> ggole_, that's a good habit if you don't want to lose data in case of machine crash
<ygrek> on some fs
<ygrek> mrvn, cmi is generated by ocamlc
<ygrek> say on step1
<ygrek> than in parallel the ocamlopt on the same ml is launched
<ggole_> .cmi doesn't seem to warrant such measures
<ggole_> Since you can just regenerate it
<ygrek> and some other thing that depends on cmi in parallel
<ygrek> ggole_, probably
<mrvn> ygrek: then your build system is broken
<ggole_> (And I'm told sync is unfortunately very expensive.)
<ygrek> mrvn, so yo suggest to drop parallel opportunity in such case?
<ygrek> ocamlbuild is not broken here
<ygrek> it handles it
<mrvn> there is no opportunity since you have a dependency on the result of the first.
<ygrek> but pays missed parallelism opportunity for it
<mrvn> it doesn't.
<ygrek> a.ml -> a.cmi a.cmo; a.ml -> a.cmx a.cmi; and b.ml depends on b.cmi
<ygrek> b.ml depends on a.cmi
<ygrek> don't you see a parallelism opportunity
<ygrek> ?
<mrvn> ygrek: sure. you can build a.cmo and a.cmx in parallel.
<ygrek> and currently you can't, because cmi will overwrite each other
<ygrek> (or at least I believe so)
<mrvn> So let them overwrite
lopex has joined #ocaml
<mrvn> unless ocamlc/opt does something stupid like truncating the file and overwriting it instead of unlink + create new one
<mrvn> open("foo.cmi", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
<mrvn> open("foo.cmi", O_RDONLY) = 5
<mrvn> bummer
<ygrek> and it is written in protions
<ygrek> actually that read - I don't understand why
<ygrek> it looks like write part, read part, write rest
<ygrek> why?
<mrvn> seems like it verifies the result or something.
<ygrek> can't believe
zpe has quit [Ping timeout: 256 seconds]
<mrvn> or probably it needs the cmi before compiling the cmo. So it writes that and then goes into the case where you already have a cmi
<ygrek> closes it immediately
<ygrek> looks fishy
davekong has joined #ocaml
sgnb` has joined #ocaml
<mrvn> open("foo.cmi", O_RDONLY) = 5
<mrvn> read(5, "Caml1999I014\204\225\246\276\0\0\0\6\0\0\0\2\0\0\0\5\0\0\0\5"..., 65536) = 38
<mrvn> close(5) = 0
ollehar has quit [Ping timeout: 268 seconds]
<ygrek> and write into it afterwards
<ygrek> do you see it?
<mrvn> It reads bad the signature
sgnb has quit [Ping timeout: 245 seconds]
<mrvn> back even
sgnb` has quit [Remote host closed the connection]
IbnFirnas has joined #ocaml
<mrvn> ygrek: It would be nice if ocamlc/opt had an option to create the cmi file and not to create the cmi file.
sgnb has joined #ocaml
<ygrek> maybe that's not "typesafe" enough
<mrvn> say you build in the following sequence: a.cmo (+a.cmi), b.cmo, a.cmx (+a.cmi) then b.cmo is out of date again and gets rebuild on the next run for no reason.
<ygrek> just a wild guess why it is not done
<mrvn> ygrek: it is done if you have a .mli file
<ygrek> yeah, correct
<ygrek> strange then
<mrvn> It wasn't designed to build both bytecode and binary.
<ygrek> hm, then probably ocamlbuild could use ocamlopt to build cmi when needed instead of ocamlc? deciding dynamically by the list of targets...
adrien_o1w has joined #ocaml
<mrvn> ygrek: One thing I actualy want to do is use ocamlc -i to generate _build/a.mli. But only overwrite _build/a.mli if it changed.
<mrvn> ygrek: it could do that if you only need one
talzeus_ has quit [Read error: Connection reset by peer]
<mrvn> and by the way, why does -i cause .cmo/cmi not to be produced? That should be optional.
adrien_oww has quit [Ping timeout: 264 seconds]
<ygrek> PR#4991 discusses the above observations
talzeus_ has joined #ocaml
<mrvn> Re: opening the .cmi twice: the second open-for-reading is done to compute the MD5 digest of the data just written. OCaml's I/O channels don't support opening for reading and writing at the same time.
<ygrek> why not compute md5 on string?
<mrvn> ygrek: if you don't want to use the -intf-suffix then try ocamlc -o foo_temp.cmo ... && { cmp -q foo_temp.cmi foo.cmi || mv foo_temp.cmi foo.cmi }
<ygrek> Re: atomic file rename: it's unclear this can be done under Windows
<mrvn> screw windows
<mrvn> ygrek: The problem with -intf-suffix is that you then need to use ocamlc even when you don't need the .cmo. Or you have to build different depends for .cmo, .cmx and .cmo+.cmx builds.
<mrvn> ygrek: note: The atomicity of rename makes no difference because of the cmp. The .cmi only gets replaced if it changed and it can only change if the source changed and then anything needing the cmi will be blocked by the dependencies and can't run in parallel to the mv.
<ygrek> I don't actually see the problem with non-atomic rename on windows
<mrvn> Without the cmp it is a problem because something could open the .cmi just inbetween the rm and rename.
<mrvn> open() could fail
<ygrek> iiuc it can be inconsistent only on errors, i.e. if something is badly broken, e.g. fs
<ygrek> but not in between
<mrvn> no. if rename is not atomic then it can randomly fail
<ggole_> The windows solution to that is file locking afaik
zpe has joined #ocaml
adrien_o1w is now known as adrien_oww
<ygrek> oh, I forgot about that, we cannot even delete the file while it is open
<ygrek> so no way to overwrite it in parallel
<ygrek> crap
<mrvn> ahh, the fun of windows. I go back to: screw windows
<mrvn> if $(WINDOWS) .noprallel endif
<adrien_oww> which language is that? :P
<mrvn> adrien_oww: pseudo-make
<adrien_oww> gnu make? ;-)
<ygrek> mrvn, actually vista+ has atomic rename, but not winxp or win2k
<ygrek> probably some conditional compilation can make it work fast on modern win and not break on old
<ygrek> obv nobody really wants to jump onto this
mcclurmc has quit [Quit: Leaving.]
zpe has quit [Ping timeout: 256 seconds]
ollehar has joined #ocaml
zpe has joined #ocaml
<adrien_oww> I don't think 2k is still supported by MS; XP will be dropped within a year
<adrien_oww> do you still support linux kernel 2.0?
Kakadu has joined #ocaml
yacks has joined #ocaml
mcclurmc has joined #ocaml
<whitequark> ... some people actually still use 2.4
<adrien_oww> yes, but 2.0?
weie has joined #ocaml
<adrien_oww> and the question is whether your code actually supports 2.0, 2.2, 2.4
weie_ has quit [Ping timeout: 248 seconds]
<adrien_oww> 2.0 is 1996 so maybe a bit too old to compare to XP but https://www.kernel.org/category/releases.html is worth looking at
mort___ has joined #ocaml
<adrien_oww> 2.2 was EOL'ed in 2003, 2.4 in 2006
yacks has quit [Read error: Operation timed out]
tane has quit [Quit: Verlassend]
introom has quit [Remote host closed the connection]
q66 has joined #ocaml
beckerb_ has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 268 seconds]
avsm has joined #ocaml
structuralist has joined #ocaml
dsheets has joined #ocaml
joostvb has quit [Ping timeout: 260 seconds]
rossberg__ has quit [Ping timeout: 260 seconds]
lifeng has joined #ocaml
joostvb has joined #ocaml
joostvb is now known as Guest21267
Kakadu has quit []
rossberg__ has joined #ocaml
ttamttam has quit [Quit: ttamttam]
avsm has quit [Quit: Leaving.]
gautamc has quit [Read error: Connection reset by peer]
gautamc has joined #ocaml
beckerb_ has quit [Ping timeout: 245 seconds]
djcoin has joined #ocaml
_andre has joined #ocaml
yacks has joined #ocaml
malo has joined #ocaml
manud has quit [Read error: Operation timed out]
tane has joined #ocaml
secret has joined #ocaml
<secret> anyone on?
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 264 seconds]
yezariaely has joined #ocaml
secret has quit [Quit: Page closed]
wwilly has quit [Quit: Leaving]
ygrek has joined #ocaml
beckerb_ has joined #ocaml
demonimin has joined #ocaml
secret has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
wwilly has joined #ocaml
darkf_ is now known as darkf
csakatoku has joined #ocaml
csakatok_ has quit [Ping timeout: 264 seconds]
<yezariaely> anyone has an idea of how to write the following recursive higher-kinded haskell type definition in Ocaml (probably using modules)? data Fix f= In (f (Fix f))
<yezariaely> I have especially problems including the In data constructor
<yezariaely> so far I have the following http://pastebin.com/K41XpSZM (doesn't type check!)
<yezariaely> better version: http://pastebin.com/4GxbXwzN
<yezariaely> even with -rectypes this doesn't work
Drup has joined #ocaml
<mrvn> % ocaml -rectypes
<mrvn> # type 'a fix = In of (('a fix -> 'a) as 'a);;
<mrvn> type 'a fix = In of 'a constraint 'a = 'a fix -> 'a
speredenn has joined #ocaml
<yezariaely> mrvn: wow. I didn't expect this to work with normal data types.
<mrvn> # type 'a foo = In of 'a bar and 'a bar = 'a foo -> 'a bar;;
<mrvn> type 'a foo = In of 'a bar
<mrvn> and 'a bar = 'a foo -> 'a bar
osa1 has joined #ocaml
<mrvn> isn't that the same? works without rectypes
<yezariaely> what is the type of 'a in here?
<yezariaely> it is not * -> * isn't it?
<mrvn> whatever f has
<mrvn> I'm assuming you want to be able to have int fix, float fix, string fix, ...
<yezariaely> well then this seems to be not what I need. I need f to be a functor, i.e. a type-function mapping from a type to another
<yezariaely> not a value.
csakatoku has quit [Remote host closed the connection]
<mrvn> then 'a would be A.t -> B.t
<yezariaely> yes, that is what I tried (see the second pastebin)
<mrvn> put the above type inside your functor to handle the recursion.
introom has joined #ocaml
<mrvn> you probably have to rewrite it a bit to fit your needs but the general idea of putting the recursion into the type defintion should hold
<yezariaely> so if I got this right: type-function is encoded in functors and recursion should be put in type t = ...?
<mrvn> yes
<yezariaely> mrvn: thank you for your help.,
introom has quit [Remote host closed the connection]
mort___ has quit [Quit: Leaving.]
osa1 has quit [Ping timeout: 264 seconds]
smondet has joined #ocaml
Yoric has joined #ocaml
mort___ has joined #ocaml
Guest21267 is now known as joostvb
avsm has joined #ocaml
speredenn has quit [Quit: Leaving]
Kakadu has joined #ocaml
lenstr has quit [Read error: Connection reset by peer]
travisbrady has joined #ocaml
<whitequark> how do you usually name tokens?
<whitequark> TOKEN or Token?
<adrien_oww> TOKEN
<ggole_> Token
<ggole_> All caps is a holdover from C afaict
* whitequark sighs
<mrvn> TOK_EN, Tok_En or Tok_en?
csakatoku has joined #ocaml
malo has quit [Quit: Leaving]
skchrko has joined #ocaml
ttamttam has joined #ocaml
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
Neros has quit [Remote host closed the connection]
LeNsTR has joined #ocaml
LeNsTR is now known as lenstr
introom has joined #ocaml
ttamttam has quit [Quit: ttamttam]
ttamttam has joined #ocaml
ttamttam has quit [Client Quit]
yacks has quit [Ping timeout: 264 seconds]
bkpt has joined #ocaml
Neros has joined #ocaml
cago has left #ocaml []
mika1 has quit [Quit: Leaving.]
structuralist has quit []
zpe has quit [Remote host closed the connection]
secret has quit [Ping timeout: 250 seconds]
gereedy has joined #ocaml
Yoric has quit [Ping timeout: 256 seconds]
darkf has quit [Quit: Leaving]
Patchou has joined #ocaml
Tamae has quit [Ping timeout: 256 seconds]
ollehar has quit [Ping timeout: 248 seconds]
<whitequark> hm, can I pass something to parser? say make it mutate a structure instead of returning an AST
<whitequark> FooParser.parse lex foo (* mutates foo *)
<whitequark> actually nevermind, that's a really bad idea and I don't need it anyway
csakatoku has quit [Remote host closed the connection]
<whitequark> another question. how do I marry Ulexing and Menhir revised parser interface?
<whitequark> specifically, Menhir wants a Lexing.position, but Ulexing doesn't give me one, and I'm not very eager to do all the tracking by hand
zpe has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
csakatoku has joined #ocaml
shinnya has joined #ocaml
skd has joined #ocaml
<skd> hello, whats the fastest way to check whether a list is empty?
<skd> fastest in terms of runtime
<adrien> compare it to []
<adrien> if l != [] then ...
<adrien> well, I haven't checked in details but it's very very very cheap
<adrien> it's a simple operation
<skd> thanks adrien
<skd> i was thinking the same as well, just wanted to confirm with someone
ocp has quit [Quit: Leaving.]
skd has left #ocaml []
malo has joined #ocaml
lifeng has quit [Ping timeout: 268 seconds]
lifeng has joined #ocaml
introom has quit [Ping timeout: 245 seconds]
osa1 has joined #ocaml
travisbrady has quit [Quit: travisbrady]
zpe has joined #ocaml
travisbrady has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
osa1 has quit [Ping timeout: 245 seconds]
ulfdoz has joined #ocaml
csakatoku has quit [Remote host closed the connection]
zpe has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
zpe has quit [Ping timeout: 264 seconds]
Yoric has joined #ocaml
smondet has quit [Ping timeout: 264 seconds]
mort___ has quit [Ping timeout: 245 seconds]
yacks has joined #ocaml
pango_ is now known as pango
Yoric has quit [Ping timeout: 276 seconds]
<gasche> whitequark:
<gasche> I just wrote a parser+lexer using Menhir+Ulex
<gasche> there are things for that purpose in MenhirLib
<gasche> I found some code on google, from Dario Texeira
<gasche> I went for my own but the error reporting isn't great for now (it's a throw-away prototype anyway)
<whitequark> gasche: you mean the Traditional2Revised thing, or how it's called?
<gasche> yes
<whitequark> that's what I use.
<gasche> whitequark: http://ocaml.nopaste.dk/p56798
<whitequark> that doesn't deal with generating Lexing.position, which menhir expects.
<gasche> my lexer doesn't handle newlines, so the generation is a bit silly
<gasche> but if you have you should adapt the code accordingly
<gasche> (I'm leaving now, so good luck)
<whitequark> thanks
ggole_ has quit []
zpe has joined #ocaml
ulfdoz has quit [Ping timeout: 264 seconds]
zpe has quit [Ping timeout: 240 seconds]
ollehar has joined #ocaml
yacks has quit [Quit: Leaving]
zpe has joined #ocaml
zpe has quit [Ping timeout: 256 seconds]
avsm has quit [Quit: Leaving.]
Neros has quit [Read error: Operation timed out]
tane has quit [Quit: Verlassend]
dsheets has quit [Ping timeout: 256 seconds]
wwilly has quit [Ping timeout: 268 seconds]
zpe has joined #ocaml
Kakadu has quit []
zpe has quit [Ping timeout: 276 seconds]
Neros has joined #ocaml
srcerer has joined #ocaml
BiDOrD has joined #ocaml
sgnb` has joined #ocaml
LeNsTR|away has joined #ocaml
Qrntz_ has joined #ocaml
zpe has joined #ocaml
lenstr has quit [*.net *.split]
demonimin has quit [*.net *.split]
sgnb has quit [*.net *.split]
lopex has quit [*.net *.split]
BiDOrD_ has quit [*.net *.split]
jpdeplaix has quit [*.net *.split]
PM has quit [*.net *.split]
Qrntz has quit [*.net *.split]
yroeht1 has quit [*.net *.split]
buddyholly has quit [*.net *.split]
thizanne has quit [*.net *.split]
dsheets has joined #ocaml
thizanne has joined #ocaml
zpe has quit [Ping timeout: 276 seconds]
jpdeplaix has joined #ocaml
demonimin has joined #ocaml
PM has joined #ocaml
zpe has joined #ocaml
zpe has quit [Read error: Operation timed out]
contempt has quit [Ping timeout: 256 seconds]
contempt has joined #ocaml
yacks has joined #ocaml
zpe has joined #ocaml
iZsh has quit [Excess Flood]
iZsh has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
contempt has quit [Ping timeout: 264 seconds]
contempt has joined #ocaml
Neros has quit [Ping timeout: 240 seconds]
contempt has quit [Ping timeout: 245 seconds]
contempt has joined #ocaml
contempt has quit [Ping timeout: 276 seconds]
ulfdoz has joined #ocaml
contempt has joined #ocaml
contempt has quit [Ping timeout: 240 seconds]
contempt has joined #ocaml
Nahra has joined #ocaml
Nahra has quit [Changing host]
Nahra has joined #ocaml
osa1 has joined #ocaml
contempt has quit [Ping timeout: 240 seconds]
contempt has joined #ocaml
Neros has joined #ocaml
contempt has quit [Ping timeout: 264 seconds]
structuralist has joined #ocaml
wmeyer has joined #ocaml
<wmeyer> hi
<adrien> o/
<adrien> night :-)
_andre has quit [Quit: leaving]
<wmeyer> hey
<wmeyer> I just got back home
<wmeyer> \o
<wmeyer> how are the patches?
<adrien> now I remember why they were in a directory named "WIP" :-)
<adrien> been too hot to work well on them
<adrien> tomorrow should be much better
<wmeyer> OK!
<wmeyer> time for me for some dependent types, yayks!
ollehar has quit [Ping timeout: 245 seconds]
<mrvn> GADTs?
<wmeyer> nope, Depedent types
<wmeyer> Coq
<mrvn> how will you implement them if not with GADTs?
LeNsTR|away is now known as lenstr
lenstr has quit [Changing host]
lenstr has joined #ocaml
<wmeyer> GADTs is a subset of dependent types
<wmeyer> in GADTs the type variables are universally qualified for each of the constructors
<mrvn> GADTs is all we have in ocaml
<wmeyer> and that's pretty much it
<wmeyer> I said Coq before
<wmeyer> GADTs are pretty much sufficient, however the dependent types open new doors
yroeht1 has joined #ocaml
buddyholly has joined #ocaml
lopex has joined #ocaml
Neros has quit [Remote host closed the connection]
* nicoo throws dependent probability monads at wmeyer :3
* wmeyer : oh no! Don't have clue about probability monads :(
contempt has joined #ocaml
<mrvn> I may or may not have a clue about probability monads :)
contempt has quit [Quit: Lost terminal]
travisbrady has quit [Quit: travisbrady]
<pippijn> mrvn: I consider it improbable
yezariaely has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
avsm has joined #ocaml
jcao219 has joined #ocaml
tane has joined #ocaml
jcao219 has quit [Client Quit]
oriba has joined #ocaml
gautamc has quit [Read error: Connection reset by peer]
ulfdoz has quit [Ping timeout: 264 seconds]
gautamc has joined #ocaml
osa1 has quit [Remote host closed the connection]
travisbrady has joined #ocaml
hellome has quit [Remote host closed the connection]
hellome has joined #ocaml
malo has quit [Quit: Leaving]
wmeyer has quit [Ping timeout: 240 seconds]
wmeyer has joined #ocaml
osa1 has joined #ocaml
osa1_ has joined #ocaml
<wmeyer> hi
osa1_ has quit [Client Quit]
<pippijn> hi
osa1 has quit [Ping timeout: 268 seconds]
<wmeyer> pippijn: hi
<orbitz> hi
<wmeyer> hi orbitz
Xom has joined #ocaml
<pippijn> I got a compliment from a bad programmer today
<pippijn> I didn't feel like saying thanks :\
<wmeyer> what did he say?
<pippijn> he said I'm more skilled than him
<pippijn> I said "ok"
<pippijn> then he said I'm a huge nerd
<orbitz> well that's better than him being a jerk
<pippijn> yes
<pippijn> he has been a jerk for 3 years
<pippijn> always calling me names
<wmeyer> it always hurts when somebody says some unpleasant words
<pippijn> today he found out I'm a programmer
<pippijn> and suddenly he was nice to me
<wmeyer> i am sure he said "nerd" and smiled openky
<wmeyer> openly
<pippijn> wmeyer: he did
<pippijn> he was nice
<pippijn> but he has been calling me names and hating me for 3 years
bkpt has quit [Quit: Leaving]
<pippijn> so I didn't really feel grateful for his sudden warmth
<orbitz> calling you names?
<wmeyer> why you didn't call him a nerd as well
<wmeyer> and smiled
<pippijn> orbitz: dickhead
<pippijn> actually he was quite inventive
<orbitz> pippijn: Is this a coworker?
<wmeyer> that's very bad
<pippijn> he might have used a dictionary for that
<wmeyer> you should tell HR
<pippijn> he's jealous, because he likes a girl who likes me
<pippijn> for 3 years..
<wmeyer> in my company he would get a refusal from HR
<orbitz> is this a coworker?
<pippijn> orbitz: indirect coworker
<wmeyer> and majority of HR are women
<orbitz> this is very oncufing
<pippijn> he's not in the company, but in the same building
<wmeyer> so this girl would also preclude him based on HR experience
<pippijn> our company and his have projects together
<wmeyer> so why not to write a jabber client that will insert randomly insultive terms, interlave with the conversation, from the dictionary as well
<wmeyer> so his a separate company
<pippijn> yes
<orbitz> Hrm you know linear types would be swell for the actor model
<wmeyer> i had problems with co-wokers too, some of them were nasty, not in this company but my first company
travisbrady has quit [Quit: travisbrady]
<orbitz> i don't interact with any coworkers
<orbitz> many*
<wmeyer> that's good, better to avoid people at work
<pippijn> orbitz: how do you imagine actor model with linear types?
<orbitz> pippijn: specifically a 'send' would consume the value
<orbitz> if you're in a shared heap setup you can avoid the copy if it doesn't do anything for you
<pippijn> hmm, yes
<pippijn> that's nice
<orbitz> and you could always force a copy if you do need it
<orbitz> I'd really like to see linear types for resources in ocaml thouhg
<pippijn> yes
<orbitz> i think that would be the cats pajamaas
<pippijn> ocaml needs better resource management tools
<pippijn> now we have monads and lexically scoped resources
<pippijn> (lexically scoped by with_dispose)
<orbitz> I would structure it with a non-linear type layer and then a safe linear type layer above, so if someone does need to do something awkward they can
contempt has joined #ocaml
<pippijn> ocaml+cool stuff
<pippijn> would be.. really cool :)
<pippijn> ocaml is getting nicer already
Qrntz_ is now known as Qrntz
Qrntz has quit [Changing host]
Qrntz has joined #ocaml
<wmeyer> pippijn: I love OCaml
<orbitz> Ocaml is the best language I know
<orbitz> and i don't even know it that well
<wmeyer> when will you come to cambridge pippijn ?
<jdoles> Does OCaml have any library in which it excels?
<wmeyer> the best from the most practical ones, it's well balanced
<wmeyer> but Coq is probably most powerful general purpose language
<wmeyer> pippijn: I insist on beer
<orbitz> jdoles: can you give an example of what you mean?
<jdoles> orbitz: AFAIK, pretty much all interesting data structures are implemented in C or C++ first.
<pippijn> wmeyer: it's hard to write programs in coq :\
<pippijn> I just keep running into walls
<pippijn> it's like making a build system with omake
<wmeyer> pippijn: it's hard but feels powerful
<pippijn> wmeyer: exactly like omake
<jdoles> orbitz: additionally they are often more efficient that way too.
<orbitz> jdoles: I don't think that is true. Most interesting data strucutres were probably implemented in FORTRAN or LISP first
<Drup> jdoles: try do to immutable data structure in C, it's gonna be fun :3
<jdoles> orbitz: I have never read a paper in which that was the case.
<pippijn> the lack of projects made with coq and the lack of documentation about coq makes it more difficult
<jdoles> Drup: they did that... in the 1970s.
<pippijn> ocaml has *lots*
<pippijn> of both
<Drup> jdoles: yes, and it's still a pain
osa1 has joined #ocaml
<orbitz> jdoles: I've read many papers where the data structure is not implemented in C first. For example: zippers, finger trees, ...
<pippijn> finger trees..
<jdoles> orbitz: zippers were invented in C first.
<jdoles> orbitz: it's just that whoever wrote first about zippers was rather ignorant about data structures.
<jdoles> As for finger trees, they don't do anything which wasn't possible before they were created.
<wmeyer> I like trees
<orbitz> jdoles: the original zippers paper is in ocaml: http://www.st.cs.uni-saarland.de/edu/seminare/2005/advanced-fp/docs/huet-zipper.pdf
<jdoles> orbitz: I know that.
<orbitz> but you just told me they were implemented in c first
<jdoles> orbitz: zippers are just a new name for an old technique.
<orbitz> jdoles: citation plz
<jdoles> orbitz: if you would read that paper, you would see that the author cites those.
<orbitz> I have read the paper
<jdoles> orbitz: perhaps you need to read it again then.
<orbitz> Anyways, to answer your question, Ocaml is decent ast functional data structures and encoding various constraints in types which is useful for many APIs
<orbitz> jdoles: proabbly, it was last year
<jdoles> I will just say it again: NOBODY IN THE FUNCTIONAL PROGRAMMING "COMMUNITY" HAS EVER DONE ANYTHING USEFUL FOR COMPUTER SCIENCE.
<Drup> that was an interesting conversation at least
<mrvn> jdoles: yeah, lambda calculus is totaly unheard of in computer since. keep of dreaming.
<orbitz> what does '"community"' mean here?
<orbitz> are you making a distrinction between something else realted to fp?
<mrvn> s/since/science/
<jdoles> mrvn: lambda calculus is just another formal model for computation, and a rather simplistic one at that.
<jdoles> There are many more such models.
<orbitz> And?
wmeyer has quit [Remote host closed the connection]
wmeyer has joined #ocaml
<Drup> guys, why do you keeping discussing with him ? :/
<pippijn> jdoles: do you advertise tup?
<jdoles> And, it means that something invented before there even were electronic computers has no relationship with people related to Haskell/OCaml/Agda/...
<wmeyer> hi Drup !
<orbitz> I'm not sure what point you're making.
<jdoles> pippijn: I think tup is a good idea, sure.
<Drup> wmeyer: hi :3
<jdoles> pippijn: why?
<pippijn> ok
<orbitz> Various contributions have been made via ocaml, haskell, agda
<mrvn> orbitz: I think he is just trolling. Lets stop feeding him
<Drup> wmeyer: are you in a gadt mood ?
<orbitz> ok
tane has quit [Quit: Verlassend]
<pippijn> nothing
<jdoles> The calculus behind Coq could be said to have been a contribution of some sort.
<wmeyer> Drup: actually i am sleepy, made 10 miles today, and did a 2h training
<wmeyer> but i am going to start once i got up
<jdoles> But I don't know whether that has been a completely new work, not derived from something else which already existed in logic.
<jdoles> Implementing Coq however, is just engineering, not computer science.
<Drup> wmeyer: I did this crapy little thing I was wondering if it was possible to make it simple/better, with any norm for better : https://github.com/Drup/eveliom/blob/master/src/server/clist.ml
<wmeyer> jdoles: you really think like this :-)
<wmeyer> jdoles: if you think like this, it's yours, and you want to join this channel you have to have something really clever to say
<wmeyer> so far you didn't make that impression
<wmeyer> but i appreciat you know about Coq
<wmeyer> you are certainly not a random Python guy
<jdoles> wmeyer: I don't quite care about what impression I give to people.
* wmeyer now it's time for me to go to be
<wmeyer> jdoles: that's not the case here, you do care, because you are saying something, so you expect a feedback
<wmeyer> or, you want use to ignore you?
jdoles has left #ocaml []
jdoles has joined #ocaml
<wmeyer> \o/
<jdoles> :)
<orbitz> faked you out wmeyer
<jdoles> Like I said.
jdoles has left #ocaml []
thomasga has quit [Quit: Leaving.]
<wmeyer> :D
<wmeyer> ok you faked out, thanks
<Drup> As I said : "that was an interesting conversation at least".
<nicoo> Still talking to jdoles ?
<wmeyer> tup sucks
<pippijn> tup doesn't do anything new
<wmeyer> keep the trolls fed, it will increase gravity coming from this channel
<pippijn> omake does what tup does, and it did that years before tup existed
<pippijn> and it is written in ocaml
<wmeyer> yes
<Drup> what is tup ?
<pippijn> I didn't say that when jdoles was here
<pippijn> Drup: a build system which is described in a very smug paper
<pippijn> which claims to invent something awesome and new, but actually that already existed years before
<pippijn> it's like someone who would today write a paper on AVL trees and claim it's a revolutionary idea
<Drup> Very common disease :D
<mrvn> what does omake do that make doesn't?
<pippijn> mrvn: a lot, but the thing that omake does and tup also does and is very proud of is: O(1) incremental build start
<pippijn> with file system monitoring
<pippijn> omake just has it as yet another feature, while it's tup's only distincive feature
<mrvn> my make does that too
<pippijn> distinctive*
<pippijn> mrvn: which make is that?
<mrvn> GNU make + inotify
<pippijn> you added inotify support to gmake?
<mrvn> it's just a matter of adding rule and then calling "make monitor"
<pippijn> hm?
<pippijn> what does make monitor do?
<mrvn> calls the rule that starts inotify
<pippijn> inotifywait/watch?
<pippijn> the command line tool?
<mrvn> yep.
<pippijn> how does it tell make that something changed?
<mrvn> it gets the filename of saved files and calls $(MAKE) file.o (or .cmo, .cmx, or whatever you need)
<pippijn> that's not O(1)
<pippijn> it's O(n) where n is the number of dependencies of file.o/whatever
<mrvn> sure it is. starting make and parsing the makefile is constant.
<pippijn> scanning the file system and building the graph is not
<pippijn> parsing the makefile is also not constant
<pippijn> if you have a project with 1 makefile, you need 1 time, with n makefiles, you need n time
<pippijn> not constant
<wmeyer> (it involves evaluation)