BA Haskell User Group meeting on March 21, 2012 (Wed)

252 views
Skip to first unread message

Ivan Tarasov

unread,
Mar 13, 2012, 5:56:10 PM3/13/12
to baha...@googlegroups.com
We introduce an approach for writing an extensible EDSL compiler in Haskell.
More specifically, we express compiler abstractions and "optimizations" as monad transformers.
We combine this compiler with synthesis techniques to obtain optimized GPU programs from medium-high level code.

Discussion: I would like to discuss several design decisions I've made, for example (a) maybe-more-modern typing via GHC 7.4.1's new Constraint Kinds extension [vs. Data.Dynamic or phantom types] (b) handling function definitions, in particular passing a reified "lift" function down the monad transformer stack (c) tradeoffs using associated data vs. associated types.

Hello everyone,

For our March meeting Nicholas Tung is going to make a talk about writing EDSLs in Haskell:

We introduce an approach for writing an extensible EDSL compiler in Haskell.
More specifically, we express compiler abstractions and "optimizations" as monad transformers.
We combine this compiler with synthesis techniques to obtain optimized GPU programs from medium-high level code.

Discussion: I would like to discuss several design decisions I've made, for example (a) maybe-more-modern typing via GHC 7.4.1's new Constraint Kinds extension [vs. Data.Dynamic or phantom types] (b) handling function definitions, in particular passing a reified "lift" function down the monad transformer stack (c) tradeoffs using associated data vs. associated types.

The meeting place is our usual place in SoMa, kindly provided by Engine Yard:

500 Third Street, Suite 510
San Francisco, CA 94107

Contact phone (mine): 650-762-6644
Host's phone (Larry's): 407-718-7665.

Please arrive a little bit earlier, so that we could start at 7pm sharp.

We may try to set up the video feed through Google Hangout (I will post a public link in my G+ before the meeting starts if we succeed in setting it up), however please don't rely on it and try to visit the meeting in person if possible. If you are going to be joining the hangout, please mute your microphone before you join.

Some people will be going from the South Bay (and probably East Bay) to the meeting and back, so there's a possibility of carpooling. Also, it's very easy to get to Engine Yard from the Caltrain station (4th & King Str) and Embarcadero/Powell BART stations. Please send me a message if you need help figuring out transportation. If you are driving and can take some people from East/South Bay to the meeting and back, please send a message to the baha...@googlegroups.com mailing list.

Please retweet/post to reddit/forward this email to those who may be interested in attending. If you plan to attend and you're not yet subscribed, please subscribe to BAHaskell Google Group to follow all the discussions related to this meeting (if you have troubles with the captcha while joining, please send me a direct email).

Cheers,
Ivan

Myles C. Maxfield

unread,
Mar 13, 2012, 6:02:51 PM3/13/12
to baha...@googlegroups.com
Count me in :]

--Myles

> --
> You received this message because you are subscribed to the Google Groups
> "Bay Area Haskell Users Group" group.
> To post to this group, send email to baha...@googlegroups.com.
> To unsubscribe from this group, send email to
> bahaskell+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/bahaskell?hl=en.

Ivan Tarasov

unread,
Mar 13, 2012, 6:19:17 PM3/13/12
to baha...@googlegroups.com
Sorry for the botched email, just ignore the first two paragraphs :-)

Ivan

On Tue, Mar 13, 2012 at 2:56 PM, Ivan Tarasov <ivan.t...@gmail.com> wrote:

aditya bhargava

unread,
Mar 17, 2012, 8:13:28 PM3/17/12
to baha...@googlegroups.com
Neat! One of my projects is writing a compiler in Haskell. It's been on the backburner, but maybe this will rekindle it :)

Adit


On Tue, Mar 13, 2012 at 2:56 PM, Ivan Tarasov <ivan.t...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "Bay Area Haskell Users Group" group.
To post to this group, send email to baha...@googlegroups.com.
To unsubscribe from this group, send email to bahaskell+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bahaskell?hl=en.



--
adit.io

Max Cantor

unread,
Mar 17, 2012, 8:53:07 PM3/17/12
to baha...@googlegroups.com
Looks great.   Moving to SF on Tuesday, really good timing on this BAHaskell meeting.  About your EDSL approach, have you looked at shakespeare-xxx EDSLs from the yesod project?  Would be interesting to see the contrasts.

Max

Ivan Tarasov

unread,
Mar 18, 2012, 2:46:26 AM3/18/12
to baha...@googlegroups.com
Max,

Welcome to SF and BAHaskell!

Would you be able to describe shakespeare-* EDSLs in short at the meeting? That could make the EDSL discussion even more interesting.

Cheers,
Ivan

Nicholas Tung

unread,
Mar 18, 2012, 2:50:09 AM3/18/12
to baha...@googlegroups.com
That would be great; I likely won't have time to read up on it (midterms, papers, etc. from school :/ ). I'll try to send out rough slides for the meeting by Monday.

Cheers,
Nicholas — https://ntung.com — 4432-nstung

Max Cantor

unread,
Mar 18, 2012, 10:43:19 AM3/18/12
to baha...@googlegroups.com
I could give a quick overview of the usage but could not do justice to the internals or development process.

Nicholas Tung

unread,
Mar 20, 2012, 11:47:34 PM3/20/12
to baha...@googlegroups.com
Attached are some preliminary slides if anyone is curious; the last two sections are still TBD.

