companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.2.0 released: https://ocaml.org/releases/5.2.0 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
grobe0ba has quit [Quit: ZNC 1.8.2 - https://znc.in]
grobe0ba has joined #ocaml
gentauro has joined #ocaml
waleee has quit [Ping timeout: 260 seconds]
ygrek has joined #ocaml
chrisz has quit [Ping timeout: 248 seconds]
chrisz has joined #ocaml
hsw has quit [Remote host closed the connection]
hsw has joined #ocaml
hsw has quit [Remote host closed the connection]
hsw has joined #ocaml
hsw has quit [Remote host closed the connection]
hsw has joined #ocaml
ygrek has quit [Remote host closed the connection]
hsw has quit [Remote host closed the connection]
mbuf has joined #ocaml
hsw has joined #ocaml
bhoot has joined #ocaml
hsw has quit [Quit: Leaving]
hsw has joined #ocaml
tomku has quit [Ping timeout: 252 seconds]
ygrek has joined #ocaml
tomku has joined #ocaml
ansiwen has quit [Quit: ZNC 1.7.1 - https://znc.in]
ansiwen has joined #ocaml
drakonis has quit [*.net *.split]
Armael has quit [*.net *.split]
leah2 has quit [*.net *.split]
landonf has quit [*.net *.split]
Techcable has quit [*.net *.split]
delyan_ has quit [*.net *.split]
jyc has quit [*.net *.split]
CalimeroTeknik has quit [*.net *.split]
buoy49__ has quit [*.net *.split]
adrien has quit [*.net *.split]
welterde has quit [*.net *.split]
Johann has quit [*.net *.split]
drakonis has joined #ocaml
leah2 has joined #ocaml
Armael has joined #ocaml
landonf has joined #ocaml
jyc has joined #ocaml
Techcable has joined #ocaml
buoy49__ has joined #ocaml
welterde has joined #ocaml
CalimeroTeknik has joined #ocaml
Johann has joined #ocaml
adrien has joined #ocaml
delyan_ has joined #ocaml
leah2 has quit [Max SendQ exceeded]
CalimeroTeknik has quit [Max SendQ exceeded]
Techcable has quit [Max SendQ exceeded]
leah2 has joined #ocaml
terrorjack has quit [*.net *.split]
copy has quit [*.net *.split]
jsoo has quit [*.net *.split]
Leonidas has quit [*.net *.split]
mima has quit [*.net *.split]
Leonidas has joined #ocaml
terrorjack has joined #ocaml
copy has joined #ocaml
mima has joined #ocaml
jsoo has joined #ocaml
bartholin has joined #ocaml
Techcable has joined #ocaml
CalimeroTeknik has joined #ocaml
ygrek has quit [Remote host closed the connection]
bhoot has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
twobitsprite has quit [Ping timeout: 248 seconds]
twobitsprite has joined #ocaml
YuGiOhJCJ has quit [Quit: YuGiOhJCJ]
Serpent7776 has joined #ocaml
bhoot has joined #ocaml
cr1901_ has joined #ocaml
cr1901 has quit [Ping timeout: 276 seconds]
alexherbo2 has joined #ocaml
olle has joined #ocaml
pi3ce has quit [Ping timeout: 245 seconds]
pi3ce has joined #ocaml
pi3ce_ has joined #ocaml
pi3ce has quit [Ping timeout: 260 seconds]
<discocaml> <peuk> Has anyone any advice on how to debug a segmentation fault in OCaml? I have a program that segfaults on MacOS ARM, only in 4.13.x, and I cannot identify the cause. When I run the executable in LLDB, I get a message that tells me that the crash happened in `hash.c` (probably not at the right line - 14 - however), but if I ask for a backtrace, lldb fails, it runs forever and I can only kill it.
<discocaml> <peuk> Does anyone have any advice on how to debug a segmentation fault in OCaml? I have a program that segfaults on MacOS ARM, only in 4.13.x, and I cannot identify the cause. When I run the executable in LLDB, I get a message that tells me that the crash happened in `hash.c` (probably not at the right line - 14 - however), but if I ask for a backtrace, lldb fails, it runs forever and I can only kill it.
<discocaml> <octachron> By only in 4.13, do you mean that the bug doesn't appear in 4.14.x and 5.x ?
<discocaml> <peuk> Yup
pie_ has joined #ocaml
<discocaml> <peuk> But I'd like to be sure that the reason why it works from 4.14 is because something has been fixed in OCaml.
<discocaml> <octachron> Is the code pure OCaml (with no possibly faulty C bindings or Obj.magic)?
<discocaml> <peuk> We have some `Obj.magic` in the project, but I *think* that in this part of the execution, they are not involved, even if it would take some time to be perfectly sure. This is why I wanted to get a trace.
TCZ has joined #ocaml
<discocaml> <otini_> Not being able to get a stack trace is new to me. But then I’ve only ever debugged on OCaml 5
<discocaml> <otini_> I would look at the exact assembly instruction faulting, that should indicate the function responsible, and then try to work out from which arguments the faulty operand is derived
<discocaml> <lukstafi> Can you try with `gdb`? Maybe you're hitting a cycle of stack frames, and I've seen `gdb` recognize that (for OCaml).
<discocaml> <lukstafi> Don't ask me what that means, it's what `gdb` said 😉
<discocaml> <peuk> It seems that GDB is not supported on Mac M1 🤔
alexherbo2 has quit [Remote host closed the connection]
waleee has joined #ocaml
waleee has quit [Ping timeout: 252 seconds]
olle has quit [Ping timeout: 245 seconds]
<discocaml> <otini_> and neither is rr… which is a big loss to you
TCZ has quit []
bhoot has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bhoot has joined #ocaml
Anarchos has joined #ocaml
<Anarchos> how to define a type which is a list of records ?
<Anarchos> « type a =({b:string}) list » doesn't work
<discocaml> <leviroth> Define the record type separately, or use objects instead of records.
<discocaml> <leviroth> Or plain tuples I suppose
<Anarchos> ok
<Anarchos> (i am porting SML code in which it is a legal syntax)
<Fardale> Annonymous record type are only available for ADT like "type t = Foo of {b:string}"
<Anarchos> Fardale ok, i can't add the "list' postfix ?
alexherbo2 has joined #ocaml
<Fardale> Apparently not, I tried to look in the manual but I was not able to find where the annonymous struct for ADT is describe. It seems to me that the grammar in the manual is not accepting it.
<Fardale> I found it, it's in the language extension part: https://ocaml.org/manual/5.2/inlinerecords.html
<Fardale> Then yes, it can only be used for ADT and GADT
<octachron> Inline records are not anonymous records, they are more records with implicit names.
bhoot has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bhoot has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
<octachron> with the meaningful difference that the record type identity is still anchored to those implicit names, and not to the record contents contrarily to anonymous records
prgbln has quit [Remote host closed the connection]
<discocaml> <deepspacejohn> I always get confused trying to remember which things are "language extensions" and which aren't. I feel like calling them extensions is misleading since they're just a normal part of the language now, for all practical purposes.
<discocaml> <lukstafi> It's kind of an anachronism.
<discocaml> <octachron> It is not completely true for some extensions (recursive modules, recursive values, open!) where people are unhappy with the specification or absence of the specification of the feature.
<discocaml> <octachron> But yes, otherwise it is mostly a question of chronology if "no one" has found the time to merge the extension into the main part of the manual.
<discocaml> <deepspacejohn> right, I can see it making sense for those ones that aren't fully specified or are still experimental. Or maybe things like attributes or doc comments that are (mainly) to benefit external tooling.
<discocaml> <deepspacejohn> But things like inline records, indexing operators, etc. feel well established (to me at least)
<companion_cube> octachron: just how likely is it that recursive modules would ever be broken?!
<companion_cube> (or, lol, inline records)
ygrek has joined #ocaml
<octachron> Recursive modules have been broken a bit recently for classes.
<companion_cube> fun stuff.
<companion_cube> I mean I avoid recursive modules, they're too ugly, but the day inline records are broken is the day I throw my computer out the window :D
<octachron> The "more fun" question is probably "how likely it is that module types will be specified and repaired"?
<octachron> And basically, the normal and simple use case of recursive will be preserved (for all version of "OCaml")
<companion_cube> is "OCaml" in the room with us? :D
<octachron> The issue is more "nobody is quite sure what should happen in the weird cases"
<companion_cube> yeah I bet
<companion_cube> modules are hard!
<octachron> And "inline records" is clearly waiting for someone to move the extension to the main section of the manual.
<companion_cube> 😍
<companion_cube> one day we'll also, I hope, fully accept type direct disambiguation into our hearts
<companion_cube> and remove the warnings from decades ago about "this field would be ambiguous blabla" :D
<companion_cube> (really great feature)
cr1901_ is now known as cr1901
<octachron> My perception is that type-directed disambiguation is still in the "the implementation could possibly be specified with a better theory" category
<companion_cube> I didn't look at the typechecker but I assume it's done by passing the expected return type around, and using that?
<companion_cube> (a form of bidirectional type checking, right?)
<octachron> For the principal part, yes. But then there is the question of how this interact with type inference.
<octachron> Which leads to the issue that a function call might typecheck or not if one switches the order of arguments in both the function definition and the function call.
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
bhoot has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Inline has quit [Ping timeout: 252 seconds]
ygrek has quit [Remote host closed the connection]
bhoot has joined #ocaml
ygrek has joined #ocaml
<discocaml> <eduardorfs> Time to finally go algebraic subtyping?
<discocaml> <eduardorfs> The ambiguous field and the record patterns breaking when switching from match to let, always makes me upset and it seems like the theory is pretty solid and even relatively close to the row poly implementation in OCaml
<companion_cube> I don't think there's any row polymorphism for record patterns
bhoot has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<discocaml> <octachron> If I understood correctly, @eduardorfs point was that if the inference mechanism switch to row polymorphism or similar, the decision to attribute a constructor to a type might be delayed to a point where the decision is principal.
<companion_cube> hmm I guess I never encounter this kind of issue
<discocaml> <octachron> I am not sure if the flow dependency of algebraic subtyping is a feature in this case, since one want to attribute the constructor to a type fast enough to avoid the complexity of inferred types for polymorphic variants.
<discocaml> <octachron> A typical example is something like `List.map (function X -> ... ) M.X` where the typechecker cannot find the `X` in the function argument because it doesn't know yet that its type is `M.t`.
<discocaml> <eduardorfs> Octachron is correct, I'm bad with words. But I would be really surprised if the complexity here is relevant, as at least kind of the type can be readily collected.
<discocaml> <eduardorfs>
<discocaml> <eduardorfs> But it is also the case that it could be limited to a single let level, if the declaration failed to collapse into a single which variant / record / array, then it just reject the let
myrkraverk has quit [Ping timeout: 252 seconds]
myrkraverk has joined #ocaml
myrkraverk_ has joined #ocaml
myrkraverk has quit [Ping timeout: 252 seconds]
Inline has joined #ocaml
bhoot has joined #ocaml
ygrek has quit [Remote host closed the connection]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
Inline has quit [Quit: Leaving]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
bhoot has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
myrkraverk_ has quit [Ping timeout: 252 seconds]
myrkraverk has joined #ocaml
bhoot has joined #ocaml
bhoot has quit [Quit: Textual IRC Client: www.textualapp.com]
waleee has joined #ocaml
Anarchos has joined #ocaml
mbuf has quit [Quit: Leaving]
alexherbo2 has joined #ocaml
Tuplanolla has joined #ocaml
ygrek has joined #ocaml
<twobitsprite> I've used opam to install tsdl, but when I try to run my test program, it just hangs on the terminal. If I try to ocamlc it, I get an "unbound module Tsdl" error. Same error in the ocaml repl... what am I missing?
<twobitsprite> (and by "try to run my test program", I mean with ocamlscript)
Serpent7776 has quit [Ping timeout: 255 seconds]
<octachron> ocamlscript?
<twobitsprite> it just compiles and executes sources as if it was a script, but nevermind that, I'm just trying to get Tsdl to work
<octachron> The standard solution except if you want to struggle and learn a lot before running anything is to use dune
<octachron> https://github.com/Octachron/olivine/tree/master/examples for an example, you can ignore everything after the SDL submodule.
cr1901 has quit [Ping timeout: 260 seconds]
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
<discocaml> <ammkrn> Are there any public implementations of the "ZAM2" zinc abstract machine as it's described in these slides?: https://xavierleroy.org/talks/zam-kazam05.pdf
<discocaml> <ammkrn> There are some aspects of the merged arg+return stack and the mixed persistent/volatile environment representation that are sort of glossed over in those which are getting past me.
Anarchos has quit [Quit: Vision[]: i've been blurred!]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
ygrek has quit [Remote host closed the connection]
mal`` has quit [Quit: Leaving]
cr1901 has joined #ocaml
mal`` has joined #ocaml
m5zs7k has quit [Ping timeout: 252 seconds]
m5zs7k has joined #ocaml
bartholin has quit [Quit: Leaving]
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
YuGiOhJCJ has joined #ocaml
<twobitsprite> I'm trying to get this test file to build with dune: https://github.com/dbuenzli/tsdl/blob/master/test/sdlevents.ml
<twobitsprite> but I'm getting the error Error: Unbound module Fmts
<twobitsprite> I've added a libraries stanza to my dune file and added tsdl to is, but adding fmts doesn't work
<twobitsprite> I've also tried adding Fmts and Format
Tuplanolla has quit [Quit: Leaving.]
waleee has quit [Ping timeout: 260 seconds]