Leonidas changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.1.1 released: https://ocaml.org/releases/5.1.1 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
jabuxas has joined #ocaml
<discocaml> <idontwantausernamefeckoff> lol i write in go i feel the pain
alexherbo2 has quit [Remote host closed the connection]
Square3 has joined #ocaml
dnh has quit [Quit: Textual IRC Client: www.textualapp.com]
bibi_ has quit [Quit: Konversation terminated!]
bibi_ has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pi3ce has joined #ocaml
jabuxas has quit [Ping timeout: 256 seconds]
jutty has quit [Changing host]
jutty has joined #ocaml
motherfsck has quit [Ping timeout: 255 seconds]
mmohammadi9812 has joined #ocaml
rgrinberg has joined #ocaml
mmohammadi9812 has quit [Ping timeout: 255 seconds]
mmohammadi9812 has joined #ocaml
mmohammadi9812 has quit [Remote host closed the connection]
mmohammadi9812 has joined #ocaml
motherfsck has joined #ocaml
mmohammadi9812 has quit [Remote host closed the connection]
waleee has quit [Ping timeout: 255 seconds]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
jutty has quit [Quit: jutty]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
prgbln has joined #ocaml
myrkraverk_ has quit [Read error: Connection reset by peer]
myrkraverk_ has joined #ocaml
myrkraverk_ has quit [Read error: Connection reset by peer]
myrkraverk_ has joined #ocaml
Square3 has quit [Ping timeout: 256 seconds]
mal`` has quit [Quit: Leaving]
mal`` has joined #ocaml
rgrinberg has joined #ocaml
Serpent7776 has joined #ocaml
mmohammadi9812 has joined #ocaml
mmohammadi9812 has quit [Ping timeout: 272 seconds]
<discocaml> <leostera> is there a table somewhere with the values of max_int per architecture?
<discocaml> <leostera> i have a test that uses it, but the value seems to be slightly larger on github action's ubuntu x86 machines than in my own x86 machine
<discocaml> <leostera> (possibly gh is running an arm box)
<discocaml> <coollcat> Best solution for sqrt of an integer? Right now I'm doing `int_of_float (sqrt (float_of_int (num)))` and I'm not sure if this is the best solution
<discocaml> <coollcat> num is always a perfect square
mizlan has quit [Ping timeout: 264 seconds]
azimut has joined #ocaml
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
bartholin has joined #ocaml
<discocaml> <bluddy5> max_int should not be different per architecture. It should be 2^62-1 for 64-bit, and 2^30-1 for 32-bit.
bartholin has quit [Quit: Leaving]
<discocaml> <bluddy5> If the allocation of the float is optimized away (check godbolt), then this is a good solution. If not, refer to this for ideas https://math.stackexchange.com/questions/2469446/what-is-a-fast-algorithm-for-finding-the-integer-square-root
<discocaml> <bluddy5> But if you don't care about an allocation either way, just stick with this.
mmohammadi9812 has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mmohammadi9812 has quit [Remote host closed the connection]
mmohammadi9812 has joined #ocaml
mizlan has joined #ocaml
mizlan has quit [Ping timeout: 260 seconds]
mmohammadi9812 has quit [Ping timeout: 260 seconds]
czy has quit [Remote host closed the connection]
czy has joined #ocaml
mmohammadi9812 has joined #ocaml
mmohammadi9812 has quit [Remote host closed the connection]
a51 has quit [Quit: WeeChat 4.2.1]
infinity0 has quit [Remote host closed the connection]
czy has quit [Remote host closed the connection]
dnh has joined #ocaml
Anarchos has joined #ocaml
bibi_ has quit [Ping timeout: 268 seconds]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
mizlan has joined #ocaml
bibi_ has joined #ocaml
mizlan has quit [Ping timeout: 268 seconds]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alexherbo2 has joined #ocaml
jabuxas has joined #ocaml
jabuxas_ has joined #ocaml
raskol has joined #ocaml
dnh has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
raskol has quit [Quit: Lost terminal]
mfranc has left #ocaml [#ocaml]
jabuxas_ has quit [Ping timeout: 260 seconds]
raskol has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
jabuxas has quit [Ping timeout: 268 seconds]
mizlan has joined #ocaml
mizlan has quit [Ping timeout: 268 seconds]
jusensei2 has quit [Quit: The Lounge - https://thelounge.chat]
jusensei2 has joined #ocaml
mmohammadi9812 has joined #ocaml
mmohammadi9812 has quit [Remote host closed the connection]
<discocaml> <lubegasimon_> How to write rules that expand to each other without hitting a cyclic grammar error in menhir. For instance, assume the rule `foo` expands to the rule `bar` which expands to `foo`. what I intend to do is more or less similar to what recursive modules in OCaml do
<discocaml> <lubegasimon_> ```
<discocaml> <lubegasimon_> foo:
<discocaml> <lubegasimon_> | b = bar { b }
<discocaml> <lubegasimon_>
<discocaml> <lubegasimon_> bar:
<discocaml> <lubegasimon_> | f = foo { f }
<discocaml> <lubegasimon_> ```
<discocaml> <lubegasimon_> How could one write rules that expand to each other without hitting a cyclic grammar error in menhir? For instance, assume the rule `foo` expands to the rule `bar` which expands to `foo`. what I intend to do is more or less similar to what recursive modules in OCaml do
<discocaml> <lubegasimon_> ```
<discocaml> <lubegasimon_> foo:
<discocaml> <lubegasimon_> | b = bar { b }
<discocaml> <lubegasimon_>
<discocaml> <lubegasimon_> bar:
<discocaml> <lubegasimon_> | f = foo { f }
<discocaml> <lubegasimon_> ```
<discocaml> <lubegasimon_> How could one write production rules that expand to each other without hitting a cyclic grammar error in menhir? For instance, assume the rule `foo` expands to the rule `bar` which expands to `foo`. what I intend to do is more or less similar to what recursive modules in OCaml do
<discocaml> <lubegasimon_> ```
<discocaml> <lubegasimon_> foo:
<discocaml> <lubegasimon_> | b = bar { b }
<discocaml> <lubegasimon_>
<discocaml> <lubegasimon_> bar:
<discocaml> <lubegasimon_> | f = foo { f }
<discocaml> <lubegasimon_> ```
szkl has joined #ocaml
<discocaml> <octachron> Do you have a non-erroneous example?
bibi_ has quit [Quit: Konversation terminated!]
mizlan has joined #ocaml
<discocaml> <lubegasimon_> Regarding what I intend to have, no!
<discocaml> <lubegasimon_> however, other rules I have locally that don't expand to each compile just fine
mizlan has quit [Ping timeout: 240 seconds]
Serpent7776 has quit [Ping timeout: 252 seconds]
<discocaml> <octachron> Well, I am confused, your example doesn't define any valid grammar, hitting a cyclic grammar error is the best that can happen in this case.
<discocaml> <lubegasimon_> The example is invalid, it demonstrates what I intend to do
<discocaml> <drupyog> Your grammar is ill-defined. It's similar to wanting `type t = u and u = t`
Square3 has joined #ocaml
Tuplanolla has joined #ocaml
mizlan has joined #ocaml
<discocaml> <octachron> or `let x = y and y = x`
mizlan has quit [Ping timeout: 255 seconds]
<discocaml> <lubegasimon_> The rules (media_condition & media_in_parens) I want to formulate are derived from this syntax `<media-condition> = <media-in-parens> | ...`& `<media-in-parens> = ( <media-condition> ) | <media-feature> | ... `.
<discocaml> <lubegasimon_> Does that make sense?
<discocaml> <lubegasimon_> it's a media_query syntax -- https://www.w3.org/TR/mediaqueries-5/#mq-syntax
Anarchos has joined #ocaml
<discocaml> <octachron> But in this case the grammar is well-defined, and menhir should have no troubles to accept it.
<discocaml> <octachron> It might be easier to link your current code?
<discocaml> <octachron> Maybe you missed the fact that `(` and `)` are token in `( <media-condition> )`?
Anarchos has quit [Quit: Vision[]: i've been blurred!]
jutty has joined #ocaml
hannes has quit [Read error: Connection reset by peer]
hannes has joined #ocaml
mizlan has joined #ocaml
mizlan has quit [Ping timeout: 260 seconds]
torretto has quit [Remote host closed the connection]
torretto has joined #ocaml
mizlan has joined #ocaml
bibi_ has joined #ocaml
mizlan has quit [Ping timeout: 268 seconds]
mizlan has joined #ocaml
Square3 has quit [Ping timeout: 268 seconds]
<discocaml> <lubegasimon_> Assume other rules defined
<discocaml> <lubegasimon_> ```
<discocaml> <lubegasimon_> media_in_parens:
<discocaml> <lubegasimon_> | mc = media_condition { mc }
<discocaml> <lubegasimon_> | mf = media_feature { mf }
<discocaml> <lubegasimon_>
<discocaml> <lubegasimon_> media_condition:
<discocaml> <lubegasimon_> | n = not { n }
<discocaml> <lubegasimon_> | mip = media_in_parens { mip }
<discocaml> <lubegasimon_>
<discocaml> <lubegasimon_> media_query:
<discocaml> <lubegasimon_> | mc = media_condition { mc }
<discocaml> <lubegasimon_> | not_or_only? WS xs = media_type WS and_media_condition_without_or? { xs }
<discocaml> <lubegasimon_> ```
<discocaml> <octachron> Then as I said you have misread the definition of `media_in_parens`.
<discocaml> <octachron> The menhir version of the definition would be `LPAREN media_condition RPAREN`, thus the `_in_parens` suffix.
<discocaml> <lubegasimon_> Indeed!! haha
<discocaml> <lubegasimon_> Thank you @octachron
bartholin has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
olle has joined #ocaml
szkl has quit [Quit: Connection closed for inactivity]
rgrinberg has joined #ocaml
mizlan has quit [Quit: mizlan]
mizlan has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
waleee has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
myrkraverk__ has joined #ocaml
myrkraverk_ has quit [Read error: Connection reset by peer]
omegatron has joined #ocaml
Square3 has joined #ocaml
olle has quit [Ping timeout: 255 seconds]
mizlan has quit [Ping timeout: 260 seconds]
mizlan has joined #ocaml
mizlan has quit [Remote host closed the connection]
mizlan has joined #ocaml
mizlan has quit [Remote host closed the connection]
mizlan has joined #ocaml
rgrinberg has joined #ocaml
bartholin has quit [Quit: Leaving]
szkl has joined #ocaml
mizlan has quit [Remote host closed the connection]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml