<div dir="ltr">This might be of interest: It's a tiny optimizing compiler which generates MIPS asm. It runs end-to-end, I think: simple programs can be tested using `nasm`:<br><br><a href="https://github.com/bollu/tiny-optimising-compiler">https://github.com/bollu/tiny-optimising-compiler</a><br><br>Best,<div>~Siddharth<br><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 15, 2020 at 3:20 AM Carter Schonwald <<a href="mailto:carter.schonwald@gmail.com">carter.schonwald@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">I do genuinely think it’s actually a great piece of code to shamelessly copy out and use for your own needs.  It doesn’t even really dictate any RTS assumptions or anything. By and large ;)</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 14, 2020 at 3:55 PM Sebastiaan Joosten <<a href="mailto:sjcjoosten%2Bhaskell@gmail.com" target="_blank">sjcjoosten+haskell@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Not something I've worked on (my answer to your original question is 'no I haven't'), but GHC has a compiler from 'CMM' to various assemblies written in Haskell </div><div dir="ltr">Code at:</div><div dir="ltr"><a href="https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GHC/CmmToAsm/" target="_blank">https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GHC/CmmToAsm/</a></div><div dir="ltr"></div><div dir="ltr"><a href="https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GHC/CmmToAsm/X86/CodeGen.hs" target="_blank">https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GHC/CmmToAsm/X86/CodeGen.hs</a></div><div dir="ltr"><br></div><div>(I used to think that LLVM was the last step in GHC. I don't know when or how I ever got that idea. Last year I learned that it only uses LLVM if you tell it to and it bypasses it completely <a href="https://downloads.haskell.org/~ghc/8.10.2/docs/html/users_guide/codegens.html" target="_blank">with the default `-fasm' option</a>. In any case, my own earlier misconception is why I felt the need to point out what is perhaps obvious to most.)</div></div><div dir="ltr"><div><br></div><div><br></div>Sebastiaan<div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 14, 2020 at 3:09 PM Vanessa McHale <<a href="mailto:vamchale@gmail.com" target="_blank">vamchale@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">That I stumbled across! I like it, though I've put off learning about <br>
assemblers...<br>
<br>
On 12/14/20 2:05 PM, Henning Thielemann wrote:<br>
><br>
> On Mon, 14 Dec 2020, Vanessa McHale wrote:<br>
><br>
>> Have any of you written compilers or backends that generate assembly? <br>
>> Lots of projects seem to "end" at LLVM.<br>
><br>
> I don't know of compiler backends, but I know of an x86 machine code <br>
> generator:<br>
>    <a href="https://hackage.haskell.org/package/harpy" rel="noreferrer" target="_blank">https://hackage.haskell.org/package/harpy</a><br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div></div></div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div></div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><a href="https://bollu.github.io/" target="_blank">https://bollu.github.io/</a><br></div></div>