Release: Scotch programming language, version 0.2.0
bendmorris.com
bendmorris.com
The interpreter also became confused at one point, and stopped handling inputs.
Since this is Haskell, you should probably be using cabal to build. I didn't know where the function main was, and had to dig around until I knew which file to invoke ghc --make with.
>> foo(Somedata(1,2))
1
It is term rewriting. If I understand you correctly, this should work as you would expect.
Thanks for taking some time to play around with it. There are definitely still some bugs to work out in the interpreter; any details you can provide about the issues you find would be much appreciated.
Why did you choose to distinguish between data constructors and functions?
I think different syntax for data constructors and functions reduces ambiguity and adds to readability.
Scotch only goes half-way. For example, I can't do this in Scotch:
>> foo(a,b) = a
>> foo(bar(a,b),bar(c,d)) = bar(a,c)
>> bar(a) = "spaghetti"
>> foo("baz","qux")
"baz"
>> foo(foo(bar("baz","qux"),bar("corge","grault")))
"baz"
>> foo(bar("anything"),bar("something"))
"spaghetti"
Scotch distinguishes between data construction and function application, but the only benefit you get out of it is that you won't get any typing errors.If you are interested by the sort of very powerful pattern matching demonstrated above, check out languages in the family of term rewriting, of which the newest and coolest is Pure, http://code.google.com/p/pure-lang/, powered by LLVM with influence from Haskell. It is also dynamically typed (by necessity).
Another popular example of term rewriting is the Mathematica language, used in the software package of the same name.
Scotch is very new and if you haven't heard of it before, you can check the main wiki page on github for some more links to blog posts, etc. It started as a hobby project that, due to a lot of positive feedback, I'm trying to push a little harder.