Any answer if going to be fairly opinion-based. That said, here are some
opinions :)
some advantages:
- interactive development
- performance
- Cxx.jl, if you want to target LLVM
- multiple dispatch
some disadvantages:
- lack of ML-style pattern-matching -- though multiple dispatch on node
type covers much of how this is used (and
https://github.com/kmsquire/Match.jl might help too)
- for an interpreter, lack of static compilation (your language would need
to carry along Julia and LLVM machinery)
Some examples of compiler-related-things written in Julia:
- Intel's ParallelAccerator compiler:
https://github.com/IntelLabs/ParallelAccelerator.jl
- Julia's type inference:
https://github.com/JuliaLang/julia/blob/master/base/inference.jl
- Julia parser: https://github.com/JuliaLang/JuliaParser.jl
- "green-fairy", an abstract interpreter:
https://github.com/carnaval/green-fairy
(MS thesis project, see PDF report. still WIP)
- parsers for object-file formats (DWARF, COFF, MachO, ...):
https://github.com/Keno?tab=repositories=source
- https://github.com/JuliaGPU/CUDAnative.jl
- https://github.com/swadey/LispSyntax.jl
- https://github.com/andrewcooke/ParserCombinator.jl
- https://github.com/abeschneider/PEGParser.jl
- BF interpreter: https://github.com/johnmyleswhite/Brainfuck.jl
On Wed, Sep 21, 2016 at 8:29 PM, Sebastian the Eight <
imperator.ozymand...@gmail.com> wrote:
> I'm curious how adept Julia is for writing compilers/interpreters? It's
> fairly easy to find example toy compilers for most other languages (C,
> OCaml, Ruby etc), but Julia seems to be lacking any examples except for its
> own. I was wondering if there are advantages or disadvantages for using
> Julia in this way, other than being a relatively new language