adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
mietek_ has joined #ocaml
mietek_ has quit [*.net *.split]
mietek_ has joined #ocaml
lostman has quit [Quit: leaving]
djellemah has quit [Read error: Connection timed out]
exm has joined #ocaml
ygrek has joined #ocaml
eikke has joined #ocaml
djellemah has joined #ocaml
lokien_ has quit [Quit: Connection closed for inactivity]
mj12` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
mj12` has joined #ocaml
xaimus has quit [Ping timeout: 250 seconds]
mj12` has quit [Remote host closed the connection]
damason has quit [Ping timeout: 265 seconds]
mj12` has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
damason has joined #ocaml
<pierpa> it's space sensitive! why ~label : x is a syntax error?
<Drup> hum, ~label: x is fine
<aantron> is this an signature (e.g. mli file)? it should be label without the ~
<pierpa> Drup, I know. aantron, it's a .ml file. I know how to make it work. I was only surprised that a space before the : is not allowed
kushal has quit [Ping timeout: 250 seconds]
<aantron> that does seem strange
<pierpa> indeed
mort___ has joined #ocaml
xaimus has joined #ocaml
mort___ has left #ocaml [#ocaml]
kushal has joined #ocaml
<def`> with a space it is parsed as a type ascribtion
pierpa has quit [Ping timeout: 264 seconds]
kakadu has quit [Remote host closed the connection]
fraggle_ has quit [Read error: Connection reset by peer]
xyh has quit [Remote host closed the connection]
fraggle_ has joined #ocaml
mj12` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
mj12` has joined #ocaml
mac10688 has joined #ocaml
groovy2shoes has quit [Quit: Leaving]
fluter_ is now known as fluter
FreeBirdLjj has joined #ocaml
sgnb` has joined #ocaml
sgnb has quit [Ping timeout: 240 seconds]
mac10688 has quit [Remote host closed the connection]
mahem1 has quit [Ping timeout: 265 seconds]
djellemah has quit [Read error: Connection timed out]
struk|desk|away is now known as struk|desk
djellemah has joined #ocaml
sh0t has joined #ocaml
shinnya has quit [Ping timeout: 265 seconds]
groovy2shoes has joined #ocaml
pyon has quit [Quit: Loops are hard. Let's GOTO shopping!]
cody` has quit [Quit: Connection closed for inactivity]
sh0t has quit [Ping timeout: 250 seconds]
hnagamin has quit [Ping timeout: 240 seconds]
b4284 has joined #ocaml
sh0t has joined #ocaml
nicholasf has quit [Ping timeout: 256 seconds]
sh0t has quit [Remote host closed the connection]
vishesh has quit [Quit: WeeChat 1.3]
vishesh has joined #ocaml
hnagamin has joined #ocaml
djellemah has quit [Read error: Connection timed out]
lokien_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 250 seconds]
FreeBir__ has joined #ocaml
djellemah has joined #ocaml
nicholasf has joined #ocaml
nyon has joined #ocaml
djellemah has quit [Read error: Connection timed out]
Sorella has quit [Quit: Connection closed for inactivity]
b4284 has quit [Ping timeout: 252 seconds]
mahasamoot has joined #ocaml
FreeBir__ has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
<wolfcore> What does it mean to "enforce invariants"?
<def`> what is the context? :)
<wolfcore> In Real World Ocaml:
<wolfcore> "Most of the time, abstraction is the right choice, for two reasons: it enhances the flexibility of your design, and it makes it possible to enforce invariants on the use of your module."
<wolfcore> talking about exposing the concrete types in an mli
<wolfcore> or leaving the abstract
<def`> you might have heard the word "encapsulation" used for the same idea in OOP context
<def`> if you make a type abstract
<def`> only your code (the code of the module) is able to introduce values of this type
djellemah has joined #ocaml
<wolfcore> okay that makes sense, it's hiding implementation details
<def`> and destructure them. so that if you make sure all functions of the module verifiy an invariant on the value produced (lile this integer is positive)
<nyon> wolfcore: It isn't just hiding implementation details. It's limiting the parts of your program that can create “bad” values.
<def`> then you know all values will always verify this invariant
<wolfcore> an invariant is a property of the value?
<wolfcore> that you assume will be a certain way?
<nyon> wolfcore: It's a property that must be true for all “good” values, but the type system isn't strong enough to enforce.
<def`> as nyon said! You might even expose the implementation (through private) but stilm prevent the user from messing with them
<wolfcore> is that because since it's an abstract type, the user can't just create that type and instead has to get it through a function provided by the library?
<nyon> wolfcore: The user can't create values of that type, other than by using your module.
Pepe__ is now known as Pepe_
FreeBirdLjj has joined #ocaml
<wolfcore> So if you make a type that's an int, but it's abstracted as Number.t, when you create that type by using the module, the module gives you the Number.t, and you still can't access the int directly?
<nyon> wolfcore: That's right. Only the module internally knows that “Number.t = int”.
<wolfcore> Okay, that makes a lot of sense!
<def`> (pedantic distinctions: you create values of that type, you don't create the type :p)
<wolfcore> Thanks nyon and def`!
<def`> you are welcome
<nyon> :-)
<wolfcore> oh yeah, a value
<nyon> Abstract types are, like, super-super-super-useful. Their importance for writing programs that don't secretly do nasty things in hidden places, can't be overstated.
MercurialAlchemi has joined #ocaml
struk|desk is now known as struk|desk|away
JacobEdelman has quit [Quit: Connection closed for inactivity]
FreeBir__ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 250 seconds]
FreeBir__ has quit [Read error: Connection reset by peer]
petercom1and has quit [Changing host]
petercom1and has joined #ocaml
petercom1and is now known as petercommand
djellemah has quit [Read error: Connection timed out]
MercurialAlchemi has quit [Ping timeout: 272 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 272 seconds]
FreeBirdLjj has joined #ocaml
tmtwd has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
djellemah has joined #ocaml
aantron has quit [Remote host closed the connection]
FreeBir__ has joined #ocaml
hnagamin has quit [Ping timeout: 272 seconds]
FreeBirdLjj has quit [Ping timeout: 276 seconds]
darkf has joined #ocaml
djellemah has quit [Read error: Connection timed out]
struk|desk|away is now known as struk|desk
FreeBirdLjj has joined #ocaml
tobiasBora has quit [Ping timeout: 250 seconds]
FreeBir__ has quit [Ping timeout: 256 seconds]
Maelan_ has quit [Ping timeout: 260 seconds]
sgnb` has quit [Read error: Connection reset by peer]
sgnb` has joined #ocaml
Maelan has joined #ocaml
tobiasBora has joined #ocaml
MercurialAlchemi has joined #ocaml
hnagamin has joined #ocaml
djellemah has joined #ocaml
lokien_ has quit [Quit: Connection closed for inactivity]
tmtwd has quit [Ping timeout: 265 seconds]
mahasamoot has quit [Ping timeout: 260 seconds]
djellemah has quit [Read error: Connection timed out]
djellemah has joined #ocaml
AltGr has left #ocaml [#ocaml]
mort___ has joined #ocaml
nicholasf has quit [Ping timeout: 250 seconds]
Haudegen has quit [Ping timeout: 265 seconds]
ygrek has quit [Ping timeout: 240 seconds]
reynir1 is now known as reynir
Haudegen has joined #ocaml
wolfcore has quit [Ping timeout: 250 seconds]
Simn has joined #ocaml
nicholasf has joined #ocaml
nicholasf has quit [Client Quit]
sfri has quit [Remote host closed the connection]
nyon has quit [Quit: Loops are hard. Let's GOTO shopping!]
AltGr has joined #ocaml
<reynir> How do I get a nice string from an epoch (say, Unix.time())
wolfcore has joined #ocaml
<reynir> Aha, there's Core.Time.of_float. I missed that somehow.
<def`> reynir: you can use Unix too
<def`> Unix.gmtime/Unix.localtime to turn a timestamp into a Unix.tm
<def`> After that it is easy to print the time... Read Unix.tm comments though
octachron has joined #ocaml
AltGr has left #ocaml [#ocaml]
xyh has joined #ocaml
sfri has joined #ocaml
mort___ has left #ocaml [#ocaml]
struk|desk is now known as struk|desk|away
damason has quit [Ping timeout: 264 seconds]
ontologiae has joined #ocaml
damason has joined #ocaml
infinity0_ has joined #ocaml
infinity0_ has quit [Remote host closed the connection]
infinity0 has quit [Ping timeout: 256 seconds]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
kakadu has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
aantron has joined #ocaml
infinity0 has quit [Ping timeout: 256 seconds]
infinity0 has joined #ocaml
sgnb` is now known as sgnb
jwatzman|work has joined #ocaml
_andre has joined #ocaml
wolfcore has quit [Ping timeout: 265 seconds]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
xyh has quit [Ping timeout: 250 seconds]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
wolfcore has joined #ocaml
bitbckt has quit [K-Lined]
bitbckt has joined #ocaml
hnagamin has quit [Ping timeout: 250 seconds]
struk|desk|away is now known as struk|desk
zpe has joined #ocaml
djellemah has quit [Read error: Connection timed out]
hnagamin has joined #ocaml
sillyotter has joined #ocaml
djellemah has joined #ocaml
kushal has quit [Ping timeout: 245 seconds]
freehck has joined #ocaml
struk|desk is now known as struk|desk|away
xyh has joined #ocaml
kushal has joined #ocaml
cody` has joined #ocaml
kushal has quit [Read error: Connection reset by peer]
kushal has joined #ocaml
sillyotter has quit [Quit: leaving]
hunteriam has quit [Quit: Connection closed for inactivity]
Haudegen has quit [Ping timeout: 264 seconds]
BitPuffin|osx has joined #ocaml
struk|desk|away is now known as struk|desk
Sorella has joined #ocaml
kakadu has quit [Quit: Page closed]
Haudegen has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
silver has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 276 seconds]
struk|desk is now known as struk|desk|away
shinnya has joined #ocaml
ryanartecona has joined #ocaml
struk|desk|away is now known as struk|desk
jwatzman|work has quit [Quit: jwatzman|work]
lokien_ has joined #ocaml
mort___ has joined #ocaml
mietek_ is now known as keteim
keteim has quit [Quit: NO CARRIER]
mietek_ has joined #ocaml
mietek_ is now known as keteim
musha68k has quit [Remote host closed the connection]
fraggle_ has quit [Remote host closed the connection]
hnagamin has quit [Ping timeout: 250 seconds]
MercurialAlchemi has joined #ocaml
hnagamin has joined #ocaml
fraggle_ has joined #ocaml
kakadu has joined #ocaml
zpe_ has joined #ocaml
struk|desk is now known as struk|desk|away
zpe has quit [Ping timeout: 240 seconds]
hnagamin has quit [Read error: Connection reset by peer]
cody` has quit [Quit: Connection closed for inactivity]
octachron has quit [Ping timeout: 250 seconds]
_andre has quit [Read error: No route to host]
struk|desk|away is now known as struk|desk
ryanartecona has quit [Ping timeout: 250 seconds]
ryanartecona has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
mahasamoot has joined #ocaml
JacobEdelman has joined #ocaml
zpe_ has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
struk|desk is now known as struk|desk|away
ryanartecona has joined #ocaml
Guest21327 is now known as johnelse
xyh has quit [Ping timeout: 245 seconds]
pierpa has joined #ocaml
struk|desk|away is now known as struk|desk
ryanartecona has quit [Quit: ryanartecona]
_andre has joined #ocaml
mort___ has quit [Quit: Leaving.]
TheAuGingembre has quit [Read error: Connection reset by peer]
justicefries has joined #ocaml
jwatzman|work has joined #ocaml
mahasamoot has quit [Ping timeout: 272 seconds]
cross has joined #ocaml
slash^ has joined #ocaml
ryanartecona has joined #ocaml
ryanartecona has quit [Client Quit]
mort___ has joined #ocaml
emias has quit [Ping timeout: 248 seconds]
jeffmo has joined #ocaml
octachron has joined #ocaml
Mercuria1Alchemi has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 272 seconds]
avsm has joined #ocaml
lokien_ has quit [Quit: Connection closed for inactivity]
emias has joined #ocaml
ryanartecona has joined #ocaml
octachron has quit [Quit: Leaving]
xyh has joined #ocaml
rpg has joined #ocaml
cody` has joined #ocaml
struk|desk is now known as struk|desk|away
nicoo has quit [Ping timeout: 260 seconds]
ryanartecona has quit [Quit: ryanartecona]
ryanartecona has joined #ocaml
mort___ has quit [Quit: Leaving.]
sillyotter has joined #ocaml
ollehar has joined #ocaml
nicoo has joined #ocaml
sillyotter has quit [Client Quit]
please_help0 is now known as please_help
<please_help> What's a good way to reduce the size of a native executable, especially one that relies on core, beside GNU strip?
<edwin> compress it, or build/link without ocaml debug info (but I'm not sure if I could live without stacktraces in a production environment)
<edwin> e.g. I have a .deb package here that is ~1 MiB and the native executable inside it is ~5.5 MiB, but then I don't use core
<please_help> I can get a hello world that uses Core to 5.5MB but I can't seem to get better than that. I also really mean the executable, so compressing is not an option.
rpg has quit [Quit: rpg]
mort___ has joined #ocaml
<edwin> there are executable compressors as well (upx), but on a Unix platform I don't think thats what you're looking for either. Is your application CPU bound? perhaps you could use bytecode. same application in bytecode is ~1.5 MiB here
<edwin> it probably needs some .so libs to load so the total size will likely be larger
<edwin> https://www.reddit.com/r/ocaml/comments/3zelp3/dead_code_elimination/ this looks interesting though, its still in an early phase though
ygrek has joined #ocaml
kakadu has quit [Quit: Page closed]
<Drup> please_help: other option is to wait next core version
<Drup> Jst said that they would use module aliases at some point, and that will result the final size a lot
mort___ has quit [Quit: Leaving.]
lokien_ has joined #ocaml
ontologiae has quit [Ping timeout: 272 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
emias has quit [Quit: Reboot.]
mort___ has joined #ocaml
emias has joined #ocaml
kdas_ has joined #ocaml
kushal has quit [Ping timeout: 245 seconds]
kdas_ is now known as kushal
kushal has quit [Changing host]
kushal has joined #ocaml
sz0 has quit [Quit: Bye.]
sz0 has joined #ocaml
ollehar has quit [Quit: ollehar]
justicefries has left #ocaml [#ocaml]
palomer has joined #ocaml
<palomer> hello everyone
<palomer> is this function dangerous: let filter_hashtbl h f = Hashtbl.iter (fun k v -> if not (f k v) then Hashtbl.remove h k) h
<palomer> I’m removing hashtbl keys as I’m iterating
<companion_cube> sounds dangerous, yeah
<companion_cube> it might work, because you only remove the current key, but still
darkf has quit [Quit: Leaving]
<Drup> pretty sure removing the key currently iterated is fine
<palomer> https://groups.google.com/forum/#!msg/fa.caml/a9B6a98eBSQ/upguXIk-ffoJ <—these guys say it’s fine
<companion_cube> it is currently fine, but nothing guarantees it will remain so
<flux> too bad iterators (ala c++) aren't fashionable ;-)
Haudegen has quit [Ping timeout: 240 seconds]
kakadu has joined #ocaml
mort___ has quit [Quit: Leaving.]
mahasamoot has joined #ocaml
exm has left #ocaml [#ocaml]
mahasamoot has quit [Ping timeout: 256 seconds]
<palomer> hmm, I wonder if anyone tried making functional iterators
<flux> lazy sequences are basically one-way functional iterators
<flux> but I don't know if there are two-way functional iterators
<Drup> x)
<Drup> well, two-way iterators are, by essence, not very functional
Haudegen has joined #ocaml
_andre has quit [Quit: leaving]
mahasamoot has joined #ocaml
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
mort___ has joined #ocaml
mahasamoot has quit [Ping timeout: 265 seconds]
<companion_cube> unless you mean zippers
<flux> you could iterate a binary tree bidirectionally and functionally, no?
<flux> just need to keep the spine around.
<flux> or is that a zipper :)
<companion_cube> it is a zipper
djellemah_ has joined #ocaml
djellemah has quit [Ping timeout: 250 seconds]
slash^ has quit [Read error: Connection reset by peer]
ely-se has joined #ocaml
avsm has quit [Quit: Leaving.]
ryanartecona has quit [Quit: ryanartecona]
<palomer> zippers!!!
xyh has quit [Quit: ChatZilla 0.9.92 [SeaMonkey 2.39/20151206235742]]
mort___ has quit [Quit: Leaving.]
mahasamoot has joined #ocaml
xyh has joined #ocaml
tristero has quit [Quit: tristero]
gdrooid has joined #ocaml
Guest38 has joined #ocaml
Guest38 is now known as adit
freehck has quit [Remote host closed the connection]
<wolfcore> Any recommendations for a GUI library?
<wolfcore> I'm on OS X but I'd like it to be cross-platform if possible
mahasamoot has quit [Ping timeout: 265 seconds]
zpe has joined #ocaml
xyh has quit [Remote host closed the connection]
exm has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 256 seconds]
<sgeisenh> I've always liked web-based interfaces ala https://github.com/hammerlab/ketrew
<smondet> wolfcore: an HTTP server in the app (with Cohttp) + a WebUI (with Tyxml_js)
<smondet> Ha :)
<sgeisenh> :D
<sgeisenh> I don't think I've seen better timing before, in my life
<smondet> I had not checked IRC in like 2 hours :)
nyon has joined #ocaml
hunteriam has joined #ocaml
zxqdms has joined #ocaml
iosys has quit [Quit: Leaving...]
tristero has joined #ocaml
<wolfcore> sgeisenh, smondet: thanks
<wolfcore> tyxml reminds me a lot of HTML generation in Haskell with Blaze or Lucid
r0se has joined #ocaml
iosys has joined #ocaml
iosys has quit [Client Quit]
gdrooid has quit [Quit: WeeChat 1.1.1]
iosys has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
<wolfcore> smondet: know of any simple example apps I can look at?
ryanartecona has joined #ocaml
<Drup> wolfcore: client only apps; client server apps, nodejs apps ?
<Drup> wolfcore: tyxml is similar, yes, but well typed, and with some additional goodies (like, you can wire in reactive signals inside, and stuff like that)
<smondet> indeed AFAIK Haskell cannot express Tyxml types (unless there is some obscure GHC extension?)
<Drup> smondet: maybe with some crazy type families ?
<Drup> it would probably be even more complicated, and tyxml is already not simple ...
<smondet> i don't know if it would work, but it would reach brainfuck levels of unreadability :)
ryanartecona has quit [Ping timeout: 276 seconds]
struk|desk|away is now known as struk|desk
ely-se has quit [Quit: Leaving...]
zpe has quit [Remote host closed the connection]
nicholasf has joined #ocaml
lokien_ has quit [Quit: Connection closed for inactivity]
mcmillhj has quit [Quit: Lost terminal]
mcmillhj has joined #ocaml
Simn has quit [Read error: Connection reset by peer]
d0nn1e_ has quit [Ping timeout: 265 seconds]
struk|desk is now known as struk|desk|away
adit has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ryanartecona has joined #ocaml
<wolfcore> Drup: I mean what smondet was mentioning, Cohttp + Tyxml, or something along those lines
<wolfcore> I've been taking a look at Ocsigen as well
Stalkr_ has joined #ocaml