7 ms·
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 s
by effigies 16y 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.
- Miky 16y ago"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.
- batterseapower 16y agoYou can "printf debug" Haskell code pretty well using 'trace' (http://hackage.haskell.org/packages/archive/base/latest/doc/html/Debug-Trace.html#v: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.
- bendmorris 16y agoThanks 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.