[Haskell-beginners] How Interactive can Haskell Ultimately be?

Michael Carpenter mbcarp at verizon.net
Tue Oct 9 00:53:55 CEST 2012

Yep, I'm verbose in my questions. I put the core question(s) in bold. 
Everything else is elaboration for clarity.

*- How interactive and "live" can GHCI make Haskell? What are the 
limits?**By "live", I mean on-the-fly coding.

**- Would it be possible to make a Haskell plugin for something like the 
Light Table IDE even if it required some behind-the-scenes trickery?**

**- How dependent is Haskell's interactivity on it's structure as a 
language and how much of it is dependent on the given compiler?**Is it 
that GHC could never provide on-the-fly coding or is it that the idea of 
highly interactive coding is completely incompatible with the core 
principles that make Haskell work? (static type system vs. dynamic type 

**- Could GHC/GHCi be used or extended to provide a more functional 
reactive Haskell similar to Elm such that you could play with your code 
the same way you can with SuperCollider or Chuck?*

By interactive, I mean that the language allows for the programmer to 
edit the program's source as it's running and see the results of the 
edit play out in the current running session without having to restart 
the program. A lot of languages use this for debugging (GHCi), but I 
know that this feature is typically very limited unless you have a 
dynamic, reactive, and/or interpreted language. There seems to be many 
tricks out there for at least giving the illusion of "live coding" such 
as interpreting the files being edited and leaving everything that's not 
dependent on it compiled. I've also read about having the compiler and 
interpreter actively dance around each other in the source, with the 
interpreter managing the files that were recently edited, providing the 
slow but interactive functionality with only the code local to the 
programmer's current activity, and the compiler recompiling files after 
they've been left alone for a while. I totally don't know what I'm 
talking about here with regard to compiler behavior, but is this 
interactive behavior even possible with GHC/GHCI given how much 
optimization takes place at compile time? Can you cherry pick like that? 
Can you even distinguish between files anymore once it's been melted 
down into C--? I'm really taking to Haskell for general purpose 
programming and I'm finding little to complain about, but there is one 
thing that Haskell lacks in that other expressive high-level languages 
like Lisp, Python, and Ruby seem to have. Interactivity. I like that 
Haskell has both a good compiler and a nice interpreter, but I don't 
know whether (in the future) the two could work together to provide 
GHCI's human-centric interactivity with GHC's computer-centric 
optimization. Can I have good performance and eat my cake too?

I was incredibly inspired by the prototype of the Light Table IDE 
project that got funding recently. I, like many, really liked how it 
gave very quick feedback in multiple ways to what you are doing. That 
helps me tremendously and its probably the most powerful feature a 
language could ever include imo. I have no doubt that such a project can 
become a successful reality, but the language that Light Table was 
performing this interactivity with was Clojure and it seems like only 
dynamic interpreted languages will work. Is Haskell, despite its 
differences from Lisp and the fact that it is a mostly compiled 
language, disqualified from granting the coder a true interactive 
environment? GHCi is REALLY powerful and helpful in this regard, but it 
seems limited to a debugger and a useful tool for tutorials.

I'm asking this because Haskell seems to have everything I would want in 
a language that is not C. The only competitor to it as a functional 
language, in my opinion, is Lisp because of this interactivity. Haskell 
seems to be doing everything right as a modern, high-level, functional 
language, but it would be perfect (for me) if it further reduced the 
barrier between the coder and the code by supporting this interactive 
paradigm. Interactivity is a killer feature for me and I love things 
like the friendly interactive shell for their focus on it.

I've used Vim plugins before for compiled languages where my changes 
were automatically compiled as I made them and a live preview presented 
after each compilation. In this sense, I know that virtually any 
language can act like you are directly affecting your software during 
run-time, but I'm talking about the sweet spot between that fake method 
and something like SuperCollider where musicians can modify their code 
in real-time as their code runs in real-time and not suffer from any 
interruptions or sudden delays - the source language is the same 
language that you use to interface with it. I think this is the ideal 
way to program and I believe it is an important feature for any language 
that aims to serve the human and not the machine.

I want to use Haskell's high-level, expressive, and modular language as 
the way to play with the code I've written. Whether it's for debugging, 
experimentation, scripting, or learning and exploring. If this is 
possible (even if it's just theory and speculation for now), Haskell 
will be that language that lets me code the way I want to.

Sorry for the long message, I didn't want any ambiguity to my question.
- Michael

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20121008/3e056e08/attachment-0001.htm>

More information about the Beginners mailing list