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/
Tuplanolla has quit [Quit: Leaving.]
<companion_cube> (which is good, global state is terrible)
zebrag has quit [Quit: Konversation terminated!]
jao has quit [Remote host closed the connection]
jao has joined #ocaml
Haudegen has quit [Ping timeout: 265 seconds]
zebrag has joined #ocaml
xgqt has quit [Ping timeout: 244 seconds]
xgqt has joined #ocaml
waleee has quit [Ping timeout: 264 seconds]
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #ocaml
chrisz has quit [Ping timeout: 252 seconds]
zebrag has quit [Quit: Konversation terminated!]
chrisz has joined #ocaml
xgqt has quit [Ping timeout: 268 seconds]
xgqt has joined #ocaml
hrberg has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
hrberg has joined #ocaml
jao has quit [Ping timeout: 252 seconds]
mbuf has joined #ocaml
bartholin has joined #ocaml
mro has joined #ocaml
Haudegen has joined #ocaml
wonko has joined #ocaml
foldright has joined #ocaml
dnh has joined #ocaml
mro has quit [Remote host closed the connection]
wonko has quit [Ping timeout: 250 seconds]
spip has quit [Read error: Connection reset by peer]
spip has joined #ocaml
mro has joined #ocaml
Serpent7776 has joined #ocaml
foldright has quit [Quit: leaving]
Tuplanolla has joined #ocaml
orbifx has joined #ocaml
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
szkl has quit [Quit: Connection closed for inactivity]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
olle has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
jpds has quit [Remote host closed the connection]
<dh`> companion_cube: lex is terrible. states in state machines per se, not so much :-p
jpds has joined #ocaml
waleee has joined #ocaml
jpds has quit [Quit: WeeChat 3.5]
mro has quit [Remote host closed the connection]
xgqt has quit [Ping timeout: 265 seconds]
xgqt has joined #ocaml
dnh has joined #ocaml
<olle> 10 | (menhir
<olle> 11 | (modules parser docblockparser))
<olle> Error: No rule found for lib/docblockparser.mly
<olle> Wanted to do two parsers
<olle> My dreams are crushed - forever
<olle> What's the rule? Is it a dune problem or a menhir problem?
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…]
dnh has joined #ocaml
zebrag has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Ping timeout: 264 seconds]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnh has joined #ocaml
<olle> File name error >< omg
<olle> Ehm, is there another way to call a parser than with a linebuf?
<olle> I already have the token list
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mro has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
jao has joined #ocaml
zebrag has joined #ocaml
mro has quit [Remote host closed the connection]
orbifx has quit [Quit: orbifx]
mro has joined #ocaml
Anarchos has joined #ocaml
dnh has joined #ocaml
waleee has quit [Ping timeout: 246 seconds]
Anarchos has quit [Ping timeout: 265 seconds]
<olle> And now I have an infinite loop lol
mro has quit [Remote host closed the connection]
mro has joined #ocaml
pippijn_ is now known as pippijn
bobo_ has joined #ocaml
spip has quit [Ping timeout: 260 seconds]
<olle> Error: docblock generates the language {epsilon}.
<olle> Gah
<olle> ????
mbuf has quit [Quit: Leaving]
mro has quit [Remote host closed the connection]
jao has quit [Ping timeout: 252 seconds]
jao has joined #ocaml
<olle> Can I upgrade my OCaml version in OPAM without a switch...?
<olle> Or do I have to do a switch everytime a new OPAM version is available?
<companion_cube> is it the 'system' switch?
<olle> → default ocaml-system.4.08.1 default
<olle> Yeah
<companion_cube> then your distro should upgrade OCaml?
<olle> Description: Ubuntu 20.04.5 LTS
<olle> Meh
<olle> Trying opam switch
mro has joined #ocaml
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<olle> 00:08.694 CLIENT conflict!
<olle> Sorry, no solution found: there seems to be a problem with your request.
<olle> Not my lucky day today
<companion_cube> create a new switch?
<olle> I'm already on → 4.14.0 ocaml-base-compiler.4.14.0 4.14.0
<olle> let d = Seq.to_dispenser (List.to_seq l) in <--- Can someone rewrite this in 4.08 compatible code? ;(
<sim642> You could just copy the bits from newer stdlib sources
<olle> Hmmmmm
qwr has quit [Ping timeout: 252 seconds]
<olle> Checking
<sim642> Although at that point you might as well skip the Seq
<sim642> And just write a list_to_dispenser function directly
<olle> Don't have the skill
<olle> But I can copy-paste it from src
<sim642> Would be a good exercise then
<sim642> to_seq is creating a Seq and to_dispenser is pattern matching it
<sim642> So the two functions could be fused to avoid going through Seq, just pass the variables directly and inline some code
<olle> Exercise?
<olle> I'm not hear to learn! xD
<sim642> And it will be more efficient because it doesn't allocate all those intermediate objects
<olle> here*
<companion_cube> what's a dispenser?
<olle> My question too lmao
qwr has joined #ocaml
<olle> Type token Seq.node is not compatible with type 'a node
<olle> Bound to happen
<sim642> You don't need to copy the definition of Seq.t
<sim642> companion_cube, Java-style iterator
<sim642> a stateful `unit -> 'a`
<olle> sim642: to_disponser returns Cons, which includes t
<companion_cube> ah. which library?
<olle> dispenser*
<sim642> companion_cube, the standard one :D
<sim642> My bad, it's `'a option` at the end, but the idea is the same
<companion_cube> ahhhhh yes, it's the newer Seq functions. I forgot François had picked this name.
<companion_cube> I call this "gen".
<sim642> olle, I guess you could use to_gen from oseq then as well
<sim642> I looked at the docs quickly before and didn't see to_dispenser so I thought it didn't have that
mro has quit [Remote host closed the connection]
mro has joined #ocaml
<olle> sim642: does oseq consume a list?
<olle> OSeq.from_list
<olle> of_list perhaps
<olle> Yep
bartholin has quit [Quit: Leaving]
<olle> Meh, piece still not fitting together, with the second parser
<olle> So hard
mro has quit [Remote host closed the connection]
mro has joined #ocaml
<olle> Hm hm
<companion_cube> tbh, just parse the comment as a string, and parse it later
<companion_cube> it'll be 10× simpler
Anarchos has joined #ocaml
<olle> companion_cube: Yes, started to think about alternatives... :d Like hard-coding the few grammar rules in the lexer instead
<olle> But now it runs... Just have to tune the grammar
dstein64- has joined #ocaml
<olle> Also, pretty cool to know how to piece together multiple DSL :D
<olle> Ya of course the grammar is incorrect :d
<olle> I hate that it can't be debugged, like "you gave me token stream x but I expected y"
dstein64- has quit [Client Quit]
dstein64 has quit [Ping timeout: 252 seconds]
dstein64 has joined #ocaml
<olle> Getting "option is None", so maybe the token provider didn't work exactly :|
<olle> Another alternative is to add state, like state = Inside_docblock, which changes the lexer behaviour
<olle> Yet another, to write the parsing of the token stream manually, without the mly file
<olle> 2 | (libraries base stdio str re dolog expect_test_helpers_kernel oseq menhir) ^^^^^^
<olle> Error: Library "menhir" not found.
<olle> olle@olle-GP60-2PF-Leopard-Pro:~/kod/pholyglot/src$ opam list | grep menhir
<olle> menhir 20220210 An LR(1) parser generator
<olle> It's installed x.x
sagax has quit [Remote host closed the connection]
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
<olle> companion_cube: Oh, maybe you mean, save as a string, and then apply a completely separate lexer+parser on-demand in the compiler during, say, inference? Might be easier...
Haudegen has joined #ocaml
<olle> No wiat
<olle> Now I get it xD
sagax has joined #ocaml
waleee has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
bobo_ has quit [Ping timeout: 246 seconds]
spip has joined #ocaml
<olle> Hm, how do I tell ocamllex to eat all chars until the string "*/"? [^ '*'] only works for single chars :d
<olle> Oh, maybe just 47 | "/**" (digit|nondigit)* as s "*/" { DOCBLOCK_AS_STR s }
<olle> is enough
<olle> or _*
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Ping timeout: 265 seconds]
<olle> Alright, got a working solution with two seperate lexer/parser systems
<olle> \o/
<olle> Now I can sleep
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
Anarchos has joined #ocaml
Serpent7776 has quit [Ping timeout: 268 seconds]
dnh has joined #ocaml
olle has quit [Ping timeout: 250 seconds]
Anarchos has quit [Quit: Vision[]: i've been blurred!]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Haudegen has quit [Ping timeout: 265 seconds]
Tuplanolla has quit [Quit: Leaving.]
wonko has joined #ocaml
mro has quit [Remote host closed the connection]
zebrag has quit [Quit: Konversation terminated!]
wonko has quit [Ping timeout: 268 seconds]