chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #ocaml
<discocaml>
<shoebum_kumar> where can I ask questions about eio?
chiselfuse has quit [Ping timeout: 260 seconds]
chiselfuse has joined #ocaml
<discocaml>
<JM> There is no eio specific channel, so here is a good place to start. That would also allow whoever is using the IRC bridge to chime it.
* mbuf
Reminder: OCaml Sequences module Twitch stream starting in an hour's time, today, Monday, April 29, 2024 at 2000 IST | 1630 CEST | 1530 GMT https://www.twitch.tv/shakthimaan
<discocaml>
<shoebum_kumar> ok cool! so my problem is I want to create a repl using Eio and I want inputs to have a specific format and output to have a specific format using stdin and stdout from the `Stdenv` helps but I cannot modify the string.
<discocaml>
<shoebum_kumar> I need to format the former part
<discocaml>
<._null._> Please don't post long code blocks, the bridge to IRC doesn't like them
ocra8 has quit [Quit: WeeChat 4.2.2]
Serpent7776 has quit [Ping timeout: 264 seconds]
<discocaml>
<shoebum_kumar> Noted
<discocaml>
<contextfreebeer> is it possible to inline calls to foreign functions?
jabuxas has quit [Ping timeout: 256 seconds]
<discocaml>
<shoebum_kumar> Found the solution
<discocaml>
<shoebum_kumar> I had to add a printf before reading the stdin
<discocaml>
<contextfreebeer> reading through the FFI section of the manual there doesn't look like there is any way to achieve this, I think the linker is in the best position to do this but AFAICT `ld` doesn't offer this option, nor any other major linker for that matter
<dh`>
there is some kind of link-time-optimization plugin interface in at least gnu ld that you could misuse for that
<dh`>
but it would require support in the foreign library
<dh`>
and since FFI calls are usually going to be into shared libraries it isn't going to be very workable anyway
<discocaml>
<contextfreebeer> yeah, pass on that one, I was mainly just curious
<discocaml>
<contextfreebeer> it would be nice to have some kind of support for inline assembly, I saw an open PR + a talk about an implementation of that, unsure of the status or whether people generally want that in the compiler though
<discocaml>
<contextfreebeer> hmm, the containing function is not super complicated though and the compiler chooses not to inline it, could just implement all of it in an external function, it doesn't allocate so I think the overhead should end up being exactly the same? I've been meaning to learn more about the FFI anyway so it's a worthwhile exercise even if I decide not to use it
tri has quit [Ping timeout: 256 seconds]
prgbln has quit [Changing host]
prgbln has joined #ocaml
chiselfuse has quit [Read error: Connection reset by peer]
chiselfuse has joined #ocaml
tri has joined #ocaml
tri has quit [Ping timeout: 260 seconds]
jabuxas has joined #ocaml
ocra8 has joined #ocaml
jabuxas has quit [Ping timeout: 256 seconds]
bartholin has joined #ocaml
<discocaml>
<_shakky> hello guys
<discocaml>
<_shakky> i'm learning ocaml not very hard level
<discocaml>
<_shakky> i need someone to help me with a function to understand how it works
<discocaml>
<_shakky> step by step, if someone wants to help me come dms, thx in advance it's about binary tree i don't think it's super hard im stuck cuz i'm not good with recursivity
<discocaml>
<._null._> Ask the question here directly (but don't paste code blocks)
<discocaml>
<_shakky> what is code blocks ?
<discocaml>
<_shakky> i can screen ? wdym
<discocaml>
<_shakky> i can screenshot ? wdym
<discocaml>
<._null._> Don't copy paste too much code, the bridge doesn't like it
<discocaml>
<._null._> Or go to #beginners
<discocaml>
<_shakky> about 10 lines
<discocaml>
<_shakky> of code
<discocaml>
<_shakky> short lines
<discocaml>
<_shakky> is that too much ?
<discocaml>
<_shakky> oh yeah i can go there if you want
<discocaml>
<._null._> Too many lines, yes. Go to the other channel, it will be fine there
tri has joined #ocaml
tri has quit [Ping timeout: 252 seconds]
Serpent7776 has joined #ocaml
tri has joined #ocaml
mbuf has quit [Quit: Leaving]
tri has quit [Ping timeout: 255 seconds]
_whitelogger has joined #ocaml
adrien has joined #ocaml
adrien has quit [Client Quit]
adrien has joined #ocaml
tri has joined #ocaml
tri has quit [Ping timeout: 240 seconds]
rgrinberg has joined #ocaml
waleee has joined #ocaml
tri has joined #ocaml
tri has quit [Ping timeout: 272 seconds]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<discocaml>
<regularspatula> Is all the magic in the Lazy module to make it fast or to get around some type checking limitations or something like that?
<discocaml>
<octachron> Only for optimisation's sake. Otherwise, you can reimplement `Lazy` yourself without troubles.
rgrinberg has joined #ocaml
<discocaml>
<regularspatula> Thanks. I like this quote in the file: WARNING: some purple magic is going on here. Do not take this file as an example of how to program in OCaml."
<discocaml>
<octachron> Basically, the runtime tries to represent a forced `Lazy.t` as the computed value without any indirection.
<discocaml>
<regularspatula> I see, thanks
ocra8 has quit [Quit: WeeChat 4.2.2]
ocra8 has joined #ocaml
bartholin has quit [Quit: Leaving]
Serpent7776 has quit [Ping timeout: 246 seconds]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tri has joined #ocaml
tri has quit [Ping timeout: 252 seconds]
<companion_cube>
Controversial opinion: lazy is mostly useless now :p
<companion_cube>
It's not thread safe, we need a thread safe alternative