amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 256 seconds]
olle has quit [Ping timeout: 260 seconds]
olle has joined #ocaml
ArthurStrong has quit [Quit: leaving]
raver has quit [Read error: Connection reset by peer]
vicfred has quit [Quit: Leaving]
schlaftier has quit [Ping timeout: 260 seconds]
smazga has joined #ocaml
nullcone has joined #ocaml
jbrown has quit [Ping timeout: 272 seconds]
smazga has quit [Ping timeout: 256 seconds]
jbrown has joined #ocaml
schlaftier has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 256 seconds]
nicoo has quit [Ping timeout: 240 seconds]
nicoo has joined #ocaml
<d_bot>
<zbaylin> @antron sorry to bother but I have a quick question about `Luv`
<d_bot>
<zbaylin>
<d_bot>
<zbaylin> If I have a `Unix.file_descr` that refers to a socket, is it possible to "convert" this to an `Luv.Os_fd.Socket.t`? I saw here you used `Obj.magic` to go from `Unix.file_descr -> Luv.File.t` (https://github.com/aantron/luv/blob/fb87c477a4a611457f6aeabfb542f4e927c78768/test/pipe.ml#L58), but I didn't know if that should also work going to a different socket type, since IIRC POSIX sockets are integral types and I'm not quite sure h
sleepydog has joined #ocaml
narimiran has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 246 seconds]
ome has joined #ocaml
mfp has quit [Ping timeout: 240 seconds]
amiloradovsky has quit [Remote host closed the connection]
smazga has joined #ocaml
smazga has quit [Ping timeout: 264 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
zebrag has quit [Quit: Konversation terminated!]
<d_bot>
<antron> @zbaylin Obj.magic should work on Linux for this. however this is not a "legitimate" solution of course, and i am using it in the test suite to work around that i removed the "real" solution earlier to get rid of a dependency on unix. you can see the code that did the conversion "correctly" in the deleted code in this diff https://github.com/aantron/luv/commit/705ec144a9f047260de8140583e88d016e33e061, perhaps that can help you to
<d_bot>
<zbaylin> Awesome, thanks -- let me know if you want any help with that lib
retropikzel has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 256 seconds]
schlaftier has quit [Quit: Ping timeout (120 seconds)]
schlaftier has joined #ocaml
ome has quit [Quit: Connection closed for inactivity]
mro_name has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 272 seconds]
mro_name has quit [Quit: Leaving...]
osa1 has quit [Quit: osa1]
osa1 has joined #ocaml
dborisog has joined #ocaml
Serpent7776 has joined #ocaml
Haudegen has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 264 seconds]
shawnw has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 260 seconds]
smazga has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
olle_ has joined #ocaml
retropikzel has left #ocaml ["Leaving"]
olle_ has quit [Client Quit]
smazga has joined #ocaml
olle_ has joined #ocaml
smazga has quit [Ping timeout: 256 seconds]
smazga has joined #ocaml
steenuil has joined #ocaml
bartholin has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
wingsorc has quit [Quit: Leaving]
smazga has joined #ocaml
smazga has quit [Ping timeout: 256 seconds]
l1x has joined #ocaml
smazga has joined #ocaml
mbuf has joined #ocaml
smazga has quit [Ping timeout: 260 seconds]
narimiran has quit [Ping timeout: 246 seconds]
narimiran has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
mfp has joined #ocaml
mbuf has quit [Quit: Leaving]
ahf_ is now known as ahf
ome has joined #ocaml
smazga has joined #ocaml
smazga has quit [Ping timeout: 272 seconds]
Haudegen has joined #ocaml
smazga has joined #ocaml
nullifidian has joined #ocaml
smazga has quit [Ping timeout: 264 seconds]
<olle_>
Would it be possible to compile a language to C and include OCaml GC support in it?
<olle_>
That is, can the OCaml GC be used from C? Should be similar to write a lib to OCaml in C, no? But you need to bootstrap the runtime somehow.
Serpent7776 has quit [Ping timeout: 256 seconds]
<companion_cube>
you need all values to be ocaml values
<companion_cube>
see caml/value.h iirc
smazga has joined #ocaml
<olle_>
companion_cube: boxed? yes, sure.
<olle_>
Is that enough for the GC to find them? I was thinking about the stack and stuff.
<d_bot>
<dinosaure> it run the function during the program startup - by this way, if you make a library (as I do in this example), I'm sure that the caml runtime is running even if the end-user did not call `caml_startup`
<olle_>
oh ok
<olle_>
gcc specific, it seems.
shawnw has quit [Ping timeout: 256 seconds]
<d_bot>
<dinosaure> yes :/ but I think, you should find something close for `clang`
<olle_>
companion_cube: Not sure I want to rely on something that never gets updated.
<olle_>
Compiling to C is a rather safe bet.
<olle_>
Especially since my toy lang will be C-like. I think. :O
<olle_>
I tried compiling to LLVM 6 years ago, but GC in LLVM is painful bullshit.
<olle_>
Otherwise I love the LLVM IR.
<companion_cube>
well good luck
<olle_>
hehe
<companion_cube>
afaik, often, languages that compile to C tend to use refcounting, not a tracing GC
<companion_cube>
(e.g. nim)
<olle_>
companion_cube: well, you end up having to take care of cyclical data?
<olle_>
but maybe they want deterministic destruction. I've thought about this.
<olle_>
Didn't know Nim compiles to C, actually.
<olle_>
All I want is a language able to perform good-ish on both the n-body benchmark and the binary tree benchmark (using GC)
<olle_>
We'll see
<d_bot>
<stab> i mean nim has a new garbage collector 😉
<d_bot>
<stab> as i understand it the general idea is just use reference counting then cycle collection phases no?
<olle_>
no idea, I don't want to write any gc code myself
<d_bot>
<stab> uh yeah that's gonna be harder but couldnt you just compile to C then use a C garbage collector technically
<olle_>
no
<d_bot>
<stab> if you dont want to do the llvm thing
<olle_>
I want opt-in stack allocation
<olle_>
boehm et al scan the stack, it can't differentiate between what should and shouldn't be collected (I think?)
<olle_>
it's all or nothing, AFAIK
<d_bot>
<stab> eh maybe this is beyond me but I dont really see the issue with stack allocations?
<olle_>
because it's conservative anyway? yeah, maybe...
<olle_>
good point
<olle_>
hm hm hm
<olle_>
it's not completely tight tho, is it?
<olle_>
for a long running process
<d_bot>
<stab> i mean i dont think you are going to get anything tight without additional work on ur part
<d_bot>
<stab> maybe im wrong
<olle_>
that's why I wanted to put OCaml in there
<olle_>
but since I'm not planning to add any polymorphism, I won't really benefit from boxing everything.
<d_bot>
<stab> i dont think that's going to work too well since you said your language is going to be C like
<d_bot>
<stab> fundamentally you are going to deal with the same issues C garbage collectors do
<d_bot>
<stab> which is being conservative with what you assume is a pointer
<d_bot>
<stab> as soon as your language is weakly typed like that basically everything is a pointer until you prove it isnt
<d_bot>
<stab> I'd honestly say your best bet for a c like language is just a gcc frontend with a c garbage collector since smart ppl have worked on those
<olle_>
stab, no weak types, no casts
<olle_>
but, it's just a toy project, nothing serious
<olle_>
maybe I should write out some AST...
<d_bot>
<stab> eh yeah then maybe it's possible to do better garbage collection but then it would have to be custom so either llvm or your own so you end up with the same issue
<d_bot>
<stab> im just saying in terms of no effort on the garbage collection front im pretty sure compiling to c with a garbage collector is probably the best you are going to find. But id ask around in the PL discord
<d_bot>
<stab> i think they have an IRC bridge if you are anti discord and there are more people there thinking about programming languages etfc
<d_bot>
<stab> I hang around there but im too dumb lol...
<olle_>
haha
<olle_>
#ocaml is the best channel for prolang discussions ;D
mxns has joined #ocaml
dborisog has quit [Ping timeout: 246 seconds]
l1x has quit [Quit: Connection closed for inactivity]
smazga has joined #ocaml
smazga has quit [Ping timeout: 240 seconds]
smazga has joined #ocaml
nicoo has quit [Ping timeout: 240 seconds]
zebrag has quit [Quit: Konversation terminated!]
smazga has quit [Ping timeout: 246 seconds]
waleee-cl has joined #ocaml
hnOsmium0001 has joined #ocaml
smazga has joined #ocaml
nicoo has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
zebrag has joined #ocaml
tane has joined #ocaml
DanC has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
<d_bot>
<stab> anybody know anything about Smallfoot in infer?
<d_bot>
<stab> if so what does a prune instruction do?
raver has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
Bahman has joined #ocaml
mxns has joined #ocaml
rak has quit [Quit: reboot]
rak has joined #ocaml
<theblatte>
stab: "prune(B)" is assume(B). They are used to translate the conditional statements, eg if(B) { C1 } else { C2 } becomes a CFG where control flow splits in two, one branch is "prune(B); C1", then other is "prune(!B); C2"
bartholin has quit [Quit: Leaving]
<theblatte>
smallfoot was the first separation logic prover, some vestigial remains can still be found in Infer's source code :p
<theblatte>
most notably SIL stands for "Smallfoot Intermediate Language", even though Smallfoot's IR looked nothing like that
<d_bot>
<stab> so is that the expected way to translate conditional branches currently? or can you associate conditions with edges now somehow or something
<d_bot>
<stab> And thanks for the explanation that makes a ton of sense
olle_ has quit [Ping timeout: 246 seconds]
<d_bot>
<stab> Im guess the new way has to do with `Prune_node of bool * Sil.if_kind * prune_node_kind` which is a nodekind that you can have so i'd guess maybe what you are supposed to do is create a node of the correct type for each exit etc
<theblatte>
stab: yes that's how branches are translated, you can look at examples by running infer with -g and inspecting infer-out/captured/*/proc_cfgs_frontend.dot (or the html debug output in the same folder)
<theblatte>
ah, right, a prune node is a node containing a prune instruction (from Sil.instr)
dborisog has joined #ocaml
<d_bot>
<stab> thanks that makes sense. and yeah probably just makes sense to look at captured code for constructs that im trying to do and then see what infer does
<d_bot>
<stab> im not looking forward to transferring all of SIL into ATD bindings since ive decided it's probably more convenient to do the lifting on the java side... well i either need ATDs for all of ghidra pcode and varnodes or SIL
<d_bot>
<stab> *shudder*
<theblatte>
stab: if that's the path you're going down to have a look at how microsoft did their C# frontend, they have a json representation for SIL
<d_bot>
<stab> cool will take a look! yeah i mean im not sure which is more convenient, lifting on the ghidra side and using the json representation of SIL or representing the ghidra stuff in ATD and then lifting on the Infer side
<d_bot>
<stab> I guess if I can use some of microsofts ideas for json smallfoot then maybe that's the way to go and lift on the ghidra side
<theblatte>
pretty sure using the json layer is the most convenient way
<theblatte>
but I haven't played with it myself yet :)
<d_bot>
<stab> lol ill be the guinea pig
<d_bot>
<stab> I think it should work fine
<d_bot>
<stab> Thanks took a deeper look, pretty promising approach to getting this done
<theblatte>
sweet!
ome has quit [Quit: Connection closed for inactivity]
mxns has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
mxns has joined #ocaml
mxns has quit [Client Quit]
mxns has joined #ocaml
amiloradovsky has joined #ocaml
Tuplanolla has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
<olle>
not completely trivial how to mix stack allocated value types with heap allocated reference types...
<olle>
you can also have a reference to a value type ><