adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.2 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
jprakash has joined #ocaml
ollehar has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
tennix has quit [Ping timeout: 264 seconds]
lobo has quit [Quit: leaving]
jao has quit [Ping timeout: 272 seconds]
keen__________34 has joined #ocaml
keen__________33 has quit [Ping timeout: 260 seconds]
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 265 seconds]
Algebr has quit [Remote host closed the connection]
ollehar has quit [Quit: ollehar]
tennix has joined #ocaml
everyonemines has joined #ocaml
<everyonemines> Well, I need to compile this OCaml program for windows. It should be standalone, and it needs to be 64-bit because of array sizes.
<everyonemines> Cygwin can't do standalone stuff, and so now I'm looking at minGW, but...
<everyonemines> - being on sourceforge is a bad sign these days
<everyonemines> - not really clear on its 64-bit support
<everyonemines> meh
nullcatx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mea-culp` has joined #ocaml
mea-culpa has quit [Ping timeout: 246 seconds]
tmtwd has quit [Ping timeout: 246 seconds]
vishesh has quit [Quit: WeeChat 1.1.1]
vishesh has joined #ocaml
ygrek has joined #ocaml
The_Mad_Pirate has quit [Quit: Konversation terminated!]
ygrek has quit [Ping timeout: 240 seconds]
tmtwd has joined #ocaml
darkf has joined #ocaml
psy_ has quit [Quit: Leaving]
jprakash has quit [Ping timeout: 264 seconds]
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 244 seconds]
shinnya has quit [Ping timeout: 272 seconds]
moei has quit [Read error: Connection reset by peer]
moei has joined #ocaml
Algebr has joined #ocaml
<Algebr> Using yojson, what's a clearcut way to update a json object? say you have {"foo":"bar"}, and I want to give back {"foo":"different"}, Util.map apparently only wants arrays.
tmtwd has quit [Remote host closed the connection]
everyonemines has left #ocaml [#ocaml]
<Algebr> I guess one way is to use to_assoc, but then there is no of_assoc.
BitPuffin|osx has quit [Ping timeout: 256 seconds]
samrat has joined #ocaml
<Algebr> I should stop complaining and do a pull request.
ygrek has joined #ocaml
AlexRussia has joined #ocaml
native_killer has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 244 seconds]
grouzen has joined #ocaml
samrat has quit [Ping timeout: 244 seconds]
psy_ has joined #ocaml
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ocaml
MercurialAlchemi has joined #ocaml
samrat has joined #ocaml
sailorswift has joined #ocaml
struktured has joined #ocaml
testo has joined #ocaml
<testo> Hey guys...this is probably a really dumb question but I'm trying to flatten a list. I noticed that the List module has a flatten function, but if I call "List.flatten [1;2;3;4;[]]" I just get "unbound value List.flatten". Can someone tell me what I'm doing wrong?
<Algebr> its part of the stdlib...how are you doing this, via plain ocaml? utop, compiling?
<testo> Just in an ml file, seems to fail the same way in utop
<Algebr> are you using core? Perhaps core changed the interface
<Algebr> oh yes, they took it away.
ygrek has quit [Ping timeout: 246 seconds]
<testo> aww is there anything I can use?
<testo> Maybe similar to scala's flatten?
kolko has quit [Ping timeout: 244 seconds]
<testo> Algebr: Also, where did you spot the missing interface?
mcclurmc has joined #ocaml
<struktured> testo: CCList.flatten, from containers ? In utop "#require containers;;" then CCList.flatten ...
<struktured> sorry, "#require "containers" "
<struktured> and opam install containers first
<Algebr> testo: core's list interface is feature rich, https://ocaml.janestreet.com/ocaml-core/111.28.00/doc/core/#Core_list find something there if you want to stick with it
<Algebr> I didn't spot the missing interface, just guessed.
<struktured> oh he's using core?
<Algebr> struktured: I'm guessing that because core does change the interface of the stdlib.
<struktured> then he can just keep a reference to stdlib's List to get flatten
<Algebr> struktured: you mean like let f = List.flatten, and then open Core.Std?
<struktured> well I meant module StdList = List;; open Core.Std;; StdList.flatten ...
<struktured> but yeah
mcclurmc has quit [Ping timeout: 272 seconds]
TheLemonMan has joined #ocaml
kolko has joined #ocaml
grouzen has quit [Ping timeout: 252 seconds]
<testo> Hey, sorry about that. gf aggro. Thanks for your help everyone :)
native_killer has quit [Ping timeout: 265 seconds]
<struktured> testo: no problem, preaching to choir :) good luck
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 265 seconds]
kakadu has joined #ocaml
struktured has quit [Ping timeout: 240 seconds]
native_killer has joined #ocaml
struktured has joined #ocaml
samrat has quit [Ping timeout: 246 seconds]
samrat has joined #ocaml
jonludlam has joined #ocaml
ollehar has joined #ocaml
ollehar has quit [Quit: ollehar]
testo has quit [Ping timeout: 246 seconds]
Bhavya has joined #ocaml
TheLemonMan has quit [Ping timeout: 265 seconds]
tennix has quit [Ping timeout: 272 seconds]
Haudegen has quit [Ping timeout: 244 seconds]
Haudegen has joined #ocaml
kolko has quit [Ping timeout: 240 seconds]
BitPuffin|osx has joined #ocaml
GeorgeHahn has quit [Read error: Connection reset by peer]
Haudegen has quit [Ping timeout: 252 seconds]
kolko has joined #ocaml
testo has joined #ocaml
<testo> I'm back :( haha. After installing Containers (opam install container) it seems the library doesnt want to load. The documentation is really garbage.
<testo> I do "open Container" and it works but List.flatten is undefined.
<testo> It seems if I do #list in utop I get a bunch of stuff like "containers.xxx" where xxx is some submodule
Haudegen has joined #ocaml
TheLemonMan has joined #ocaml
tane has joined #ocaml
<kakadu> how do you link it?
<kakadu> testo: ^
zpe has joined #ocaml
<testo> kakadu: Im doing it from utop
<kakadu> do you #require something?
<testo> I just figured it worked like Core and I could do "open XYZ"
<testo> I dont know when to use one or the other
<kakadu> open will not work without right require
<testo> so I have to require it first then
mcclurmc has joined #ocaml
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mcclurmc has quit [Ping timeout: 252 seconds]
zpe has quit [Remote host closed the connection]
obadz has quit [Ping timeout: 244 seconds]
obadz has joined #ocaml
samrat has quit [Ping timeout: 264 seconds]
samrat has joined #ocaml
<companion_cube> testo: #require "containers";; first, indeed
AlexRussia has quit [Quit: WeeChat 1.3-dev]
jonludlam has quit [Ping timeout: 255 seconds]
Haudegen has quit [Ping timeout: 272 seconds]
sh0t has joined #ocaml
Haudegen has joined #ocaml
AlexRussia has joined #ocaml
obadz has quit [Ping timeout: 255 seconds]
obadz has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 244 seconds]
samrat has quit [Ping timeout: 255 seconds]
samrat has joined #ocaml
sp0on has joined #ocaml
samrat has quit [Ping timeout: 256 seconds]
nullcatxxx_ has joined #ocaml
tennix has joined #ocaml
Algebr has quit [Ping timeout: 246 seconds]
tennix has quit [Ping timeout: 265 seconds]
obadz has quit [Ping timeout: 244 seconds]
obadz has joined #ocaml
ggole has joined #ocaml
moviuro__ has joined #ocaml
<moviuro__> Hi all. unison broke (again) thanks to a marshaling function that changed
<moviuro__> however, the issue still happens if I build the same version of unison on the same version of ocaml in FreeBSD and archlinux
<moviuro__> I'm just out of ideas on how to debug
<moviuro__> and out of time too
ski has quit [Ping timeout: 265 seconds]
<companion_cube> I think unison needs to be modernized
<companion_cube> and it shouldn't use Marshall
<adrien> it's so kind of you to volunteer!
tennix has joined #ocaml
<companion_cube> heh
<mrvn> what else does one use?
<mrvn> moviuro__: different endianness?
<mrvn> or bitness?
<companion_cube> to replace marshall? a lot of stuff, including json, sexp...
<mrvn> is there an ocaml-json with syntax extension?
<companion_cube> ppx_deriving_yojson
<companion_cube> there is sexplib for S-expressions, if you prefer
<mrvn> I know about sexplibs syntax extension. That's why I asked. It's so damn usefull
<mrvn> What would you use when you need to interact with python?
siddharthv_away has quit [Read error: Connection reset by peer]
<companion_cube> json, I guess
johnelse has quit [Read error: Connection reset by peer]
<companion_cube> or protobuf, or any other format that isn't tied to a single language
Bhavya has quit [Quit: Quit the channel]
<mrvn> No ocaml-protobuf in Debian. :(
<companion_cube> since ocaml does static linking, why couln't debian package unison without packaging some of its dependencies?
<adrien> "lol"
<mrvn> Then you have to include the modules in the source and any time any of the modules changes you have to update the whole thing by hand.
johnelse has joined #ocaml
siddharthv_away has joined #ocaml
johnelse is now known as Guest67410
<companion_cube> the source of the problem is that debian packaging is very annoying, isn't it?
<mrvn> no. It's rather simple.
<companion_cube> oh, then adding dependencies to unison would not be too hard, would it? just package them :)
<mrvn> exactly.
ski has joined #ocaml
<mrvn> The hardest part is probably writing debian/copyright and getting it right.
siddharthv_away has quit [Ping timeout: 240 seconds]
<mrvn> hmm, ocaml-protobuf doesn't look nice. Looks like you have to define seperate parser and generator function on top of the type. No syntax exception like sexplib.
Guest67410 has quit [Ping timeout: 264 seconds]
<mrvn> s/exception/extension/
<companion_cube> there is ppx_deriving_protobuf, too
mcclurmc has joined #ocaml
lordkryss has joined #ocaml
johnelse_ has joined #ocaml
<mrvn> What's with the keys in protobuf? Is everything stored as randomly ordered dictionary of key:value?
tennix has quit [Ping timeout: 256 seconds]
obadz has quit [Ping timeout: 250 seconds]
mcclurmc has quit [Ping timeout: 255 seconds]
obadz has joined #ocaml
<companion_cube> keys are positions, I think
<companion_cube> it's a binary encoding
tennix has joined #ocaml
tennix has quit [Changing host]
tennix has joined #ocaml
<mrvn> I just know that one day I will have [@key 1] [@key 2] [@key 1]
johnelse1 has joined #ocaml
siddharthv_away has joined #ocaml
johnelse1 has quit [Read error: Connection reset by peer]
johnelse_ has quit [Ping timeout: 244 seconds]
tennix has quit [Ping timeout: 250 seconds]
siddharthv_away has quit [Ping timeout: 240 seconds]
johnelse_ has joined #ocaml
<mrvn> ppx_deriving_protobuf is nice. That's how I want to use serializing/deserializing. But for python it looks like I have to compile a .proto file with protoc. That means I have to define each type twice.
siddharthv_away has joined #ocaml
<MercurialAlchemi> how do you ensure something is not garbage collected in ocaml?
<mrvn> You keep it alive
<mrvn> let liveguard = value (* value may never die *)
<MercurialAlchemi> binding it to something you don't use is not sufficient, I suppose
<mrvn> only for as long as the binding lives.
<MercurialAlchemi> it won't collect liveguard?
<MercurialAlchemi> right
<mrvn> Are you doing an interface with C?
tennix has joined #ocaml
<MercurialAlchemi> no, I'm playing with react, and the fine manual says that effectful effects and signals may be reclaimed by the GC
<MercurialAlchemi> this could be an issue in a real program
<mrvn> I consider that a bug in the bindings. If they store any ocaml values outside of ocaml then they have to tell the GC about it.
<mrvn> The only exception would be weak pointer.
<MercurialAlchemi> right
<companion_cube> MercurialAlchemi: you might use a toplevel foo list ref, where type foo = Foo : 'a -> foo
<mrvn> better to use a hashtbl so you can easily remove stuff again when they become obsolete
<companion_cube> now that's more difficult
tennix has quit [Ping timeout: 250 seconds]
<companion_cube> you have to choose a name for each value
<mrvn> name? you just use a int as key that you increment for every Foo:'a->foo you add
<MercurialAlchemi> companion_cube: a global variable? that's the work of the devil
<companion_cube> mrvn: sold
* MercurialAlchemi peeks at companion_cube to look for horns
<companion_cube> but if you keep the int as a key, why not just hold the reference? :)
<companion_cube> MercurialAlchemi: have you ever seen horns on a cube?
obadz has quit [Ping timeout: 256 seconds]
<MercurialAlchemi> companion_cube: sure, just plaster baphomet's image on each face
<mrvn> companion_cube: because (in my use cases) I would hold the int in some C structure.
tennix has joined #ocaml
<companion_cube> mrvn: I see
<Drup> MercurialAlchemi: Lwt_react.E.keep
obadz has joined #ocaml
<mrvn> Wasn't there a ppx_deriving thing to include enums from C headers?
tennix has quit [Ping timeout: 246 seconds]
<MercurialAlchemi> Drup: thx
<Drup> MercurialAlchemi: I finished the atrocity archive, it's fabulous.
<MercurialAlchemi> ah, good
<MercurialAlchemi> it's pretty fun
<mrvn> Drup: stop writing a fractal generator. They might hear you.
<Drup> I already did several ._.
<MercurialAlchemi> mrvn: on the other hand it can work as a job application
<MercurialAlchemi> :)
obadz has quit [Ping timeout: 244 seconds]
* mrvn aims 2 webcams at MercurialAlchemi and loads the basilisk app
<MercurialAlchemi> :)
obadz has joined #ocaml
<MercurialAlchemi> no carbon atom in mercury to transform
jao has joined #ocaml
* mrvn is still looking for something that generates ocaml types and python classes with serialize/deserialize from a common source.
Anarchos has joined #ocaml
<companion_cube> maybe facebook's thrift?
<mrvn> thrift.apache.org?
nullcatx_ has joined #ocaml
<companion_cube> I guess so
<companion_cube> there's also messagepack, etc.
<companion_cube> many cross-language binary formats , those days
Algebr has joined #ocaml
<mrvn> too many. But most don't have a common source file
nullcatxxx_ has quit [Ping timeout: 246 seconds]
zpe has joined #ocaml
Algebr has quit [Ping timeout: 260 seconds]
tennix has joined #ocaml
mcclurmc has joined #ocaml
kolko has quit [Ping timeout: 250 seconds]
BitPuffin|osx has quit [Remote host closed the connection]
kolko has joined #ocaml
BitPuffin|osx has joined #ocaml
mcclurmc has quit [Ping timeout: 250 seconds]
struktured has quit [Ping timeout: 244 seconds]
<MercurialAlchemi> mrvn: why do you need a binary format?
<MercurialAlchemi> can't you just json?
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
rand000 has joined #ocaml
wwilly has joined #ocaml
<native_killer> What are the hidden features of OCaml ?
<Drup> hidden features ? :D
<mrvn> MercurialAlchemi: I don't think any non binary format will be efficient at GBit/s rates.
<mrvn> MercurialAlchemi: if I pick jonson how to I make a common source for the message structures?
<Drup> mrvn: did you looked at piqi ?
jprakash has joined #ocaml
nullcatxxx_ has joined #ocaml
struktured has joined #ocaml
<mrvn> Drup: that looks to have the right features, sort of. But that's an ugly syntax. *shiver*
Nahra has quit [Remote host closed the connection]
nullcatx_ has quit [Ping timeout: 250 seconds]
octachron has joined #ocaml
<mrvn> All of those suggestions define a type in the target language and then create their own on-wire format to represent those types. I guess I'm looking for something that goes the other way. Given a on-wire format create types and functions for some target languages.
<companion_cube> sadly it's not obvious
<mrvn> yeah. generating network packages is relatively easy. But parsing them gets complex fast.
<Drup> mrvn: piqi does both in multiple languages
samrat has joined #ocaml
<mrvn> Drup: how do I specify a binary format? The examples seem to go piqi -> protobuf -> python and piqi -> ocaml.
<mrvn> "Piqi includes a data serialization system for OCaml. It can be used for serializing OCaml values in 4 different formats: Google Protocol Buffers, JSON, XML and Piq." no binary
jprakash has quit [Quit: leaving]
<companion_cube> protobuf is binary
<mrvn> but it's own format, not a given binary format.
<companion_cube> well piqi doesn't support every format
<mrvn> for example say I want to parse NTP datagrams.
native_killer_ has joined #ocaml
grouzen has joined #ocaml
native_killer has quit [Ping timeout: 255 seconds]
<Drup> protobuf is not piqi specific
<Drup> ah, ok
<flux> I suppose you can add a piqi backend for that purpose, but it's probably not worth it :)
<mrvn> I don't think the piqi language has enough flexibility to map existing binary formats.
<mrvn> First thing I think it fails is: struct { ui32 len; char data[len]; }
mcclurmc has joined #ocaml
struktured has quit [Ping timeout: 244 seconds]
tennix has quit [Ping timeout: 255 seconds]
mcclurmc has quit [Ping timeout: 256 seconds]
struktured has joined #ocaml
jonludlam has joined #ocaml
tennix has joined #ocaml
tennix has joined #ocaml
kolko has quit [Ping timeout: 240 seconds]
sp0on has quit [Ping timeout: 272 seconds]
<mrvn> What did I have to set in oasis again that it doesn't create such a large _tags file (and others)?
kolko has joined #ocaml
struktured has quit [Ping timeout: 246 seconds]
tennix has quit [Ping timeout: 255 seconds]
zpe has quit [Remote host closed the connection]
sp0on has joined #ocaml
<Drup> the dynamic setyp
<Drup> setup*
<mrvn> oasis setup -setup-update dynamic
_whitelogger has quit [Ping timeout: 240 seconds]
_whitelogger has joined #ocaml
chris2 has quit [Ping timeout: 240 seconds]
<flux> mrvn, I'm not sure I understand what is the need for such tool.. not for interchanging data between ocaml/python I guess?
<flux> porting code between ocaml and python?
<flux> but somehow do it from the start :)
<mrvn> flux: for example I would like to write my own ntp client. And stuff that connect python and ocaml code. But I don't want to use different tools for each.
<flux> hmm. write your own ntp client in either ocaml or python? but not both?
<flux> if you have "stuff that connect python and ocaml code", isn't piqi and friends suitable for that
<mrvn> yes. but that I can't use to write an ntp client.
<flux> well, you can use a different system, ie. bitstring for writing the ntp client..
jonludlam has quit [Ping timeout: 250 seconds]
<mrvn> I can do a lot of things. But ideally would be a swiss army knife for writing network code.
<mrvn> You know, the one-tool-fits-all kind
<flux> one big complicated tool that fits no task very well ;)
<flux> the task of describing arbitrary binary formats so that it an interface can just be extracted for a limited number (>1) languages itself is quite a problem
<flux> I mean, it's always "well it does 90% of the task, then I just need to add this 10% to handle the difficult part"
<flux> and that 10% is written in the language you're targeting
<flux> so said intermediate language would then have its own turing complete language embedded within..
tmtwd has joined #ocaml
Algebr has joined #ocaml
<flux> maybe your language would look a bit like XCB-XML (but it works only for X11): https://github.com/mwitmer/guile-xcb/blob/master/xcb/xml/xproto.xml
<flux> so it needs constructs like this, but to support 'all' use cases it would be more complicated: <list type="KEYCODE" name="keycodes"> <op op="*"> <fieldref>keycodes_per_modifier</fieldref> <value>8</value> </op> </list>
chris2 has joined #ocaml
Algebr has quit [Ping timeout: 246 seconds]
<sh0t> hi guys...i am new of emacs.. I installed tuareg and i can see highlighted the ocaml keywords...but that doesn't work for .mll or .mly files...while it did work on another computer straight away after the intsallation...
Hannibal_Smith has joined #ocaml
mcclurmc has joined #ocaml
tennix has joined #ocaml
mcclurmc has quit [Ping timeout: 246 seconds]
tennix has quit [Ping timeout: 265 seconds]
_obad_ has joined #ocaml
<_obad_> so who is going to vancouver for icfp 2015 and related things?
<flux> sh0t, I don't know why that is, but perhaps you can use a solution similar to this init.el fragment: (setq auto-mode-alist (append auto-mode-alist '(("\\.inl\\'" . c++-mode) ("\\.cl$" . c-mode)) ) )
tennix has joined #ocaml
<flux> I'm also pretty sure there is a function that does setq and append in one go and someone is going to point it out soon.. :-)
ygrek has joined #ocaml
Algebr has joined #ocaml
tmtwd has quit [Ping timeout: 255 seconds]
tennix has quit [Ping timeout: 244 seconds]
<ggole> cl-pushf
<ggole> But usually in .emacs you would use add-to-list, which is idempotent
tennix has joined #ocaml
tennix has joined #ocaml
<flux> ah, that was it. I had used it elsewhere..
Algebr has quit [Remote host closed the connection]
tennix has quit [Ping timeout: 264 seconds]
<flux> but, I don't refactor my init.el often :)
sp0on has quit [Ping timeout: 246 seconds]
tennix has joined #ocaml
tennix has joined #ocaml
sp0on has joined #ocaml
darkf has quit [Quit: Leaving]
AlexRussia has quit [Read error: Connection reset by peer]
tennix has quit [Ping timeout: 250 seconds]
samrat has quit [Ping timeout: 244 seconds]
tennix has joined #ocaml
sp0on has quit [Quit: WeeChat 0.4.2]
sp0on has joined #ocaml
<MercurialAlchemi> companion_cube: is there a mutable set somewhere in containers?
ely-se has joined #ocaml
<flux> mercurialalchemi, Hashset?
tennix has quit [Ping timeout: 250 seconds]
<ely-se> Is it possible to set the -pkg flag for ocamlbuild in myocamlbuild.ml?
samrat has joined #ocaml
<flux> other than that: just put the set into a ref
<companion_cube> Containers_misc.Hashset, indeed, but it's in misc so it's pretty experimental
<companion_cube> in other words, nothing solid for mutable sets
<companion_cube> (unless you use a regular hashtable with unit values)
<MercurialAlchemi> hmm
<MercurialAlchemi> well, I suppose I'll patch it if doesn't work :)
<MercurialAlchemi> right now I'm using immutable sets in mutable record fields, but it's getting both long in the tooth and error-prone
<MercurialAlchemi> since nothing prevents me from overwriting one set with another by accident
<MercurialAlchemi> (I have multiple fields of the same type)
<companion_cube> oh god, hashset is a bit old
tennix has joined #ocaml
<companion_cube> it uses a custom hashtable
<ggole> Nih? In containers?!
<companion_cube> ;)
<companion_cube> it's from the time I really liked polymorphic values over functors
<companion_cube> and I still do
<ggole> Yeah, there are advantages to doing it that way
<MercurialAlchemi> I don't like Hashtbl.remove
<ggole> No arity restriction
<MercurialAlchemi> how do you remove a value for real, usually?
<companion_cube> the secret is not using Hashtbl.add
<companion_cube> never
<companion_cube> I only use Hashtbl.replace :)
<MercurialAlchemi> right
tennix has quit [Ping timeout: 244 seconds]
<MercurialAlchemi> I have to say that I don't understand why you would want this 'feature' in the first place
<ggole> You mean the "stack" of values?
native_killer_ has quit [Quit: Leaving]
<MercurialAlchemi> yeah, with "hiding instead of deleting"
<companion_cube> it's useful for things like scoping
<ggole> You could use it for (mutable) scope
<ggole> ^
<companion_cube> but indeed, it's very specialized
<companion_cube> I would rather have push : ('a, 'b list) hashtbl -> 'a -> 'b -> unit
<ggole> Yeah.
<companion_cube> dedicated functions for this feature
<mrvn> it's also faster when you have collisions
tennix has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Ping timeout: 250 seconds]
tennix has quit [Ping timeout: 265 seconds]
jprakash has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<companion_cube> MercurialAlchemi: if you really miss a decent mutable set, I can add one (or merge a PR)
tennix has joined #ocaml
<MercurialAlchemi> companion_cube: right now I'm playing around
tmtwd has joined #ocaml
ely-se has left #ocaml ["Leaving..."]
tennix has quit [Ping timeout: 240 seconds]
<MercurialAlchemi> I'm trying to make an entities-components-systems system in ocaml with react
<MercurialAlchemi> and containers, obviously
tennix has joined #ocaml
<companion_cube> did you read the cranial burnout blogpost ?
<MercurialAlchemi> yeah, but it looked too nice
<MercurialAlchemi> :)
<MercurialAlchemi> actually, what I'm going for right now is to have a list of entity ids, and one container per property/flag
<MercurialAlchemi> and then submodules offer views around groups of properties
<MercurialAlchemi> eg, Store.Player, Store.Movable
tennix has quit [Ping timeout: 246 seconds]
<MercurialAlchemi> with only a subset of properties
<companion_cube> iirc, the cranial burnout stuff was a kind of in-memory inheritance system
<companion_cube> it looked really nice
<companion_cube> are you writing a game too?
<MercurialAlchemi> yeah, basic roguelike
<MercurialAlchemi> I'm avoiding inheritance for now
<mrvn> When I use "setup-update dynamic" how do I add my own _tags file then without breaking oasis?
<MercurialAlchemi> central management for the people
* MercurialAlchemi writes a FiveYearPlan module
<companion_cube> hmm, an OCaml roguelike, sounds interesting
jave has quit [Ping timeout: 264 seconds]
<mrvn> Drup: what ocaml version is that for? half the options are unknown in 4.02
tennix has joined #ocaml
<MercurialAlchemi> ECS are pretty nice in theory
<Drup> mrvn: all this options are in 4.02 and most are from before
<Drup> these*
<Drup> actually, except safe-string, all of them are quite old, I think
<mrvn> % ocamlc -version
<mrvn> 4.02.2
<mrvn> /usr/bin/ocamlc: unknown option '-safe-strings'.
<Drup> spelling, my dear mrvn, spelling.
<MercurialAlchemi> hmm, why doesn't it find Hashset when I have added containers.misc and deleted setup.*?
jprakash has quit [Ping timeout: 240 seconds]
<mrvn> ocamlc: unknown option `-safe-string'.
<mrvn> + /usr/bin/ocamlfind ocamlc -c -g -bin-annot -safe-string -short-paths -strict-sequence -w +A-4-6-9-40-42-44 -I common -I common/ocaml -o common/ocaml/BE.cmo common/ocaml/BE.ml
magistr has joined #ocaml
<mrvn> if I call ocamlc manually with -safe-string it works for some reason.
<companion_cube> MercurialAlchemi: it's in Containers_misc.Hashset
<Drup> mrvn: your ocamlfind install is screwed up
tennix has quit [Ping timeout: 256 seconds]
<mrvn> Drup: looks like it. It's from ocaml.debian.net/debian/ocaml-4.02.2
<Drup> just use opam already, it will make your life more simple
jave has joined #ocaml
<mrvn> oh wait, it's actually from debian sid. That isn't right, wrong ocaml version there
<mrvn> Setting up ocaml-findlib (1.5.5-2) ...
<MercurialAlchemi> ah, much better
<MercurialAlchemi> companion_cube: thx
<mrvn> And suddenyl I get "Error: This expression has type bytes but an expression was expected of type string" like I should.
<magistr> realworldocaml is best source to learn ocaml?
<thizanne> magistr: for a total beginner, i'm not sure
ggole has quit [Ping timeout: 246 seconds]
tennix has joined #ocaml
<MercurialAlchemi> ah, muuuuch better
<magistr> thizanne, may be install a prolog and begin on it
jprakash has joined #ocaml
<MercurialAlchemi> magistr: rwo is pretty good, yeah
tennix has quit [Ping timeout: 252 seconds]
<magistr> MercurialAlchemi, but i must know ZFC, tapl, cpdt
<MercurialAlchemi> magistr: to learn ocaml?
<magistr> MercurialAlchemi, yep, to effective use it
<MercurialAlchemi> haha
<MercurialAlchemi> well, no
<magistr> and okasaki data structures
<Drup> magistr: what makes you think that ?
<MercurialAlchemi> you need to know about persistent data structures, but you don't need to know about the underlying implementation
ollehar has joined #ocaml
<companion_cube> MercurialAlchemi: is your roguelike project on github ?
<MercurialAlchemi> companion_cube: er, no
<MercurialAlchemi> right now, it's a mess of various approaches, none of which compile :)
mcclurmc has joined #ocaml
<MercurialAlchemi> I have some bits of LTerm stuff, some bits of react in another file, and my ECS experiment mixed with react stuff in a third file :)
lobo has joined #ocaml
<Drup> ECS ?
<companion_cube> :D
<companion_cube> Drup: entity component system
<Drup> React and LTerm together works quite well
<Drup> ah, right
<companion_cube> afaict it's a in-memory database for representing objects as data
<companion_cube> quite popular in games nowadays
<Drup> It's on my todo list to do a widget library for lterm
<Drup> based on the current widget system, with some improvements
<MercurialAlchemi> the idea with ECS is that your game objects are a bunch of tags/properties, and that you can freely add/remove these properties
<MercurialAlchemi> then a system can update groups of object which have a bunch of interesting properties for this system
<MercurialAlchemi> eg, a physics system will want to work with everything that has a velocity
<companion_cube> do you use an open variant for the tags?
tennix has joined #ocaml
<MercurialAlchemi> well, not exactly
tennix has quit [Changing host]
tennix has joined #ocaml
<MercurialAlchemi> right now, I have a Store module
<MercurialAlchemi> its type t is a bunch of sets and hashtbls and a mutable option field
<MercurialAlchemi> then I have sub modules like Store.Player
<MercurialAlchemi> this has a type associated, but it is only instantiated when querying the module to get the player, by reading various tables
<MercurialAlchemi> this means that each submodule ever offers a partial view of an entity (right now, the "player" type has no coordinates, because the system dealing with it should have no need for it)
<companion_cube> each tag is a hashset of the IDs that have this tag?
<MercurialAlchemi> yeah, or hashtbl if you have data associated
<MercurialAlchemi> eg, coords
<companion_cube> isn't it possible for objects, rather, to be a set of tags?
tennix has quit [Ping timeout: 256 seconds]
sh0t has quit [Ping timeout: 256 seconds]
<companion_cube> unless you spend more time iterating on "all objects with tag foo" than "does object a have tag b"
<MercurialAlchemi> I spend more time iterating on "objects with tag foo", indeed
<MercurialAlchemi> it's not particularly fast, smart or elegant, but it's type safe
<MercurialAlchemi> and since you create entities using the Store submodules, this should restrict what combination of tags you can make
sh0t has joined #ocaml
tennix has joined #ocaml
<MercurialAlchemi> right now, the only thing these types have in common is the entity id
shinnya has joined #ocaml
tennix has quit [Ping timeout: 256 seconds]
<companion_cube> ok, I'm writing a proper HashSet
<companion_cube> functorized
<companion_cube> @ MercurialAlchemi
tennix has joined #ocaml
tennix has joined #ocaml
<MercurialAlchemi> companion_cube: you don't need to :)
<MercurialAlchemi> but thks
nullcatxxx_ has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
tennix has quit [Ping timeout: 265 seconds]
<companion_cube> no pb :)
tennix has joined #ocaml
tennix has quit [Changing host]
tennix has joined #ocaml
ygrek has joined #ocaml
tennix has quit [Ping timeout: 246 seconds]
<companion_cube> MercurialAlchemi: pushed
darius93 has quit [*.net *.split]
nopf has quit [*.net *.split]
merry has quit [*.net *.split]
scythe- has quit [*.net *.split]
c-c has quit [*.net *.split]
pippijn has quit [*.net *.split]
thorsten` has quit [*.net *.split]
smondet has quit [*.net *.split]
c-c has joined #ocaml
<MercurialAlchemi> dear me
smondet has joined #ocaml
nopf has joined #ocaml
merry has joined #ocaml
pippijn has joined #ocaml
scythe- has joined #ocaml
darius93 has joined #ocaml
c-c is now known as Guest87942
thorsten` has joined #ocaml
magistr has left #ocaml ["Ухожу я от вас"]
tennix has joined #ocaml
tennix has joined #ocaml
<MercurialAlchemi> companion_cube: this looks good
tennix has quit [Ping timeout: 246 seconds]
jprakash has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
stomp has quit [*.net *.split]
theblatte has quit [*.net *.split]
fraggle-boate_ has quit [*.net *.split]
_2can has quit [*.net *.split]
taion809 has quit [*.net *.split]
Pepe_ has quit [*.net *.split]
k1000 has quit [*.net *.split]
kerneis has quit [*.net *.split]
The_third_man has quit [*.net *.split]
TallerGhostWalt has quit [*.net *.split]
pollux has quit [*.net *.split]
mehdid has quit [*.net *.split]
SHODAN has quit [*.net *.split]
stomp has joined #ocaml
_2can has joined #ocaml
SHODAN has joined #ocaml
taion809 has joined #ocaml
TallerGhostWalt has joined #ocaml
Pepe_ has joined #ocaml
theblatte has joined #ocaml
kerneis has joined #ocaml
k1000 has joined #ocaml
pollux has joined #ocaml
mehdid has joined #ocaml
The_third_man has joined #ocaml
fraggle-boate_ has joined #ocaml
mcclurmc has quit [Ping timeout: 265 seconds]
<MercurialAlchemi> there is one thing I realized while playing with LTerm
<MercurialAlchemi> Merlin doesn't complete on object methods
sp0on has quit [Ping timeout: 264 seconds]
mcclurmc has joined #ocaml
<Drup> it does on recent merlin
ely-se has joined #ocaml
mcclurmc has quit [Ping timeout: 246 seconds]
ollehar has quit [Ping timeout: 240 seconds]
tennix has joined #ocaml
sp0on has joined #ocaml
<ely-se> According to http://caml.inria.fr/pub/docs/manual-ocaml/libref/type_Map.html, Map.mem has type "Map.S.key -> 'a Map.S.t -> bool"
<ely-se> however, Map.mem "a" String.Map.empty results in a type error: "This expression has type string but an expression was expected of type ('a, 'b, 'c) Map.t"
<ely-se> Could somebody enlighten me on this? I'm really confused
<ely-se> It works fine if I swap the arguments.
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
samrat has quit [Ping timeout: 265 seconds]
tennix has quit [Ping timeout: 260 seconds]
<companion_cube> ely-se: do you use Core?
<ely-se> yes; open Core.Std
<companion_cube> ah, that's why you're looking at the wrong documentation
<companion_cube> :)
<ely-se> oh XD. ok
<ely-se> thanks :P
tennix has joined #ocaml
<ely-se> OCaml is fun
<companion_cube> hmm, the trick to avoid mixing different comparison functions is interesting
<ely-se> first project is going well so-far
tennix has quit [Ping timeout: 264 seconds]
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
sh0t has quit [Ping timeout: 246 seconds]
tennix has joined #ocaml
tennix has joined #ocaml
ygrek has quit [Ping timeout: 272 seconds]
tennix has quit [Ping timeout: 250 seconds]
xificurC has quit [Read error: Connection reset by peer]
mv has joined #ocaml
tennix has joined #ocaml
tennix has quit [Ping timeout: 244 seconds]
sailorswift has joined #ocaml
Hannibal_Smith has quit [Ping timeout: 250 seconds]
<mv> Hi, I'm having some troubles compiling a program that uses xml-light. I keep getting this error: Reference to undefined global `Xml'
<mv> I'm using the command: ocamlfind ocamlc -package xml-light xt.ml
tennix has joined #ocaml
tennix has joined #ocaml
<_obad_> afaik xml-light is a wrapper around xmlm
<_obad_> try adding -package xmlm
<Drup> no it's not
<_obad_> drup: you're right I stand corrected
<mv> Yeah, that didn't work
<Drup> mv: add -linkpkg
<mv> Drup, thanks that worked
<def`> MercurialAlchemi: it should, if object type can be determined
<MercurialAlchemi> I may have an older merlin
tennix has quit [Ping timeout: 260 seconds]
<Drup> MercurialAlchemi; def` : I used it recently, and it worked quite well
tennix has joined #ocaml
tennix has quit [Ping timeout: 265 seconds]
mcclurmc has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 265 seconds]
tennix has joined #ocaml
tennix has joined #ocaml
mcclurmc has quit [Ping timeout: 255 seconds]
<testo> Hey guys, if I have a module, say "mymod.ml" in the same folder as another folder, and another file called "myprog.ml", then inside myprog.ml I should be able to refer to mymod.ml by Mymod.xxx where xxx is the function right?
<testo> utop is giving me a Unbound module Mymod when I try to #use "myprog.ml" even though it should be working
<testo> with utop do I have to manually #use the mymod.ml file first? Or is it supposed to automagically pick up dependencies?
<ely-se> myprog.ml uses Mymod module but you haven't #use'd that yet
<ely-se> #use "mymod.ml";; #use "myprog.ml";;
tennix has quit [Ping timeout: 256 seconds]
<testo> seems like thats what these guys are saying
<testo> ocamlbuild will automatically handle dependencies, but utop doesnt
ollehar has joined #ocaml
<testo> ah ha
<testo> so what I have to do is ocamlc mymod.ml
<testo> from within utop I can then do #load "mymod.cmo";;
<testo> and then that will get the Mymod namespace into utop like it should. Then stuff works.
tennix has joined #ocaml
<octachron> the other solution is to use #mod_use rather than #use
<testo> oh huh, didn't even think of that.
tennix has quit [Ping timeout: 272 seconds]
Haudegen has quit [Ping timeout: 264 seconds]
deavid has quit [Ping timeout: 244 seconds]
Haudegen has joined #ocaml
toomuchtvrotsurb has joined #ocaml
tane has quit [Quit: Verlassend]
octachron has quit [Quit: Leaving]
toomuchtvrotsurb has quit [Remote host closed the connection]
moviuro__ has quit [Quit: Konversation terminated!]
xificurC has joined #ocaml
deavid has joined #ocaml
mcclurmc has joined #ocaml
swgillespie has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
sh0t has joined #ocaml
Hannibal_Smith has joined #ocaml
<Leonidas> does #mod_use resolve dependencies?
<Leonidas> that would be super-neat, because I wrote myself a short file that I always have to include to load all dependencies
mal`` has quit [Ping timeout: 265 seconds]
tennix has joined #ocaml
<Drup> Leonidas: nope, completely orthogonal
<Leonidas> That'd still be neat if utop could do that
tennix has quit [Ping timeout: 240 seconds]
<Drup> Leonidas: that's kinda what #require is for, though
mal`` has joined #ocaml
mv has quit [Remote host closed the connection]
tennix has joined #ocaml
tennix has joined #ocaml
malc_ has joined #ocaml
wwilly has left #ocaml ["Leaving"]
<Leonidas> Drup: maybe, I'll have to try that next time.
<Leonidas> There's a lot of confusing #options, #use #require #load etc.
<mrvn> does utop read a $(PWD)/.utoprc?
tennix has quit [Ping timeout: 244 seconds]
<mrvn> Leonidas: #require is from ocaml-findlib iirc
Nahra has joined #ocaml
tennix has joined #ocaml
sp0on has quit [Quit: WeeChat 0.4.2]
deavid has quit [Ping timeout: 244 seconds]
tennix has quit [Ping timeout: 260 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
tennix has joined #ocaml
tennix has quit [Ping timeout: 256 seconds]
mcclurmc has quit [Remote host closed the connection]
tennix has joined #ocaml
ollehar has quit [Ping timeout: 244 seconds]
sh0t has quit [Ping timeout: 260 seconds]
tennix has quit [Ping timeout: 260 seconds]
toomuchtvrotsurb has joined #ocaml
tennix has joined #ocaml
contempt has quit [Ping timeout: 264 seconds]
tennix has quit [Ping timeout: 260 seconds]
claudiuc has joined #ocaml
grouzen has quit [Ping timeout: 244 seconds]
contempt has joined #ocaml
claudiuc_ has joined #ocaml
claudiuc has quit [Ping timeout: 246 seconds]
claudiuc_ has quit [Remote host closed the connection]
ely-se has quit [Quit: Leaving...]
deavid has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
jprakash has joined #ocaml
kakadu has quit [Remote host closed the connection]
martinium has quit [Read error: Connection reset by peer]
tennix has joined #ocaml
tennix has quit [Ping timeout: 264 seconds]
Hannibal_Smith has quit [Read error: Connection reset by peer]
lobo has quit [Quit: leaving]
MercurialAlchemi has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 250 seconds]
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
jao has joined #ocaml
toomuchtvrotsurb has quit [Remote host closed the connection]
malc_ has quit [Quit: leaving]