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…]