Em 06-12-2013 06:08, Rohan Drape escreveu: > #2 Miguel Negrão Nov 13, 2013; 7:42am Re: Towards SC 4 > >> Haskell has emacs bindings but I'm not a emacs person >> (yet), so I couldn't use that, even with that you >> can't really do proper live coding of functions etc. > > Perhaps I misunderstand, but I'm pretty sure this is > completely incorrect! > > The Haskell SC3 bindings work with the Glasgow > interpreter (ghci) as well as the compiler (ghc). > > I use both haskell and sclanguage all the time, and the > interaction model seems more or less exactly the same. > > What do you think is the difference? Hi Rohan, I'm glad to learn that it is incorrect, as I would be quite curious to try some live coding in haskell with sc3 server at some point in the future. :-) I was referring to two separte issues: 1) As far as I know there isn't anything similar to the sc-ide where you select text (normal haskell code, anything that ghc would accept, i.e. not having to wrap do blocks with { } ) and execute, except for emacs (with hsc3 for instance). Like I said, I'm not an emacs person at the moment, so that's not really a viable possibility for me. I was thinking of a more conventional (by today's standards) text editor. I did eventually learn that leksah has a scratch pad functionality where you can write code, select and it executes in ghci, making sure to wrap it for multiline execution, but that is not really usable either, since one would want the ability to manage multiple documents, and not have to copy paste every block of code to exectue to the scratch pad. 2) The other part that's not clear to me regarding live coding in Haskell, is how it will work with the static typing. One possibility when rewriting a function, eventually changing it's and other functions types is to just reload the whole module in ghci, but that will make the last executed stuff unreacheable. For instance, when using hsc3-server's monad, after reloading the module one can no longer execute things on the same monad value. Another option is to just redefine the function in ghci, that seems to be possible, but then other functions that referred to the old version of the function will continue to refer to the old version, which is the logical think otherwise types would no longer make sense. I guess those functions would also have to be re-evaluated, which is fair enough. So not sure in practice how much of problem that is, or if it is a problem at all. best, Miguel
Attachment:
signature.asc
Description: OpenPGP digital signature