adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.09 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.09/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
reynir has quit [Ping timeout: 240 seconds]
reynir has joined #ocaml
ollehar has quit [Ping timeout: 256 seconds]
ollehar has joined #ocaml
reynir has quit [Ping timeout: 264 seconds]
reynir has joined #ocaml
mangoicedtea has quit [Quit: Leaving]
<brettgilio> Hey all. I am considering implementing an IRC server in OCaml with some of the ratified IRCv3 extensions. Is there currently any semi-well known IRC server written in OCaml?
<companion_cube> no, there's an IRC library but it's more oriented towards writing clients afaik
<brettgilio> companion_cube: yep. I think I saw that one. I think there is a gap here for an irc server, maybe I can fill it
borne has quit [Ping timeout: 260 seconds]
reynir has quit [Ping timeout: 264 seconds]
reynir has joined #ocaml
<d_bot> <nu11ptr> Ocaml newbie....can OUnit display a nice diff of strings when they aren't equal? striking out....
<d_bot> <nu11ptr> I need to know the chars that are not equal - it displays them but hey look identical, so assuming some control char is there but not visable
<d_bot> <nu11ptr> I need to know the chars that are not equal - it displays them but hey look identical, so assuming some control char is there but not visible (edited)
<d_bot> <nu11ptr> Ocaml newbie....can OUnit display a nice diff of strings (with at least first char that is different....) when they aren't equal? striking out.... (edited)
motherfs1 is now known as motherfsck
<d_bot> <nu11ptr> I need to know the chars that are not equal - when I display them but hey look identical, so assuming some control char is there but not visible (edited)
<companion_cube> brettgilio: tbh I think the trend is in rust/go for these things these days
<companion_cube> @nu11ptr not by default, I guess it could be a nice feature
<brettgilio> companion_cube: you're right. That's why I'm wanting to try it in ocaml, to see what the result would be
<brettgilio> Lwt / async and the pending multicore domains make a good trial scenario for something like an ocaml IRC server
<brettgilio> Im sure this won't "take off" like oregono or wtvr it's called in Go, but hell it may be neat to see what ocaml brings to this
amiloradovsky has quit [Ping timeout: 244 seconds]
<companion_cube> oh it'd definitely be an interesting experiment!
<brettgilio> companion_cube: I'll keep this channel updated if anything happens
<companion_cube> :)
vicfred has quit [Quit: Leaving]
vicfred has joined #ocaml
zolk3ri has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Client Quit]
bartholin has quit [Quit: Leaving]
rlr has quit [Remote host closed the connection]
vicfred has quit [Quit: Leaving]
zolk3ri has quit [Remote host closed the connection]
waleee-cl has quit [Quit: Connection closed for inactivity]
vicfred has joined #ocaml
vicfred has quit [Max SendQ exceeded]
vicfred has joined #ocaml
osa1 has joined #ocaml
narimiran has joined #ocaml
Jesin has quit [Ping timeout: 240 seconds]
jmorris has joined #ocaml
<defolos> <zozozo "defolos: the "specialized type" "> it turns out I've used the type annotations wrongly and confused the compiler with that
<defolos> after removing them everything worked
* defolos needs to read more of real world ocaml apparently
jmorris has quit [Quit: Leaving]
narimiran has quit [Ping timeout: 256 seconds]
olle has joined #ocaml
borne has joined #ocaml
Guest22813 has joined #ocaml
Guest86335 has quit [Ping timeout: 240 seconds]
<reynir> brettgilio: there's scylla, but it was written by someone who wanted to checkout mirage os and has been unmaintained. https://github.com/ahf/ircd-scylla
Guest86335 has joined #ocaml
<def> cool
Guest22813 has quit [Quit: Bin weg.]
Haudegen has joined #ocaml
companion_cube has quit [*.net *.split]
theblatte has quit [*.net *.split]
TC01 has quit [*.net *.split]
jerith has quit [*.net *.split]
stux|RC-only has quit [*.net *.split]
companion_cube has joined #ocaml
jerith has joined #ocaml
theblatte has joined #ocaml
stux|RC-only has joined #ocaml
TC01 has joined #ocaml
berke has joined #ocaml
<berke> hi all, does anyone know about the status of ocaml for m68k ?
<berke> i saw there is an old caml light but i like my modules
Jesin has joined #ocaml
<sgnb> berke: you mean ocamlopt? bytecode should work (the Debian package compiles)
<berke> bytecode might work but ocamlc.byte clocks in at 10 megs or so
<berke> i want to use it on an amiga with 6 megs of ram
<berke> i was thinking an old version.
<berke> was 68k supported by ocamlopt before ? not sure if the git history goes that far
<berke> i guess i could try an older bytecode version
<sgnb> what do you mean by "clocks in"?
<berke> the bytecode executable is over 10 megs in size i think
<berke> not even counting the heap
<olle> berke: no Vampire Amiga?
<olle> isn't caml-light ported to Amiga?
<berke> no just got an old a2000
<berke> i have a mist too
<berke> caml light has a port but CL does not have modules
<berke> a bit too primitive
<sgnb> ah, you're right, ocamlc.byte is 16M in Debian m68k
nullcone has quit [Quit: Connection closed for inactivity]
<sgnb> berke: are you really such a box for development? maybe just running OCaml code is enough? (I'm suggesting cross-compilation)
<berke> ideally i would like to write the cue
<berke> *code on the machine itself. if not, yes i could run Debian m68k on qemu or something that's a good idea
berke has quit [Remote host closed the connection]
berke has joined #ocaml
<berke> looks like m68k was deprecated in 3.08, the oldest version available in the git repository
berke2 has joined #ocaml
<berke> ocaml 2.99 is the latest version with m68k support
berke2 has quit [Remote host closed the connection]
<berke> heh it's around that time that I started using ocaml, I think I had a cyrix 166 or something like that. I was sick of using perl, ocaml was such a relief. plus back then you didn't have camlp4 and genlex parsers were built-in.
sarna has joined #ocaml
oriba has joined #ocaml
mbuf has joined #ocaml
ggole has joined #ocaml
waleee-cl has joined #ocaml
jnavila has joined #ocaml
<berke> yey I managed to get a hello world native m68k using ocaml 2.99 on debian qemu-m68k
<def> how big is this old binary?
<berke> ocamlopt bytecode 875913 bytes
<def> I wonder how much bloat we got since that time
<berke> it's still a bit crashy at the end, I'll attempt world.opt once I fix those bugs. had to convert the assembler syntax from whatever sun was using to as
<berke> as the target was sunos 68k
<berke> and ocamlrun is 78420 bytes
<berke> vs 293056 bytes on x86-64 for 4.08.1
<berke> maybe part of the bloat is due to x86-64 having more optimizations and being much more complicated than the old m68k
<berke> the native ocamlopt.opt is 1.8 megs (1.1 stripped)
<berke> doesn't work yet, but that shouldn't affect the size
<def> right. also the cflags for compiling the runtime are more aggressive on recent versions.
<def> debug information are also richer.
reynir has quit [Ping timeout: 258 seconds]
reynir has joined #ocaml
webshinra has quit [Remote host closed the connection]
osa1_ has joined #ocaml
osa1 has quit [Ping timeout: 246 seconds]
webshinra has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
narimiran has joined #ocaml
Serpent7776 has quit [Read error: Connection reset by peer]
berke has quit [Ping timeout: 256 seconds]
aaaaaa has joined #ocaml
sarna has quit [Quit: Connection closed]
Serpent7776 has joined #ocaml
<cemerick> tfw you want to add a new library dependency, but it pulls in e.g. core_kernel...the precipice yawns before you
<def> :) that's why I don't do that
<cemerick> the lib in question (monads) doesn't seem to let core stuff bleed through for the most part. We'll see how it goes ๐Ÿคž
borne has quit [Ping timeout: 244 seconds]
<Drup> and oasis ... :3
<Drup> Does it really offer more than lemonade ?
spew has joined #ocaml
Haudegen has joined #ocaml
<companion_cube> `monads`? how is that not a 0-dep library? :p
<companion_cube> (or maybe stuff like seq and result)
dckc has quit [Ping timeout: 240 seconds]
dckc has joined #ocaml
borne has joined #ocaml
<cemerick> companion_cube: I suspect BAP uses core stuff, and so just picking up its base monadic operators and such is convenient
<companion_cube> ah, I see, it's in BAP. makes sense.
<cemerick> yeah
<cemerick> it's the only mtl-esque thing I can find
<companion_cube> hmm, mtl as in haskell?
<cemerick> right
<companion_cube> what does it entail, for you?
<cemerick> I've been manually threading "warnings" as one part of the tuple returned in Results, and it's just a pita to be sure I'm passing along previous "stages" warnings along, etc
<companion_cube> and so you use a state monad?
<cemerick> just way too easy to make a writer out of a result
<companion_cube> ah
<cemerick> basically
<companion_cube> (I'd use side effects :D)
<cemerick> just spit out warnings out whereever I want, and just pick them all up at the end
<cemerick> lol
<cemerick> companion_cube: y'all heathens are gonna get burned when multicore becomes the law of the land ;-P
<companion_cube> nah
<companion_cube> state effects can be local too!
<companion_cube> think of it as a less inefficient state monad :)
<cemerick> you mean, lexically local? That won't work for a bunch of pipeline stages that can be mixed and matched for different purposes.
<companion_cube> well, you can mix and match I guess
<cemerick> eh, I don't really have a lot of use for that kind of local state
<cemerick> honestly still not as easy as a monadic interface, since the bookkeeping remains up to me within that scope
<companion_cube> but you have to put let* everywhere :p
<cemerick> nah, I just explicitly >>= everywhere
* companion_cube shuddes
<companion_cube> shudders
<cemerick> heh
<d_bot> <Bluddy> yikes. yeah I hate ` >>= fun ()` in ocaml
<cemerick> style is as style does. do notation is _fine_, but it's a big handicap when you really are using the monads for what they are
<d_bot> <Bluddy> `let*` master race
<cemerick> uh, no ๐Ÿ˜ฌ
<d_bot> <Anurag> its purely cosmetic but i use either ppx_let of let* whenever dealing with monads these days
<d_bot> <Bluddy> `let*` is great
<d_bot> <Bluddy> (or ppx_let)
<d_bot> <Anurag> its purely cosmetic but i use either ppx_let or let* whenever dealing with monads these days (edited)
<cemerick> it's not just cosmetic
<cemerick> using let* "binds" the structure of your computation to the structure of the code
<d_bot> <Anurag> i meant more as i can achieve the same functionality with `Foo.bind` or `Foo.(>>=)` , but i find the let ops version easier to read. Unless i'm missing something else about this?
<d_bot> <Bluddy> yeah I'm not sure what you mean. The variables that come after `fun` are bound to `let`s. It's a 1-to-1 mapping
<cemerick> the do notation/let* operators make binding function composition much more clumsy
<d_bot> <Bluddy> do you have an example? Because I'm having trouble seeing why that would be the case
<companion_cube> same, for me `let* x = y in z` is very close to `y >>= fun x -> z`
<companion_cube> except less ugly
<d_bot> <Et7f3> I feel like like the second is more straight foward
<d_bot> <Et7f3> like y in this function
<companion_cube> when you have five of them, meh :p
<companion_cube> it's like coding normally but replacing `let` with `|> fun x -> โ€ฆ`
<d_bot> <Bluddy> I mean, I like do notation in haskell as well, which is very similar
<cemerick> If you're defining all of your functions inline, I'd agree
<companion_cube> you can throw in the odd `>>=` if you miss it :D
<cemerick> If you have a large array of binding fns that need to be combined in various ways and orders, then sticking with >>= makes the structure of the computation completely clear
<companion_cube> I'd love an example :p
towel has quit [*.net *.split]
engil has quit [*.net *.split]
johnel has quit [*.net *.split]
<cemerick> Momentarily
<companion_cube> I find let very clear, it sequentializes stuff nicely too
johnel has joined #ocaml
<companion_cube> (it even works for side effects!)
engil has joined #ocaml
engil has quit [Changing host]
engil has joined #ocaml
towel has joined #ocaml
osa1_ has quit [Ping timeout: 264 seconds]
<d_bot> <Anurag> I do sprinkle the odd `>>= function` at times, which i can avoid if we get a `match*` `match+` ๐Ÿ™‚
<companion_cube> oh boy if only
<cemerick> I would _not_ want to try to make this look imperative
<companion_cube> ah but that's pointfree style
<cemerick> ๐Ÿคท
<cemerick> pointfree is never a thing I do intentionally. It's a side effect in this case.
<companion_cube> heh, fun
<cemerick> The regularity of interface means that I can apply combinators with abandon, and the result is extremely understandable
<olle> what's %> ?
<companion_cube> it's also interesting that you put >>= at the beginning of the line
<companion_cube> olle: probably function composition
<olle> ok
<cemerick> let/do notation _is_ super useful in cases where a monad is necessary, but fundamentally an impediment to the mental model
<cemerick> e.g. lwt
<cemerick> olle: yes, comp
<companion_cube> hum, in lwt I don't see why it's a problem to use let*/lwt%lwt ?
<cemerick> companion_cube: I'm agreeing with you :-)
<companion_cube> ah
<companion_cube> still not sure why it's an impediment :p
<cemerick> oh
<cemerick> well, I guess that's IMO
<cemerick> thinking of threads as monads is a very leaky abstraction
<companion_cube> I think monads in OCaml are a bit different than monads in Hakell
<companion_cube> +s
<companion_cube> they're less, hum, pure in general
<cemerick> I don't know that there's any real difference
<cemerick> they're just an abstraction/design pattern in both cases. Obviously each lang emphasizes things differently.
<companion_cube> well I think lwt is not actually a proper monad
<companion_cube> it's not pure and stuff :D
<companion_cube> I mean, *creating* a `'a Lwt.t` and then discarding it can have effects
<companion_cube> even if you don't bind it
<cemerick> oh, sure. Same with IO though
<cemerick> monads definitely don't have to be pure
<companion_cube> hum, IO in haskell is pure
<companion_cube> it's the hidden IO.run that is not :)
<cemerick> this is the distinction without a difference :-P
<olle> IO.run is hidden? always?
<d_bot> <Bluddy> so I have to context-switch to my haskell days, but cemerick: I believe the fact that you don't ever need to bind variables, and it's just one 'flow', is an indication that you're not really utilizing monads, but instead using applicative functors
<companion_cube> in haskell afaik you can always simplify `let x = some_lwt_stuff in e` into `e` if `x \notin frevars(e)`
<companion_cube> olle: it's the main function
<d_bot> <Bluddy> And this is the reason you can avoid let* easily
<companion_cube> in Ocaml that's incorrect since a lwt future might just do its stuff even if not "used"
<cemerick> Bluddy: very much the same w.r.t. haskell days, but elsewhere I do use a choice combinator that internally binds a prior result and determines the next step based on it. iirc, that does make it strictly monadic and not just applicative
<olle> not to talk about category theory
<d_bot> <cemerick> (aside: it's surreal to have both irc and discord open when you're actively chatting :-P)
<d_bot> <Drup> Why ?
<Drup> You don't like answering to yourself ?
<d_bot> <Drup> And having twice the notifications
<Drup> for every message
<companion_cube> just mute #general
<companion_cube> no duplication
<olle> don't use discord?
<cemerick> whew, y'all have notifications for irc or discord ๐Ÿ˜…
<olle> sounds like another academic problem ;)
<companion_cube> I have notifications for hls on IRC, of course :p
mbuf has quit [Quit: Leaving]
Tuplanolla has joined #ocaml
jnavila has quit [Quit: Konversation terminated!]
borne has quit [Ping timeout: 244 seconds]
<d_bot> <dj charlie> guys, i was reading about using `ppx_sexp_conv` with gadts and i saw this answer: https://github.com/janestreet/ppx_sexp_conv/issues/8
<d_bot> <dj charlie> i feel like i haven't seen
<d_bot> <dj charlie> ```type something = Obj : 'something t -> something_else``` before
<d_bot> <dj charlie> anyone have any thoughts? ๐Ÿ‘€
<d_bot> <dj charlie> i feel like i haven't seen
<d_bot> <dj charlie> ```type something = Obj : _ t -> something_else``` before (edited)
<d_bot> <dj charlie> is this kind of like accessing the namespace for Obj in the type signature?
<Drup> No, it's a constructor named Obj
<d_bot> <dj charlie> hm
<Drup> it's mostly like normal constructors (Some of 'a, etc). It has a special syntax because it's a GADT
<d_bot> <dj charlie> AHHHH
<d_bot> <dj charlie> I SEE IT NOW
<d_bot> <dj charlie> thanks
<d_bot> <dj charlie> oh man i was attaching special meaning to Obj cause i thought it was doing something funky with the module with the same name haha
<d_bot> <dj charlie> ๐Ÿ˜“ feeling dumb now thanks haha
olle has quit [Ping timeout: 265 seconds]
Haudegen has quit [Quit: Bin weg.]
osa1 has joined #ocaml
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
borne has joined #ocaml
pigeonv has joined #ocaml
muskan has joined #ocaml
Haudegen has joined #ocaml
<d_bot> <hcarty> It is an unfortunate choice for an example name since it's so widely encouraged that users avoid the module `Obj`
Guest86335 has quit [Ping timeout: 240 seconds]
Guest86335 has joined #ocaml
pigeonv has quit [Ping timeout: 244 seconds]
pigeonv has joined #ocaml
Jesin has quit [Quit: Leaving]
muskan has quit [Remote host closed the connection]
reynir is now known as \_oK
\_oK is now known as reynir
mfp has joined #ocaml
narimiran has quit [Ping timeout: 256 seconds]
osa1 has quit [Ping timeout: 260 seconds]
sonologico has joined #ocaml
<thizanne> first part: ยซ it's obvious that if true then return 5 else return "Hello" will actually always return 5 ยป. second part: ยซ it's obvious that the axioms of implicational propositional calculus are similar to the types of SKI combinator calculus ! ยป
nullcone has joined #ocaml
Hrundi_V_Bakshi has joined #ocaml
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
raver has joined #ocaml
sonologico has quit [Quit: Leaving]
sonologico has joined #ocaml
ggole has quit [Quit: Leaving]
Jesin has joined #ocaml
raver has quit [Read error: Connection reset by peer]
_whitelogger has joined #ocaml
raver has joined #ocaml
reynir has quit [Ping timeout: 240 seconds]
reynir has joined #ocaml
amiloradovsky has joined #ocaml
Tuplanolla has quit [Ping timeout: 260 seconds]
Hrundi_V_Bakshi has quit [Ping timeout: 256 seconds]
amiloradovsky has quit [Ping timeout: 244 seconds]
Haudegen has quit [Ping timeout: 256 seconds]
Serpent7776 has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
mangoicedtea has joined #ocaml
mangoicedtea has quit [Quit: Leaving]