Typing the Shen Sources

117 views
Skip to first unread message

Mark Thom

unread,
May 1, 2015, 1:17:56 PM5/1/15
to qil...@googlegroups.com
I'm wondering if it might be worthwhile to add types to the Shen sources. The main thing hindering the performance of my Haskell backend is that it translates from the K Lambda sources to what is essentially a dynamically typed, Haskellized Lisp, which obstructs some of the optimizations that GHC (the Haskell compiler) does. If we could add a concise type theory to the functions in the Shen sources, I could write a Shen->Haskell transpiler that would likely be capable of generating much tighter code. It might also be of some help to other implementers. It looks like a fair amount of work, and so I ask, is writing a typed variant of the Shen sources a good idea from this vantage point?

Raoul Duke

unread,
May 1, 2015, 1:47:19 PM5/1/15
to qilang
From a pedantic/cool point of view, I say yes! (But I am not really
actually invested, I have no skin in the game, I haven't contributed
diddly other than some cash and many more complaints - er, critiques.)

Mark Tarver

unread,
May 5, 2015, 7:02:02 AM5/5/15
to qil...@googlegroups.com
Can be done to a degree - but some types are complex - the type of all  Shen  function defs.

Mark

On Fri, May 1, 2015 at 6:17 PM, Mark Thom <markjor...@gmail.com> wrote:
I'm wondering if it might be worthwhile to add types to the Shen sources. The main thing hindering the performance of my Haskell backend is that it translates from the K Lambda sources to what is essentially a dynamically typed, Haskellized Lisp, which obstructs some of the optimizations that GHC (the Haskell compiler) does. If we could add a concise type theory to the functions in the Shen sources, I could write a Shen->Haskell transpiler that would likely be capable of generating much tighter code. It might also be of some help to other implementers. It looks like a fair amount of work, and so I ask, is writing a typed variant of the Shen sources a good idea from this vantage point?

--
You received this message because you are subscribed to the Google Groups "Shen" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qilang+un...@googlegroups.com.
To post to this group, send email to qil...@googlegroups.com.
Visit this group at http://groups.google.com/group/qilang.
For more options, visit https://groups.google.com/d/optout.

Kean Lau

unread,
May 18, 2015, 9:34:32 AM5/18/15
to qil...@googlegroups.com
These complex cases would make interesting discussion topics.

In general eating your own dog food is a good practice. Typing the Shen sources might point us to areas where we can improve Shen.

By the way, what's the process for contributing to the Shen sources? The repository on Github only seems to be a mirror...

Raoul Duke

unread,
May 18, 2015, 1:59:40 PM5/18/15
to qilang
> In general eating your own dog food is a good practice. Typing the Shen
> sources might point us to areas where we can improve Shen.

hell yes.
Reply all
Reply to author
Forward
0 new messages