Cheers,
Nicholas — https://ntung.com — 4432-nstung

On Tue, Mar 13, 2012 at 14:56, Ivan Tarasov <ivan.t...@gmail.com> wrote:
Hello everyone,

For our March meeting Nicholas Tung is going to make a talk about writing EDSLs in Haskell:

We introduce an approach for writing an extensible EDSL compiler in Haskell.
More specifically, we express compiler abstractions and "optimizations" as monad transformers.
We combine this compiler with synthesis techniques to obtain optimized GPU programs from medium-high level code.

Discussion: I would like to discuss several design decisions I've made, for example (a) maybe-more-modern typing via GHC 7.4.1's new Constraint Kinds extension [vs. Data.Dynamic or phantom types] (b) handling function definitions, in particular passing a reified "lift" function down the monad transformer stack (c) tradeoffs using associated data vs. associated types.

The meeting place is our usual place in SoMa, kindly provided by Engine Yard:

500 Third Street, Suite 510
San Francisco, CA 94107

Contact phone (mine): 650-762-6644
Host's phone (Larry's): 407-718-7665.

Please arrive a little bit earlier, so that we could start at 7pm sharp.

We may try to set up the video feed through Google Hangout (I will post a public link in my G+ before the meeting starts if we succeed in setting it up), however please don't rely on it and try to visit the meeting in person if possible. If you are going to be joining the hangout, please mute your microphone before you join.

Some people will be going from the South Bay (and probably East Bay) to the meeting and back, so there's a possibility of carpooling. Also, it's very easy to get to Engine Yard from the Caltrain station (4th & King Str) and Embarcadero/Powell BART stations. Please send me a message if you need help figuring out transportation. If you are driving and can take some people from East/South Bay to the meeting and back, please send a message to the baha...@googlegroups.com mailing list.

Please retweet/post to reddit/forward this email to those who may be interested in attending. If you plan to attend and you're not yet subscribed, please subscribe to BAHaskell Google Group to follow all the discussions related to this meeting (if you have troubles with the captcha while joining, please send me a direct email).

Cheers,
Ivan

presentation.pdf

Greg Steuck

unread,
Mar 21, 2012, 1:40:24 AM3/21/12
to baha...@googlegroups.com, gatoat...@gmail.com
Hey Nickolas,

One motivating example that could make your research interesting for
people doing DSP would be an FFT implementation. So, if you can show
an FFT written in some very readable style getting transformed into a
flamethrower GPU program, I will certainly be impressed.

Thanks
Greg

--
nest.cx is Gmail hosted, use PGP for anything private. Key:
http://tinyurl.com/ho8qg
Fingerprint: 5E2B 2D0E 1E03 2046 BEC3  4D50 0B15 42BD 8DF5 A1B0

Myles C. Maxfield

unread,
Mar 21, 2012, 1:41:27 AM3/21/12
to baha...@googlegroups.com, gatoat...@gmail.com
+1 for that idea

Charles Martin

unread,
Mar 21, 2012, 10:02:35 PM3/21/12
to baha...@googlegroups.com, ivan.t...@gmail.com
Will there be a G+ hangout?

Nicholas Tung

unread,
Mar 26, 2012, 3:04:19 PM3/26/12
to baha...@googlegroups.com
Hi all,

    Attached is the current source code (you should be able to run "ghci Hz2/Tests/SpecializeParforTest.hs"). See the README for a list of cabal packages (I think I got most of them). You'll need GHC 7.4.1. Also, I recommend wrapping "cabal" so that it will warn you if an installation will break previously installed packages -- see my question on stackoverflow [ http://goo.gl/aeMFh ] and zsh script here [ http://pastebin.com/PGYWqdKA ].

    Slides are attached too. Hopefully the code quality & my explanation will improve over the next few months ... thanks for the feedback, and apologies it got complicated / I didn't disentangle this work from the GPU stuff.

    Also, thanks to Greg for the FFT idea; that looks to be a great candidate for study. Please send me any other problems; I'm especially interested in simple ones that are unrelated to GPUs (but benefit from the "extensible language" idea).

take care,
Nicholas — https://ntung.com — 4432-nstung
hasketzi.7z
presentation.pdf

Ivan Tarasov

unread,
Mar 26, 2012, 5:57:10 PM3/26/12
to baha...@googlegroups.com
Nicholas,

Thanks for the great talk! I'm quite impressed by the possibilities of using the EDSLs and yices (or some other SMT-solvers) for generating optimized code, alas I'm not dealing with any GPU stuff.

Offtopic: I noticed you were using some vim extension that allowed you navigate through your code/buffers very efficiently. What was it?

Cheers,
Ivan

Nicholas Tung

unread,
Mar 26, 2012, 6:43:56 PM3/26/12
to baha...@googlegroups.com
Thanks! The buffer switching extension I use is called FuzzyFinder; after installation you can map it to a key like so,

noremap <F2> <Esc>:FufBuffer<CR>

It's pretty good, especially if you have a directorized structure; say I wanted to open "Hz2/Tests/SpecializeParforTest.hs", then I could hit F2 and type "t/s" (matching tests/specialize...) and then Ctrl+N down to the result.

cheers,
Nicholas — https://ntung.com — 4432-nstung
Reply all
Reply to author
Forward
0 new messages