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/
vicfred has quit [Quit: Leaving]
kaph has quit [Ping timeout: 256 seconds]
<d_bot> <mbacarella> when it's time to do a minor collection, how are the live words detected? I assume it's doing something clever instead of tracing from the roots?
spip has quit [Ping timeout: 246 seconds]
spip has joined #ocaml
<d_bot> <Anurag> > @pilothole nice. one question: did ppxlib require changing to use objects, or did you add that for funsies?
<d_bot> <Anurag> The use of objects was related to ppxlib. I'll add that this was my first time using anything ppx related, and there might be a better/simpler approach than what I used in my pull-request.
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
kaph has joined #ocaml
<gopiandcode> Okay, thanks for the help! got it running, turns out the issue was with using the appropriate Cflags, now I can compile modules that reference other dynamically linked modules without problem!
waleee has quit [Ping timeout: 250 seconds]
<drakonis> gopiandcode: any gocaml updates in the near future?
<gopiandcode> drakonis: yes, I plan to release an update to bring it up to date with the latest ocaml soon
<drakonis> fantastic.
Techcable has quit [Remote host closed the connection]
Techcable has joined #ocaml
Techcable_ has joined #ocaml
chrisz has quit [Ping timeout: 248 seconds]
chrisz has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
Techcable has quit [Remote host closed the connection]
Techcable_ has quit [Remote host closed the connection]
Sankalp has quit [Ping timeout: 250 seconds]
Sankalp has joined #ocaml
Haudegen has joined #ocaml
gravicappa has joined #ocaml
<d_bot> <cod1r> hi
kotrcka has quit [Remote host closed the connection]
vicfred has joined #ocaml
Techcable has joined #ocaml
shawnw has joined #ocaml
Serpent7776 has joined #ocaml
xgqt has quit [Ping timeout: 272 seconds]
xgqt has joined #ocaml
mro has joined #ocaml
<gopiandcode> Is it possible to allow dynlinked code to access global variables in the calling modules context? like updating a ref?
Anarchos has joined #ocaml
olle has joined #ocaml
bobo has joined #ocaml
spip has quit [Ping timeout: 240 seconds]
<octachron> gopiandcode, yes, that's how dynlinked code can communicate with the caller.
<gopiandcode> In my case, I'm also compiling the code at runtime as well ~ how would I configure the `Env.t` env to include the signature of the host code itself?
<gopiandcode> Currently, I'm trying to manually use `Env.add_module` ... and just manually constructing the signature of the parts fo the current host context that I want my dynlinked code to access
<gopiandcode> is there an easier way?
mro has quit [Remote host closed the connection]
mro has joined #ocaml
<octachron> You should not add persistent module with `Env.add_module`.
<gopiandcode> right, I figured that was probably not the right approach
<octachron> It sounds simpler for you to use the persistent module loading hook.
<gopiandcode> Where could I find that? Typemod? or Env?
<gopiandcode> oh, do you mean Env.persistent_structures_of_dir?
<gopiandcode> paired with Env.add_persistent_structure?
<octachron> No, look at Persistent_env
bartholin has joined #ocaml
<gopiandcode> octachron: yup, just tried Env.add_persistent_structure and the code just failed to type check; I'll have a look at peristent_env and how it's used in the compiler
<gopiandcode> is Persistent_env something global?
<gopiandcode> octachron: I'm using a native code compilation pipeline adapted from opttoploop or opttopeval (4.12.0 branch)
<gopiandcode> octachron: I can successfully typecheck, compile, dynlink and execute arbitrary OCaml snippets from files or strings, but I would like to let the snippets to also access variables in the host environment
<gopiandcode> I'm not sure where Persistent_env interacts with the compilation pipeline unless it's some global state
<Anarchos> gopiandcode if you find a solution to compile ocaml code and use it at runtime , i am interested in your solution
<gopiandcode> Anarchos: I've managed to compile ocaml code natively and use it at runtime (I can retrieve values (even functional ones back from the compiled code))
<gopiandcode> Anarchos: I'm just working on trying to get shared state between the compiled and host code
<gopiandcode> let vl' : int -> int = eval_expr env (raw_parse_expr_str "fun i -> i + 1") in Printf.printf "evaluated value: %d\n" (vl' 2);
<Anarchos> gopiandcode great ! is your solution available somewhere ?
<gopiandcode> I can share a snippet, just give me a sec
<Anarchos> gopiandcode i want to compile some struct and use them at runtime
<gopiandcode> That should be possible as well, you'll probably have to use an existential type to hide the type definition so you can share it between the compiled and host code
<Anarchos> gopiandcode by struct, i mean module A = struct … end
<gopiandcode> Ah right, that should work as well, but you'll probably need to define the module signature in the host, and you'll need to share the signature between the host and compiled code I think?
<gopiandcode> I'm Still working on sharing signatures/types between the compiled and host code
<gopiandcode> it's mostly just a simplified version of the opttopeval native toplevel code from 4.12.0 branch, although took a quite a while to work out which parts of the spooky global compiler state had to be initialised in what order to prevent things from crashing
<Anarchos> gopiandcode ok so you use natdynlink to run an 'external' toplevel, and communicate with it ?
<gopiandcode> I'm not running an 'external' toplevel, afaik I think
<gopiandcode> I'm compiling the module down to assembly, and then dynamically loading it
<gopiandcode> at least that's what I believe 'caml_natdynlink_run_toplevel' does,
<gopiandcode> You can see the definition of that native function at the above link
<gopiandcode> it doesn't run a toplevel itself
<gopiandcode> it just calls dlopen on a given filename, and then runs the dll
<gopiandcode> At least that is my understanding of how the native toplevel works - each submitted phrase is compiled natively to a dll and loaded dynamically
<octachron> That's indeed the case (in the normal setup)
wingsorc has quit [Ping timeout: 260 seconds]
Tuplanolla has joined #ocaml
<gopiandcode> octachron: ah, I think I see what you mean
dhil has joined #ocaml
<gopiandcode> w.r.t Persistent_env?
<gopiandcode> I guess I should use Env.add_persistent_structure
<gopiandcode> and then update the Persistent_signature.load function to return a cached cmi
<gopiandcode> I guess I can use ppx_blob to depend on the source code of one of the modules in my project
<gopiandcode> ohhh, that might be a big hack, but then I could build the cmi file from the source code text, avoiding the circular dependency
dextaa4 has joined #ocaml
mro has quit [Remote host closed the connection]
<gopiandcode> AHHHH!! IT WORKS!
gravicappa has quit [Ping timeout: 260 seconds]
<gopiandcode> Anarchos: I am able to confirm that using the approach suggested by octachron, it is possible to share modules between compiled and host env
mro has joined #ocaml
<gopiandcode> let vl' : (module Global.S) = eval_expr env (raw_parse_expr_str "(module (struct ... ) : Global.S)" ....
<gopiandcode> Global.S has to be a signature that is visible from both the host env, and the compilation env
Haudegen has quit [Quit: Bin weg.]
<gopiandcode> but that aside, works like a charm!!
<Anarchos> gopiandcode i think i will have to compile the signature first :)
<gopiandcode> Yeah, the signature has to be visible from the host env, so it should be available when you're compiling the project, but that's not too suprising as OCaml is statically typed
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Client Quit]
gravicappa has joined #ocaml
dextaa4 has quit [Remote host closed the connection]
slbtty has joined #ocaml
kaph has quit [Read error: Connection reset by peer]
kaph has joined #ocaml
Haudegen has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
Sankalp has quit [Ping timeout: 256 seconds]
Sankalp has joined #ocaml
kaph has quit [Ping timeout: 276 seconds]
kaph has joined #ocaml
Anarchos has joined #ocaml
spip has joined #ocaml
bobo has quit [Ping timeout: 272 seconds]
shawnw has quit [Ping timeout: 246 seconds]
<d_bot> <mbacarella> I forgot about the write barrier!
Sankalp has quit [Ping timeout: 272 seconds]
Sankalp has joined #ocaml
gwizon has joined #ocaml
kaph has quit [Ping timeout: 246 seconds]
kaph has joined #ocaml
rgrinberg has joined #ocaml
gwizon has quit [Quit: leaving]
x88x88x has quit [Quit: ZNC - https://znc.in]
bartholin has quit [Quit: Leaving]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
Sankalp- has joined #ocaml
Sankalp has quit [Ping timeout: 272 seconds]
Sankalp- is now known as Sankalp
vicfred has quit [Quit: Leaving]
<d_bot> <danielo515> hello people. What is used for gui in ocaml nowadays?
<sim642> Make a webapp?
<d_bot> <orbitz> I make WebApps. Although that gtk bindings are maintained i think
waleee has joined #ocaml
olle has quit [Ping timeout: 256 seconds]
<d_bot> <Drakonis> ah, ocaml's website got replaced wtih v3 now
<d_bot> <Drakonis> how nice.
Haudegen has quit [Quit: Bin weg.]
<drakonis> opam's documentation has to go up somewhere though
<d_bot> <cod1r> LET'S GOOOOOOOOOOOOOOOOO
dextaa4 has joined #ocaml
chrisz has quit [Ping timeout: 276 seconds]
chrisz has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<d_bot> <Ambika E.> Hi
<d_bot> <mbacarella> is there a good cross-platform gui toolkit that renders to native widgets? is qt the least horrible option?
<d_bot> <mbacarella> like, not even asking about the ocaml compatibility here
dextaa4 has quit [Read error: Connection reset by peer]
<d_bot> <Constantine> Does ocaml support cross compilation out of the box?
<d_bot> <Constantine>
<d_bot> <Constantine> Like to compile binary for win and Mac while I'm on Linux?
<Anarchos> Constantine i don't think so
<Anarchos> Constantine but you can compile to bytecode , which is portable
dextaa4 has joined #ocaml
<Anarchos> but you will need the runtime on the win/mac
<d_bot> <orbitz> Good is subjective. But i think Qt and wxwidgets are the big ones, depending on your targets
rgrinberg has joined #ocaml
dextaa4 has quit [Read error: Connection reset by peer]
dextaa4 has joined #ocaml
dextaa4 has quit [Read error: Connection reset by peer]
dextaa4 has joined #ocaml
Haudegen has joined #ocaml
olle has joined #ocaml
genpaku has quit [Ping timeout: 276 seconds]
genpaku has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
jpds has quit [Ping timeout: 240 seconds]
jpds has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<qwr> hard choice to be honest, i would look lablgtk3 also - don't know how broken or usable it might be
<qwr> but native widgets and cross-platform is pretty much only wxwidgets imho
<qwr> not sure whether how much matters today - on windows 10/11 even the windows components are each one with totally different style
<qwr> with qt you can be consistent at least on one platform (KDE) ;)
Serpent7776 has quit [Quit: leaving]
kaph has quit [Ping timeout: 276 seconds]
gwizon has joined #ocaml
dextaa4 has quit [Ping timeout: 256 seconds]
rgrinberg has joined #ocaml
kaph has joined #ocaml
gwizon has quit [Quit: leaving]
zebrag has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gwizon has joined #ocaml
gwizon has quit [Client Quit]
gravicappa has quit [Ping timeout: 272 seconds]
random-jellyfish has joined #ocaml
jpds has quit [Ping timeout: 240 seconds]
jpds has joined #ocaml
wingsorc has joined #ocaml
<d_bot> <idnes> meow
bastienleonard has joined #ocaml
olle has quit [Ping timeout: 272 seconds]
kaph has quit [Read error: Connection reset by peer]
kaph has joined #ocaml
random-jellyfish has quit [Ping timeout: 252 seconds]
dhil has quit [Ping timeout: 260 seconds]
Haudegen has quit [Ping timeout: 250 seconds]