vrtbl / passerine

A small extensible programming language designed for concise expression with little code.
https://passerine.io
MIT License
1.04k stars 38 forks source link

Code Generation and JIT #22

Open sirinath opened 3 years ago

sirinath commented 3 years ago

Have the ability to have multistage programming with code generation, JITing or compiling.

slightknack commented 3 years ago

Right now, Passerine runs on a bytecode interpreter written in Rust. I think that JIT/compilation are a good idea, but because we haven't yet implemented a HM type system, it's currently not possible to monomorphize functions and emit low-level code. I think a nice first step in this direction would be compiling to Wasm.

This is a big ask, and a bit out of scope at the moment. Because of this, I'm closing this issue for now - if you have any particular ideas on what the JIT pipeline would look like for Passerine specifically, please share. Otherwise, we can reopen this issue for discussion when JIT/codegen becomes more of a possibility.

sirinath commented 3 years ago

I think the following are worth while pursuing:

slightknack commented 3 years ago

Thanks for the further comment. I've had a discussion with some other Core Team Members, and I think JIT is something worth pursuing - for this reason I'm reopening this issue :D

sirinath commented 3 years ago

What I had in might was not just code generation but Multi-stage programming (MSP) with Lightweight Modular Staging (LMS). The code generated would be typed assembly language (TAL) and/or Proof-carrying code (PCC)

slightknack commented 3 years ago

I'm not altogether that familiar with MSP, TAL, or PCC. Would you mind explaining what they are, how they would work together in the context of Passerine, and what advantages / disadvantages they would bring to the language?

On Mon, Mar 22, 2021 at 8:54 AM Suminda Sirinath Salpitikorala Dharmasena < @.***> wrote:

What I had in might was not just code generation but Multi-stage programming (MSP) https://en.wikipedia.org/wiki/Multi-stage_programming with Lightweight Modular Staging (LMS). The code generated would be typed assembly language (TAL) https://en.wikipedia.org/wiki/Typed_assembly_language and/or Proof-carrying code (PCC) https://en.wikipedia.org/wiki/Proof-carrying_code

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/vrtbl/passerine/issues/22#issuecomment-803846699, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANCIUGUHDUUQCGLVFMFBNM3TE3ZRTANCNFSM4YB4SZGA .