<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`
<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…]