Re:Quilc: An optimizing quantum compiler written in Common Lisp
by neilv on Thursday February 28, 2019 @08:06PM
(#19277096)
Common Lisp seems like a fine choice. Just to add to your Racket comments...
Some of the ways one might do this in Racket are also doable the same in most any Scheme variant/descendant of the last couple decades (and more ways, for Scheme implementations that provide `syntax-case`). So you could write it "in Racket" in such a way that you can also try out performance of the same code with various other Schemes (Gambit, Chicken, Bigloo, etc.).
Some ways in Racket, however, have no equivalent in any other platform right now. For example, having a `#lang quilc` that uses the Racket module&phase system and syntax objects&transformers to turn the language into Racket code behind the scenes (preserving things like source location, and source IDE support), and let you mix&match with modules implemented in other `#lang`s.
An optional addition to this idiomatic syntax transformation-based approach in Racket is that you could could also write the code to make it simultaneously spit out some native/assembler or IR for LLVM, CUDA/OpenCL, C, etc., like a traditional compiler. Perhaps the expand-to-Racket "backend" is initial rapid prototype as you figure out your language's syntax and semantics, and the IR-writing is what you do later. And you can keep both backends, and test the tricky one against the original simple one that's easy to analyze. And your compiler is bootstrappable from a nice language.
(The Racket universe also has some hands-on PL people, who you can still talk with directly on the email lists, thanks to Racket still being a relatively small and strong community. Without the temptations of money confusing things. :) And it has some nice related PL tools, like Redex.)
Some of the ways one might do this in Racket are also doable the same in most any Scheme variant/descendant of the last couple decades (and more ways, for Scheme implementations that provide `syntax-case`). So you could write it "in Racket" in such a way that you can also try out performance of the same code with various other Schemes (Gambit, Chicken, Bigloo, etc.).
Some ways in Racket, however, have no equivalent in any other platform right now. For example, having a `#lang quilc` that uses the Racket module&phase system and syntax objects&transformers to turn the language into Racket code behind the scenes (preserving things like source location, and source IDE support), and let you mix&match with modules implemented in other `#lang`s.
An optional addition to this idiomatic syntax transformation-based approach in Racket is that you could could also write the code to make it simultaneously spit out some native/assembler or IR for LLVM, CUDA/OpenCL, C, etc., like a traditional compiler. Perhaps the expand-to-Racket "backend" is initial rapid prototype as you figure out your language's syntax and semantics, and the IR-writing is what you do later. And you can keep both backends, and test the tricky one against the original simple one that's easy to analyze. And your compiler is bootstrappable from a nice language.
(The Racket universe also has some hands-on PL people, who you can still talk with directly on the email lists, thanks to Racket still being a relatively small and strong community. Without the temptations of money confusing things. :) And it has some nice related PL tools, like Redex.)