companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.14.0 released: https://ocaml.org/releases/4.14.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
Serpent7776 has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
waleee has joined #ocaml
Serpent7776 has quit [Ping timeout: 264 seconds]
waleee has quit [Ping timeout: 265 seconds]
Tuplanolla has quit [Quit: Leaving.]
waleee has joined #ocaml
waleee has quit [Ping timeout: 265 seconds]
jao has quit [Remote host closed the connection]
jao has joined #ocaml
waleee has joined #ocaml
adanwan_ has quit [Ping timeout: 258 seconds]
adanwan has joined #ocaml
adanwan has quit [Ping timeout: 258 seconds]
adanwan has joined #ocaml
Haudegen has quit [Ping timeout: 260 seconds]
adanwan has quit [Remote host closed the connection]
adanwan_ has joined #ocaml
kandu_ has quit [Ping timeout: 240 seconds]
waleee has quit [Ping timeout: 268 seconds]
kotrcka has joined #ocaml
chrisz has quit [Ping timeout: 268 seconds]
chrisz has joined #ocaml
jpds1 has quit [Remote host closed the connection]
jpds1 has joined #ocaml
kotrcka has quit [Remote host closed the connection]
Everything has quit [Quit: leaving]
jao has quit [Ping timeout: 252 seconds]
Dimonax has quit [Quit: Leaving]
bartholin has joined #ocaml
bartholin has quit [Quit: Leaving]
orbifx has joined #ocaml
adanwan_ has quit [Ping timeout: 258 seconds]
adanwan has joined #ocaml
Haudegen has joined #ocaml
Serpent7776 has joined #ocaml
Serpent7776 has quit [Ping timeout: 250 seconds]
olle has joined #ocaml
bobo_ has quit [Read error: Connection reset by peer]
bobo_ has joined #ocaml
dnh has joined #ocaml
orbifx has quit [Quit: orbifx]
Tuplanolla has joined #ocaml
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnh has joined #ocaml
gopiandcode has quit [Quit: WeeChat 3.0]
zebrag has joined #ocaml
perrierjouet has quit [Quit: WeeChat 3.6]
perrierjouet has joined #ocaml
Serpent7776 has joined #ocaml
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnh has joined #ocaml
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
waleee has joined #ocaml
dnh has joined #ocaml
jao has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
jao has quit [Remote host closed the connection]
jao has joined #ocaml
<cizra> ski: Yea... It was a vastly overengineered way of representing all combos of +, * and () between 3 variables. It would've been much, much easier to just list all the 8 or so variants as actual math expressions like [ a+b+c; a*b*; ...].
<ski> cizra : and the (lack of) recursiveness ?
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnh has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
<David[m]123> Anyone have an idea of the current state of support for effects and multicore in js_of_ocaml or melange.re?
mro has joined #ocaml
mro has quit [Remote host closed the connection]
bartholin has joined #ocaml
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnh has joined #ocaml
<olle> Damn
<olle> Hacklang rewrote their system in Rust
<olle> From OCaml
mro has joined #ocaml
<olle> Horrible
mro has quit [Remote host closed the connection]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnh has joined #ocaml
mro has joined #ocaml
<olle> Hmm
<olle> Need help with Menhir
<olle> I need to produce a second section of the lexer which parses so called docblocks in PHP
<olle> /** @param array<int> $ints */ as an example
<olle> Hmm
<olle> OK, maybe it works :)
<olle> Nope
<olle> Seems like it jumps back to the main lexer rule, but I don't know why :d
<olle> Oh, it returns to the main instead of being recusrive >< %$#$%@#
<olle> But:
<olle> "The rules are recursive: once it matches a token, it calls itself to start over and match the next token"
<olle> Missing something
<companion_cube> Are you talking about ocamllex?
mro has quit [Ping timeout: 248 seconds]
<olle> companion_cube: No, Menhir
<companion_cube> Hmm that's a weird sentence, all recursion in menhir is explicit?
<olle> companion_cube: Yeah??
<olle> Damn
<olle> That's the line. I want to keep parsing the docblock, not go back to main parser "token"
<companion_cube> This is ocamllex
<companion_cube> I suggest you take a look at how ocamlc does it :-)
<olle> Myeh
<companion_cube> Here you're just returning a token, if you want to return the whole docstring as one token you need to recurse
<companion_cube> Line 144 and 287
<olle> Isn't that horribly complicated compared to the automatic recursion??
CalimeroTeknik has quit [Quit: バイバイ]
midgard has quit [Quit: Bye]
midgard has joined #ocaml
CalimeroTeknik has joined #ocaml
<olle> companion_cube: The comment use-case does not apply, because I actually want to add tokens to the token stream, not return unit
<companion_cube> There is no automatic recursion, idk where this comes from
mro has joined #ocaml
<olle> :)
<companion_cube> The only "automatic" recursion is that the parser will call the main entry point repeatedly when it wants the next token
<olle> Hmmm
<olle> companion_cube: So it's impossible to make a DSL on lexer level? It's a parser thing rather?
<companion_cube> The parser uses only one main lexer, yes
<companion_cube> You can do dirty tricks, of course. For example setting a reference that points to the currently active lexer. When you enter a comment you swap the main lexer for the comment lexer. It's ugly.
<olle> companion_cube: Yeah, but one "rule" in the lexer can correspond to a DSL, no?
<olle> Because "<" and ">" means different things in the DSL, semantically
<olle> It's never a comparison, always a "generic" notation like array<int>
<olle> And there are lots of things to be ignored, all lines starting with '*' not followed by '@param' or '@return'
mro has quit [Read error: Connection reset by peer]
mro_ has joined #ocaml
<olle> OK, so I'm adding a "result" param to the extra rule to collect tokens :d
<companion_cube> Yeah that's a solution
<olle> Now I just have to tell menhir that the call is a list of token, not a single token :P
<olle> Error: This expression has type token list but an expression was expected of type token
midgard has quit [Quit: Bye]
CalimeroTeknik has quit [Quit: バイバイ]
<companion_cube> You can't parse it with the same parser
<companion_cube> I think
midgard has joined #ocaml
<olle> Goddamnit ><
<olle> Maybe just take a shower instead
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
spip has joined #ocaml
bobo_ has quit [Ping timeout: 268 seconds]
<olle> Maybe I can make a token that takes a token list... %token <token list> DOCBLOCK
CalimeroTeknik has joined #ocaml
CalimeroTeknik has quit [Changing host]
CalimeroTeknik has joined #ocaml
<olle> START_SCRIPT DOCBLOCK ( DOCBLOCK_PARAM ARRAY_TYPE LT INT_TYPE GT NAME $ints) FUNCTION NAME foo LPAREN ARRAY_TYPE AMPERSAND DOLLAR NAME ints RPAREN COLON VOID_TYPE LBRACE RBRACE
<olle> Hooray!
<dh`> hmm
<dh`> what are you trying to do? sorry I didn't pop up earlier
* olle bbl
<dh`> ah, doc strings
<dh`> I don't think ocamllex is intended to be able to do that
<olle> menhir, in this case
<dh`> it is the lexer that's the issue, unless I'm totally misunderstanding
<dh`> traditional lex has top-level states and ocamllex doesn't
qwr has quit [Ping timeout: 268 seconds]
qwr has joined #ocaml
bartholin has quit [Quit: Leaving]
<olle> Hm
jpds1 has quit [Ping timeout: 258 seconds]
jpds1 has joined #ocaml
mro_ has quit [Quit: Leaving...]
jpds1 is now known as jpds
Serpent7776 has quit [Ping timeout: 248 seconds]
gentauro has quit [Read error: Connection reset by peer]
gentauro has joined #ocaml
qwr has quit [Ping timeout: 252 seconds]
qwr has joined #ocaml
jpds has quit [Ping timeout: 258 seconds]
jpds has joined #ocaml
olle has quit [Ping timeout: 265 seconds]