

Release: Scotch programming language, version 0.2.0 - bendmorris
http://www.bendmorris.com/2011/01/scotch-020-is-out.html

======
ecounysis
This looks like it could be promising: "Intended to provide a fast, developer-
friendly functional scripting language with increased productivity similar to
object-oriented languages Python and Ruby."

------
tumult
What's the evaluation strategy? At first glance I thought it might be term
rewriting, but it doesn't appear to be so. I don't understand what I'm allowed
to pattern match. I cannot define a function like "foo(Somedata(a, b)) = a"
and I don't know why.

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.

~~~
bendmorris
>> foo(Somedata(a,b)) = a

>> 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.

~~~
tumult
Looks like it was because I had a space after the comma. Oops!

Why did you choose to distinguish between data constructors and functions?

~~~
bendmorris
Whoops, that'd be a parsing error. Thanks for catching that.

I think different syntax for data constructors and functions reduces ambiguity
and adds to readability.

~~~
tumult
One reason to have separate domains for data and functions is that it allows
you to have types. If you start with the presumption that you aren't going to
have types, you no longer need to make this distinction.

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.

------
steadicat
The syntax looks amazing. Would be great if you added information about the
interpreter (is it implemented in Haskell?) and build instructions for Mac.

~~~
bendmorris
Thanks! The interpreter is implemented in Haskell. Better documentation is in
the works. Until then, here's an earlier thread with Mac build instructions:

<http://news.ycombinator.com/item?id=2037973>

------
equark
What's the underlying motivation?

~~~
bendmorris
Basically, the aim is to be developer-friendly and fast to throw things
together in, but with the power of a functional language. It's a dynamic, weak
typed functional language with readable syntax that makes certain things that
are chores in other languages easier - I/O and concurrency being two examples.

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.

