companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.14.0 released: https://ocaml.org/releases/4.14.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
<greenbagels> so modules are implicitly defined by .ml source files, right
<greenbagels> so if im making a library that fits in say, 1 module, then there's no need to explicitly make something like "module Mymodule ..." in a file named mymodule.ml?
<d_bot> <Et7f3 (@me on reply)> You are right
<greenbagels> ok, if i ever want this to *not* happen, would it be possible?
<greenbagels> or is this implicit outer module unavoidable
<greenbagels> (not saying i want to, just curious)
<d_bot> <Jektrix> whats the lowest power device people have run OCaml well on?
<d_bot> <mbacarella> There's a mirage web server running on something pretty low power, iirc
<d_bot> <leviroth> Is the question what’s the lowest power thing you could run an OCaml program on (so like, minimum system requirements for the runtime) or what’s the minimum for running the compiler etc?
<d_bot> <Jektrix> the former
<d_bot> <NULL> greenbagels: What would it look like ?
<d_bot> <NULL> How do you use another file's function otherwise ?
<greenbagels> @NULL, yeah that's what made me think it was likely to not be possible
<d_bot> <NULL> I guess you could include everything in every file, but you immediately see why it is a bad idea
<d_bot> <NULL> in every subsequent* file, for some definition of subsequent
<greenbagels> right
<d_bot> <inkbottle> `let eval_value (type a) (v : a value) : a = ...`, the returned value is of type `a`, so why isn't the compiler complaining about type escaping?
<d_bot> <NULL> Why would it complain ?
<d_bot> <NULL> The type of your function is `'a. 'a value -> 'a` which is perfectly fine
<d_bot> <NULL> That's partially wrong, you're not actually telling the compiler that your function is polymorphic here
<d_bot> <inkbottle> yes
<d_bot> <inkbottle> `let eval_value : 'a value -> 'a = fun (type a) (v : a value) : a -> match v with Int x -> x | Bool x -> x`, okay, so here, no escaping type. But below, escaping type: `let rec eval : 'a expr -> 'a = fun (type a) (e : a expr) : a -> match e with | Value v -> eval_value v | If (c, t, e) -> if eval c then eval t else eval e | Eq (x, y) -> eval x = eval y | Plus (x, y) -> eval x + eval y`
<d_bot> <inkbottle> Actually I don't understand what really is escaping, and where.
<d_bot> <NULL> Escaping is probably what you have in mind, the thing you don't understand is how to avoid it / what doesn't trigger it
<d_bot> <inkbottle> no, I know how to avoid it
<d_bot> <inkbottle> what I don't understand is what is escaping
<d_bot> <NULL> `a` is escaping when you recursively call `eval`
<d_bot> <inkbottle> okay, I think I got a part of it which is already a lot
<d_bot> <NULL> The standard way to avoid the issue is to make explicit to the compiler the fact that `eval` is polymorphic in `'a`
wingsorc has joined #ocaml
chrisz has quit [Ping timeout: 240 seconds]
chrisz has joined #ocaml
vicfred has joined #ocaml
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #ocaml
<d_bot> <inkbottle> `type any = Any : 'a -> any;; let a = [ Any 3; Any true ];; let foo = function Any x -> x;;`
<d_bot> <inkbottle> `let foo = fun (type a) (x : any) -> match x with | Any true -> true | _ -> false;;`
<d_bot> <inkbottle> `type any = Any : 'a * int -> any;; let foo x = match x with | Any (_, y) -> y ;;` this one is working
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
rgrinberg has joined #ocaml
kaph_ has quit [Read error: Connection reset by peer]
<greenbagels> anyone know if the calendar opam package supports parsing ISO8601 timestamps into a proper data type
<d_bot> <darrenldl> define proper data type : v
<greenbagels> uh, not-a-string
<d_bot> <darrenldl> i think it gives you a float(?)
<greenbagels> i guess i can make a makeshift one if need be...
<d_bot> <darrenldl> if you dont mind deps, try timedesc
<d_bot> <darrenldl> (dont have time to slim down deps atm, but eventually...
<greenbagels> wait, were you talking about something in core earlier?
<d_bot> <darrenldl> dont think so
<d_bot> <darrenldl> as in janestreet core?
<greenbagels> er, sorry, im new to ocaml
<d_bot> <darrenldl> not sure
<greenbagels> i guess i mean stdlib
<d_bot> <darrenldl> oh
<greenbagels> does stdlib have a time submodule?
<d_bot> <darrenldl> not a full blown one you'd see in other langs, no
<d_bot> <darrenldl> (say golang, even though its of dubious make at places
<greenbagels> well, always room in the future to add things, removing bad quality things is harder :)
<greenbagels> timedesc you say though...
<greenbagels> this looks nice
<greenbagels> yeah basically being able to parse and compare dates is all i really need
<d_bot> <darrenldl> there is not much (if any) gotchas in timedesc, other packages for date time i cannot say
<d_bot> <darrenldl> (well outside of ptime, but ptime serves slightly different purpose
<d_bot> <darrenldl> calendar does not support sub hour time zone offset for instance
<d_bot> <darrenldl> (i actually dont remember if ptine does parsing etc, but if it does, its a good choice
<greenbagels> ok ill check it out, thanks for the input
zebrag has quit [Read error: Connection reset by peer]
ansiwen has quit [Quit: ZNC 1.7.1 - https://znc.in]
ansiwen has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gravicappa has joined #ocaml
Serpent7776 has joined #ocaml
Tuplanolla has joined #ocaml
mro has joined #ocaml
kaph has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
Haudegen has joined #ocaml
gareppa has joined #ocaml
mro has joined #ocaml
mro has quit [Client Quit]
gareppa has quit [Quit: Leaving]
bartholin has joined #ocaml
dhil has joined #ocaml
bobo has joined #ocaml
spip has quit [Ping timeout: 252 seconds]
kaph has quit [Read error: Connection reset by peer]
kaph has joined #ocaml
Anarchos has joined #ocaml
dhil has quit [Ping timeout: 248 seconds]
Sankalp- has joined #ocaml
Sankalp has quit [Ping timeout: 240 seconds]
Sankalp- is now known as Sankalp
bartholin has quit [Ping timeout: 240 seconds]
bartholin has joined #ocaml
waleee has quit [Ping timeout: 260 seconds]
gravicappa has quit [Ping timeout: 252 seconds]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hyphen has quit [Ping timeout: 248 seconds]
hyphen has joined #ocaml
hyphen has quit [Ping timeout: 240 seconds]
bartholin has quit [Ping timeout: 240 seconds]
hyphen has joined #ocaml
gereedy has joined #ocaml
gravicappa has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
gereedy has quit [Ping timeout: 260 seconds]
Anarchos has joined #ocaml
dhil has joined #ocaml
dhil has quit [Client Quit]
hyphen has quit [Ping timeout: 260 seconds]
bartholin has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
mro has joined #ocaml
aspe has joined #ocaml
mro has quit [Remote host closed the connection]
hyphen has joined #ocaml
aspe has quit [Quit: aspe]
hyphen has quit [Ping timeout: 240 seconds]
hyphen has joined #ocaml
<d_bot> <mbacarella> what's the rationale for removing Stream from the ocaml stdlib and separating it out into this? https://opam.ocaml.org/packages/camlp-streams/
waleee has joined #ocaml
<d_bot> <mbacarella> oh, found the issue talking about it: https://github.com/ocaml/ocaml/issues/6711
mro has joined #ocaml
aspe has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
bartholin has quit [Ping timeout: 248 seconds]
bartholin has joined #ocaml
bartholin has quit [Client Quit]
rgrinberg has joined #ocaml
gereedy has joined #ocaml
<hyphen> I've just looked at this after living in my bookmarks for a bunch of weeks: https://users.cecs.anu.edu.au/~steveb/pubs/papers/lxr-pldi-2022.pdf
<hyphen> and my first thought was "hm this may work well for java but I wonder if the allocation patterns of a functional language would also reap its benefits"
<hyphen> supposedly it's a general approach and not java-specific. and they claim with this you can have it both ways (latency and throughput)
<hyphen> cool stuff
mro has quit [Ping timeout: 240 seconds]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
waleee has quit [Ping timeout: 248 seconds]
hyphen has quit [Ping timeout: 260 seconds]
hyphen has joined #ocaml
waleee has joined #ocaml
aspe has quit [Quit: aspe]
gravicappa has quit [Ping timeout: 240 seconds]
DNH has joined #ocaml
zebrag has joined #ocaml
hyphen has quit [Ping timeout: 246 seconds]
hyphen has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mro has quit [Quit: Leaving...]
hyphen has quit [Ping timeout: 252 seconds]
hyphen has joined #ocaml
olle has joined #ocaml
olle has quit [Remote host closed the connection]
Tuplanolla has quit [Quit: Leaving.]
Haudegen has quit [Ping timeout: 240 seconds]
spip has joined #ocaml
bobo has quit [Ping timeout: 240 seconds]
DNH has quit [Quit: Textual IRC Client: www.textualapp.com]