Re: SML.NET
dvanhorn <[email protected]>
| Newsgroups | gmane.org.ballistichelmet.lambda |
|---|---|
| Message-ID | <[email protected]> |
Aaron S. Hawley wrote: > huh, i'm usually anti-macro (of course never having actually used macros > in a functional language). Well, macros are not really related to functional programming. What a macro (or rewrite rule) does is match the abstract syntax tree of an expression, transform the matched tree, and then place the new expression in place of the original. In Scheme this is fairly clean since the syntax is simply and uniform. In a language like C++ it's a mess and things get broken. > in a related thread, found this quote: > > "I feel quite certain that the reason Scheme feels different to me from ML > is not the parentheses, but rather the lack of static typing, algebraic > datatypes, and other semantic components. Yes it lacks static typing, but one way to think of this is that all ML programs are a strict subset of Scheme programs. There is no language support for algebraic data types in the sense that ML provides (ie you can't introduce a new type that the compiler will check, since there is no type checker), but you can program with algebraic data types in Scheme (and should). This seems to be indicitive of the ML v Scheme trade-off: we can limit the things we can write in order to get these nice properties like type safety, or we can write without restrictions and when we need a property like type safety, we add the restrictions ourself (in this case using macros!). > I feel certain about this, > because every time I start programming in Scheme now, the first thing I > want to program with the macro system is a static type checker, and not a > parser for an ML-like grammr. It's true that since type safety is a syntactic property (ie decidable at compile time), the Scheme syntax macro system is amenable to implementing a type checker/inferer. If you wanted to, you could write a macro that would infer and check types with the same rules as ML (ie let-polymorphism). > -- http://lambda.weblogs.com/discuss/msgReader$2190?mode=day > > I'd be willing to argue that ML (the theorom prover's language) is easier > to learn than scheme. only because I still don't [really] know scheme. > /end edict > > /a -d