Hacker News new | ask | show | jobs
by effigies 5652 days ago
This is kind of neat. It seems like it'd be useful as a more easily debugged Haskell.

I'd be more inclined to actually play with it, though, if it accepted a superset of Haskell, which allowed arbitrary IO tainting. So I might write:

    do
        pure code
        {- Scotch debug statements
        ...
        -}
        pure code
And then just dump it into the Scotch compiler/interpreter when I ran into issues.

Of course, this would only work if you could guarantee semantic equivalence to the Haskell except in those debug bits.

3 comments

"A superset of Haskell, which allowed arbitrary IO tainting" doesn't really make any sense with Haskell's semantics, unless you're talking about unsafePerformIO, which already exists.
Thanks for the comment. One of my main goals was definitely to make an easier-to-debug and easier-to-throw-things-together-quickly-in functional language. To help accomplish this goal, there are some other significant differences from Haskell, such as dynamic/weak typing and cleaner syntax - I think that some aspects of Haskell's syntax are barriers to adoption and comprehension, so I'm going for a more Python-esque "readable pseudocode" syntax as much as possible. So, there will never quite be equivalence to Haskell. I think your idea would make an interesting project as well, and as a Haskell user I'd definitely use it.
You can "printf debug" Haskell code pretty well using 'trace' (http://hackage.haskell.org/packages/archive/base/latest/doc/...) which was designed for the purpose.

The lack of gdb support for Haskell is very irritating, but it seems you won't get that with Scotch at the moment either.