cvogt / flow-comprehensions

Work in progress: Simpler and more powerful alternative to Scala's built-in for-comprehension syntax
Other
25 stars 5 forks source link

Regarding GSoC #11

Closed satrana42 closed 4 years ago

satrana42 commented 8 years ago

Hey,

I am Satwant and am an undergrad at IIT Delhi. Over the past year I have become a Scala fan, primarily because of my internship work at the Allen Institute for Artificial Intelligence, and extended work in IIT Delhi's Data Analysis and Intelligence Research Group.

I am interested in working on the 'Super-charged for-comprehensions' project for GSoC 16. I was wondering how to begin with the proposal, and what kind of patches can I provide to show my interest and capabilities.

Thanks Satwant Rana

cvogt commented 8 years ago

Hi Satwant Rana,

@clhodapp and I are currently working on an implementation ourselves, which we are going to present at the NEScala on March 2nd 2016. The GSoC project assumes, that until the application time of GSoC, ideas for additional features arise that could be covered by a GSoC project. Things may be clearer in a few weeks from now. It is not certain, that we are actually going to have something to work on in this topic, but if we do you can probably start reading the source code and discussing contributions 3 weeks from now. What you could do for now is read the source code of the alternative implementations our there listed here: https://github.com/cvogt/flow-comprehensions/issues/7 Understanding those will help a great deal.

Good preparation would also be learning how to write Scala macros yourself. Writing some blackbox macros. And learning about compilers and ASTs in general. It's is one of the hardest topics in the Scala space.

Cheers

Chris

satrana42 commented 8 years ago

Hi Chris,

I will read this to begin with.

I have done a course in Programming Languages which focused solely on functional programming, and implemented functions such as unification and a toy PROLOG interpreter in SML-NJ. I have a size-able public Scala codebase here. Also I host a Resume here.

You can see and decide if I can be an appropriate fit for a spin-off project worthy of GSoC. I don't wish to take your time right before your approaching deadline.

Thanks, Satwant

cvogt commented 8 years ago

sounds good. I don't think either of us has studied the paper in depth. Bringing that knowledge to the table can be helpful.

satrana42 commented 8 years ago

I took a refresher on Haskell this weekend and on Monads in specific. I will start looking into this paper. Is there anything specific you want me to focus on?

cvogt commented 8 years ago

Not really, anything regarding the rules of extraction is interesting. Also when they allow extraction or if always.

satrana42 commented 8 years ago

I have read the first three sections of the paper so far, up to the desugaring codo part. I found the discussion on comonads significantly more challenging compared to monads, primarily because the topic hasn't been covered as nicely anywhere.

The comonad examples discussed in the paper had two notions of context, one through a cursor (an array comonad) and another through structure (binary tree comonad). Here, I'd like to ask how do you plan to incorporate comonads and codo blocks to improve for comprehensions in Scala? I have mostly used for comprehensions, for list comprehension tasks, which doesn't need the knowledge of monads. I wonder how you could add codo functionality without having to describe the notion of comonads, something like "tree / 2d array comprehensions"?

Meanwhile, the codo construct seems fairly general, and includes single and multiple variable environment. So you could have code blocks like,

some_calculation = codo x =>
    y <- square x
    z <- cube x
    x + y + z

Regarding when they allow extraction, the desugaring codo section talks of a general desugaring method for arbitrary codo blocks, and IMO it seems to cover most use cases.