AnAverageHuman has quit [Ping timeout: 256 seconds]
sonologico has joined #ocaml
jao has quit [Ping timeout: 255 seconds]
sonologico has quit [Remote host closed the connection]
JimmyRcom has quit [Ping timeout: 246 seconds]
JimmyRcom has joined #ocaml
nikivi has joined #ocaml
bartholin has joined #ocaml
FreeBirdLjj has joined #ocaml
orbifx has joined #ocaml
Haudegen has joined #ocaml
funkatronixxx has joined #ocaml
orbifx has quit [Ping timeout: 244 seconds]
kalio has quit [Ping timeout: 272 seconds]
kalio has joined #ocaml
AxiomaticEspress has joined #ocaml
keep_learning_M has quit [Quit: This computer has gone to sleep]
bartholin has quit [Ping timeout: 245 seconds]
funkatronixxx has quit [Quit: WeeChat 2.3]
bartholin has joined #ocaml
keep_learning_M has joined #ocaml
asymptotically has joined #ocaml
keep_learning_M has quit [Client Quit]
dhil has joined #ocaml
mfp has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 272 seconds]
Haudegen has quit [Remote host closed the connection]
silver has joined #ocaml
webshinra has joined #ocaml
Haudegen has joined #ocaml
jao has joined #ocaml
themsay has quit [Read error: Connection reset by peer]
themsay has joined #ocaml
dhil has quit [Ping timeout: 246 seconds]
kakadu_ has joined #ocaml
kakadu has quit [Ping timeout: 246 seconds]
dhil has joined #ocaml
aiowej has joined #ocaml
<aiowej>
Hi! I want to learn how to implement a compiler for a language like ML, but purely functional, really nothing more than a typed lambdacalc with pattern matching and union types. I already know how to type check, but am stuck on how to create the actual output. Looking to output something like C++, Rust, or LLVM IR, i.e. no closures. Maybe should do CPS? Anyways, my question is this: what book do you recommend for someone who
<aiowej>
just-wants-to-get-it-done, compiling a pure lambda language to C/LLVM?
<def`>
Andrew Appel modern compiler implementation in ML? You can just skip the lower level parts.
cantstanya has quit [Remote host closed the connection]
<def`>
(And imho, producing C++, Rust or LLVM IR will just make things more complex, stick to C, it is portable)
cantstanya has joined #ocaml
<aiowej>
def`: thank you! I know his book Compiling with Continuations, which is cool, but being 1/3 through it I'm not sure it has all the answers (or I'm a dum dum). Will check the book out. There are some data structures implemented for both C++ and Rust I want in my stdlib
<aiowej>
def`: if you have read both books, I would love to heard what valuable knowledge is available in Modern Compiler Implementation in ML as compared to Compiling with Continuation. Many thanks
<aiowej>
:s/heard/hear
aiowej has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
spew has joined #ocaml
AnAverageHuman has joined #ocaml
<Leonidas>
wow, 'Illegal permutation of structure fields' when I attempt to PPX generate signatures :(
<Drup>
eh, that's a fun one
<Drup>
it's quite challenging to trigger
<def`>
:D
<Leonidas>
I managed to do that with a `module type` in an ml and the same `module type` in an mli
<Drup>
exactly the same one ?
ollehar has joined #ocaml
<Leonidas>
no, the ml had the same sig defined a second time, redundantly
<Leonidas>
I found an 18 year old discussion on caml-list about this error, quite impressive. Markus Mottl was around back then already
<octachron>
Normally, module types cannot be defined twice?
<Leonidas>
octachron: I am a bit annoyed by this myself, because it is now 100% code duplication. Maybe I should just move it into an _impl module
<octachron>
You are generating the mli and ml files in completely different phases?
<Drup>
that shouldn't be a problem, as long as they are the same
ygrek has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 250 seconds]
<Leonidas>
octachron: no, my issue was that I had the type in the ml file with a manual definition, why in the mli I just let my deriving plugin generate it.
<Leonidas>
and this seems to generate subtly different things since ppxlib.deriver wraps these generated signatures in a sig that it then includes ¯\_(ツ)_/¯
AnAverageHuman has quit [Ping timeout: 256 seconds]
jao has quit [Ping timeout: 245 seconds]
jao has joined #ocaml
jao has quit [Ping timeout: 252 seconds]
q9929t has joined #ocaml
shakalaka has joined #ocaml
q9929t has quit [Quit: q9929t]
Jesin has quit [Quit: Leaving]
freyr69 has joined #ocaml
Jesin has joined #ocaml
<spew>
what ppx is this?
<Leonidas>
spew: my own
<Leonidas>
that I'm writing
<Leonidas>
which is why I didn't use the signature generation, because I didn't trust it yet and thought I could go by with manually writing it, thus triggering the error