Leonidas changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.13.0 released: https://ocaml.org/releases/4.13.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
szkl has joined #ocaml
waleee has quit [Ping timeout: 260 seconds]
waleee has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
waleee has quit [Ping timeout: 260 seconds]
waleee has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
waleee has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
waleee has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
waleee has joined #ocaml
waleee has quit [Ping timeout: 260 seconds]
waleee has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
waleee has joined #ocaml
shebang has quit [Quit: WeeChat 3.4.1]
Haudegen has quit [Ping timeout: 268 seconds]
waleee has quit [Ping timeout: 260 seconds]
waleee has joined #ocaml
waleee has quit [Ping timeout: 256 seconds]
tizoc has quit [Quit: Coyote finally caught me]
waleee has joined #ocaml
tizoc has joined #ocaml
waleee has quit [Ping timeout: 256 seconds]
waleee has joined #ocaml
mbuf has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
waleee has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
waleee has joined #ocaml
notnotdan has quit [Quit: bye]
waleee has quit [Ping timeout: 240 seconds]
waleee has joined #ocaml
zebrag has quit [Quit: Konversation terminated!]
gravicappa has joined #ocaml
troydm has quit [Ping timeout: 250 seconds]
bartholin has joined #ocaml
szkl has quit [Quit: Connection closed for inactivity]
mro has joined #ocaml
namkeleser has joined #ocaml
Serpent7776 has joined #ocaml
mro has quit [Remote host closed the connection]
bartholin has quit [Ping timeout: 240 seconds]
perrierjouet has quit [Quit: WeeChat 3.4.1]
perrierjouet has joined #ocaml
bartholin has joined #ocaml
Tuplanolla has joined #ocaml
gdd has quit [Ping timeout: 260 seconds]
wyrd has quit [Remote host closed the connection]
Haudegen has joined #ocaml
wyrd has joined #ocaml
Everything has joined #ocaml
dextaa_ has joined #ocaml
bartholin has quit [Ping timeout: 272 seconds]
bartholin has joined #ocaml
mbuf has quit [Ping timeout: 256 seconds]
gdd has joined #ocaml
gravicappa has quit [Ping timeout: 272 seconds]
mro has joined #ocaml
infinity0 has quit [Remote host closed the connection]
bobo has quit [Ping timeout: 240 seconds]
infinity0 has joined #ocaml
bobo has joined #ocaml
bartholin has quit [Ping timeout: 272 seconds]
bartholin has joined #ocaml
mbuf has joined #ocaml
mbuf has quit [Remote host closed the connection]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro_ has joined #ocaml
mro has quit [Ping timeout: 256 seconds]
Everything has quit [Quit: leaving]
namkeleser has quit [Quit: Client closed]
bartholin has quit [Ping timeout: 260 seconds]
wyrd has quit [Remote host closed the connection]
wyrd has joined #ocaml
mro_ has quit [Remote host closed the connection]
bartholin has joined #ocaml
gravicappa has joined #ocaml
dextaa_ has quit [Remote host closed the connection]
jonasbits has quit [Ping timeout: 268 seconds]
jonasbits has joined #ocaml
Absalom has quit [Quit: the lounge - https://webirc.envs.net]
Absalom has joined #ocaml
<d_bot> <eokd7> Hi everyone, I am an Outreachy applicant and looking forward to learn a lot about OCAML and contribute immensely to the project I am on. I will be asking for your support and help with any difficulties I might have. Thank you
<dmbaturin> Please note that the official styling is OCaml. :)
<d_bot> <eokd7> Noted😊
bartholin has quit [Ping timeout: 272 seconds]
bartholin has joined #ocaml
troydm has joined #ocaml
quartz has joined #ocaml
<quartz> Hello. I'm trying to implement python like indentation in my compiler. I'm using this sample code as a reference, but I'm confused on how they did it. can someone explain to me how they implemented indentation? https://bpa.st/YOOQ
<d_bot> <NULL> The parser has the easy job when it comes to detecting indentation, it just learns when an indentation or a dedentation happens from the lexer
<d_bot> <NULL> It doesn't detect indentation, it just interprets it
<quartz> But where in the code that I posted does this happen?
<sleepydog> it has already happened at this point
<d_bot> <NULL> The part where indentation is interpreted is everywhere IDENT and DEDENT appear
<sleepydog> there is a lexer that decides what an indentation is
<d_bot> <NULL> As sleepydog says, the part where indentation is detected is in the lexer, earlier in the chain
<sleepydog> python lets devs choose to use any # of spaces or a tab for indentation, so i imagine that part is complicated for python
<sleepydog> but the lexer would have to keep track of the current level of indentation to detect when a dedent happens. maybe in a global variable
<sleepydog> ident too, i guess. i dislike significant whitespace :)
<quartz> Hmmmm OK
<d_bot> <NULL> If you do it the FP way, it would be an additional argument in the lexer function, this way it's not mutable
<quartz> Hmmm OK let me try to find the file where they implement the lexer
<d_bot> <NULL> Look for a mll file
<quartz> They only have .ml and .mly files
<d_bot> <NULL> Then the lexer isn't generated through ocamllex, so I guess look for "lexer" or something
<quartz> Oh there's one mll called scanner.mll
<sleepydog> sounds promising
<quartz> I'm assuming that lines 52 and 54 are where they implement it? https://bpa.st/MU6Q
xgqt has quit [Read error: Connection reset by peer]
<sleepydog> the rule on line 120
<quartz> Uhhh
<d_bot> <NULL> Using `(==)` on ints, not a good idea
<sleepydog> NULL: would that ever give an unexpected result? or does it just thwart certain optimizations?
Anarchos has joined #ocaml
<d_bot> <NULL> It compares the underlying thing the variable holds (so it could be a pointer), but since it's an int it should behave as expected (since they are stored exactly as ints, just shifted)
xgqt has joined #ocaml
<d_bot> <NULL> Also, it uses queues so not as "pure" as I'd do it
<quartz> What do you guys use OCaml for?
<Anarchos> quartz i develop a formal mathematical demonstration verifier
<quartz> sleepydog: Can you tell me why line 105 implements python like indentation
<quartz> Anarchos: Is that a project for your job or just a personal project?
<Anarchos> quartz a personal one
<d_bot> <mbacarella> I'm generally pretty intimidated when I hear what other people use ocaml for. Most of my career the answer is something like system monitoring or compliance archiving
<d_bot> <mbacarella> Extremely typesafe rsync wrappers
rond_ has joined #ocaml
<quartz> Sorry to ask again, but I'm not sure how line 105 of this code implements a python like indentation for a compiler when it has FLOAT_LITERAL in the code: https://bpa.st/MU6Q
<d_bot> <NULL> There's no indentation information related to a float literal, so why should there be INDENT or DEDENT there ?
<quartz> yeah good point. I was just following up on what sleepydog suggested, that's all.
bartholin has quit [Ping timeout: 252 seconds]
<quartz> So they actually implement python indentation in lines 52 and 54? it seems they wrote a simple recrusive function that adds DEDENT or INDENT to a queue?
<d_bot> <NULL> As sleepdog said, the core of the implementation is at lines 120 and following
<quartz> omg
<quartz> Wow I need some sleep, I saw 105 for some reason
<quartz> I've literally been up all night lol and this is what happens
<quartz> sleepydog: Thanks for pointing that out
bartholin has joined #ocaml
quartz has quit [Quit: WeeChat 3.4]
rond_ has quit [Quit: Client closed]
rgrinberg has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
rgrinberg has quit [Ping timeout: 240 seconds]
bartholin has quit [Ping timeout: 260 seconds]
mro has joined #ocaml
mro has quit [Client Quit]
bartholin has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
gravicappa has quit [Ping timeout: 252 seconds]
waleee has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wyrd has quit [Ping timeout: 240 seconds]
wyrd has joined #ocaml
Serpent7776 has quit [Quit: leaving]
spip has joined #ocaml
bobo has quit [Ping timeout: 260 seconds]
bartholin has quit [Quit: Leaving]
rawley has joined #ocaml