[nem-en] Re: Scala: what you say about it?
Andrey Khropov
andrey.khropov at gmail.com
Sun Nov 19 11:00:44 CET 2006
Kamil Skalski wrote:
> For me this is just a proof that macro capabilities are a needed
> feature for modern languages. It is just a matter of time when some
> (probably limited) form of them will be getting into more and more
> languages, also those branded by big companies.
Definitely.
I'd say not necessarily macros but one or another form of metaprogramming.
Look how popular website frameworks based on metaprogramming like Ruby-on-Rails
are becoming popular.
Also look what Sergey Dmitriev (JetBrains founder) think about future
programming languages:
http://www.eweek.com/article2/0,1895,2009126,00.asp.
<cite>
any modern software platform and language should have 12 main features: object
orientation; support for language extensions and meta-programming; an
intelligent IDE; clear syntax and readable program code; support for
collections; support for writing GUI applications; support for writing Web
applications; support for multithreading; support for functional types,
closures and continuations; garbage collection; an effective virtual
machine/runtime; and the ability to deploy to any operating system.
</cite>
I think Nemerle fits in this picture pretty well :).
> - usability of Nemerle macros in multi-language, large projects - in
> my currently developed application I have a Nemerle library + some
> macros and GUI client in C#.
I hope it will be possible to design some GUI in WinForms designer (maybe even
XAML) and get Nemerle code soon (I'm working on it).
> Gilles Dubochet mentions MetaML - the interesting thing to point here
> is that MetaML / MetaOcaml, etc. are all statically typed and I mean
> *strongly* statically typed - the code inside quotations is also
> type-checked. This is of course very nice feature, but hm... honestly,
> to do anything usable in such a setting you need to sweat a lot. The
> theoretical foundations in this field are improving, but so far this
> is just too limiting. Most of the macros I wrote and found nice are in
> fact "dynamic" - it means that they build code in a very dynamic way,
> just putting some parts of code generated by utility functions
> together. Their result is then type-checked at use-site when somebody
> calls the macro.
>
> So, my observation is that if you want run-time code transformation
> and execution it would be better to do strong type-checking, otherwise
> the hard time debugging macros becomes even harder. But if you have
> strong type-checking you cannot do anything useful with your macros..
> :( For me the dynamic macros + their compile-time execution is much
> closer to the usability optimum in this field.
I agree - this's probably the right balance between flexibility and type
correctness.
>
> And to do not disappoint the run-time code transformation + execution
> fans I can just say that this is of course also possible in Nemerle.
I agree.
> The only thing I envy a little bit from Scala guys is the "fresh"
> state ;) I think there are many things we could have cleaner in our
> macro system and starting the stuff from scratch has the best
> potential (and hope) to make things well designed.
Well I think *they* should envy you because you've already inplemented it and
saw the pitfalls, got some experience with it. So now you can make more
informed and thoughtful decisions.
> But, as I am
> thinking mainly about the compiler API design, not the general
> concepts of our macro system, it still seems fixable in future for
> Nemerle.
And what's your vision on the future of Nemerle?
>
> As to note, also F# (and Boo of course) incorporates macros these
> days.
Well I think Nemerle is pretty well ahead of them.
F# has that OCaml syntax which I think is much less readable than Nemerle.
It's main advantage is that it is backed by MS. And they promote it as a
language of choice for people (scientists primarily) who want something beyond
C#.
And Boo doesn't have pattern matching and macros there are obscure.
I think the closest competitor to Nemerle is Scala.
IMO Nemerle is better in all aspects except it doesn't have traits.
So adding traits would be nice althought it isn't a must-have feature.
--
AKhropov
More information about the devel-en
mailing list