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/
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
motherfsck has quit [Read error: Connection reset by peer]
Fardale has quit [Quit: WeeChat 3.0]
<companion_cube> Ok I'm extremely offended by this post
<companion_cube> For a start, it uses the spelling "colour"
<companion_cube> What is this, oxford ????
<companion_cube> (more seriously the use of Str is a bit dubious)
Fardale has joined #ocaml
infinity0 has quit [Ping timeout: 246 seconds]
infinity0 has joined #ocaml
dnh has joined #ocaml
<discocaml> <yawaramin> yeah, you said that already 😉
<companion_cube> Lol getting old is sad
<companion_cube> I'm but a humble Markov chain at this point
motherfsck has joined #ocaml
Phandal has joined #ocaml
Fardale has quit [Quit: WeeChat 3.8]
Fardale has joined #ocaml
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
infinity0 has quit [Remote host closed the connection]
<discocaml> <rongcuid> Thank you. But ocaml for automation?
dnh has joined #ocaml
dnh has quit [Client Quit]
m5zs7k has quit [Remote host closed the connection]
m5zs7k has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
mccd has joined #ocaml
mccd has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
zanetti has joined #ocaml
zanetti has quit [Excess Flood]
zanetti has joined #ocaml
<discocaml> <mbacarella> You're my favorite stochastic parrot, c-cube
jabuxas has joined #ocaml
<companion_cube> awwww
<companion_cube> make sure to not turn the temperature too high though, I might say crazy things
Phandal has quit [Quit: leaving]
zanetti has quit [Quit: zanetti]
germ has joined #ocaml
germ has quit [Changing host]
germ has joined #ocaml
germ has quit [Client Quit]
germ has joined #ocaml
germ has quit [Changing host]
germ has joined #ocaml
jabuxas has quit [Ping timeout: 268 seconds]
zanetti has joined #ocaml
Square2 has joined #ocaml
<discocaml> <eduardoac3782> hello, I am newbie in ocaml
Square2 has quit [Ping timeout: 255 seconds]
zanetti has quit [Quit: zanetti]
berberman has quit [Ping timeout: 268 seconds]
berberman has joined #ocaml
duncan has quit [Ping timeout: 268 seconds]
duncan has joined #ocaml
cr1901 has quit [Read error: Connection reset by peer]
cr1901 has joined #ocaml
dnh has joined #ocaml
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnh has joined #ocaml
waleee has joined #ocaml
chrisz has joined #ocaml
dnh has quit [Client Quit]
<discocaml> <darrenldl> welcome!
Serpent7776 has joined #ocaml
bartholin has joined #ocaml
olle has joined #ocaml
bartholin has quit [Quit: Leaving]
zanetti has joined #ocaml
<discocaml> <Kali> welcome
deadmarshal_ has quit [Ping timeout: 264 seconds]
deadmarshal_ has joined #ocaml
pi3ce has joined #ocaml
pi3ce has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
pi3ce has joined #ocaml
hannes__ has joined #ocaml
hannes has quit [Ping timeout: 252 seconds]
malte has quit [Ping timeout: 252 seconds]
gdd has quit [Ping timeout: 252 seconds]
ocabot has quit [Ping timeout: 252 seconds]
gdd has joined #ocaml
ocabot has joined #ocaml
malte has joined #ocaml
myrkraverk has quit [Remote host closed the connection]
myrkraverk has joined #ocaml
pi3ce has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
pi3ce has joined #ocaml
Anarchos has joined #ocaml
pi3ce has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
pi3ce has joined #ocaml
pi3ce has quit [Read error: Connection reset by peer]
pi3ce has joined #ocaml
dnh has joined #ocaml
dnh has quit [Client Quit]
thelounge142 has joined #ocaml
<discocaml> <rongcuid> Are effects globally registered?
<discocaml> <octachron> No, they are not.
<discocaml> <rongcuid> Are they not extending the `Effect` type?
<discocaml> <octachron> Yes?
<discocaml> <rongcuid> If two modules want two different `EffectA`, can they do it?
<discocaml> <rongcuid> I've never used extensible types before
<discocaml> <octachron> They can. Extensible variant constructors are values that are recorded in the module that defined them.
<reynir> ah you mean if the constructors share the same name?
<discocaml> <rongcuid> Yes
<discocaml> <rongcuid> Ok, but what's the scope of the new variant?
<discocaml> <octachron> The same as the scope of a value defined in same module.
<discocaml> <rongcuid> So instead of a name referring to the new constructor, only that particular value is the constructor
<discocaml> <octachron> Not necessarily because one can re-export an extension constructor `type exn += Also_failure = Failure`
<discocaml> <octachron> `try (raise Also_Failure "s") with Failure x -> x` reduces to `"s"`
<discocaml> <rongcuid> ok
<discocaml> <rongcuid> Are Effects actually well-hidden CPS programming?
thelounge142 has quit [Ping timeout: 252 seconds]
jabuxas has joined #ocaml
<companion_cube> @rongcuid: exceptions are a common case for extensible sum types :)
szkl has joined #ocaml
thelounge142 has joined #ocaml
pi3ce has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
pi3ce has joined #ocaml
thelounge142 has quit [Remote host closed the connection]
a51 has quit [Quit: WeeChat 4.2.1]
jabuxas has quit [Ping timeout: 256 seconds]
jabuxas has joined #ocaml
jabuxas has quit [Read error: Connection reset by peer]
jabuxas_ has joined #ocaml
Fardale has quit [Quit: WeeChat 3.8]
olle has quit [Ping timeout: 264 seconds]
myrkraverk has quit [Read error: Connection reset by peer]
myrkraverk has joined #ocaml
<Anarchos> how to generate documentation from the javadoc-style comments in ocaml/parsing/location.mli ?
szkl has quit [Quit: Connection closed for inactivity]
<discocaml> <drewolson> has anyone tried the “one billion row challenge” in ocaml?
a51 has joined #ocaml
waleee has quit [Quit: WeeChat 4.1.2]
Serpent7776 has quit [Read error: Connection reset by peer]
<discocaml> <rongcuid> Is it preferred to use `Base` or `Core` over `Stdlib`?
<discocaml> <mbacarella> not officially but it's like, ten lines
<discocaml> <drewolson> sure, but is it “fast”TM
Serpent7776 has joined #ocaml
<Anarchos> rongcuid it is just a matter of taste : De gustibus et coloribus non disputandum est…
<discocaml> <deepspacejohn> @rongcuid it is by some people. For others the stdlib is fine. Theres not a “right” answer to that. I’d personally suggest that if you don’t know if you need the features in Base then just stick to stdlib.
<discocaml> <rongcuid> I am reading real world ocaml
<discocaml> <deepspacejohn> In that case it makes sense to use Base to follow along with it. A lot of “real world” projects just use the stdlib too though.
torretto has quit [Remote host closed the connection]
<discocaml> <yawaramin> Base is a more portable version of Core. some Jane Street libraries, like Async, don't work on Windows
torretto has joined #ocaml
<discocaml> <rongcuid> It seems like ocaml has no type classes. How are "interfaces" generally implemented, then?
<discocaml> <mbacarella> if you know the names of the base stations ahead of time you can do minimal perfect hashing and then you run in O(n) simply updating a giant array
<discocaml> <mbacarella> if not, you do a fair bit of heap alloc and heap traversal but nothing out of the ordinary wrt other languages
<discocaml> <octachron> @rongcuid , you don't need type classes to implement interfaces (or module types). Type classes are useful for *composing* interfaces. For that, OCaml has functions or functors depending on the level of complexity.
jabuxas_ has quit [Ping timeout: 268 seconds]
<discocaml> <rongcuid> Ok. I'll need to look at some design patterns
<Anarchos> deepspacejohn i prefer to stick to Stdlib to be sure that my code will compile even if external libs are not supported anymore
dnh has joined #ocaml
<Anarchos> wow the ocaml lexer is really complicated
<Anarchos> i don't remember if the dragonbook exposes the way to deal with commetns in the lexer as ocaml does it
bartholin has joined #ocaml
<dh`> ocamlyacc is a clone of traditional yacc almost to the point of bug compatibility, but ocamllex is its own thing
<dh`> or do you mean the ocaml compiler's specific lexer?
<dh`> either way, production lexers tend to be huge messes
waleee has joined #ocaml
Tuplanolla has joined #ocaml
myrkraverk has quit [Ping timeout: 268 seconds]
<discocaml> <contextfreebeer> Anarchos: dragon book is largely theoretical
<discocaml> <contextfreebeer> I'm also curious if you're talking about the lexer for OCaml or not, doesn't seem terribly complicated, it uses the standard type of technique of introducing a new start state which in ocamllex would be a recursive call, ocamllex in general definitely has issues though
myrkraverk has joined #ocaml
<Anarchos> dh` yes i spoke about the compiler lexer
<Anarchos> contextfreebeer what puzzles me is the COMMENT token in ocaml/parsing/parser.mly
Anarchos has quit [Quit: be back later]
torretto_ has joined #ocaml
torretto has quit [Ping timeout: 260 seconds]
Anarchos has joined #ocaml
Anarchos has quit [Read error: Connection reset by peer]
<discocaml> <hockletock> ocaml has very weird comments honestly
<discocaml> <hockletock> I don't know another language that imposes requirements on comment contents beyond "you must terminate them" - but in ocaml, `(* " *)` is illegal (unterminated string) as is `(* (* *)` - nested comments have to be terminated, it won't just take the outermost pair of start/end tokens
<discocaml> <hockletock> I can't see what it does with the comment_start_locs other than use them to report unterminated comments
<discocaml> <leviroth> I think lisp also does this
<discocaml> <._null._> Rust also has this
<discocaml> <._null._> The reason is that you can comment any valid OCaml code by wrapping it with `(*` and `*)` and it will still be valid code
<discocaml> <hockletock> lord knows I've put triple single quotes around python code with triple double quote docstrings enough times I should be grateful
Anarchos has joined #ocaml
<discocaml> <jurynullification> hello!
motherfsck has quit [Ping timeout: 252 seconds]
motherfsck has joined #ocaml
<Anarchos> how can i help to get a native compiler back on a plateform ?
a51 has quit [Quit: WeeChat 4.2.1]
<dh`> working nested comments is a feature, not a bug
bartholin has quit [Quit: Leaving]
<dh`> though it's a nuisance to implement
<Anarchos> dh` look how they are parsed in the source of the ocaml compiler ?
Serpent7776 has quit [Ping timeout: 255 seconds]
<dh`> I see COMMENT listed as a token in the parser, but it doesn't appear in any of the grammar rules
<Anarchos> dh` i have same troubles to understand that for 2 days, and even ask that today here :)
<Anarchos> the trick is that lexer.mll accumulates comments in its comment_list
<Anarchos> and there is a comment_level counter too
<dh`> my guess is that the lexer suppresses them before they get to the parser
<dh`> which is what you would expect, adding comments to your grammar by hand is a horrorshow
<dh`> but they're in the token enumeration so that the lexer can do this in some semi-convenient way
<Anarchos> the token enumeration is mandatory cause your lexer rule must return a token
<Anarchos> but COMMENT is not used anywhere in parser.mly
<dh`> if you're going to have nested comments, a state-machine-based lexer can't cope, so you need to either use a stronger lexer model or remove comments downstream
<dh`> ocamllex does have a stronger lexer model though so idk
<Anarchos> dh` look at wrap_comment_lexer in ocaml/parsing/lexer.mll
<Anarchos> comments are dealed by side-effects of rules linked to the ghost token COMMENT
<dh`> yes, as I was saying they're removed downstream by the lexer
<Anarchos> no removed, just stored
<Anarchos> and cmt_format.ml uses them
<dh`> they are removed from the token stream
<dh`> nothing uses the copy in cmt_format.ml, though (that I can see)
<dh`> anyway, there you have it
<Anarchos> dh` look for «Lexer.comments()» call
<dh`> i'm not sure what you're confused about
<Anarchos> dh` i was just answering your questions ! i am not confused
Anarchos has quit [Quit: Vision[]: i've been blurred!]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]