szkl has quit [Quit: Connection closed for inactivity]
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #ocaml
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #ocaml
<discocaml>
<barconstruction> In discussions about modular implicits, why is it considered important to have the implicits be modules instead of something like records? People talk about the challenges of integrating ML module systems with typeclasses but Rocq has both and they're complementary. Why not borrow from Rocq's design here?
<discocaml>
<barconstruction> I like that Rocq lets you hide typeclasses behind a module and only import the ones you want.
<discocaml>
<barconstruction> Maybe a better question is "What don't we like about Rocq's typeclass system design"
<discocaml>
<barconstruction> I'm reading the modular implicits paper and Rocq's typeclasses seem more similar to scala implicits than Haskell typeclasses based on their definition. I didn't realize Haskell typeclasses don't have to be explicitly specified as function arguments.
dh` has quit [Ping timeout: 252 seconds]
dh` has joined #ocaml
dh` has quit [Changing host]
dh` has joined #ocaml
dh` has quit [Ping timeout: 246 seconds]
dh` has joined #ocaml
bartholin has joined #ocaml
Serpent7776 has joined #ocaml
kurfen has quit [Ping timeout: 252 seconds]
kurfen has joined #ocaml
bartholin has quit [Quit: Leaving]
Serpent7776 has quit [Ping timeout: 252 seconds]
<discocaml>
<._null._> Rocq's records can pack types, OCaml's can't
<rustyne>
romain.beauxis: from what I read in amd64.S, part of the callback assembly code is shared with caml_start_program, so that seems legit
<rustyne>
On 4.14.2, amd64.S:483 and 651
<discocaml>
<xavierm02_> Typeclass resolution is hard to control, it can easily take way too long. There's also canonical structures in Rocq that don't suffer from this problem
<discocaml>
<xavierm02_> In Rocq the advantage of records over modules is that they are first class, i.e. you can define them by e.g. recursion. In OCaml, records are not dependent, and modules can be made first class, so it makes more sense to use modules
<discocaml>
<dubious245> I sometimes forget something is actually an uint8 or an int16 in a bigarray.
jbowen has quit [Ping timeout: 265 seconds]
<discocaml>
<dubious245> Encoding that in my ocaml code would be nice.
<discocaml>
<dubious245> Rather than me looking at debugging messages and for a minuting trying to figure out the error and then facepalming when I realize its an underflow.
jbowen has joined #ocaml
wbooze has quit [Quit: Leaving]
<discocaml>
<._null._> You could wrap them in a module if you need type safety
<discocaml>
<barconstruction> @._null._
<discocaml>
<barconstruction> Imo idiomatic use of typeclasses in Rocq doesn't require you to bundle the type into the record. Compare Rocq
<discocaml>
<barconstruction> ```coq
<discocaml>
<barconstruction> Class Showable(A : Type) := {
<discocaml>
<barconstruction> to_string : A -> string
<discocaml>
<barconstruction> }
<discocaml>
<barconstruction> ```
<discocaml>
<barconstruction> with OCaml
<discocaml>
<barconstruction> ```
<discocaml>
<barconstruction> type 'a showable := {
<discocaml>
<barconstruction> to_string : 'a -> string
<discocaml>
<barconstruction> }
<discocaml>
<barconstruction> ```
<discocaml>
<barconstruction> Then typeclass inference on `show 3` would search for an inhabitant of the record type `int showable`.
<discocaml>
<barconstruction> Canonical structures does require this bundling
wbooze has joined #ocaml
<discocaml>
<deepspacejohn> Doesn't using modules sort-of enable higher-kinded types? since you can have a module with `sig type 'a t val to_string: ('a -> string) -> 'a t -> string` but you can't have a record `type 't showable = { to_string: ('a -> string) -> 'a 't -> string}`.
<discocaml>
<deepspacejohn> that module signature is currently disallowed in first-class modules, but IIRC module explicits/implicits allowed it somehow.
ddakx has joined #ocaml
ddakx has quit [Client Quit]
Phandal has joined #ocaml
<discocaml>
<froyo> rustyne: why not make of_int identity and just let garbage exist on the higher bits? in other words make the module a view on ints with only the conversion to ints clearing the upper bits and sign-extending
wbooze has quit [Quit: Leaving]
wbooze has joined #ocaml
mstevens has quit [Read error: Connection reset by peer]
mstevens has joined #ocaml
cbarrett has quit [Read error: Connection reset by peer]
cbarrett has joined #ocaml
jbowen has quit [Ping timeout: 260 seconds]
caasih has quit [Ping timeout: 248 seconds]
Boarders_____ has quit [Ping timeout: 248 seconds]
Boarders_____ has joined #ocaml
caasih has joined #ocaml
jbowen has joined #ocaml
wbooze has quit [Quit: Leaving]
<rustyne>
froyo: I don’t really know why they chose this, but I would approve: it’s better to maintain the sensible invariant of the expected bounds of an Int8.t
<discocaml>
<._null._> froyo: what should `fun (x : Int8.t) -> (x lsl 8) lsr 8` do ? If it's ints without bound checks then this function is identity on int8, but if the bounds are checked it's a constant function to 0
wbooze has joined #ocaml
<discocaml>
<barconstruction> I skimmed the modular implicits paper last night and they do discuss this yeah. I can't say the details because I was just skimming but they're planning to elaborate functions taking modular implicits into functors instead of using first class modules
Haudegen has quit [Quit: Bin weg.]
euphores has quit [Quit: Leaving.]
euphores has joined #ocaml
Serpent7776 has joined #ocaml
wbooze has quit [Quit: Leaving]
abbe__ has quit [Ping timeout: 248 seconds]
JSharp has quit [Read error: Connection reset by peer]
Duns_Scrotus has quit [Read error: Connection reset by peer]
wbooze has joined #ocaml
Techcable has quit [Read error: Connection reset by peer]
JSharp has joined #ocaml
Techcable has joined #ocaml
abbe__ has joined #ocaml
Duns_Scrotus has joined #ocaml
Haudegen has joined #ocaml
<discocaml>
<mbacarella> > warning 62: License doesn't adhere to the SPDX standard, see https://spdx.org/licenses/ : "proprietary"
<discocaml>
<mbacarella> is there a way to make opam stop warning about this?
<discocaml>
<mbacarella> yes. also latest enough version of opam
* discocaml
<mbacarella> starts claude code up at the top-level of his home directory
<discocaml>
<mbacarella> "dear claude, please go through every single ocaml repo I have and pull it and fix my opam licenses by editing dune-project and then running some dune command to force regeneration. create branch and push. then run gh to make a pr out of it. oh. figure out whatever workaholic on my team to assign it to by looking through git log. please go ahead without requiring confirmation of any commands"
dhil has quit [Ping timeout: 248 seconds]
<discocaml>
<yawaramin> claude: no. do it yourself
bartholin has joined #ocaml
<discocaml>
<froyo> > is there a way to make opam stop warning about this?
<discocaml>
<froyo> yea release it as free software :P
wbooze has quit [Quit: Leaving]
<discocaml>
<mbacarella> @wasla sure, you think I should release my stylometric forum post de-anonymization tool as AGPL or WTFPL licensed?
wbooze has joined #ocaml
<discocaml>
<deepspacejohn> it would be nice if `dune init` didn't generate a license name that triggers that warning, at least.
<discocaml>
<dubious245> Can AI do that?
<discocaml>
<dubious245>
<discocaml>
<dubious245> I've not used them or looked into the current state of them.
<discocaml>
<mbacarella> the claude code CLI tool can yeah
<discocaml>
<contificate> yeah, I don't even touch the keyboard any more
<discocaml>
<contificate> I say "Jarvis, produce more slop"
<discocaml>
<contificate> and `slop.ml` appears fully complete in my emacs buffer momentarily
<discocaml>
<mbacarella> it actually prompts you before it runs commands locally, every step of the way. but if you just feel the AGI and say "assume yes to everything" it moves so much faster
<discocaml>
<contificate> jokes aside, I do actually think this AI slop will (and already has) made a notable change to our industry, so I'm genuinely considering learning plumbing or something
<discocaml>
<mbacarella> I did see someone on HN complain the other day that it `rm -rf`'d their entire home directory by accident
<discocaml>
<mbacarella> hahaha
<discocaml>
<dubious245> I mean the AI's are trained on publicly available data, these conpanies arent licensing anything. Increasingly publicly avalible data is AI generated. It is proven that AIs consuming the output of AI degrades their performance. So they are slowly poisoning the well they drink from. Like a toddler in a bathtub.
<discocaml>
<yawaramin> public internet is full of jokes like 'rm -fr to remove the French language translations and free up some space'
ddakx has joined #ocaml
<discocaml>
<gooby_diatonic> I'd rather remove all the languages but French
<discocaml>
<dubious245> Touche.
<dmbaturin>
It's what they tried to do with Breton, Occitan, and other languages hundreds years ago. ;)
<discocaml>
<froyo> > should release my stylometric forum post de-anonymization tool as AGPL or WTFPL
<discocaml>
<froyo> agpl for sure my 3 letter agency friend
<discocaml>
<froyo> rustyne: the types don't give more compact memory repr because ocaml only deals with words and they perform worse on each operation as it stands. I don't see a use for the PR at the moment in all honestly. seems premature, would make a lot stronger case for it once levity polymorphism is merged in.
<discocaml>
<froyo> if it's merged in right now, for the sake of just having it there, then it could be a design constraint/obstacle or just baggage in the future when the language may change
<discocaml>
<froyo> and we already have packing in string, buffer, bytes, bigarray..
<discocaml>
<froyo> so interfacing should "just work"
<discocaml>
<froyo> it's packing in data structures that I'm talking about
<discocaml>
<froyo> NULL: well the first question will be why you're shifting in quantities larger than the type you're using, as that's not a normal behavior anyway. and as to how you want to define that undefined behavior, I'd probably expect right shifts to clear higher bits anyway to prevent garbage from sneaking into the "view"
<discocaml>
<froyo> larger or equal*
<discocaml>
<._null._> Even if not shifts, anything that overflows that affect a result
<discocaml>
<dubious245> It should zero out the bits?
<discocaml>
<froyo> so is the question about optimizing overflowing operations at the cost of everything else?
<discocaml>
<._null._> can affect*
<discocaml>
<froyo> seems like a losing strategy for an implementation, how I see it
<discocaml>
<froyo> in any case the current implementation masks everywhere it seems
<discocaml>
<froyo> so I guess the plan is to get it in first then cut excess computations later
<discocaml>
<._null._> I'm not sure what optimisations you want to add. Sure, additions and substractions are fine if they overflow, but no other operation is
<discocaml>
<edhebi> also most operations on ints require a shift regardless don't theuy
<discocaml>
<edhebi> also most operations on ints require a shift regardless don't they
<discocaml>
<dubious245> :bThoughtful: they do, dont they.
<discocaml>
<froyo> NULL: I'd rather not optimise those modules since I don't see a case for them to begin with lol
<discocaml>
<._null._> Then why not mask every operation ? I must have missed something
<discocaml>
<froyo> fair point on shifts yea maybe it's not an actual cost
<discocaml>
<froyo> iirc the compiler can deduce the net shifting amount
<discocaml>
<froyo> (ps: avoid editing in this channel, it creates noise for irc users)
<discocaml>
<froyo> > the current implementation masks everywhere
<discocaml>
<froyo> shifts everywhere. I was misremembering what I saw
ddakx has quit [Quit: leaving]
Tuplanolla has joined #ocaml
bartholin has quit [Quit: Leaving]
<discocaml>
<edhebi> ideally you can often shifts some inputs, compute all the stuff, and unshift the output, but that doesn't nessessarily handle overflow properly I think ?
<discocaml>
<edhebi> I haven't thought about it too much tbf
wickedshell has quit [Ping timeout: 246 seconds]
<discocaml>
<trilon> Hello guys, I am doing a CTF Challenge and the program requires me to give it a marshal and do something eventually to reveal the flag
<discocaml>
<trilon> can somebody help? (ping if anyone is interested)
<discocaml>
<edhebi> with those challenges usually you're expected to reverse the code to understand the algorithm checking your input, and then usually do some bonus programming to construct said input
<discocaml>
<edhebi> given the challenge name I assume it's either weird type level computation or maybe something like Obj.magic shenanigans
<discocaml>
<trilon> yeah I think its related, however I tried constructing such payload and anything that I give is a bad object
<discocaml>
<edhebi> you have access to the challenge's code don't you ?
<discocaml>
<trilon> but I still get bad object error
<discocaml>
<edhebi> is that challenge categorized ?
<discocaml>
<edhebi> again, I'm almost entirely sure this is a reverse challenge
<discocaml>
<trilon> This challenge is by my university, I have a class called: "Introduction to security", I have solved all the recent challenges and this is the last one.
<discocaml>
<trilon> Yeah the category is binary exploitation
<discocaml>
<edhebi> I'm assuming you're expected to understand the program from the binary (disclaimer I have no experience whatsoever reversing ocaml) to find the mem vulnerability
<discocaml>
<edhebi> I imagine this is following some course or something ?
<discocaml>
<trilon> I tried that, it is a complete mess
<discocaml>
<trilon> no not really
<discocaml>
<trilon> So basically, our teacher tought us basic stuff regarding reversing etc
<discocaml>
<trilon> We are not required to solve all challenges
<discocaml>
<trilon> only like 1/3 of them
xenu has joined #ocaml
<discocaml>
<trilon> this is the hardest available
<discocaml>
<trilon> we haven't been tought ocaml or whatever
<discocaml>
<trilon> I have found this, which is where the check happens
<discocaml>
<._null._> Don't paste code blocks in this channel though
<discocaml>
<._null._> It's annoying to IRC users
<discocaml>
<trilon> ok
<discocaml>
<edhebi> as I said I've never reversed ocaml so I'm not familiar with the functions in there, but it looks like a matter of "go line by line and more and more into detail until you can exerce later and later branches"
<discocaml>
<edhebi> also debuggers are great
<discocaml>
<trilon> Alright
<discocaml>
<trilon> I need to make a ocaml program that will output something that then after it will be passed to a function `Digest.to_hex`
<discocaml>
<trilon> can you help me make such program?
<discocaml>
<trilon> @edhebi
tremon has quit [Quit: getting boxed in]
Haudegen has quit [Quit: Bin weg.]
<discocaml>
<yawaramin> this seems like a neverending battle