You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by richard emberson <ri...@gmail.com> on 2011/01/05 00:15:16 UTC
Scala-Wicket Help and Advice
Dev Wicketers,
What: I have ported Wicket to Scala
A couple of months ago I took a 1.5 snapshot and ported to Scala.
This encompasses all of the source and test code. As successive 1.5
snapshots were released, I ported those differences to my Scala
version. I am current with 1.5 M3.
The Java 137,791 loc in 1.5 M3 are now 100,077 loc Scala (not
counting all the println statements I put into the Scala code
for debugging). I used cloc (http://cloc.sourceforge.net/) to
count lines of code.
I have also replaced all of the Java collection classes with
Scala collection classes (though a small number of Java collection
classes remain that did not have comparable Scala implementations).
I have changed many method return types from the Java returning
some "object" or "null" to Scala returning "Some(object)" or "None"
(using the Scala Option[return-type] construct) - trying to
eliminate nulls.
Lastly, I pushed the IModel[T] typing down to the Component class
making get/set DefaultModel and get/set DefaultModelObject strong
typed. This included using Scala companion object apply methods
which eliminated having to explicitly declare type parameters in
most end-user code (I had read that one of the objections to
pushing strong typing down to the Component class in Wicket was
that there were "too many notes", end-user code was too verbose).
It can not interoperate with Java Wicket because Scala compiles to
JVM class files and so all of the classes in Java Wicket also
appear in Scala-Wicket.
I have an "internal" name for my Scala port of Wicket which
acknowledges its Wicket heritage as well as advertises its
enterprise level capabilities. For external communications,
I am currently simply call it Scala-Wicket.
Why: Scala is a better Java
I was introduced to Scala 9 months ago and quickly determined that
it was a better Java (at least IMO). For Scala to succeed it
requires more programmers to use it. Many on the Scala mailing
lists were from a functional background and seemed not to recognize
that Haskell and Lisp are not blindingly successful but, rather,
niche languages and that the heavy selling of Scala's function and
typing capabilities might turn off Java programmers.
Scala struck me in many ways as a strong-typed JavaScript, at
least, much of the code did not have to have type declarations
because the compiler could infer types in many cases. In addition,
a whole lot of the Java boil-plate code was not needed. As such,
it could be sold as simply a better Java; a more-to-the-point
object oriented language with functional programming in-the-small.
To get more Java programmers to try Scala I looked for a
significant Java application with a strong support and user
community that I could port to Scala. I ended up with Wicket.
Wicket is an enterprise level web framework (unlike existing
Scale web frameworks which place restrictions on enterprise IT
organizations, e.g., by requiring sticky sessions). It is well
documented. And, as it turned out, very, very importantly it had
a large number of unit tests (the unit tests saved my butt,
without them I would never had succeeded in getting a port that
worked).
No, Really, Why:
I like Scala and I took the time to learn it. Right now about
20% of programmers use Java while only some 0.4% use Scala.
I did not want my effort of learning Scala to be wasted so my
solution is to increase the number of Scala programmers. Where
to get them? Again, my solution is from the existing horde of
Java programmers.
Plans: Release, Evolve and Proselytize
I would like to release Scala-Wicket.
I do not know if Apache hosts anything other than Java code.
Growing a community is important.
Still Todo:
Comments: All of the existing class and inline comments are
still Java related. This would have to be a long, on-going
task to edit the comments so they reflect the code's
Scala usage.
Package path: The code still uses the "org.apache.wicket"
package path and this must be changed - unless this became
an Apache project.
Author: I have quite literally looked at and touched every line
of code but I have not yet felt comfortable with adding
myself as an author since, well, many changes were
syntactic and not semantic.
Refactor with Traits: Currently the port uses Scala traits like
Java interfaces but it should be possible to factor the
common code out into the traits. This would result in many
of the interfaces, the "I" files, such as IModel.scala,
going away.
Some general refactoring:
As an example, consider factoring out the IModel[T] from
Component. Half the time a user wants a Component with
no model, so, if there was a HasModel trait:
class Model[T](var value: T) {
def getObject: T = value
def setObject(value: T): Unit = this.value = value
}
trait HasModel[T] {
var model: Model[T]
def getDefaultModel: IModel[T] = model
def setDefaultModel(model: IModel[T]): this.type = {
....
this
}
def getDefaultModelObject: Option[T] = {
....
}
def setDefaultModelObject(obj: T): this.type = {
....
this
}
}
The Component hierarchy would have no model support.
The user could add model support when needed:
val form = new Form("hi")
with HasModel[Int] { var model = new Model(42) }
Just an Idea.
STM: There are a number of Scala STM projects and I do not know
if it is useful to add STM capabilities to Scala-Wicket.
RBAC: I've written a Scala implementation of the NIST RBAC
recommended standard and might consider adding it.
Logging: Adding a Scala-based logging framework to aid user
debugging.
Monitoring and stats: In the last couple of years many web
sites have added monitoring and statistics gathering
capabilities (e.g., who clicks what, where, how long, on
what page does the visitor exit the web site, etc.) in
order to know how the web site is being used and then
improve the web site.
Significant Memory Usage Reduction: I've an idea that would
significantly decrease the memory usage of Scala-Wicket and
I plan to do a test implementation.
Replace Java features: There are still some Java-isms that can
be replaced with Scala equivalents.
Port additional Java Wicket libraries to Scala.
Enable multiple instances of a unit tests to be run at once.
More: ????????????
I want to avoid using some of the WTF features of Scala (when a
Java programmer looks at the code and says "WTF") in order to
ease and accelerate acceptance by Java programmers; as
examples, implicits can make code hard to understand and
advanced Scala type usages, as James Gosling said, "makes one's
head spin".
Help and Advice: How should Scala-Wicket be extended and released
Scala-Wicket is a port and evolution of Wicket, not a ground-up
re-write. Given that, what would you do differently in Wicket
now that there are years of experience using it?
How best to get a hosting site, release the code and build a
community?
Are there any mechanism to help fund such an open-source project?
This is not meant to be a general announcement but rather a means
for me to get some initial advice as to how to proceed.
Any help is appreciated.
Richard Emberson
--
Quis custodiet ipsos custodes
Re: Scala-Wicket Help and Advice
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
One can always get better at following but tools must improve to be
better for building ;)
**
Martin
2011/1/11 Rodolfo Hansen <kr...@gmail.com>:
> I guess Project Lombok could be extended for this.
>
> You would be inviting the same problems encountered by C++ with its
> multiple inheritance,
> and all that magic will probably make things harder to follow.
>
> But; like all shotguns, it's everyone's responsibility where they aim,
> lest they shoot themselves in the foot.
>
> :D
>
>
> On Sun, 2011-01-09 at 10:00 +0200, Martin Makundi wrote:
>
>> >>> Either way, you have to put logic somewhere that tries to figure out
>> >>> what the heck you want to borrow and then figure out where the heck to
>> >>> get it.
>> >>
>> >> If it is done at compile time you don't need "messaging" logic. It
>> >> would be uniquely defined what you can get.
>> >
>> > Please explain.
>>
>> Think about object hierarchy. It is uniquely defined what method
>> overrides what etc.
>>
>> So it would just expand the same idea to "membership dimensions" in
>> addition to "inheritance dimensions".
>>
>> I mean that assuming man has a bag would work effectively similar to
>> man extends bag at compile time.
>>
>> If bag has a getter then man can expose that getter. However, if we
>> would really extend bag then we are stuck with it (and we could'nt
>> have man wear both jacket, trousers and bag at same time).
>>
>> When man only "has" bag then we can also change the bag and extend the
>> bag with another bag or set it to null even.
>>
>> Nevertheless, we could annotate:
>>
>> @DefaultExpose(ExposeLevels.ALL)
>> public class Man {
>> private Bag bag;
>> }
>>
>> public class Customs {
>> public boolean investigate(Man man) {
>> Pencil = man.getPencil();
>> }
>> }
>>
>> :::: Alternatively you can move the annotation
>>
>> public class Man {
>> @DefaultExpose(ExposeLevels.ALL)
>> private Bag bag;
>> }
>>
>> ::: or even more detailed:
>>
>> public class Bag {
>> @DefaultExpose(ExposeLevels.ALL)
>> private PencilCase pencilCase;
>> }
>>
>>
>> Override rules could be same as "as if" the Man extended Bag and as if
>> Bag extened PencilCase.
>>
>> **
>> Martin
>
>
>
Re: Scala-Wicket Help and Advice
Posted by Rodolfo Hansen <kr...@gmail.com>.
I guess Project Lombok could be extended for this.
You would be inviting the same problems encountered by C++ with its
multiple inheritance,
and all that magic will probably make things harder to follow.
But; like all shotguns, it's everyone's responsibility where they aim,
lest they shoot themselves in the foot.
:D
On Sun, 2011-01-09 at 10:00 +0200, Martin Makundi wrote:
> >>> Either way, you have to put logic somewhere that tries to figure out
> >>> what the heck you want to borrow and then figure out where the heck to
> >>> get it.
> >>
> >> If it is done at compile time you don't need "messaging" logic. It
> >> would be uniquely defined what you can get.
> >
> > Please explain.
>
> Think about object hierarchy. It is uniquely defined what method
> overrides what etc.
>
> So it would just expand the same idea to "membership dimensions" in
> addition to "inheritance dimensions".
>
> I mean that assuming man has a bag would work effectively similar to
> man extends bag at compile time.
>
> If bag has a getter then man can expose that getter. However, if we
> would really extend bag then we are stuck with it (and we could'nt
> have man wear both jacket, trousers and bag at same time).
>
> When man only "has" bag then we can also change the bag and extend the
> bag with another bag or set it to null even.
>
> Nevertheless, we could annotate:
>
> @DefaultExpose(ExposeLevels.ALL)
> public class Man {
> private Bag bag;
> }
>
> public class Customs {
> public boolean investigate(Man man) {
> Pencil = man.getPencil();
> }
> }
>
> :::: Alternatively you can move the annotation
>
> public class Man {
> @DefaultExpose(ExposeLevels.ALL)
> private Bag bag;
> }
>
> ::: or even more detailed:
>
> public class Bag {
> @DefaultExpose(ExposeLevels.ALL)
> private PencilCase pencilCase;
> }
>
>
> Override rules could be same as "as if" the Man extended Bag and as if
> Bag extened PencilCase.
>
> **
> Martin
Re: Scala-Wicket Help and Advice
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
>>> Either way, you have to put logic somewhere that tries to figure out
>>> what the heck you want to borrow and then figure out where the heck to
>>> get it.
>>
>> If it is done at compile time you don't need "messaging" logic. It
>> would be uniquely defined what you can get.
>
> Please explain.
Think about object hierarchy. It is uniquely defined what method
overrides what etc.
So it would just expand the same idea to "membership dimensions" in
addition to "inheritance dimensions".
I mean that assuming man has a bag would work effectively similar to
man extends bag at compile time.
If bag has a getter then man can expose that getter. However, if we
would really extend bag then we are stuck with it (and we could'nt
have man wear both jacket, trousers and bag at same time).
When man only "has" bag then we can also change the bag and extend the
bag with another bag or set it to null even.
Nevertheless, we could annotate:
@DefaultExpose(ExposeLevels.ALL)
public class Man {
private Bag bag;
}
public class Customs {
public boolean investigate(Man man) {
Pencil = man.getPencil();
}
}
:::: Alternatively you can move the annotation
public class Man {
@DefaultExpose(ExposeLevels.ALL)
private Bag bag;
}
::: or even more detailed:
public class Bag {
@DefaultExpose(ExposeLevels.ALL)
private PencilCase pencilCase;
}
Override rules could be same as "as if" the Man extended Bag and as if
Bag extened PencilCase.
**
Martin
Re: Scala-Wicket Help and Advice
Posted by James Carman <ja...@carmanconsulting.com>.
On Sat, Jan 8, 2011 at 4:19 PM, Martin Makundi
<ma...@koodaripalvelut.com> wrote:
>>
>> Either way, you have to put logic somewhere that tries to figure out
>> what the heck you want to borrow and then figure out where the heck to
>> get it.
>
> If it is done at compile time you don't need "messaging" logic. It
> would be uniquely defined what you can get.
>
Please explain.
Re: Scala-Wicket Help and Advice
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Hi!
> public <T> T borrowObject(Class<T> objectType)
>
> where you can do
>
> Pencil p = man.borrowObject(Pencil.class);
>
> Either way, you have to put logic somewhere that tries to figure out
> what the heck you want to borrow and then figure out where the heck to
> get it.
If it is done at compile time you don't need "messaging" logic. It
would be uniquely defined what you can get.
> I don't necessarily think I would consider this a shortcoming
> of the Java language.
Well.. if there is room for improvement it could be considered a
shortcoming. Solution is not necessarily simple, but possible ;)
**
Martin
>
Re: Scala-Wicket Help and Advice
Posted by James Carman <ja...@carmanconsulting.com>.
On Sat, Jan 8, 2011 at 2:59 PM, Martin Makundi
<ma...@koodaripalvelut.com> wrote:
>
> It should be possible to say that "man will proxy by default all get
> methods of his belongings", It should be possible to say that "bag
> will proxy by default all get methods of his belongings". Same with
> pencil casing. In such situation i wouldn't need to CODE all thsoe
> get.get.get.get methods but the framework or compilation procedure
> would provide them automatically.
>
> WHEN I want to intervene the GET method (and track borrowed pencils
> for example) I could just override the man.getPencil explicitly to do
> that.
>
Okay, I see your point. This type of thing is possible in a language
like Ruby where you can merely send "messages" to an object as opposed
to calling methods. However, then you have to put all sorts of logic
in the "handle any message" method to try to figure out what the heck
you're trying to do (like ActiveRecord's dynamic finders). Is this
any better than just writing a method like this in Java:
public <T> T borrowObject(Class<T> objectType)
where you can do
Pencil p = man.borrowObject(Pencil.class);
Either way, you have to put logic somewhere that tries to figure out
what the heck you want to borrow and then figure out where the heck to
get it. I don't necessarily think I would consider this a shortcoming
of the Java language.
Re: Scala-Wicket Help and Advice
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Hi!
> You would use a more domain-oriented design approach. Setters/getters
> are merely used because of all the frameworks that support (and
> expect) them. Why do you care where the man is carrying his pencil?
> Perhaps he's keeping it in his sock. All you want to do is ask the man
> object for a pencil.
Yes.
> Having to go through his carrying bag to his
> pencil case to get his pencil is exposing the implementation.
I don't plan to expose implementation. I just want to make the
implementation inside the man. But more easily.
> However, if you have to ask him for the pencil and then he can go dig
> in his bag to get his pencil case to find a pencil, then perhaps he can do
> something at that point and jot down a note that you've just borrowed
> a pencil from him.
This is correct but I want to streamline the implementation of "he can go dig
in his bag to get his pencil case to find a pencil".
Again, the more complex you make the example ("jot down a note that
you've just borrowed from him") the more special and rare case you
make it. That's not what I am after to simplify. I want to simplify
the 90% of cases where it is ONLY about GET an item without
interventions.
It should be possible to say that "man will proxy by default all get
methods of his belongings", It should be possible to say that "bag
will proxy by default all get methods of his belongings". Same with
pencil casing. In such situation i wouldn't need to CODE all thsoe
get.get.get.get methods but the framework or compilation procedure
would provide them automatically.
WHEN I want to intervene the GET method (and track borrowed pencils
for example) I could just override the man.getPencil explicitly to do
that.
**
Martin
>
Re: Scala-Wicket Help and Advice
Posted by James Carman <ja...@carmanconsulting.com>.
On Sat, Jan 8, 2011 at 1:25 PM, Martin Makundi
<ma...@koodaripalvelut.com> wrote:
>>> What I hate about java is its one-dimensionality... ehh.. say you have:
>>>
>>> object man
>>> object man carrying bag
>>> bag carrying pencil case.
>>>
>> This isn't a Java problem. This is a design problem.
>
> How would you workaround the design assuming you cannot change the
> releations between the object models (object model has its own
> requirements/sweetspot)?
>
You would use a more domain-oriented design approach. Setters/getters
are merely used because of all the frameworks that support (and
expect) them. Why do you care where the man is carrying his pencil?
Perhaps he's keeping it in his sock. All you want to do is ask the man
object for a pencil. Having to go through his carrying bag to his
pencil case to get his pencil is exposing the implementation. If the
man exposes his bag/pencil case to the world, then someone can just
steal the pencil from him without him knowing about it. However, if
you have to ask him for the pencil and then he can go dig in his bag
to get his pencil case to find a pencil, then perhaps he can do
something at that point and jot down a note that you've just borrowed
a pencil from him.
Re: Scala-Wicket Help and Advice
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
>> What I hate about java is its one-dimensionality... ehh.. say you have:
>>
>> object man
>> object man carrying bag
>> bag carrying pencil case.
>>
> This isn't a Java problem. This is a design problem.
How would you workaround the design assuming you cannot change the
releations between the object models (object model has its own
requirements/sweetspot)?
**
Martin
Re: Scala-Wicket Help and Advice
Posted by James Carman <ja...@carmanconsulting.com>.
On Sat, Jan 8, 2011 at 1:07 PM, Martin Makundi
<ma...@koodaripalvelut.com> wrote:
>
> What I hate about java is its one-dimensionality... ehh.. say you have:
>
> object man
> object man carrying bag
> bag carrying pencil case.
>
> Now I want the man to hand me the pencil, I must implement:
> * man.getpencil->man.getbag.getpencil
> * bag.getpencil->bag.getpencilcase.getpencil
> * pencilcase.getpencil
>
> In real business cases this is very OK, but usually there are 90% just
> dummy getters and 10% are real business objects like "transfer money
> in avery safe and robust manner"...
>
> I whish there was an easy way to "transparently penetrate beans". I
> could actually call man.getPencil and it would be authorized to fetch
> it from bag,pencilcase.
>
> Ofcourse I could configure exceptions to the rule, but in general I
> could say that "it is allowed in general" or "it is not allowed in
> general". And maybe annotate access rules.
>
This isn't a Java problem. This is a design problem.
Re: Scala-Wicket Help and Advice
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
> Analysis is the a background process that parses the file and highlights
> errors, warnings, etc while you type. Eclipse has the same, though the name
> may be different. It's slow in Scala, like compilation is.
If it is slow then it is pain. Computer speeds might enhance faster than ides ;)
> Yes, it gives you context help. It's very helpful with a caveat: in
> Scala, there are several implicit conversions (String to RichString, etc)
> that may take place depending on what method you invoke. IDEA tries to be
> smart and preview the methods that would be accessible if any valid
> transformation for your current type would be accessible, resulting in too
> many matches.
Ouch.
What I hate about java is its one-dimensionality... ehh.. say you have:
object man
object man carrying bag
bag carrying pencil case.
Now I want the man to hand me the pencil, I must implement:
* man.getpencil->man.getbag.getpencil
* bag.getpencil->bag.getpencilcase.getpencil
* pencilcase.getpencil
In real business cases this is very OK, but usually there are 90% just
dummy getters and 10% are real business objects like "transfer money
in avery safe and robust manner"...
I whish there was an easy way to "transparently penetrate beans". I
could actually call man.getPencil and it would be authorized to fetch
it from bag,pencilcase.
Ofcourse I could configure exceptions to the rule, but in general I
could say that "it is allowed in general" or "it is not allowed in
general". And maybe annotate access rules.
Maybe there is a compile time tool that does just this already for
java? Something like bindgen or Project Lombok?
That is the next foreseeable "obstacle" in making java efficient.
After that it's maybe time for fancy functional proframming or
multiple inheritance ;)
**
Martin
>
>
>
> On Sat, Jan 8, 2011 at 1:34 AM, James Carman <ja...@carmanconsulting.com>wrote:
>
>> Since scala is statically-typed, the ide can (and does) give you contextual
>> help very easily
>> On Jan 8, 2011 2:21 AM, "Martin Makundi" <
>> martin.makundi@koodaripalvelut.com>
>> wrote:
>> >> But it will do the right thing about 90% of the time. you'll
>> subconsciously
>> >> work around 4 or 5% of the rest that doesn't work, and the remaining
>> 5-6%
>> >> will irritate you.
>> >
>> > I am used to coding 90% using context help with eclipse (ctrl+space).
>> > I am a fast writer but that speeds up my coding by 1000%.
>> >
>> > Will an IDE do that for scala 90%?
>> >
>> > I consider context help and quickfix proposals most important for speedy
>> work.
>> >
>> >> - imports sometimes get messed up (relative vs absolute, I hate that in
>> >> scala) and require a manual correction
>> >
>> > Import organization is important to me also. I like to spend my time
>> > coding logic instead of organizing text files.
>> >
>> >> - analysis is useful about 90% of the time, but it's so slow you may
>> just
>> >> not care for it
>> >
>> > What is analysis? I hope it isn't the context help ;)
>> >
>> >
>> >
>> > **
>> > Martin
>> >
>> >> - it crashes the JVM on Oracle's JRockit (although IDEA is much faster
>> in
>> >> that jvm)
>> >>
>> >>
>> >> On Fri, Jan 7, 2011 at 5:37 PM, Liam Clarke-Hutchinson
>> >> <li...@steelsky.co.nz>wrote:
>> >>
>> >>> Define complete.
>> >>>
>> >>> On Sat, Jan 8, 2011 at 7:52 AM, Martin Makundi <
>> >>> martin.makundi@koodaripalvelut.com> wrote:
>> >>>
>> >>> > Nice or complete?
>> >>> >
>> >>> > **
>> >>> > Martin
>> >>> >
>> >>> > 2011/1/7 Jonathan Locke <jo...@gmail.com>:
>> >>> > >
>> >>> > > Have you checked out IDEA? My Scala friends tell me it has pretty
>> nice
>> >>> > Scala
>> >>> > > support.
>> >>> > >
>> >>> > > Jon
>> >>> > >
>> >>> > > "Less is more."
>> >>> > >
>> >>> >
>> >>>
>> http://www.amazon.com/Coding-Software-Process-Jonathan-Locke/dp/0615404820/
>> >>> > >
>> >>> > > --
>> >>> > > View this message in context:
>> >>> >
>> >>>
>>
>> http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3185239.html
>> >>> > > Sent from the Forum for Wicket Core developers mailing list archive
>> at
>> >>> > Nabble.com.
>> >>> > >
>> >>> >
>> >>>
>> >>
>>
>
Re: Scala-Wicket Help and Advice
Posted by Gustavo Hexsel <gh...@gmail.com>.
Analysis is the a background process that parses the file and highlights
errors, warnings, etc while you type. Eclipse has the same, though the name
may be different. It's slow in Scala, like compilation is.
Yes, it gives you context help. It's very helpful with a caveat: in
Scala, there are several implicit conversions (String to RichString, etc)
that may take place depending on what method you invoke. IDEA tries to be
smart and preview the methods that would be accessible if any valid
transformation for your current type would be accessible, resulting in too
many matches.
Scala has a billion ways to do things, and a billion methods to go with
it. Auto-completion and control-mouseover/control-click (show definition/go
to definition) are extremely helpful to find which method or operator is
being called and where it is defined.
On Sat, Jan 8, 2011 at 1:34 AM, James Carman <ja...@carmanconsulting.com>wrote:
> Since scala is statically-typed, the ide can (and does) give you contextual
> help very easily
> On Jan 8, 2011 2:21 AM, "Martin Makundi" <
> martin.makundi@koodaripalvelut.com>
> wrote:
> >> But it will do the right thing about 90% of the time. you'll
> subconsciously
> >> work around 4 or 5% of the rest that doesn't work, and the remaining
> 5-6%
> >> will irritate you.
> >
> > I am used to coding 90% using context help with eclipse (ctrl+space).
> > I am a fast writer but that speeds up my coding by 1000%.
> >
> > Will an IDE do that for scala 90%?
> >
> > I consider context help and quickfix proposals most important for speedy
> work.
> >
> >> - imports sometimes get messed up (relative vs absolute, I hate that in
> >> scala) and require a manual correction
> >
> > Import organization is important to me also. I like to spend my time
> > coding logic instead of organizing text files.
> >
> >> - analysis is useful about 90% of the time, but it's so slow you may
> just
> >> not care for it
> >
> > What is analysis? I hope it isn't the context help ;)
> >
> >
> >
> > **
> > Martin
> >
> >> - it crashes the JVM on Oracle's JRockit (although IDEA is much faster
> in
> >> that jvm)
> >>
> >>
> >> On Fri, Jan 7, 2011 at 5:37 PM, Liam Clarke-Hutchinson
> >> <li...@steelsky.co.nz>wrote:
> >>
> >>> Define complete.
> >>>
> >>> On Sat, Jan 8, 2011 at 7:52 AM, Martin Makundi <
> >>> martin.makundi@koodaripalvelut.com> wrote:
> >>>
> >>> > Nice or complete?
> >>> >
> >>> > **
> >>> > Martin
> >>> >
> >>> > 2011/1/7 Jonathan Locke <jo...@gmail.com>:
> >>> > >
> >>> > > Have you checked out IDEA? My Scala friends tell me it has pretty
> nice
> >>> > Scala
> >>> > > support.
> >>> > >
> >>> > > Jon
> >>> > >
> >>> > > "Less is more."
> >>> > >
> >>> >
> >>>
> http://www.amazon.com/Coding-Software-Process-Jonathan-Locke/dp/0615404820/
> >>> > >
> >>> > > --
> >>> > > View this message in context:
> >>> >
> >>>
>
> http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3185239.html
> >>> > > Sent from the Forum for Wicket Core developers mailing list archive
> at
> >>> > Nabble.com.
> >>> > >
> >>> >
> >>>
> >>
>
Re: Scala-Wicket Help and Advice
Posted by Liam Clarke-Hutchinson <li...@steelsky.co.nz>.
On Tue, Jan 11, 2011 at 6:18 AM, Gustavo Hexsel <gh...@gmail.com> wrote:
> Actually, in Scala it's idiomatic to skip the type on vals (unless they're
> complex structures or you NEED to declare the type as a higher-level, like
> it's a public val of a java collection and you want to enforce the
> interface).
>
I know, I was trying to give IntelliJ as many hints as possible though. I
use explicit types when it makes my code clearer.
Also, if you type "new Model<blah>()" and do an insert-variable while it's
> under the cursor, it will create the val declaration for you (with the type
> if you want).
>
Ah, I might be doing it backwards, I'll have to give it a shot.
Regards,
Liam Clarke
> On Sun, Jan 9, 2011 at 8:11 PM, Liam Clarke-Hutchinson
> <li...@steelsky.co.nz>wrote:
>
> > Biggest thing I miss in IntelliJ when coding Scala (I write Wicket in
> Java
> > for my dayjob) is my autocompletion of types. In Java you can type in
> > "IModel<String> foo = new" and hit Ctrl + shift + space and it'll provide
> a
> > list of all types that subclass IModel, but for the time being (IntelliJ
> > 10, build 99.32, Scala plugin 0.4.407) "val foo: IModel[String] = new"
> with
> > ctrl + shift + space does nothing.
> >
> > But IntelliJ does a really good job of navigating some of the byzantine
> > Scala code I've been dealing with. (Some people seem to think that every
> > Scala library should be a DSL replete with mysterious operators and where
> > everything happens via implicit conversions nested three types deep. :<)
> > It's definitely the best I've seen for Scala, but it's not quite at the
> > Java
> > levels of polish - but then, JetBrains have been working on the Java side
> > of
> > Intellij for 10 versions now. ;)
> >
> >
> > On Sat, Jan 8, 2011 at 10:34 PM, James Carman <
> james@carmanconsulting.com
> > >wrote:
> >
> > > Since scala is statically-typed, the ide can (and does) give you
> > contextual
> > > help very easily
> > > On Jan 8, 2011 2:21 AM, "Martin Makundi" <
> > > martin.makundi@koodaripalvelut.com>
> > > wrote:
> > > >> But it will do the right thing about 90% of the time. you'll
> > > subconsciously
> > > >> work around 4 or 5% of the rest that doesn't work, and the remaining
> > > 5-6%
> > > >> will irritate you.
> > > >
> > > > I am used to coding 90% using context help with eclipse (ctrl+space).
> > > > I am a fast writer but that speeds up my coding by 1000%.
> > > >
> > > > Will an IDE do that for scala 90%?
> > > >
> > > > I consider context help and quickfix proposals most important for
> > speedy
> > > work.
> > > >
> > > >> - imports sometimes get messed up (relative vs absolute, I hate that
> > in
> > > >> scala) and require a manual correction
> > > >
> > > > Import organization is important to me also. I like to spend my time
> > > > coding logic instead of organizing text files.
> > > >
> > > >> - analysis is useful about 90% of the time, but it's so slow you may
> > > just
> > > >> not care for it
> > > >
> > > > What is analysis? I hope it isn't the context help ;)
> > > >
> > > >
> > > >
> > > > **
> > > > Martin
> > > >
> > > >> - it crashes the JVM on Oracle's JRockit (although IDEA is much
> faster
> > > in
> > > >> that jvm)
> > > >>
> > > >>
> > > >> On Fri, Jan 7, 2011 at 5:37 PM, Liam Clarke-Hutchinson
> > > >> <li...@steelsky.co.nz>wrote:
> > > >>
> > > >>> Define complete.
> > > >>>
> > > >>> On Sat, Jan 8, 2011 at 7:52 AM, Martin Makundi <
> > > >>> martin.makundi@koodaripalvelut.com> wrote:
> > > >>>
> > > >>> > Nice or complete?
> > > >>> >
> > > >>> > **
> > > >>> > Martin
> > > >>> >
> > > >>> > 2011/1/7 Jonathan Locke <jo...@gmail.com>:
> > > >>> > >
> > > >>> > > Have you checked out IDEA? My Scala friends tell me it has
> pretty
> > > nice
> > > >>> > Scala
> > > >>> > > support.
> > > >>> > >
> > > >>> > > Jon
> > > >>> > >
> > > >>> > > "Less is more."
> > > >>> > >
> > > >>> >
> > > >>>
> > >
> >
> http://www.amazon.com/Coding-Software-Process-Jonathan-Locke/dp/0615404820/
> > > >>> > >
> > > >>> > > --
> > > >>> > > View this message in context:
> > > >>> >
> > > >>>
> > >
> > >
> >
> http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3185239.html
> > > >>> > > Sent from the Forum for Wicket Core developers mailing list
> > archive
> > > at
> > > >>> > Nabble.com.
> > > >>> > >
> > > >>> >
> > > >>>
> > > >>
> > >
> >
>
Re: Scala-Wicket Help and Advice
Posted by Gustavo Hexsel <gh...@gmail.com>.
Actually, in Scala it's idiomatic to skip the type on vals (unless they're
complex structures or you NEED to declare the type as a higher-level, like
it's a public val of a java collection and you want to enforce the
interface).
Also, if you type "new Model<blah>()" and do an insert-variable while it's
under the cursor, it will create the val declaration for you (with the type
if you want).
On Sun, Jan 9, 2011 at 8:11 PM, Liam Clarke-Hutchinson
<li...@steelsky.co.nz>wrote:
> Biggest thing I miss in IntelliJ when coding Scala (I write Wicket in Java
> for my dayjob) is my autocompletion of types. In Java you can type in
> "IModel<String> foo = new" and hit Ctrl + shift + space and it'll provide a
> list of all types that subclass IModel, but for the time being (IntelliJ
> 10, build 99.32, Scala plugin 0.4.407) "val foo: IModel[String] = new" with
> ctrl + shift + space does nothing.
>
> But IntelliJ does a really good job of navigating some of the byzantine
> Scala code I've been dealing with. (Some people seem to think that every
> Scala library should be a DSL replete with mysterious operators and where
> everything happens via implicit conversions nested three types deep. :<)
> It's definitely the best I've seen for Scala, but it's not quite at the
> Java
> levels of polish - but then, JetBrains have been working on the Java side
> of
> Intellij for 10 versions now. ;)
>
>
> On Sat, Jan 8, 2011 at 10:34 PM, James Carman <james@carmanconsulting.com
> >wrote:
>
> > Since scala is statically-typed, the ide can (and does) give you
> contextual
> > help very easily
> > On Jan 8, 2011 2:21 AM, "Martin Makundi" <
> > martin.makundi@koodaripalvelut.com>
> > wrote:
> > >> But it will do the right thing about 90% of the time. you'll
> > subconsciously
> > >> work around 4 or 5% of the rest that doesn't work, and the remaining
> > 5-6%
> > >> will irritate you.
> > >
> > > I am used to coding 90% using context help with eclipse (ctrl+space).
> > > I am a fast writer but that speeds up my coding by 1000%.
> > >
> > > Will an IDE do that for scala 90%?
> > >
> > > I consider context help and quickfix proposals most important for
> speedy
> > work.
> > >
> > >> - imports sometimes get messed up (relative vs absolute, I hate that
> in
> > >> scala) and require a manual correction
> > >
> > > Import organization is important to me also. I like to spend my time
> > > coding logic instead of organizing text files.
> > >
> > >> - analysis is useful about 90% of the time, but it's so slow you may
> > just
> > >> not care for it
> > >
> > > What is analysis? I hope it isn't the context help ;)
> > >
> > >
> > >
> > > **
> > > Martin
> > >
> > >> - it crashes the JVM on Oracle's JRockit (although IDEA is much faster
> > in
> > >> that jvm)
> > >>
> > >>
> > >> On Fri, Jan 7, 2011 at 5:37 PM, Liam Clarke-Hutchinson
> > >> <li...@steelsky.co.nz>wrote:
> > >>
> > >>> Define complete.
> > >>>
> > >>> On Sat, Jan 8, 2011 at 7:52 AM, Martin Makundi <
> > >>> martin.makundi@koodaripalvelut.com> wrote:
> > >>>
> > >>> > Nice or complete?
> > >>> >
> > >>> > **
> > >>> > Martin
> > >>> >
> > >>> > 2011/1/7 Jonathan Locke <jo...@gmail.com>:
> > >>> > >
> > >>> > > Have you checked out IDEA? My Scala friends tell me it has pretty
> > nice
> > >>> > Scala
> > >>> > > support.
> > >>> > >
> > >>> > > Jon
> > >>> > >
> > >>> > > "Less is more."
> > >>> > >
> > >>> >
> > >>>
> >
> http://www.amazon.com/Coding-Software-Process-Jonathan-Locke/dp/0615404820/
> > >>> > >
> > >>> > > --
> > >>> > > View this message in context:
> > >>> >
> > >>>
> >
> >
> http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3185239.html
> > >>> > > Sent from the Forum for Wicket Core developers mailing list
> archive
> > at
> > >>> > Nabble.com.
> > >>> > >
> > >>> >
> > >>>
> > >>
> >
>
Re: Scala-Wicket Help and Advice
Posted by Liam Clarke-Hutchinson <li...@steelsky.co.nz>.
Biggest thing I miss in IntelliJ when coding Scala (I write Wicket in Java
for my dayjob) is my autocompletion of types. In Java you can type in
"IModel<String> foo = new" and hit Ctrl + shift + space and it'll provide a
list of all types that subclass IModel, but for the time being (IntelliJ
10, build 99.32, Scala plugin 0.4.407) "val foo: IModel[String] = new" with
ctrl + shift + space does nothing.
But IntelliJ does a really good job of navigating some of the byzantine
Scala code I've been dealing with. (Some people seem to think that every
Scala library should be a DSL replete with mysterious operators and where
everything happens via implicit conversions nested three types deep. :<)
It's definitely the best I've seen for Scala, but it's not quite at the Java
levels of polish - but then, JetBrains have been working on the Java side of
Intellij for 10 versions now. ;)
On Sat, Jan 8, 2011 at 10:34 PM, James Carman <ja...@carmanconsulting.com>wrote:
> Since scala is statically-typed, the ide can (and does) give you contextual
> help very easily
> On Jan 8, 2011 2:21 AM, "Martin Makundi" <
> martin.makundi@koodaripalvelut.com>
> wrote:
> >> But it will do the right thing about 90% of the time. you'll
> subconsciously
> >> work around 4 or 5% of the rest that doesn't work, and the remaining
> 5-6%
> >> will irritate you.
> >
> > I am used to coding 90% using context help with eclipse (ctrl+space).
> > I am a fast writer but that speeds up my coding by 1000%.
> >
> > Will an IDE do that for scala 90%?
> >
> > I consider context help and quickfix proposals most important for speedy
> work.
> >
> >> - imports sometimes get messed up (relative vs absolute, I hate that in
> >> scala) and require a manual correction
> >
> > Import organization is important to me also. I like to spend my time
> > coding logic instead of organizing text files.
> >
> >> - analysis is useful about 90% of the time, but it's so slow you may
> just
> >> not care for it
> >
> > What is analysis? I hope it isn't the context help ;)
> >
> >
> >
> > **
> > Martin
> >
> >> - it crashes the JVM on Oracle's JRockit (although IDEA is much faster
> in
> >> that jvm)
> >>
> >>
> >> On Fri, Jan 7, 2011 at 5:37 PM, Liam Clarke-Hutchinson
> >> <li...@steelsky.co.nz>wrote:
> >>
> >>> Define complete.
> >>>
> >>> On Sat, Jan 8, 2011 at 7:52 AM, Martin Makundi <
> >>> martin.makundi@koodaripalvelut.com> wrote:
> >>>
> >>> > Nice or complete?
> >>> >
> >>> > **
> >>> > Martin
> >>> >
> >>> > 2011/1/7 Jonathan Locke <jo...@gmail.com>:
> >>> > >
> >>> > > Have you checked out IDEA? My Scala friends tell me it has pretty
> nice
> >>> > Scala
> >>> > > support.
> >>> > >
> >>> > > Jon
> >>> > >
> >>> > > "Less is more."
> >>> > >
> >>> >
> >>>
> http://www.amazon.com/Coding-Software-Process-Jonathan-Locke/dp/0615404820/
> >>> > >
> >>> > > --
> >>> > > View this message in context:
> >>> >
> >>>
>
> http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3185239.html
> >>> > > Sent from the Forum for Wicket Core developers mailing list archive
> at
> >>> > Nabble.com.
> >>> > >
> >>> >
> >>>
> >>
>
Re: Scala-Wicket Help and Advice
Posted by James Carman <ja...@carmanconsulting.com>.
Since scala is statically-typed, the ide can (and does) give you contextual
help very easily
On Jan 8, 2011 2:21 AM, "Martin Makundi" <ma...@koodaripalvelut.com>
wrote:
>> But it will do the right thing about 90% of the time. you'll
subconsciously
>> work around 4 or 5% of the rest that doesn't work, and the remaining 5-6%
>> will irritate you.
>
> I am used to coding 90% using context help with eclipse (ctrl+space).
> I am a fast writer but that speeds up my coding by 1000%.
>
> Will an IDE do that for scala 90%?
>
> I consider context help and quickfix proposals most important for speedy
work.
>
>> - imports sometimes get messed up (relative vs absolute, I hate that in
>> scala) and require a manual correction
>
> Import organization is important to me also. I like to spend my time
> coding logic instead of organizing text files.
>
>> - analysis is useful about 90% of the time, but it's so slow you may just
>> not care for it
>
> What is analysis? I hope it isn't the context help ;)
>
>
>
> **
> Martin
>
>> - it crashes the JVM on Oracle's JRockit (although IDEA is much faster in
>> that jvm)
>>
>>
>> On Fri, Jan 7, 2011 at 5:37 PM, Liam Clarke-Hutchinson
>> <li...@steelsky.co.nz>wrote:
>>
>>> Define complete.
>>>
>>> On Sat, Jan 8, 2011 at 7:52 AM, Martin Makundi <
>>> martin.makundi@koodaripalvelut.com> wrote:
>>>
>>> > Nice or complete?
>>> >
>>> > **
>>> > Martin
>>> >
>>> > 2011/1/7 Jonathan Locke <jo...@gmail.com>:
>>> > >
>>> > > Have you checked out IDEA? My Scala friends tell me it has pretty
nice
>>> > Scala
>>> > > support.
>>> > >
>>> > > Jon
>>> > >
>>> > > "Less is more."
>>> > >
>>> >
>>>
http://www.amazon.com/Coding-Software-Process-Jonathan-Locke/dp/0615404820/
>>> > >
>>> > > --
>>> > > View this message in context:
>>> >
>>>
http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3185239.html
>>> > > Sent from the Forum for Wicket Core developers mailing list archive
at
>>> > Nabble.com.
>>> > >
>>> >
>>>
>>
Re: Scala-Wicket Help and Advice
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
> But it will do the right thing about 90% of the time. you'll subconsciously
> work around 4 or 5% of the rest that doesn't work, and the remaining 5-6%
> will irritate you.
I am used to coding 90% using context help with eclipse (ctrl+space).
I am a fast writer but that speeds up my coding by 1000%.
Will an IDE do that for scala 90%?
I consider context help and quickfix proposals most important for speedy work.
> - imports sometimes get messed up (relative vs absolute, I hate that in
> scala) and require a manual correction
Import organization is important to me also. I like to spend my time
coding logic instead of organizing text files.
> - analysis is useful about 90% of the time, but it's so slow you may just
> not care for it
What is analysis? I hope it isn't the context help ;)
**
Martin
> - it crashes the JVM on Oracle's JRockit (although IDEA is much faster in
> that jvm)
>
>
> On Fri, Jan 7, 2011 at 5:37 PM, Liam Clarke-Hutchinson
> <li...@steelsky.co.nz>wrote:
>
>> Define complete.
>>
>> On Sat, Jan 8, 2011 at 7:52 AM, Martin Makundi <
>> martin.makundi@koodaripalvelut.com> wrote:
>>
>> > Nice or complete?
>> >
>> > **
>> > Martin
>> >
>> > 2011/1/7 Jonathan Locke <jo...@gmail.com>:
>> > >
>> > > Have you checked out IDEA? My Scala friends tell me it has pretty nice
>> > Scala
>> > > support.
>> > >
>> > > Jon
>> > >
>> > > "Less is more."
>> > >
>> >
>> http://www.amazon.com/Coding-Software-Process-Jonathan-Locke/dp/0615404820/
>> > >
>> > > --
>> > > View this message in context:
>> >
>> http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3185239.html
>> > > Sent from the Forum for Wicket Core developers mailing list archive at
>> > Nabble.com.
>> > >
>> >
>>
>
Re: Scala-Wicket Help and Advice
Posted by Gustavo Hexsel <gh...@gmail.com>.
it's not 100% of Java's level,mostly cause Scala is a much more complex
language.
But it will do the right thing about 90% of the time. you'll subconsciously
work around 4 or 5% of the rest that doesn't work, and the remaining 5-6%
will irritate you.
That's my perception, of course...
Among the list of things I found that may annoy you:
- imports sometimes get messed up (relative vs absolute, I hate that in
scala) and require a manual correction
- compilation is slower than sbt in "~ compile" so I never use it
- analysis is useful about 90% of the time, but it's so slow you may just
not care for it
- it crashes the JVM on Oracle's JRockit (although IDEA is much faster in
that jvm)
On Fri, Jan 7, 2011 at 5:37 PM, Liam Clarke-Hutchinson
<li...@steelsky.co.nz>wrote:
> Define complete.
>
> On Sat, Jan 8, 2011 at 7:52 AM, Martin Makundi <
> martin.makundi@koodaripalvelut.com> wrote:
>
> > Nice or complete?
> >
> > **
> > Martin
> >
> > 2011/1/7 Jonathan Locke <jo...@gmail.com>:
> > >
> > > Have you checked out IDEA? My Scala friends tell me it has pretty nice
> > Scala
> > > support.
> > >
> > > Jon
> > >
> > > "Less is more."
> > >
> >
> http://www.amazon.com/Coding-Software-Process-Jonathan-Locke/dp/0615404820/
> > >
> > > --
> > > View this message in context:
> >
> http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3185239.html
> > > Sent from the Forum for Wicket Core developers mailing list archive at
> > Nabble.com.
> > >
> >
>
Re: Scala-Wicket Help and Advice
Posted by Liam Clarke-Hutchinson <li...@steelsky.co.nz>.
Define complete.
On Sat, Jan 8, 2011 at 7:52 AM, Martin Makundi <
martin.makundi@koodaripalvelut.com> wrote:
> Nice or complete?
>
> **
> Martin
>
> 2011/1/7 Jonathan Locke <jo...@gmail.com>:
> >
> > Have you checked out IDEA? My Scala friends tell me it has pretty nice
> Scala
> > support.
> >
> > Jon
> >
> > "Less is more."
> >
> http://www.amazon.com/Coding-Software-Process-Jonathan-Locke/dp/0615404820/
> >
> > --
> > View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3185239.html
> > Sent from the Forum for Wicket Core developers mailing list archive at
> Nabble.com.
> >
>
Re: Scala-Wicket Help and Advice
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Nice or complete?
**
Martin
2011/1/7 Jonathan Locke <jo...@gmail.com>:
>
> Have you checked out IDEA? My Scala friends tell me it has pretty nice Scala
> support.
>
> Jon
>
> "Less is more."
> http://www.amazon.com/Coding-Software-Process-Jonathan-Locke/dp/0615404820/
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3185239.html
> Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.
>
Re: Scala-Wicket Help and Advice
Posted by Jonathan Locke <jo...@gmail.com>.
Have you checked out IDEA? My Scala friends tell me it has pretty nice Scala
support.
Jon
"Less is more."
http://www.amazon.com/Coding-Software-Process-Jonathan-Locke/dp/0615404820/
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3185239.html
Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.
Re: Scala-Wicket Help and Advice
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
I would adopt scala immediately if it had all the IDE tools Java has
with equal reliability (amount of showstopper/awkward bugs).
So guess it's just a matter of time, if nobody comes up with something better.
Lots of people are taught into coding java (as if that helps ;), so
one day when people are taught scala or its successors, it might be
perceived more mainstreamn than now.
Anywayz.. in 50 yrs or so, computers will be doing the coding automatically ;))
**
Martin
2011/1/7 Jonathan Locke <jo...@gmail.com>:
>
> Kuhn's "The Structure of Scientific Revolutions" has to do with people
> denying *the truth* when there are radical paradigm shifts in knowledge. I
> hardly think Scala qualifies for this analogy. Most of what Scala does has
> already been done in one form or another. What it represents is the
> application of long-existing knowledge from universities to *industrial*
> problems. As did Java.
>
> I do not deny that Scala is better than Java in terms of its abstract
> approach to a variety of problems that Java doesn't and probably never will
> solve well (and these are problems that I am excited to see solved). What I
> am saying, however, is that your idea that it's going to get widespread
> adoption is very naive regarding the contexts where it would need to be
> applied. I think Scala is going to become difficult to follow in the absence
> of these magical coding guidelines (which are always bent or ignored) much
> more quickly than Java does, which means it is going to prove exceptionally
> hard to manage on a large team. Which is going to make it difficult for
> managers to chose Scala (they don't want to make their own job harder or
> riskier). They have to understand and be comfortable with all these deep and
> dangerous features and techniques. Which really means that they have to be
> fairly top-flight coders. I don't know about you, but relatively few of my
> bosses have been this intellectually adventurous or willing to take on risk
> (and for good reason: they are there (unfortunately perhaps) to produce
> business results, not technical excellence).
>
> I think Scala's forte is going to be allowing very small teams where
> everyone understands all aspects of Scala fairly deeply (i.e., you'd better
> understand monads and Scala's type system fully because SOMEONE on your team
> will use a feature or technique if it exists!) to produce amazing results
> *very* quickly. That is something of a revolution in itself, but I think it
> will be a cottage industry relative to the size rest of the software
> industry. This is not necessarily a bad thing. If you want to work with
> smart people, Scala is going to be a pretty quick way of identifying smart
> people! I know this from experience: I can't even understand on several
> readings a lot of my friend Greg's posts about Scala and monads and
> mathematics. I would need to go back to graduate school in math and I'd
> probably need an IQ upgrade to boot.
>
> I know this sounds awfully Dilbert (and maybe that's who I've become), but
> at a mid-sized or large company (which is where most people work), what you
> want in a language is something that protects you from your co-workers. In
> my experience, even the "advanced" features of C++ and Java have
> consistently been abused and even wrecked whole projects.
>
> All this said, Scala is probably a god-send to small startups and university
> spin-offs. And I think it's an important stake in the ground because it
> references a future wider-scale industrial software revolution that
> eventually will occur when someone more practical sits down and figures out
> how to pack Scala's features (and some things it didn't address) into a
> language that's as easy to learn and read and work with as Java. My advice
> to you is this: don't get caught up in the politics of technology adoption.
> You will only find yourself frustrated and disappointed because at the end
> of the day, it's a business world not a technology world. Instead go find
> the cool kids and hack away in Scala on some crazy new startup that really
> will change the world. Odds are you'll beat the pants off your Java-based
> competitors on time-to-market. And if you're wondering why I don't do that,
> it's because of all this green paper stuff they keep throwing at me. Maybe I
> really have gotten old.
>
> Jon
>
> "Less is more."
> http://www.amazon.com/Coding-Software-Process-Jonathan-Locke/dp/0615404820/
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3181566.html
> Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.
>
Re: Scala-Wicket Help and Advice
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Why people use C++ to facilitate making business a mess?
**
Martin
2011/1/19 Liam Clarke-Hutchinson <li...@steelsky.co.nz>:
> Hey mate,
>
> I code Java for my day job, and write my fun code in Scala. I just love the
> flexibility of Scala combined with the power to use all my existing Java
> libraries. That said,
> I don't see Scala overcoming Java anytime soon because it offers developers
> _too much_ freedom. I had a real bad time using
> http://dispatch.databinder.net for a project, because it fully utilized a
> lot of Scala features to offer a really shit API. Java makes everyone
> conform to a base level while preventing soaring, and it's a base level
> that's sane. And when it comes to writing business code, as in "Code that
> makes money", Scala's freedom doesn't offer overly much compared to Java's
> enforced conformity.
>
> Don't get me wrong, I <3 Scala, but while half of me wants to use it at
> work, the other half is terrified of what the Java developers who write
> Spring code like this:
>
> <bean id="something class="java.lang.String">
> <constructor-arg index="0">
> <value>${someProperty}</value>
> </constructor-arg>
> </bean>
>
> Would do with the power of Scala at their finger tips. (PS, that's real
> Spring code that I saw (and refactored) today.)
>
> On Tue, Jan 18, 2011 at 5:33 PM, richard emberson <
> richard.emberson@gmail.com> wrote:
>
>> I originally mentioned the Kuhn book in the context of the politics of
>> change. Altering the focus, you brought up *the truth* as the view
>> held by those resisting change, which I believe is not the larger
>> insight to be gained from his book. It is still my contention that my
>> original interpretation is valid; Scala faces resistance to change and
>> the structure of that resistance, maps into those structures
>> identified by Kuhn.
>>
>> Using a term you earlier used, I think it would be naive to believe
>> that entrenched business forces will stop the emergence of a new,
>> major development language. Such forces were aligned against C, C++
>> and Java, but the forces were overcome. In each case, rational
>> examination of the languages revealed advantages as well as
>> non-rational forces, such as Sun's marketing and glitter in the case
>> of Java, strengthening the prospects of the language's adaption. I
>> hope we can both agree that change will come.
>>
>> But, I do not believe the change will be revolutionary but, rather,
>> evolutionary. A language that evolves from an existing ecosystem has a
>> much greater likelihood of becoming significant than a green field
>> language.
>>
>> I paint and sculpt as well as do mathematics and physics and, for me,
>> language selection is far closer to math and physics than to the play
>> of colors or shape and form. I, thus, do not agree that choosing a
>> programming language is an exercise in artistry, but rather, its a
>> more rational process. And, if beauty is involved, then it is
>> scientific beauty and not artistic beauty. Are you Picasso? Maybe
>> even Mondrian? Hopefully, not Pollock.
>>
>> Concerning the languages you listed as "the way forward", an important
>> criteria must be: where are the programmers coming from? One can wait
>> for a new generation or one can see if any existing programmers will
>> migrate from their current language to a new language. Some language
>> usages from the web:
>> Java 18%
>> C 16%
>> C++ 9%
>> Python 6%
>> C# 6%
>> Objective-C 3%
>> Ruby 2%
>> Lisp 1%
>> Scheme ~0.5%
>> Haskell ~0.3%
>> Scala ~0.3%
>> Eiffel <0.1%
>> Clojure ~0.0%
>>
>> So, where might future Haskell or Clojure or Eiffel or Scala
>> programmers come from?
>>
>> # So, what about Eiffel?
>>
>> Eiffel (with DbC, "design by contract") is a 25 year old language and
>> its usage stats are down in the noise - well below Scala, Clojure and
>> Haskell - and showing its age. Hard to see a ground swell of C or Java
>> programmers switching to Eiffel.
>>
>> Eiffel's grasp exceeded what could be supported; its notion of
>> "contract" was so big, it was hard to find a wrapper around it all.
>> Category Theory may provide for a pragmatic approach to reasoning
>> about interfaces (contracts) which might not encompass all possible
>> rely/guarantee predicates, but many. As such, the three laws of
>> Monads from Category Theory might yield a more coherent, reasoned
>> approach to DbC and interface design. Curiously, this has been
>> discussed by the author of Scala as a possible approach to adding DbC
>> to Scala. For the Scala-CLR binding there is native support for such
>> constructs while for the Scala-JVM binding, it would have to be done
>> with code.
>>
>>
>> # So, what about Haskell?
>>
>> Haskell is the flag ship FP testbed which has been out there for close
>> to 20 years. There are no large enterprise applications written in
>> Haskell. It has certainly not taking the programming world by storm
>> whatever its merits. In addition, for Haskell, and all FP languages
>> for that matter, the world view required is not shared by most people,
>> Folks do not see the world as math functions (program mangers and
>> customers certainly don't); functional programming in-the-large is an
>> unnatural mapping of external objects and relationship to a FP design.
>> (That said, Category Theory is being used more in Physics and
>> non-computer Mathematics as a means of providing some guidance by
>> helping to find higher level relationships between areas of research,
>> but those are rather rarefied endeavors.) Again, where are the
>> converts to Haskell coming from? Just an occasional graduate student.
>>
>>
>> # So, what about Clojure?
>>
>> Clojure is an interesting case; its immutable data structures are a
>> strength but as soon as you allow users to call into Java libraries
>> any program-level reasoning due to such data structures are suspect -
>> an issue with any FP language which is not 100% pure. In addition,
>> where is the pool of potential converts? Clojure is a rather large
>> leap for the 20% of programmers using Java (or for that matter for the
>> 20% using C/C++) Converts would likely come from the Lisp (1% usage)
>> and Scheme (usage levels in the noise) community.
>>
>> As an aside, I had considered porting the Clojure runtime to Scala.
>> There would have been many advantages over the Java-based
>> runtime, e.g.:
>> Scala with its immutable data structures would be a good fit,
>> Scala's coming parallelized data structures targeted to
>> multi-core environments saving the Clojure group much development
>> effort.
>> Scala would have given the Clojure community delimited continuations
>> which the Scheme folks would like and understand.
>> But, such a port, while interesting and I would certainly have
>> learned Clojure, would not have appreciably increased the number
>> of Scala users - so I choice Wicket.
>>
>>
>> # So, what about Scala?
>>
>> I recently came upon a discussion of Joshua Bloch's "Effective Java",
>> its list of recommended practices and how they map into Scala.
>> Curiously, in each case, the article pointed out that Scala made
>> simpler or completely eliminated the need for the "Effective Java"
>> better-coding-practice. So, if one thinks that "Effective Java" makes
>> sense, so does, at least at the level of the recommendations, a switch
>> to Scala - the state of art has moved on from Java. As I have been
>> advocating, Scala is a better Java; switching from OO Java to OO Scala
>> is relatively easy and certainly Java's warts have become very
>> glaring.
>>
>> As with any language and development team, one needs development
>> standards. In this, Scala is no different than Java, C++, C, etc. To
>> not let programmers use Scala because one don't trust them and that
>> the team's development practices are not being followed or are
>> inadequate is not a problem with the language but rather with those in
>> positions of authority and/or respect for failing to set the proper
>> environment.
>>
>> Scala does allow users to access the existing, significant base of
>> Java libraries so that a whole universe of supporting libraries does
>> not have to be re-created for Scala. Also, if the use of its
>> functional and extended type capabilities are controlled, it offers a
>> relatively easy migration for the average Java programmer (or any of
>> the other OO languages listed above - a large pool of potential
>> converts).
>>
>>
>> The rate of change is increasing, A 100 years ago, change occurred much
>> slower than today. The establishment 100 years ago, those forces that
>> resist change as described by Kuhn, suffered few consequences for
>> their recalcitrance. But, now, change on the order of a few years is
>> the new constant, and it is only getting shorter (we are, in fact,
>> approaching the singularity). So, yesterday's guru, technical
>> innovator is today's stick-in-the-mud detractor - unless one rises
>> above the recurring drama Knuth discussed. Now a day, one might say,
>> Go Meta young man or become a Dunsel.
>>
>>
>> Quis custodiet ipsos custodes
>>
>
Re: Scala-Wicket Help and Advice
Posted by mb-td <mb...@thomas-daily.de>.
Thank you for the extensive overview! I wish you the best of luck and success
for this endeavour. Don't forget to let us know when a project website is up
and running :)
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3475536.html
Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.
Re: Scala-Wicket Help and Advice
Posted by richard emberson <ri...@gmail.com>.
STATUS
4/21/11
Waiting for final release of Wicket 1.5.
Status:
Scala-Wicket at Wicket version 1.5 RC3
About 50% of WicketStuff version 1.5 RC3 ported to Scala
(something to do while waiting for Wicket 1.5)
Scala-Wicket is about 1/2 the number of lines of code (or,
1/2 the number of CRs) - Scala code tends to be denser
or, another way of saying it, Java has a lot of needless
verbosity and boiler plate code.
Replaced Java collections with Scala collections.
Many places the use of null return values has been replace with
the use of Option.
Many places the construct:
if (component instance Form) {
Form form = (Form) component
...
}
has been replace with:
component match {
case form: Form => ...
case _ => // nothing
}
but more need to be converted.
Strong typing has been pushed down to Component. In Java
Wicket, a Component's Model's object is not typed. In the
Scala version it is typed. This makes things more verbose
but the code is strong typed. For example, the signature of
a Component with its parametric type with a Model object of
type String is now "Component[String]"
For the version 2 release of Scala Wicket, this will be
simplified.
Converted Ant build system to use either: Maven, Ivy or one's own
local repository. This is controlled by the value of
an Ant property.
And bunches of other things.
Plans:
After Wicket 1.5 final is merged into existing Scala code
I need to do the following:
Choose a name since there is resistance in the Wicket
community to calling it ScalaWicket (which was only a
working name anyway);
With the name chosen, all of the package paths will have
to be changed (from org.apache.wicket to, for example,
org.thenewdomainname). I do not know if the apache
organization would like the Scala version as a project.
Get a domain and web-site reflecting the name.
Find a site where the source can be located. Currently, I
am using SVN and don't expect to change for the first release.
I would like to do the following:
During porting I had to put lots of println statements into
the code just to figure out what was happening (or not
happening as the case may be). I'd like to convert them
to logging code.
This will lead to a version 1.0.
Future Plans:
It has become clear through some testing that using Scala's
traits as mixins can significantly lower memory usage.
As a not very useful example, consider a Parent Trait:
trait Parent[T] {
private var parent: T
def getParent: T = parent
protected def setParent(parent: T) : Unit = this.parent =
parent
}
Currently, all Components have a parent instance variable. Using
the Parent Trait, Page Components which do not have a parent
will not have to pay the overhead of the parent instance variable.
Yea, not much savings, but, where as, Java at most can have a
single trait-like mixin in the form of an abstract base class,
with Scala one can have any number of such mixin traits ... And
there are many cases where not all of the stuff in Component and
MarkupContainer are need for all components (Component and
MarkupContainer are rather bloated as classes go).
As an example, how may Label Components need a Model? So, having
a Model will be a mixin. Also, some Components will have a model
and never need to change to a different Model. For such Components
the Model instance variable can be eliminated.
I imagine most of the interfaces, traits with no implementation,
will be changed to mixin traits with implementations.
With such mixins, the signature of a Component will once again
be simply "Component".
Plan to understand why the Wicket community says that it is not
reasonable to share the in-memory representations of the HTML
between user sessions. Which is to say, the HTML in the various
HTML files are shared across sessions but the Java Component
hierarchy associate with the HTML is not shared. Clearly, per user
data can not be shared, but have to better understand the limits
of the Component hierarchy that precludes its sharing across users.
Plan to understand better the various Component hierarchy traversals
that take place, such as the render traversal. There is a
bunch of stuff happening and some of it looks like it grew
organically as special cases rather than obeying a uniform
architecture. Also, it appears that during the same traversal the
same code for the same Component is call multiple times.
Scala supports the principle of uniform access. Java Wicket uses
the Java bean approach with getters and setters. Have to see
if this should be changed in the Scala version from bean to
uniform access.
Like to add the ability to monitor and collect statistics concerning
usage patterns with the ability to easily conduct experiments and
modify pages.
This will lead to a version 2.0. I hope this happens quickly. Also,
I hope to get user community support for determining what needs to
be done.
Additional Plans and Issues:
Convert comments from JavaDoc format to ScalaDoc format.
Can/should Scala parallel collections be used.
Should Scala STM be used when committing multiple Model objects.
Review the use of ListBuffer vs ArrayBuffer and should collection
signatures be of type Seq.
Currently, in the Component constructor on-initialization listeners
are triggered. This is very, very bad, the objects are not yet
fully
constructed by they are given out to arbitrary code. Is there
a better Scala approach.
Well, thats the way it is.
Richard
On 04/21/2011 10:38 AM, mb-td wrote:
> Is the port still in progress? Please write one or two lines about the
> status.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3466499.html
> Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.
>
--
Quis custodiet ipsos custodes
Re: Scala-Wicket Help and Advice
Posted by mb-td <mb...@thomas-daily.de>.
Is the port still in progress? Please write one or two lines about the
status.
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3466499.html
Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.
Re: Scala-Wicket Help and Advice
Posted by richard emberson <ri...@gmail.com>.
Yea, for a while now I have been concerned about taxing
the good graces of the dev mailing list with this thread;
going from pre-announcing and asking for advice, to
Scala IDEs, what Knuth meant, and whether or not Scala will
go main stream.
After porting 1.5 final over I will release the port,
probably, on Sourceforge along with a Home web site.
So, let the thread die.
Thanks
Richard
On 01/19/2011 09:01 AM, James Carman wrote:
> I believe this conversation has gone enough off-course that it no
> longer belongs on this mailing list. We're not discussing anything
> related to Wicket anymore.
>
> On Wed, Jan 19, 2011 at 11:57 AM, richard emberson
> <ri...@gmail.com> wrote:
>>
>>
>> On 01/19/2011 07:22 AM, Martin Makundi wrote:
>>>
>>> The only thing that bugs me about scala is its flexibility of
>>> accepting different kind of notation. It's that what was the
>>> "downfall" of html: making complilers flexible to allow various human
>>> input and as end result none of the browsers work correctly because
>>> the truth is only "in the eye of the beholder" (or creator only, in
>>> this case).
>>
>> I guess concerning HTML, I would say that it did not have a good
>> enough spec soon enough and, of course, MS did whatever they wanted
>> anyway.
>> Scala has a very, very detailed spec (do not try to learn the
>> language by reading the spec first).
>> Scala also has the incredible advantage that the Scala team
>> can make changes that are not backward compatible, which is to
>> say, Scala has had a long gestation period.
>> This advantage was particularly useful in going from the 2.7 to 2.8
>> releases where the whole collection framework was redone. They are
>> finding out what works best and folding those changes back into the
>> language. This will slow down with time (I expect the collection
>> re-write is the last super big change).
>>
>>>
>>> Scala maybe needs a bit more syntactical canonicity?
>>
>> I agree, languages have multiple ways of doing things:
>> while-loop and for-loops
>> i++ vs i += 1 vs i = i + 1 (Scala does not support i++)
>>
>> First, Scala is both OO and FP, so there are generally a
>> couple of approaches - one that looks like Java and one that
>> is more pipelined, data flowing through functions.
>>
>> So, it is true that Scala allows one to be "creative!?".
>> Some of this comes from the vastly richer set of capabilities
>> associated with the collection classes. In Java one has
>> Iterator while in Scala there is a whole lot of extra
>> standard methods.
>>
>> Just yesterday while working on my NIST RBAC code, I had to
>> decide how to check access rights in a test class:
>> Does a Session have a given Permission, where
>> Roles are in a Set and RolesToPerm is a Map from Role to Permission:
>>
>> def checkAccess(session: Session, perm: Permission): Boolean = {
>> // version 0, very Java-like, never considered
>> for (role<- session.getRoles) {
>> val pOp = roleToPerms.get(role)
>> if (permOp.isDefined)
>> if (permOp.get == perm) return true
>> }
>> false
>>
>> // or version 1, handling Option the Scala-way
>> for (role<- session.getRoles) {
>> roleToPerms.get(role) match {
>> case Some(p) => if (p == perm) return true
>> case None => // ignore
>> }
>> }
>> false
>>
>> // or version 2, rather more functional
>> sesson.getRoles.foldLeft(false) { _ || roleToPerms.get(_).getOrElse(null)
>> == perm }
>> }
>>
>> The first two versions are not too hard to understand, but the last
>> one, unless you know what foldLeft does, is, I imagine, opaque to most
>> Java programmers.
>> ["foldLeft" sets the result value with an initial value, "false", and
>> then iterates over the values of the container, "roles", performing
>> the operation, "||", creating a new result value on each iteration
>> where the first "_" is the current result value and the second "_" is
>> the value from the container. "getOrElse returns the value looked up
>> from "roleToPerms" and, if it does not exist, returns "null". Lastly,
>> the iteration stops when the first true value, "== perm" is true;
>> the normal "||" shortcutting.]
>> That said, I consider the code to be functional
>> programming in-the-small, a single line of code and, ultimately, more
>> understandable (and more maintainable) than either of the proceeding
>> versions. [There maybe a better way to pipeline the evaluation, this
>> is just what I did.]
>>
>> I have very mixed feelings about DSLs. If every programmer in your
>> project creates their own DSLs for their own section or, even worse,
>> per class, then DSLs are very bad; less understandable code, a
>> maintenance problem and a barrier to getting new hires up to speed.
>> On the other hand, if a project controls the use of DSLs and they
>> are well documented, they could (not will be, but could) be a boon
>> rather than a bust.
>>
>>>
>>> **
>>> Martin
>>>
>>> 2011/1/19 richard emberson<ri...@gmail.com>:
>>>>
>>>> Yea,
>>>>
>>>> I have consistently advocated using Scala with strong coding
>>>> standards - standards that are actually believed in and enforced.
>>>> I have referred to it as OO Scala, Scala which is strong on the
>>>> Java-like Object-Oriented features plus functional programming
>>>> in-the-small, but refrains from using functional programming
>>>> in-the-large, many of Scala's "functional goodies" and advanced
>>>> type capabilities (and if any of these really have to be used, they
>>>> should be approved by the group and be documented in detail).
>>>>
>>>> The reasons for Scala and using it with limitation are:
>>>> Scala is a better Java and
>>>> The use of Scala's "advanced features" must be controlled so that
>>>> code is understandable, maintainable and, most importantly, so that
>>>> one can access the existing programmer labor pool and not have to
>>>> limit one self to the very small number of FP programmers out there.
>>>>
>>>> Those who advocate the use of Scala's advanced features on large
>>>> projects are really advocating that Scala be only a niche language.
>>>>
>>>> Richard
>>>>
>>>> On 01/18/2011 11:02 PM, Liam Clarke-Hutchinson wrote:
>>>>>
>>>>> Hey mate,
>>>>>
>>>>> I code Java for my day job, and write my fun code in Scala. I just love
>>>>> the
>>>>> flexibility of Scala combined with the power to use all my existing Java
>>>>> libraries. That said,
>>>>> I don't see Scala overcoming Java anytime soon because it offers
>>>>> developers
>>>>> _too much_ freedom. I had a real bad time using
>>>>> http://dispatch.databinder.net for a project, because it fully utilized
>>>>> a
>>>>> lot of Scala features to offer a really shit API. Java makes everyone
>>>>> conform to a base level while preventing soaring, and it's a base level
>>>>> that's sane. And when it comes to writing business code, as in "Code
>>>>> that
>>>>> makes money", Scala's freedom doesn't offer overly much compared to
>>>>> Java's
>>>>> enforced conformity.
>>>>>
>>>>> Don't get me wrong, I<3 Scala, but while half of me wants to use it at
>>>>> work, the other half is terrified of what the Java developers who write
>>>>> Spring code like this:
>>>>>
>>>>> <bean id="something class="java.lang.String">
>>>>> <constructor-arg index="0">
>>>>> <value>${someProperty}</value>
>>>>> </constructor-arg>
>>>>> </bean>
>>>>>
>>>>> Would do with the power of Scala at their finger tips. (PS, that's real
>>>>> Spring code that I saw (and refactored) today.)
>>>>>
>>>>> On Tue, Jan 18, 2011 at 5:33 PM, richard emberson<
>>>>> richard.emberson@gmail.com> wrote:
>>>>>
>>>>>> I originally mentioned the Kuhn book in the context of the politics of
>>>>>> change. Altering the focus, you brought up *the truth* as the view
>>>>>> held by those resisting change, which I believe is not the larger
>>>>>> insight to be gained from his book. It is still my contention that my
>>>>>> original interpretation is valid; Scala faces resistance to change and
>>>>>> the structure of that resistance, maps into those structures
>>>>>> identified by Kuhn.
>>>>>>
>>>>>> Using a term you earlier used, I think it would be naive to believe
>>>>>> that entrenched business forces will stop the emergence of a new,
>>>>>> major development language. Such forces were aligned against C, C++
>>>>>> and Java, but the forces were overcome. In each case, rational
>>>>>> examination of the languages revealed advantages as well as
>>>>>> non-rational forces, such as Sun's marketing and glitter in the case
>>>>>> of Java, strengthening the prospects of the language's adaption. I
>>>>>> hope we can both agree that change will come.
>>>>>>
>>>>>> But, I do not believe the change will be revolutionary but, rather,
>>>>>> evolutionary. A language that evolves from an existing ecosystem has a
>>>>>> much greater likelihood of becoming significant than a green field
>>>>>> language.
>>>>>>
>>>>>> I paint and sculpt as well as do mathematics and physics and, for me,
>>>>>> language selection is far closer to math and physics than to the play
>>>>>> of colors or shape and form. I, thus, do not agree that choosing a
>>>>>> programming language is an exercise in artistry, but rather, its a
>>>>>> more rational process. And, if beauty is involved, then it is
>>>>>> scientific beauty and not artistic beauty. Are you Picasso? Maybe
>>>>>> even Mondrian? Hopefully, not Pollock.
>>>>>>
>>>>>> Concerning the languages you listed as "the way forward", an important
>>>>>> criteria must be: where are the programmers coming from? One can wait
>>>>>> for a new generation or one can see if any existing programmers will
>>>>>> migrate from their current language to a new language. Some language
>>>>>> usages from the web:
>>>>>> Java 18%
>>>>>> C 16%
>>>>>> C++ 9%
>>>>>> Python 6%
>>>>>> C# 6%
>>>>>> Objective-C 3%
>>>>>> Ruby 2%
>>>>>> Lisp 1%
>>>>>> Scheme ~0.5%
>>>>>> Haskell ~0.3%
>>>>>> Scala ~0.3%
>>>>>> Eiffel<0.1%
>>>>>> Clojure ~0.0%
>>>>>>
>>>>>> So, where might future Haskell or Clojure or Eiffel or Scala
>>>>>> programmers come from?
>>>>>>
>>>>>> # So, what about Eiffel?
>>>>>>
>>>>>> Eiffel (with DbC, "design by contract") is a 25 year old language and
>>>>>> its usage stats are down in the noise - well below Scala, Clojure and
>>>>>> Haskell - and showing its age. Hard to see a ground swell of C or Java
>>>>>> programmers switching to Eiffel.
>>>>>>
>>>>>> Eiffel's grasp exceeded what could be supported; its notion of
>>>>>> "contract" was so big, it was hard to find a wrapper around it all.
>>>>>> Category Theory may provide for a pragmatic approach to reasoning
>>>>>> about interfaces (contracts) which might not encompass all possible
>>>>>> rely/guarantee predicates, but many. As such, the three laws of
>>>>>> Monads from Category Theory might yield a more coherent, reasoned
>>>>>> approach to DbC and interface design. Curiously, this has been
>>>>>> discussed by the author of Scala as a possible approach to adding DbC
>>>>>> to Scala. For the Scala-CLR binding there is native support for such
>>>>>> constructs while for the Scala-JVM binding, it would have to be done
>>>>>> with code.
>>>>>>
>>>>>>
>>>>>> # So, what about Haskell?
>>>>>>
>>>>>> Haskell is the flag ship FP testbed which has been out there for close
>>>>>> to 20 years. There are no large enterprise applications written in
>>>>>> Haskell. It has certainly not taking the programming world by storm
>>>>>> whatever its merits. In addition, for Haskell, and all FP languages
>>>>>> for that matter, the world view required is not shared by most people,
>>>>>> Folks do not see the world as math functions (program mangers and
>>>>>> customers certainly don't); functional programming in-the-large is an
>>>>>> unnatural mapping of external objects and relationship to a FP design.
>>>>>> (That said, Category Theory is being used more in Physics and
>>>>>> non-computer Mathematics as a means of providing some guidance by
>>>>>> helping to find higher level relationships between areas of research,
>>>>>> but those are rather rarefied endeavors.) Again, where are the
>>>>>> converts to Haskell coming from? Just an occasional graduate student.
>>>>>>
>>>>>>
>>>>>> # So, what about Clojure?
>>>>>>
>>>>>> Clojure is an interesting case; its immutable data structures are a
>>>>>> strength but as soon as you allow users to call into Java libraries
>>>>>> any program-level reasoning due to such data structures are suspect -
>>>>>> an issue with any FP language which is not 100% pure. In addition,
>>>>>> where is the pool of potential converts? Clojure is a rather large
>>>>>> leap for the 20% of programmers using Java (or for that matter for the
>>>>>> 20% using C/C++) Converts would likely come from the Lisp (1% usage)
>>>>>> and Scheme (usage levels in the noise) community.
>>>>>>
>>>>>> As an aside, I had considered porting the Clojure runtime to Scala.
>>>>>> There would have been many advantages over the Java-based
>>>>>> runtime, e.g.:
>>>>>> Scala with its immutable data structures would be a good fit,
>>>>>> Scala's coming parallelized data structures targeted to
>>>>>> multi-core environments saving the Clojure group much development
>>>>>> effort.
>>>>>> Scala would have given the Clojure community delimited continuations
>>>>>> which the Scheme folks would like and understand.
>>>>>> But, such a port, while interesting and I would certainly have
>>>>>> learned Clojure, would not have appreciably increased the number
>>>>>> of Scala users - so I choice Wicket.
>>>>>>
>>>>>>
>>>>>> # So, what about Scala?
>>>>>>
>>>>>> I recently came upon a discussion of Joshua Bloch's "Effective Java",
>>>>>> its list of recommended practices and how they map into Scala.
>>>>>> Curiously, in each case, the article pointed out that Scala made
>>>>>> simpler or completely eliminated the need for the "Effective Java"
>>>>>> better-coding-practice. So, if one thinks that "Effective Java" makes
>>>>>> sense, so does, at least at the level of the recommendations, a switch
>>>>>> to Scala - the state of art has moved on from Java. As I have been
>>>>>> advocating, Scala is a better Java; switching from OO Java to OO Scala
>>>>>> is relatively easy and certainly Java's warts have become very
>>>>>> glaring.
>>>>>>
>>>>>> As with any language and development team, one needs development
>>>>>> standards. In this, Scala is no different than Java, C++, C, etc. To
>>>>>> not let programmers use Scala because one don't trust them and that
>>>>>> the team's development practices are not being followed or are
>>>>>> inadequate is not a problem with the language but rather with those in
>>>>>> positions of authority and/or respect for failing to set the proper
>>>>>> environment.
>>>>>>
>>>>>> Scala does allow users to access the existing, significant base of
>>>>>> Java libraries so that a whole universe of supporting libraries does
>>>>>> not have to be re-created for Scala. Also, if the use of its
>>>>>> functional and extended type capabilities are controlled, it offers a
>>>>>> relatively easy migration for the average Java programmer (or any of
>>>>>> the other OO languages listed above - a large pool of potential
>>>>>> converts).
>>>>>>
>>>>>>
>>>>>> The rate of change is increasing, A 100 years ago, change occurred much
>>>>>> slower than today. The establishment 100 years ago, those forces that
>>>>>> resist change as described by Kuhn, suffered few consequences for
>>>>>> their recalcitrance. But, now, change on the order of a few years is
>>>>>> the new constant, and it is only getting shorter (we are, in fact,
>>>>>> approaching the singularity). So, yesterday's guru, technical
>>>>>> innovator is today's stick-in-the-mud detractor - unless one rises
>>>>>> above the recurring drama Knuth discussed. Now a day, one might say,
>>>>>> Go Meta young man or become a Dunsel.
>>>>>>
>>>>>>
>>>>>> Quis custodiet ipsos custodes
>>>>>>
>>>>>
>>>>
>>>> --
>>>> Quis custodiet ipsos custodes
>>>>
>>>
>>
>> --
>> Quis custodiet ipsos custodes
>>
>
--
Quis custodiet ipsos custodes
Re: Scala-Wicket Help and Advice
Posted by James Carman <ja...@carmanconsulting.com>.
Don't get me wrong, I'm all about seeing a Wicket-like Scala-based
project (and would contribute to it), but that's not what we've been
debating here lately on this thread. If you guys want to talk about
coming up with a from-the-ground-up Scala-based, Wicket-inspired
project, then I'm all ears and think we should start putting something
in github or something.
On Wed, Jan 19, 2011 at 12:09 PM, Martin Makundi
<ma...@koodaripalvelut.com> wrote:
> What about rewriting wicket into most wonderful tight functional scala style?
>
> def : webserver {
> homepage,
> logoutpage,
> onlinestore,
> }
>
> ...
>
> ;)
>
> **
> Martin
>
> 2011/1/19 James Carman <ja...@carmanconsulting.com>:
>> I believe this conversation has gone enough off-course that it no
>> longer belongs on this mailing list. We're not discussing anything
>> related to Wicket anymore.
>>
>> On Wed, Jan 19, 2011 at 11:57 AM, richard emberson
>> <ri...@gmail.com> wrote:
>>>
>>>
>>> On 01/19/2011 07:22 AM, Martin Makundi wrote:
>>>>
>>>> The only thing that bugs me about scala is its flexibility of
>>>> accepting different kind of notation. It's that what was the
>>>> "downfall" of html: making complilers flexible to allow various human
>>>> input and as end result none of the browsers work correctly because
>>>> the truth is only "in the eye of the beholder" (or creator only, in
>>>> this case).
>>>
>>> I guess concerning HTML, I would say that it did not have a good
>>> enough spec soon enough and, of course, MS did whatever they wanted
>>> anyway.
>>> Scala has a very, very detailed spec (do not try to learn the
>>> language by reading the spec first).
>>> Scala also has the incredible advantage that the Scala team
>>> can make changes that are not backward compatible, which is to
>>> say, Scala has had a long gestation period.
>>> This advantage was particularly useful in going from the 2.7 to 2.8
>>> releases where the whole collection framework was redone. They are
>>> finding out what works best and folding those changes back into the
>>> language. This will slow down with time (I expect the collection
>>> re-write is the last super big change).
>>>
>>>>
>>>> Scala maybe needs a bit more syntactical canonicity?
>>>
>>> I agree, languages have multiple ways of doing things:
>>> while-loop and for-loops
>>> i++ vs i += 1 vs i = i + 1 (Scala does not support i++)
>>>
>>> First, Scala is both OO and FP, so there are generally a
>>> couple of approaches - one that looks like Java and one that
>>> is more pipelined, data flowing through functions.
>>>
>>> So, it is true that Scala allows one to be "creative!?".
>>> Some of this comes from the vastly richer set of capabilities
>>> associated with the collection classes. In Java one has
>>> Iterator while in Scala there is a whole lot of extra
>>> standard methods.
>>>
>>> Just yesterday while working on my NIST RBAC code, I had to
>>> decide how to check access rights in a test class:
>>> Does a Session have a given Permission, where
>>> Roles are in a Set and RolesToPerm is a Map from Role to Permission:
>>>
>>> def checkAccess(session: Session, perm: Permission): Boolean = {
>>> // version 0, very Java-like, never considered
>>> for (role <- session.getRoles) {
>>> val pOp = roleToPerms.get(role)
>>> if (permOp.isDefined)
>>> if (permOp.get == perm) return true
>>> }
>>> false
>>>
>>> // or version 1, handling Option the Scala-way
>>> for (role <- session.getRoles) {
>>> roleToPerms.get(role) match {
>>> case Some(p) => if (p == perm) return true
>>> case None => // ignore
>>> }
>>> }
>>> false
>>>
>>> // or version 2, rather more functional
>>> sesson.getRoles.foldLeft(false) { _ || roleToPerms.get(_).getOrElse(null)
>>> == perm }
>>> }
>>>
>>> The first two versions are not too hard to understand, but the last
>>> one, unless you know what foldLeft does, is, I imagine, opaque to most
>>> Java programmers.
>>> ["foldLeft" sets the result value with an initial value, "false", and
>>> then iterates over the values of the container, "roles", performing
>>> the operation, "||", creating a new result value on each iteration
>>> where the first "_" is the current result value and the second "_" is
>>> the value from the container. "getOrElse returns the value looked up
>>> from "roleToPerms" and, if it does not exist, returns "null". Lastly,
>>> the iteration stops when the first true value, "== perm" is true;
>>> the normal "||" shortcutting.]
>>> That said, I consider the code to be functional
>>> programming in-the-small, a single line of code and, ultimately, more
>>> understandable (and more maintainable) than either of the proceeding
>>> versions. [There maybe a better way to pipeline the evaluation, this
>>> is just what I did.]
>>>
>>> I have very mixed feelings about DSLs. If every programmer in your
>>> project creates their own DSLs for their own section or, even worse,
>>> per class, then DSLs are very bad; less understandable code, a
>>> maintenance problem and a barrier to getting new hires up to speed.
>>> On the other hand, if a project controls the use of DSLs and they
>>> are well documented, they could (not will be, but could) be a boon
>>> rather than a bust.
>>>
>>>>
>>>> **
>>>> Martin
>>>>
>>>> 2011/1/19 richard emberson<ri...@gmail.com>:
>>>>>
>>>>> Yea,
>>>>>
>>>>> I have consistently advocated using Scala with strong coding
>>>>> standards - standards that are actually believed in and enforced.
>>>>> I have referred to it as OO Scala, Scala which is strong on the
>>>>> Java-like Object-Oriented features plus functional programming
>>>>> in-the-small, but refrains from using functional programming
>>>>> in-the-large, many of Scala's "functional goodies" and advanced
>>>>> type capabilities (and if any of these really have to be used, they
>>>>> should be approved by the group and be documented in detail).
>>>>>
>>>>> The reasons for Scala and using it with limitation are:
>>>>> Scala is a better Java and
>>>>> The use of Scala's "advanced features" must be controlled so that
>>>>> code is understandable, maintainable and, most importantly, so that
>>>>> one can access the existing programmer labor pool and not have to
>>>>> limit one self to the very small number of FP programmers out there.
>>>>>
>>>>> Those who advocate the use of Scala's advanced features on large
>>>>> projects are really advocating that Scala be only a niche language.
>>>>>
>>>>> Richard
>>>>>
>>>>> On 01/18/2011 11:02 PM, Liam Clarke-Hutchinson wrote:
>>>>>>
>>>>>> Hey mate,
>>>>>>
>>>>>> I code Java for my day job, and write my fun code in Scala. I just love
>>>>>> the
>>>>>> flexibility of Scala combined with the power to use all my existing Java
>>>>>> libraries. That said,
>>>>>> I don't see Scala overcoming Java anytime soon because it offers
>>>>>> developers
>>>>>> _too much_ freedom. I had a real bad time using
>>>>>> http://dispatch.databinder.net for a project, because it fully utilized
>>>>>> a
>>>>>> lot of Scala features to offer a really shit API. Java makes everyone
>>>>>> conform to a base level while preventing soaring, and it's a base level
>>>>>> that's sane. And when it comes to writing business code, as in "Code
>>>>>> that
>>>>>> makes money", Scala's freedom doesn't offer overly much compared to
>>>>>> Java's
>>>>>> enforced conformity.
>>>>>>
>>>>>> Don't get me wrong, I<3 Scala, but while half of me wants to use it at
>>>>>> work, the other half is terrified of what the Java developers who write
>>>>>> Spring code like this:
>>>>>>
>>>>>> <bean id="something class="java.lang.String">
>>>>>> <constructor-arg index="0">
>>>>>> <value>${someProperty}</value>
>>>>>> </constructor-arg>
>>>>>> </bean>
>>>>>>
>>>>>> Would do with the power of Scala at their finger tips. (PS, that's real
>>>>>> Spring code that I saw (and refactored) today.)
>>>>>>
>>>>>> On Tue, Jan 18, 2011 at 5:33 PM, richard emberson<
>>>>>> richard.emberson@gmail.com> wrote:
>>>>>>
>>>>>>> I originally mentioned the Kuhn book in the context of the politics of
>>>>>>> change. Altering the focus, you brought up *the truth* as the view
>>>>>>> held by those resisting change, which I believe is not the larger
>>>>>>> insight to be gained from his book. It is still my contention that my
>>>>>>> original interpretation is valid; Scala faces resistance to change and
>>>>>>> the structure of that resistance, maps into those structures
>>>>>>> identified by Kuhn.
>>>>>>>
>>>>>>> Using a term you earlier used, I think it would be naive to believe
>>>>>>> that entrenched business forces will stop the emergence of a new,
>>>>>>> major development language. Such forces were aligned against C, C++
>>>>>>> and Java, but the forces were overcome. In each case, rational
>>>>>>> examination of the languages revealed advantages as well as
>>>>>>> non-rational forces, such as Sun's marketing and glitter in the case
>>>>>>> of Java, strengthening the prospects of the language's adaption. I
>>>>>>> hope we can both agree that change will come.
>>>>>>>
>>>>>>> But, I do not believe the change will be revolutionary but, rather,
>>>>>>> evolutionary. A language that evolves from an existing ecosystem has a
>>>>>>> much greater likelihood of becoming significant than a green field
>>>>>>> language.
>>>>>>>
>>>>>>> I paint and sculpt as well as do mathematics and physics and, for me,
>>>>>>> language selection is far closer to math and physics than to the play
>>>>>>> of colors or shape and form. I, thus, do not agree that choosing a
>>>>>>> programming language is an exercise in artistry, but rather, its a
>>>>>>> more rational process. And, if beauty is involved, then it is
>>>>>>> scientific beauty and not artistic beauty. Are you Picasso? Maybe
>>>>>>> even Mondrian? Hopefully, not Pollock.
>>>>>>>
>>>>>>> Concerning the languages you listed as "the way forward", an important
>>>>>>> criteria must be: where are the programmers coming from? One can wait
>>>>>>> for a new generation or one can see if any existing programmers will
>>>>>>> migrate from their current language to a new language. Some language
>>>>>>> usages from the web:
>>>>>>> Java 18%
>>>>>>> C 16%
>>>>>>> C++ 9%
>>>>>>> Python 6%
>>>>>>> C# 6%
>>>>>>> Objective-C 3%
>>>>>>> Ruby 2%
>>>>>>> Lisp 1%
>>>>>>> Scheme ~0.5%
>>>>>>> Haskell ~0.3%
>>>>>>> Scala ~0.3%
>>>>>>> Eiffel<0.1%
>>>>>>> Clojure ~0.0%
>>>>>>>
>>>>>>> So, where might future Haskell or Clojure or Eiffel or Scala
>>>>>>> programmers come from?
>>>>>>>
>>>>>>> # So, what about Eiffel?
>>>>>>>
>>>>>>> Eiffel (with DbC, "design by contract") is a 25 year old language and
>>>>>>> its usage stats are down in the noise - well below Scala, Clojure and
>>>>>>> Haskell - and showing its age. Hard to see a ground swell of C or Java
>>>>>>> programmers switching to Eiffel.
>>>>>>>
>>>>>>> Eiffel's grasp exceeded what could be supported; its notion of
>>>>>>> "contract" was so big, it was hard to find a wrapper around it all.
>>>>>>> Category Theory may provide for a pragmatic approach to reasoning
>>>>>>> about interfaces (contracts) which might not encompass all possible
>>>>>>> rely/guarantee predicates, but many. As such, the three laws of
>>>>>>> Monads from Category Theory might yield a more coherent, reasoned
>>>>>>> approach to DbC and interface design. Curiously, this has been
>>>>>>> discussed by the author of Scala as a possible approach to adding DbC
>>>>>>> to Scala. For the Scala-CLR binding there is native support for such
>>>>>>> constructs while for the Scala-JVM binding, it would have to be done
>>>>>>> with code.
>>>>>>>
>>>>>>>
>>>>>>> # So, what about Haskell?
>>>>>>>
>>>>>>> Haskell is the flag ship FP testbed which has been out there for close
>>>>>>> to 20 years. There are no large enterprise applications written in
>>>>>>> Haskell. It has certainly not taking the programming world by storm
>>>>>>> whatever its merits. In addition, for Haskell, and all FP languages
>>>>>>> for that matter, the world view required is not shared by most people,
>>>>>>> Folks do not see the world as math functions (program mangers and
>>>>>>> customers certainly don't); functional programming in-the-large is an
>>>>>>> unnatural mapping of external objects and relationship to a FP design.
>>>>>>> (That said, Category Theory is being used more in Physics and
>>>>>>> non-computer Mathematics as a means of providing some guidance by
>>>>>>> helping to find higher level relationships between areas of research,
>>>>>>> but those are rather rarefied endeavors.) Again, where are the
>>>>>>> converts to Haskell coming from? Just an occasional graduate student.
>>>>>>>
>>>>>>>
>>>>>>> # So, what about Clojure?
>>>>>>>
>>>>>>> Clojure is an interesting case; its immutable data structures are a
>>>>>>> strength but as soon as you allow users to call into Java libraries
>>>>>>> any program-level reasoning due to such data structures are suspect -
>>>>>>> an issue with any FP language which is not 100% pure. In addition,
>>>>>>> where is the pool of potential converts? Clojure is a rather large
>>>>>>> leap for the 20% of programmers using Java (or for that matter for the
>>>>>>> 20% using C/C++) Converts would likely come from the Lisp (1% usage)
>>>>>>> and Scheme (usage levels in the noise) community.
>>>>>>>
>>>>>>> As an aside, I had considered porting the Clojure runtime to Scala.
>>>>>>> There would have been many advantages over the Java-based
>>>>>>> runtime, e.g.:
>>>>>>> Scala with its immutable data structures would be a good fit,
>>>>>>> Scala's coming parallelized data structures targeted to
>>>>>>> multi-core environments saving the Clojure group much development
>>>>>>> effort.
>>>>>>> Scala would have given the Clojure community delimited continuations
>>>>>>> which the Scheme folks would like and understand.
>>>>>>> But, such a port, while interesting and I would certainly have
>>>>>>> learned Clojure, would not have appreciably increased the number
>>>>>>> of Scala users - so I choice Wicket.
>>>>>>>
>>>>>>>
>>>>>>> # So, what about Scala?
>>>>>>>
>>>>>>> I recently came upon a discussion of Joshua Bloch's "Effective Java",
>>>>>>> its list of recommended practices and how they map into Scala.
>>>>>>> Curiously, in each case, the article pointed out that Scala made
>>>>>>> simpler or completely eliminated the need for the "Effective Java"
>>>>>>> better-coding-practice. So, if one thinks that "Effective Java" makes
>>>>>>> sense, so does, at least at the level of the recommendations, a switch
>>>>>>> to Scala - the state of art has moved on from Java. As I have been
>>>>>>> advocating, Scala is a better Java; switching from OO Java to OO Scala
>>>>>>> is relatively easy and certainly Java's warts have become very
>>>>>>> glaring.
>>>>>>>
>>>>>>> As with any language and development team, one needs development
>>>>>>> standards. In this, Scala is no different than Java, C++, C, etc. To
>>>>>>> not let programmers use Scala because one don't trust them and that
>>>>>>> the team's development practices are not being followed or are
>>>>>>> inadequate is not a problem with the language but rather with those in
>>>>>>> positions of authority and/or respect for failing to set the proper
>>>>>>> environment.
>>>>>>>
>>>>>>> Scala does allow users to access the existing, significant base of
>>>>>>> Java libraries so that a whole universe of supporting libraries does
>>>>>>> not have to be re-created for Scala. Also, if the use of its
>>>>>>> functional and extended type capabilities are controlled, it offers a
>>>>>>> relatively easy migration for the average Java programmer (or any of
>>>>>>> the other OO languages listed above - a large pool of potential
>>>>>>> converts).
>>>>>>>
>>>>>>>
>>>>>>> The rate of change is increasing, A 100 years ago, change occurred much
>>>>>>> slower than today. The establishment 100 years ago, those forces that
>>>>>>> resist change as described by Kuhn, suffered few consequences for
>>>>>>> their recalcitrance. But, now, change on the order of a few years is
>>>>>>> the new constant, and it is only getting shorter (we are, in fact,
>>>>>>> approaching the singularity). So, yesterday's guru, technical
>>>>>>> innovator is today's stick-in-the-mud detractor - unless one rises
>>>>>>> above the recurring drama Knuth discussed. Now a day, one might say,
>>>>>>> Go Meta young man or become a Dunsel.
>>>>>>>
>>>>>>>
>>>>>>> Quis custodiet ipsos custodes
>>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> Quis custodiet ipsos custodes
>>>>>
>>>>
>>>
>>> --
>>> Quis custodiet ipsos custodes
>>>
>>
>
Re: Scala-Wicket Help and Advice
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
What about rewriting wicket into most wonderful tight functional scala style?
def : webserver {
homepage,
logoutpage,
onlinestore,
}
...
;)
**
Martin
2011/1/19 James Carman <ja...@carmanconsulting.com>:
> I believe this conversation has gone enough off-course that it no
> longer belongs on this mailing list. We're not discussing anything
> related to Wicket anymore.
>
> On Wed, Jan 19, 2011 at 11:57 AM, richard emberson
> <ri...@gmail.com> wrote:
>>
>>
>> On 01/19/2011 07:22 AM, Martin Makundi wrote:
>>>
>>> The only thing that bugs me about scala is its flexibility of
>>> accepting different kind of notation. It's that what was the
>>> "downfall" of html: making complilers flexible to allow various human
>>> input and as end result none of the browsers work correctly because
>>> the truth is only "in the eye of the beholder" (or creator only, in
>>> this case).
>>
>> I guess concerning HTML, I would say that it did not have a good
>> enough spec soon enough and, of course, MS did whatever they wanted
>> anyway.
>> Scala has a very, very detailed spec (do not try to learn the
>> language by reading the spec first).
>> Scala also has the incredible advantage that the Scala team
>> can make changes that are not backward compatible, which is to
>> say, Scala has had a long gestation period.
>> This advantage was particularly useful in going from the 2.7 to 2.8
>> releases where the whole collection framework was redone. They are
>> finding out what works best and folding those changes back into the
>> language. This will slow down with time (I expect the collection
>> re-write is the last super big change).
>>
>>>
>>> Scala maybe needs a bit more syntactical canonicity?
>>
>> I agree, languages have multiple ways of doing things:
>> while-loop and for-loops
>> i++ vs i += 1 vs i = i + 1 (Scala does not support i++)
>>
>> First, Scala is both OO and FP, so there are generally a
>> couple of approaches - one that looks like Java and one that
>> is more pipelined, data flowing through functions.
>>
>> So, it is true that Scala allows one to be "creative!?".
>> Some of this comes from the vastly richer set of capabilities
>> associated with the collection classes. In Java one has
>> Iterator while in Scala there is a whole lot of extra
>> standard methods.
>>
>> Just yesterday while working on my NIST RBAC code, I had to
>> decide how to check access rights in a test class:
>> Does a Session have a given Permission, where
>> Roles are in a Set and RolesToPerm is a Map from Role to Permission:
>>
>> def checkAccess(session: Session, perm: Permission): Boolean = {
>> // version 0, very Java-like, never considered
>> for (role <- session.getRoles) {
>> val pOp = roleToPerms.get(role)
>> if (permOp.isDefined)
>> if (permOp.get == perm) return true
>> }
>> false
>>
>> // or version 1, handling Option the Scala-way
>> for (role <- session.getRoles) {
>> roleToPerms.get(role) match {
>> case Some(p) => if (p == perm) return true
>> case None => // ignore
>> }
>> }
>> false
>>
>> // or version 2, rather more functional
>> sesson.getRoles.foldLeft(false) { _ || roleToPerms.get(_).getOrElse(null)
>> == perm }
>> }
>>
>> The first two versions are not too hard to understand, but the last
>> one, unless you know what foldLeft does, is, I imagine, opaque to most
>> Java programmers.
>> ["foldLeft" sets the result value with an initial value, "false", and
>> then iterates over the values of the container, "roles", performing
>> the operation, "||", creating a new result value on each iteration
>> where the first "_" is the current result value and the second "_" is
>> the value from the container. "getOrElse returns the value looked up
>> from "roleToPerms" and, if it does not exist, returns "null". Lastly,
>> the iteration stops when the first true value, "== perm" is true;
>> the normal "||" shortcutting.]
>> That said, I consider the code to be functional
>> programming in-the-small, a single line of code and, ultimately, more
>> understandable (and more maintainable) than either of the proceeding
>> versions. [There maybe a better way to pipeline the evaluation, this
>> is just what I did.]
>>
>> I have very mixed feelings about DSLs. If every programmer in your
>> project creates their own DSLs for their own section or, even worse,
>> per class, then DSLs are very bad; less understandable code, a
>> maintenance problem and a barrier to getting new hires up to speed.
>> On the other hand, if a project controls the use of DSLs and they
>> are well documented, they could (not will be, but could) be a boon
>> rather than a bust.
>>
>>>
>>> **
>>> Martin
>>>
>>> 2011/1/19 richard emberson<ri...@gmail.com>:
>>>>
>>>> Yea,
>>>>
>>>> I have consistently advocated using Scala with strong coding
>>>> standards - standards that are actually believed in and enforced.
>>>> I have referred to it as OO Scala, Scala which is strong on the
>>>> Java-like Object-Oriented features plus functional programming
>>>> in-the-small, but refrains from using functional programming
>>>> in-the-large, many of Scala's "functional goodies" and advanced
>>>> type capabilities (and if any of these really have to be used, they
>>>> should be approved by the group and be documented in detail).
>>>>
>>>> The reasons for Scala and using it with limitation are:
>>>> Scala is a better Java and
>>>> The use of Scala's "advanced features" must be controlled so that
>>>> code is understandable, maintainable and, most importantly, so that
>>>> one can access the existing programmer labor pool and not have to
>>>> limit one self to the very small number of FP programmers out there.
>>>>
>>>> Those who advocate the use of Scala's advanced features on large
>>>> projects are really advocating that Scala be only a niche language.
>>>>
>>>> Richard
>>>>
>>>> On 01/18/2011 11:02 PM, Liam Clarke-Hutchinson wrote:
>>>>>
>>>>> Hey mate,
>>>>>
>>>>> I code Java for my day job, and write my fun code in Scala. I just love
>>>>> the
>>>>> flexibility of Scala combined with the power to use all my existing Java
>>>>> libraries. That said,
>>>>> I don't see Scala overcoming Java anytime soon because it offers
>>>>> developers
>>>>> _too much_ freedom. I had a real bad time using
>>>>> http://dispatch.databinder.net for a project, because it fully utilized
>>>>> a
>>>>> lot of Scala features to offer a really shit API. Java makes everyone
>>>>> conform to a base level while preventing soaring, and it's a base level
>>>>> that's sane. And when it comes to writing business code, as in "Code
>>>>> that
>>>>> makes money", Scala's freedom doesn't offer overly much compared to
>>>>> Java's
>>>>> enforced conformity.
>>>>>
>>>>> Don't get me wrong, I<3 Scala, but while half of me wants to use it at
>>>>> work, the other half is terrified of what the Java developers who write
>>>>> Spring code like this:
>>>>>
>>>>> <bean id="something class="java.lang.String">
>>>>> <constructor-arg index="0">
>>>>> <value>${someProperty}</value>
>>>>> </constructor-arg>
>>>>> </bean>
>>>>>
>>>>> Would do with the power of Scala at their finger tips. (PS, that's real
>>>>> Spring code that I saw (and refactored) today.)
>>>>>
>>>>> On Tue, Jan 18, 2011 at 5:33 PM, richard emberson<
>>>>> richard.emberson@gmail.com> wrote:
>>>>>
>>>>>> I originally mentioned the Kuhn book in the context of the politics of
>>>>>> change. Altering the focus, you brought up *the truth* as the view
>>>>>> held by those resisting change, which I believe is not the larger
>>>>>> insight to be gained from his book. It is still my contention that my
>>>>>> original interpretation is valid; Scala faces resistance to change and
>>>>>> the structure of that resistance, maps into those structures
>>>>>> identified by Kuhn.
>>>>>>
>>>>>> Using a term you earlier used, I think it would be naive to believe
>>>>>> that entrenched business forces will stop the emergence of a new,
>>>>>> major development language. Such forces were aligned against C, C++
>>>>>> and Java, but the forces were overcome. In each case, rational
>>>>>> examination of the languages revealed advantages as well as
>>>>>> non-rational forces, such as Sun's marketing and glitter in the case
>>>>>> of Java, strengthening the prospects of the language's adaption. I
>>>>>> hope we can both agree that change will come.
>>>>>>
>>>>>> But, I do not believe the change will be revolutionary but, rather,
>>>>>> evolutionary. A language that evolves from an existing ecosystem has a
>>>>>> much greater likelihood of becoming significant than a green field
>>>>>> language.
>>>>>>
>>>>>> I paint and sculpt as well as do mathematics and physics and, for me,
>>>>>> language selection is far closer to math and physics than to the play
>>>>>> of colors or shape and form. I, thus, do not agree that choosing a
>>>>>> programming language is an exercise in artistry, but rather, its a
>>>>>> more rational process. And, if beauty is involved, then it is
>>>>>> scientific beauty and not artistic beauty. Are you Picasso? Maybe
>>>>>> even Mondrian? Hopefully, not Pollock.
>>>>>>
>>>>>> Concerning the languages you listed as "the way forward", an important
>>>>>> criteria must be: where are the programmers coming from? One can wait
>>>>>> for a new generation or one can see if any existing programmers will
>>>>>> migrate from their current language to a new language. Some language
>>>>>> usages from the web:
>>>>>> Java 18%
>>>>>> C 16%
>>>>>> C++ 9%
>>>>>> Python 6%
>>>>>> C# 6%
>>>>>> Objective-C 3%
>>>>>> Ruby 2%
>>>>>> Lisp 1%
>>>>>> Scheme ~0.5%
>>>>>> Haskell ~0.3%
>>>>>> Scala ~0.3%
>>>>>> Eiffel<0.1%
>>>>>> Clojure ~0.0%
>>>>>>
>>>>>> So, where might future Haskell or Clojure or Eiffel or Scala
>>>>>> programmers come from?
>>>>>>
>>>>>> # So, what about Eiffel?
>>>>>>
>>>>>> Eiffel (with DbC, "design by contract") is a 25 year old language and
>>>>>> its usage stats are down in the noise - well below Scala, Clojure and
>>>>>> Haskell - and showing its age. Hard to see a ground swell of C or Java
>>>>>> programmers switching to Eiffel.
>>>>>>
>>>>>> Eiffel's grasp exceeded what could be supported; its notion of
>>>>>> "contract" was so big, it was hard to find a wrapper around it all.
>>>>>> Category Theory may provide for a pragmatic approach to reasoning
>>>>>> about interfaces (contracts) which might not encompass all possible
>>>>>> rely/guarantee predicates, but many. As such, the three laws of
>>>>>> Monads from Category Theory might yield a more coherent, reasoned
>>>>>> approach to DbC and interface design. Curiously, this has been
>>>>>> discussed by the author of Scala as a possible approach to adding DbC
>>>>>> to Scala. For the Scala-CLR binding there is native support for such
>>>>>> constructs while for the Scala-JVM binding, it would have to be done
>>>>>> with code.
>>>>>>
>>>>>>
>>>>>> # So, what about Haskell?
>>>>>>
>>>>>> Haskell is the flag ship FP testbed which has been out there for close
>>>>>> to 20 years. There are no large enterprise applications written in
>>>>>> Haskell. It has certainly not taking the programming world by storm
>>>>>> whatever its merits. In addition, for Haskell, and all FP languages
>>>>>> for that matter, the world view required is not shared by most people,
>>>>>> Folks do not see the world as math functions (program mangers and
>>>>>> customers certainly don't); functional programming in-the-large is an
>>>>>> unnatural mapping of external objects and relationship to a FP design.
>>>>>> (That said, Category Theory is being used more in Physics and
>>>>>> non-computer Mathematics as a means of providing some guidance by
>>>>>> helping to find higher level relationships between areas of research,
>>>>>> but those are rather rarefied endeavors.) Again, where are the
>>>>>> converts to Haskell coming from? Just an occasional graduate student.
>>>>>>
>>>>>>
>>>>>> # So, what about Clojure?
>>>>>>
>>>>>> Clojure is an interesting case; its immutable data structures are a
>>>>>> strength but as soon as you allow users to call into Java libraries
>>>>>> any program-level reasoning due to such data structures are suspect -
>>>>>> an issue with any FP language which is not 100% pure. In addition,
>>>>>> where is the pool of potential converts? Clojure is a rather large
>>>>>> leap for the 20% of programmers using Java (or for that matter for the
>>>>>> 20% using C/C++) Converts would likely come from the Lisp (1% usage)
>>>>>> and Scheme (usage levels in the noise) community.
>>>>>>
>>>>>> As an aside, I had considered porting the Clojure runtime to Scala.
>>>>>> There would have been many advantages over the Java-based
>>>>>> runtime, e.g.:
>>>>>> Scala with its immutable data structures would be a good fit,
>>>>>> Scala's coming parallelized data structures targeted to
>>>>>> multi-core environments saving the Clojure group much development
>>>>>> effort.
>>>>>> Scala would have given the Clojure community delimited continuations
>>>>>> which the Scheme folks would like and understand.
>>>>>> But, such a port, while interesting and I would certainly have
>>>>>> learned Clojure, would not have appreciably increased the number
>>>>>> of Scala users - so I choice Wicket.
>>>>>>
>>>>>>
>>>>>> # So, what about Scala?
>>>>>>
>>>>>> I recently came upon a discussion of Joshua Bloch's "Effective Java",
>>>>>> its list of recommended practices and how they map into Scala.
>>>>>> Curiously, in each case, the article pointed out that Scala made
>>>>>> simpler or completely eliminated the need for the "Effective Java"
>>>>>> better-coding-practice. So, if one thinks that "Effective Java" makes
>>>>>> sense, so does, at least at the level of the recommendations, a switch
>>>>>> to Scala - the state of art has moved on from Java. As I have been
>>>>>> advocating, Scala is a better Java; switching from OO Java to OO Scala
>>>>>> is relatively easy and certainly Java's warts have become very
>>>>>> glaring.
>>>>>>
>>>>>> As with any language and development team, one needs development
>>>>>> standards. In this, Scala is no different than Java, C++, C, etc. To
>>>>>> not let programmers use Scala because one don't trust them and that
>>>>>> the team's development practices are not being followed or are
>>>>>> inadequate is not a problem with the language but rather with those in
>>>>>> positions of authority and/or respect for failing to set the proper
>>>>>> environment.
>>>>>>
>>>>>> Scala does allow users to access the existing, significant base of
>>>>>> Java libraries so that a whole universe of supporting libraries does
>>>>>> not have to be re-created for Scala. Also, if the use of its
>>>>>> functional and extended type capabilities are controlled, it offers a
>>>>>> relatively easy migration for the average Java programmer (or any of
>>>>>> the other OO languages listed above - a large pool of potential
>>>>>> converts).
>>>>>>
>>>>>>
>>>>>> The rate of change is increasing, A 100 years ago, change occurred much
>>>>>> slower than today. The establishment 100 years ago, those forces that
>>>>>> resist change as described by Kuhn, suffered few consequences for
>>>>>> their recalcitrance. But, now, change on the order of a few years is
>>>>>> the new constant, and it is only getting shorter (we are, in fact,
>>>>>> approaching the singularity). So, yesterday's guru, technical
>>>>>> innovator is today's stick-in-the-mud detractor - unless one rises
>>>>>> above the recurring drama Knuth discussed. Now a day, one might say,
>>>>>> Go Meta young man or become a Dunsel.
>>>>>>
>>>>>>
>>>>>> Quis custodiet ipsos custodes
>>>>>>
>>>>>
>>>>
>>>> --
>>>> Quis custodiet ipsos custodes
>>>>
>>>
>>
>> --
>> Quis custodiet ipsos custodes
>>
>
Re: Scala-Wicket Help and Advice
Posted by James Carman <ja...@carmanconsulting.com>.
I believe this conversation has gone enough off-course that it no
longer belongs on this mailing list. We're not discussing anything
related to Wicket anymore.
On Wed, Jan 19, 2011 at 11:57 AM, richard emberson
<ri...@gmail.com> wrote:
>
>
> On 01/19/2011 07:22 AM, Martin Makundi wrote:
>>
>> The only thing that bugs me about scala is its flexibility of
>> accepting different kind of notation. It's that what was the
>> "downfall" of html: making complilers flexible to allow various human
>> input and as end result none of the browsers work correctly because
>> the truth is only "in the eye of the beholder" (or creator only, in
>> this case).
>
> I guess concerning HTML, I would say that it did not have a good
> enough spec soon enough and, of course, MS did whatever they wanted
> anyway.
> Scala has a very, very detailed spec (do not try to learn the
> language by reading the spec first).
> Scala also has the incredible advantage that the Scala team
> can make changes that are not backward compatible, which is to
> say, Scala has had a long gestation period.
> This advantage was particularly useful in going from the 2.7 to 2.8
> releases where the whole collection framework was redone. They are
> finding out what works best and folding those changes back into the
> language. This will slow down with time (I expect the collection
> re-write is the last super big change).
>
>>
>> Scala maybe needs a bit more syntactical canonicity?
>
> I agree, languages have multiple ways of doing things:
> while-loop and for-loops
> i++ vs i += 1 vs i = i + 1 (Scala does not support i++)
>
> First, Scala is both OO and FP, so there are generally a
> couple of approaches - one that looks like Java and one that
> is more pipelined, data flowing through functions.
>
> So, it is true that Scala allows one to be "creative!?".
> Some of this comes from the vastly richer set of capabilities
> associated with the collection classes. In Java one has
> Iterator while in Scala there is a whole lot of extra
> standard methods.
>
> Just yesterday while working on my NIST RBAC code, I had to
> decide how to check access rights in a test class:
> Does a Session have a given Permission, where
> Roles are in a Set and RolesToPerm is a Map from Role to Permission:
>
> def checkAccess(session: Session, perm: Permission): Boolean = {
> // version 0, very Java-like, never considered
> for (role <- session.getRoles) {
> val pOp = roleToPerms.get(role)
> if (permOp.isDefined)
> if (permOp.get == perm) return true
> }
> false
>
> // or version 1, handling Option the Scala-way
> for (role <- session.getRoles) {
> roleToPerms.get(role) match {
> case Some(p) => if (p == perm) return true
> case None => // ignore
> }
> }
> false
>
> // or version 2, rather more functional
> sesson.getRoles.foldLeft(false) { _ || roleToPerms.get(_).getOrElse(null)
> == perm }
> }
>
> The first two versions are not too hard to understand, but the last
> one, unless you know what foldLeft does, is, I imagine, opaque to most
> Java programmers.
> ["foldLeft" sets the result value with an initial value, "false", and
> then iterates over the values of the container, "roles", performing
> the operation, "||", creating a new result value on each iteration
> where the first "_" is the current result value and the second "_" is
> the value from the container. "getOrElse returns the value looked up
> from "roleToPerms" and, if it does not exist, returns "null". Lastly,
> the iteration stops when the first true value, "== perm" is true;
> the normal "||" shortcutting.]
> That said, I consider the code to be functional
> programming in-the-small, a single line of code and, ultimately, more
> understandable (and more maintainable) than either of the proceeding
> versions. [There maybe a better way to pipeline the evaluation, this
> is just what I did.]
>
> I have very mixed feelings about DSLs. If every programmer in your
> project creates their own DSLs for their own section or, even worse,
> per class, then DSLs are very bad; less understandable code, a
> maintenance problem and a barrier to getting new hires up to speed.
> On the other hand, if a project controls the use of DSLs and they
> are well documented, they could (not will be, but could) be a boon
> rather than a bust.
>
>>
>> **
>> Martin
>>
>> 2011/1/19 richard emberson<ri...@gmail.com>:
>>>
>>> Yea,
>>>
>>> I have consistently advocated using Scala with strong coding
>>> standards - standards that are actually believed in and enforced.
>>> I have referred to it as OO Scala, Scala which is strong on the
>>> Java-like Object-Oriented features plus functional programming
>>> in-the-small, but refrains from using functional programming
>>> in-the-large, many of Scala's "functional goodies" and advanced
>>> type capabilities (and if any of these really have to be used, they
>>> should be approved by the group and be documented in detail).
>>>
>>> The reasons for Scala and using it with limitation are:
>>> Scala is a better Java and
>>> The use of Scala's "advanced features" must be controlled so that
>>> code is understandable, maintainable and, most importantly, so that
>>> one can access the existing programmer labor pool and not have to
>>> limit one self to the very small number of FP programmers out there.
>>>
>>> Those who advocate the use of Scala's advanced features on large
>>> projects are really advocating that Scala be only a niche language.
>>>
>>> Richard
>>>
>>> On 01/18/2011 11:02 PM, Liam Clarke-Hutchinson wrote:
>>>>
>>>> Hey mate,
>>>>
>>>> I code Java for my day job, and write my fun code in Scala. I just love
>>>> the
>>>> flexibility of Scala combined with the power to use all my existing Java
>>>> libraries. That said,
>>>> I don't see Scala overcoming Java anytime soon because it offers
>>>> developers
>>>> _too much_ freedom. I had a real bad time using
>>>> http://dispatch.databinder.net for a project, because it fully utilized
>>>> a
>>>> lot of Scala features to offer a really shit API. Java makes everyone
>>>> conform to a base level while preventing soaring, and it's a base level
>>>> that's sane. And when it comes to writing business code, as in "Code
>>>> that
>>>> makes money", Scala's freedom doesn't offer overly much compared to
>>>> Java's
>>>> enforced conformity.
>>>>
>>>> Don't get me wrong, I<3 Scala, but while half of me wants to use it at
>>>> work, the other half is terrified of what the Java developers who write
>>>> Spring code like this:
>>>>
>>>> <bean id="something class="java.lang.String">
>>>> <constructor-arg index="0">
>>>> <value>${someProperty}</value>
>>>> </constructor-arg>
>>>> </bean>
>>>>
>>>> Would do with the power of Scala at their finger tips. (PS, that's real
>>>> Spring code that I saw (and refactored) today.)
>>>>
>>>> On Tue, Jan 18, 2011 at 5:33 PM, richard emberson<
>>>> richard.emberson@gmail.com> wrote:
>>>>
>>>>> I originally mentioned the Kuhn book in the context of the politics of
>>>>> change. Altering the focus, you brought up *the truth* as the view
>>>>> held by those resisting change, which I believe is not the larger
>>>>> insight to be gained from his book. It is still my contention that my
>>>>> original interpretation is valid; Scala faces resistance to change and
>>>>> the structure of that resistance, maps into those structures
>>>>> identified by Kuhn.
>>>>>
>>>>> Using a term you earlier used, I think it would be naive to believe
>>>>> that entrenched business forces will stop the emergence of a new,
>>>>> major development language. Such forces were aligned against C, C++
>>>>> and Java, but the forces were overcome. In each case, rational
>>>>> examination of the languages revealed advantages as well as
>>>>> non-rational forces, such as Sun's marketing and glitter in the case
>>>>> of Java, strengthening the prospects of the language's adaption. I
>>>>> hope we can both agree that change will come.
>>>>>
>>>>> But, I do not believe the change will be revolutionary but, rather,
>>>>> evolutionary. A language that evolves from an existing ecosystem has a
>>>>> much greater likelihood of becoming significant than a green field
>>>>> language.
>>>>>
>>>>> I paint and sculpt as well as do mathematics and physics and, for me,
>>>>> language selection is far closer to math and physics than to the play
>>>>> of colors or shape and form. I, thus, do not agree that choosing a
>>>>> programming language is an exercise in artistry, but rather, its a
>>>>> more rational process. And, if beauty is involved, then it is
>>>>> scientific beauty and not artistic beauty. Are you Picasso? Maybe
>>>>> even Mondrian? Hopefully, not Pollock.
>>>>>
>>>>> Concerning the languages you listed as "the way forward", an important
>>>>> criteria must be: where are the programmers coming from? One can wait
>>>>> for a new generation or one can see if any existing programmers will
>>>>> migrate from their current language to a new language. Some language
>>>>> usages from the web:
>>>>> Java 18%
>>>>> C 16%
>>>>> C++ 9%
>>>>> Python 6%
>>>>> C# 6%
>>>>> Objective-C 3%
>>>>> Ruby 2%
>>>>> Lisp 1%
>>>>> Scheme ~0.5%
>>>>> Haskell ~0.3%
>>>>> Scala ~0.3%
>>>>> Eiffel<0.1%
>>>>> Clojure ~0.0%
>>>>>
>>>>> So, where might future Haskell or Clojure or Eiffel or Scala
>>>>> programmers come from?
>>>>>
>>>>> # So, what about Eiffel?
>>>>>
>>>>> Eiffel (with DbC, "design by contract") is a 25 year old language and
>>>>> its usage stats are down in the noise - well below Scala, Clojure and
>>>>> Haskell - and showing its age. Hard to see a ground swell of C or Java
>>>>> programmers switching to Eiffel.
>>>>>
>>>>> Eiffel's grasp exceeded what could be supported; its notion of
>>>>> "contract" was so big, it was hard to find a wrapper around it all.
>>>>> Category Theory may provide for a pragmatic approach to reasoning
>>>>> about interfaces (contracts) which might not encompass all possible
>>>>> rely/guarantee predicates, but many. As such, the three laws of
>>>>> Monads from Category Theory might yield a more coherent, reasoned
>>>>> approach to DbC and interface design. Curiously, this has been
>>>>> discussed by the author of Scala as a possible approach to adding DbC
>>>>> to Scala. For the Scala-CLR binding there is native support for such
>>>>> constructs while for the Scala-JVM binding, it would have to be done
>>>>> with code.
>>>>>
>>>>>
>>>>> # So, what about Haskell?
>>>>>
>>>>> Haskell is the flag ship FP testbed which has been out there for close
>>>>> to 20 years. There are no large enterprise applications written in
>>>>> Haskell. It has certainly not taking the programming world by storm
>>>>> whatever its merits. In addition, for Haskell, and all FP languages
>>>>> for that matter, the world view required is not shared by most people,
>>>>> Folks do not see the world as math functions (program mangers and
>>>>> customers certainly don't); functional programming in-the-large is an
>>>>> unnatural mapping of external objects and relationship to a FP design.
>>>>> (That said, Category Theory is being used more in Physics and
>>>>> non-computer Mathematics as a means of providing some guidance by
>>>>> helping to find higher level relationships between areas of research,
>>>>> but those are rather rarefied endeavors.) Again, where are the
>>>>> converts to Haskell coming from? Just an occasional graduate student.
>>>>>
>>>>>
>>>>> # So, what about Clojure?
>>>>>
>>>>> Clojure is an interesting case; its immutable data structures are a
>>>>> strength but as soon as you allow users to call into Java libraries
>>>>> any program-level reasoning due to such data structures are suspect -
>>>>> an issue with any FP language which is not 100% pure. In addition,
>>>>> where is the pool of potential converts? Clojure is a rather large
>>>>> leap for the 20% of programmers using Java (or for that matter for the
>>>>> 20% using C/C++) Converts would likely come from the Lisp (1% usage)
>>>>> and Scheme (usage levels in the noise) community.
>>>>>
>>>>> As an aside, I had considered porting the Clojure runtime to Scala.
>>>>> There would have been many advantages over the Java-based
>>>>> runtime, e.g.:
>>>>> Scala with its immutable data structures would be a good fit,
>>>>> Scala's coming parallelized data structures targeted to
>>>>> multi-core environments saving the Clojure group much development
>>>>> effort.
>>>>> Scala would have given the Clojure community delimited continuations
>>>>> which the Scheme folks would like and understand.
>>>>> But, such a port, while interesting and I would certainly have
>>>>> learned Clojure, would not have appreciably increased the number
>>>>> of Scala users - so I choice Wicket.
>>>>>
>>>>>
>>>>> # So, what about Scala?
>>>>>
>>>>> I recently came upon a discussion of Joshua Bloch's "Effective Java",
>>>>> its list of recommended practices and how they map into Scala.
>>>>> Curiously, in each case, the article pointed out that Scala made
>>>>> simpler or completely eliminated the need for the "Effective Java"
>>>>> better-coding-practice. So, if one thinks that "Effective Java" makes
>>>>> sense, so does, at least at the level of the recommendations, a switch
>>>>> to Scala - the state of art has moved on from Java. As I have been
>>>>> advocating, Scala is a better Java; switching from OO Java to OO Scala
>>>>> is relatively easy and certainly Java's warts have become very
>>>>> glaring.
>>>>>
>>>>> As with any language and development team, one needs development
>>>>> standards. In this, Scala is no different than Java, C++, C, etc. To
>>>>> not let programmers use Scala because one don't trust them and that
>>>>> the team's development practices are not being followed or are
>>>>> inadequate is not a problem with the language but rather with those in
>>>>> positions of authority and/or respect for failing to set the proper
>>>>> environment.
>>>>>
>>>>> Scala does allow users to access the existing, significant base of
>>>>> Java libraries so that a whole universe of supporting libraries does
>>>>> not have to be re-created for Scala. Also, if the use of its
>>>>> functional and extended type capabilities are controlled, it offers a
>>>>> relatively easy migration for the average Java programmer (or any of
>>>>> the other OO languages listed above - a large pool of potential
>>>>> converts).
>>>>>
>>>>>
>>>>> The rate of change is increasing, A 100 years ago, change occurred much
>>>>> slower than today. The establishment 100 years ago, those forces that
>>>>> resist change as described by Kuhn, suffered few consequences for
>>>>> their recalcitrance. But, now, change on the order of a few years is
>>>>> the new constant, and it is only getting shorter (we are, in fact,
>>>>> approaching the singularity). So, yesterday's guru, technical
>>>>> innovator is today's stick-in-the-mud detractor - unless one rises
>>>>> above the recurring drama Knuth discussed. Now a day, one might say,
>>>>> Go Meta young man or become a Dunsel.
>>>>>
>>>>>
>>>>> Quis custodiet ipsos custodes
>>>>>
>>>>
>>>
>>> --
>>> Quis custodiet ipsos custodes
>>>
>>
>
> --
> Quis custodiet ipsos custodes
>
Re: Scala-Wicket Help and Advice
Posted by richard emberson <ri...@gmail.com>.
On 01/19/2011 07:22 AM, Martin Makundi wrote:
> The only thing that bugs me about scala is its flexibility of
> accepting different kind of notation. It's that what was the
> "downfall" of html: making complilers flexible to allow various human
> input and as end result none of the browsers work correctly because
> the truth is only "in the eye of the beholder" (or creator only, in
> this case).
I guess concerning HTML, I would say that it did not have a good
enough spec soon enough and, of course, MS did whatever they wanted
anyway.
Scala has a very, very detailed spec (do not try to learn the
language by reading the spec first).
Scala also has the incredible advantage that the Scala team
can make changes that are not backward compatible, which is to
say, Scala has had a long gestation period.
This advantage was particularly useful in going from the 2.7 to 2.8
releases where the whole collection framework was redone. They are
finding out what works best and folding those changes back into the
language. This will slow down with time (I expect the collection
re-write is the last super big change).
>
> Scala maybe needs a bit more syntactical canonicity?
I agree, languages have multiple ways of doing things:
while-loop and for-loops
i++ vs i += 1 vs i = i + 1 (Scala does not support i++)
First, Scala is both OO and FP, so there are generally a
couple of approaches - one that looks like Java and one that
is more pipelined, data flowing through functions.
So, it is true that Scala allows one to be "creative!?".
Some of this comes from the vastly richer set of capabilities
associated with the collection classes. In Java one has
Iterator while in Scala there is a whole lot of extra
standard methods.
Just yesterday while working on my NIST RBAC code, I had to
decide how to check access rights in a test class:
Does a Session have a given Permission, where
Roles are in a Set and RolesToPerm is a Map from Role to Permission:
def checkAccess(session: Session, perm: Permission): Boolean = {
// version 0, very Java-like, never considered
for (role <- session.getRoles) {
val pOp = roleToPerms.get(role)
if (permOp.isDefined)
if (permOp.get == perm) return true
}
false
// or version 1, handling Option the Scala-way
for (role <- session.getRoles) {
roleToPerms.get(role) match {
case Some(p) => if (p == perm) return true
case None => // ignore
}
}
false
// or version 2, rather more functional
sesson.getRoles.foldLeft(false) { _ ||
roleToPerms.get(_).getOrElse(null) == perm }
}
The first two versions are not too hard to understand, but the last
one, unless you know what foldLeft does, is, I imagine, opaque to most
Java programmers.
["foldLeft" sets the result value with an initial value, "false", and
then iterates over the values of the container, "roles", performing
the operation, "||", creating a new result value on each iteration
where the first "_" is the current result value and the second "_" is
the value from the container. "getOrElse returns the value looked up
from "roleToPerms" and, if it does not exist, returns "null". Lastly,
the iteration stops when the first true value, "== perm" is true;
the normal "||" shortcutting.]
That said, I consider the code to be functional
programming in-the-small, a single line of code and, ultimately, more
understandable (and more maintainable) than either of the proceeding
versions. [There maybe a better way to pipeline the evaluation, this
is just what I did.]
I have very mixed feelings about DSLs. If every programmer in your
project creates their own DSLs for their own section or, even worse,
per class, then DSLs are very bad; less understandable code, a
maintenance problem and a barrier to getting new hires up to speed.
On the other hand, if a project controls the use of DSLs and they
are well documented, they could (not will be, but could) be a boon
rather than a bust.
>
> **
> Martin
>
> 2011/1/19 richard emberson<ri...@gmail.com>:
>> Yea,
>>
>> I have consistently advocated using Scala with strong coding
>> standards - standards that are actually believed in and enforced.
>> I have referred to it as OO Scala, Scala which is strong on the
>> Java-like Object-Oriented features plus functional programming
>> in-the-small, but refrains from using functional programming
>> in-the-large, many of Scala's "functional goodies" and advanced
>> type capabilities (and if any of these really have to be used, they
>> should be approved by the group and be documented in detail).
>>
>> The reasons for Scala and using it with limitation are:
>> Scala is a better Java and
>> The use of Scala's "advanced features" must be controlled so that
>> code is understandable, maintainable and, most importantly, so that
>> one can access the existing programmer labor pool and not have to
>> limit one self to the very small number of FP programmers out there.
>>
>> Those who advocate the use of Scala's advanced features on large
>> projects are really advocating that Scala be only a niche language.
>>
>> Richard
>>
>> On 01/18/2011 11:02 PM, Liam Clarke-Hutchinson wrote:
>>>
>>> Hey mate,
>>>
>>> I code Java for my day job, and write my fun code in Scala. I just love
>>> the
>>> flexibility of Scala combined with the power to use all my existing Java
>>> libraries. That said,
>>> I don't see Scala overcoming Java anytime soon because it offers
>>> developers
>>> _too much_ freedom. I had a real bad time using
>>> http://dispatch.databinder.net for a project, because it fully utilized a
>>> lot of Scala features to offer a really shit API. Java makes everyone
>>> conform to a base level while preventing soaring, and it's a base level
>>> that's sane. And when it comes to writing business code, as in "Code that
>>> makes money", Scala's freedom doesn't offer overly much compared to Java's
>>> enforced conformity.
>>>
>>> Don't get me wrong, I<3 Scala, but while half of me wants to use it at
>>> work, the other half is terrified of what the Java developers who write
>>> Spring code like this:
>>>
>>> <bean id="something class="java.lang.String">
>>> <constructor-arg index="0">
>>> <value>${someProperty}</value>
>>> </constructor-arg>
>>> </bean>
>>>
>>> Would do with the power of Scala at their finger tips. (PS, that's real
>>> Spring code that I saw (and refactored) today.)
>>>
>>> On Tue, Jan 18, 2011 at 5:33 PM, richard emberson<
>>> richard.emberson@gmail.com> wrote:
>>>
>>>> I originally mentioned the Kuhn book in the context of the politics of
>>>> change. Altering the focus, you brought up *the truth* as the view
>>>> held by those resisting change, which I believe is not the larger
>>>> insight to be gained from his book. It is still my contention that my
>>>> original interpretation is valid; Scala faces resistance to change and
>>>> the structure of that resistance, maps into those structures
>>>> identified by Kuhn.
>>>>
>>>> Using a term you earlier used, I think it would be naive to believe
>>>> that entrenched business forces will stop the emergence of a new,
>>>> major development language. Such forces were aligned against C, C++
>>>> and Java, but the forces were overcome. In each case, rational
>>>> examination of the languages revealed advantages as well as
>>>> non-rational forces, such as Sun's marketing and glitter in the case
>>>> of Java, strengthening the prospects of the language's adaption. I
>>>> hope we can both agree that change will come.
>>>>
>>>> But, I do not believe the change will be revolutionary but, rather,
>>>> evolutionary. A language that evolves from an existing ecosystem has a
>>>> much greater likelihood of becoming significant than a green field
>>>> language.
>>>>
>>>> I paint and sculpt as well as do mathematics and physics and, for me,
>>>> language selection is far closer to math and physics than to the play
>>>> of colors or shape and form. I, thus, do not agree that choosing a
>>>> programming language is an exercise in artistry, but rather, its a
>>>> more rational process. And, if beauty is involved, then it is
>>>> scientific beauty and not artistic beauty. Are you Picasso? Maybe
>>>> even Mondrian? Hopefully, not Pollock.
>>>>
>>>> Concerning the languages you listed as "the way forward", an important
>>>> criteria must be: where are the programmers coming from? One can wait
>>>> for a new generation or one can see if any existing programmers will
>>>> migrate from their current language to a new language. Some language
>>>> usages from the web:
>>>> Java 18%
>>>> C 16%
>>>> C++ 9%
>>>> Python 6%
>>>> C# 6%
>>>> Objective-C 3%
>>>> Ruby 2%
>>>> Lisp 1%
>>>> Scheme ~0.5%
>>>> Haskell ~0.3%
>>>> Scala ~0.3%
>>>> Eiffel<0.1%
>>>> Clojure ~0.0%
>>>>
>>>> So, where might future Haskell or Clojure or Eiffel or Scala
>>>> programmers come from?
>>>>
>>>> # So, what about Eiffel?
>>>>
>>>> Eiffel (with DbC, "design by contract") is a 25 year old language and
>>>> its usage stats are down in the noise - well below Scala, Clojure and
>>>> Haskell - and showing its age. Hard to see a ground swell of C or Java
>>>> programmers switching to Eiffel.
>>>>
>>>> Eiffel's grasp exceeded what could be supported; its notion of
>>>> "contract" was so big, it was hard to find a wrapper around it all.
>>>> Category Theory may provide for a pragmatic approach to reasoning
>>>> about interfaces (contracts) which might not encompass all possible
>>>> rely/guarantee predicates, but many. As such, the three laws of
>>>> Monads from Category Theory might yield a more coherent, reasoned
>>>> approach to DbC and interface design. Curiously, this has been
>>>> discussed by the author of Scala as a possible approach to adding DbC
>>>> to Scala. For the Scala-CLR binding there is native support for such
>>>> constructs while for the Scala-JVM binding, it would have to be done
>>>> with code.
>>>>
>>>>
>>>> # So, what about Haskell?
>>>>
>>>> Haskell is the flag ship FP testbed which has been out there for close
>>>> to 20 years. There are no large enterprise applications written in
>>>> Haskell. It has certainly not taking the programming world by storm
>>>> whatever its merits. In addition, for Haskell, and all FP languages
>>>> for that matter, the world view required is not shared by most people,
>>>> Folks do not see the world as math functions (program mangers and
>>>> customers certainly don't); functional programming in-the-large is an
>>>> unnatural mapping of external objects and relationship to a FP design.
>>>> (That said, Category Theory is being used more in Physics and
>>>> non-computer Mathematics as a means of providing some guidance by
>>>> helping to find higher level relationships between areas of research,
>>>> but those are rather rarefied endeavors.) Again, where are the
>>>> converts to Haskell coming from? Just an occasional graduate student.
>>>>
>>>>
>>>> # So, what about Clojure?
>>>>
>>>> Clojure is an interesting case; its immutable data structures are a
>>>> strength but as soon as you allow users to call into Java libraries
>>>> any program-level reasoning due to such data structures are suspect -
>>>> an issue with any FP language which is not 100% pure. In addition,
>>>> where is the pool of potential converts? Clojure is a rather large
>>>> leap for the 20% of programmers using Java (or for that matter for the
>>>> 20% using C/C++) Converts would likely come from the Lisp (1% usage)
>>>> and Scheme (usage levels in the noise) community.
>>>>
>>>> As an aside, I had considered porting the Clojure runtime to Scala.
>>>> There would have been many advantages over the Java-based
>>>> runtime, e.g.:
>>>> Scala with its immutable data structures would be a good fit,
>>>> Scala's coming parallelized data structures targeted to
>>>> multi-core environments saving the Clojure group much development
>>>> effort.
>>>> Scala would have given the Clojure community delimited continuations
>>>> which the Scheme folks would like and understand.
>>>> But, such a port, while interesting and I would certainly have
>>>> learned Clojure, would not have appreciably increased the number
>>>> of Scala users - so I choice Wicket.
>>>>
>>>>
>>>> # So, what about Scala?
>>>>
>>>> I recently came upon a discussion of Joshua Bloch's "Effective Java",
>>>> its list of recommended practices and how they map into Scala.
>>>> Curiously, in each case, the article pointed out that Scala made
>>>> simpler or completely eliminated the need for the "Effective Java"
>>>> better-coding-practice. So, if one thinks that "Effective Java" makes
>>>> sense, so does, at least at the level of the recommendations, a switch
>>>> to Scala - the state of art has moved on from Java. As I have been
>>>> advocating, Scala is a better Java; switching from OO Java to OO Scala
>>>> is relatively easy and certainly Java's warts have become very
>>>> glaring.
>>>>
>>>> As with any language and development team, one needs development
>>>> standards. In this, Scala is no different than Java, C++, C, etc. To
>>>> not let programmers use Scala because one don't trust them and that
>>>> the team's development practices are not being followed or are
>>>> inadequate is not a problem with the language but rather with those in
>>>> positions of authority and/or respect for failing to set the proper
>>>> environment.
>>>>
>>>> Scala does allow users to access the existing, significant base of
>>>> Java libraries so that a whole universe of supporting libraries does
>>>> not have to be re-created for Scala. Also, if the use of its
>>>> functional and extended type capabilities are controlled, it offers a
>>>> relatively easy migration for the average Java programmer (or any of
>>>> the other OO languages listed above - a large pool of potential
>>>> converts).
>>>>
>>>>
>>>> The rate of change is increasing, A 100 years ago, change occurred much
>>>> slower than today. The establishment 100 years ago, those forces that
>>>> resist change as described by Kuhn, suffered few consequences for
>>>> their recalcitrance. But, now, change on the order of a few years is
>>>> the new constant, and it is only getting shorter (we are, in fact,
>>>> approaching the singularity). So, yesterday's guru, technical
>>>> innovator is today's stick-in-the-mud detractor - unless one rises
>>>> above the recurring drama Knuth discussed. Now a day, one might say,
>>>> Go Meta young man or become a Dunsel.
>>>>
>>>>
>>>> Quis custodiet ipsos custodes
>>>>
>>>
>>
>> --
>> Quis custodiet ipsos custodes
>>
>
--
Quis custodiet ipsos custodes
Re: Scala-Wicket Help and Advice
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Yeah.. scala is like javazcribl ;)
2011/1/19 Gustavo Hexsel <gh...@gmail.com>:
> Flexible syntax is a big part of it, but combined with operator override,
> it's a potential hole for understanding.
> They will never officially do that because one big use-case for scala is
> DSLs, in which this is an advantage (and the main scala team just got a
> reasonably large funding from a group that is interested in using Scala as
> DSLs).
>
> I'm with Richard, only strict coding standards will move Scala into
> mainstream (ok ok, there are a FEW mainstream projects, but I mean
> MAINmainstream). I'm not sure why it was never officially proposed yet...
>
> []s Gus
>
>
> On Wed, Jan 19, 2011 at 7:22 AM, Martin Makundi <
> martin.makundi@koodaripalvelut.com> wrote:
>
>> The only thing that bugs me about scala is its flexibility of
>> accepting different kind of notation. It's that what was the
>> "downfall" of html: making complilers flexible to allow various human
>> input and as end result none of the browsers work correctly because
>> the truth is only "in the eye of the beholder" (or creator only, in
>> this case).
>>
>> Scala maybe needs a bit more syntactical canonicity?
>>
>> **
>> Martin
>>
>> 2011/1/19 richard emberson <ri...@gmail.com>:
>> > Yea,
>> >
>> > I have consistently advocated using Scala with strong coding
>> > standards - standards that are actually believed in and enforced.
>> > I have referred to it as OO Scala, Scala which is strong on the
>> > Java-like Object-Oriented features plus functional programming
>> > in-the-small, but refrains from using functional programming
>> > in-the-large, many of Scala's "functional goodies" and advanced
>> > type capabilities (and if any of these really have to be used, they
>> > should be approved by the group and be documented in detail).
>> >
>> > The reasons for Scala and using it with limitation are:
>> > Scala is a better Java and
>> > The use of Scala's "advanced features" must be controlled so that
>> > code is understandable, maintainable and, most importantly, so that
>> > one can access the existing programmer labor pool and not have to
>> > limit one self to the very small number of FP programmers out there.
>> >
>> > Those who advocate the use of Scala's advanced features on large
>> > projects are really advocating that Scala be only a niche language.
>> >
>> > Richard
>> >
>> > On 01/18/2011 11:02 PM, Liam Clarke-Hutchinson wrote:
>> >>
>> >> Hey mate,
>> >>
>> >> I code Java for my day job, and write my fun code in Scala. I just love
>> >> the
>> >> flexibility of Scala combined with the power to use all my existing Java
>> >> libraries. That said,
>> >> I don't see Scala overcoming Java anytime soon because it offers
>> >> developers
>> >> _too much_ freedom. I had a real bad time using
>> >> http://dispatch.databinder.net for a project, because it fully utilized
>> a
>> >> lot of Scala features to offer a really shit API. Java makes everyone
>> >> conform to a base level while preventing soaring, and it's a base level
>> >> that's sane. And when it comes to writing business code, as in "Code
>> that
>> >> makes money", Scala's freedom doesn't offer overly much compared to
>> Java's
>> >> enforced conformity.
>> >>
>> >> Don't get me wrong, I<3 Scala, but while half of me wants to use it at
>> >> work, the other half is terrified of what the Java developers who write
>> >> Spring code like this:
>> >>
>> >> <bean id="something class="java.lang.String">
>> >> <constructor-arg index="0">
>> >> <value>${someProperty}</value>
>> >> </constructor-arg>
>> >> </bean>
>> >>
>> >> Would do with the power of Scala at their finger tips. (PS, that's real
>> >> Spring code that I saw (and refactored) today.)
>> >>
>> >> On Tue, Jan 18, 2011 at 5:33 PM, richard emberson<
>> >> richard.emberson@gmail.com> wrote:
>> >>
>> >>> I originally mentioned the Kuhn book in the context of the politics of
>> >>> change. Altering the focus, you brought up *the truth* as the view
>> >>> held by those resisting change, which I believe is not the larger
>> >>> insight to be gained from his book. It is still my contention that my
>> >>> original interpretation is valid; Scala faces resistance to change and
>> >>> the structure of that resistance, maps into those structures
>> >>> identified by Kuhn.
>> >>>
>> >>> Using a term you earlier used, I think it would be naive to believe
>> >>> that entrenched business forces will stop the emergence of a new,
>> >>> major development language. Such forces were aligned against C, C++
>> >>> and Java, but the forces were overcome. In each case, rational
>> >>> examination of the languages revealed advantages as well as
>> >>> non-rational forces, such as Sun's marketing and glitter in the case
>> >>> of Java, strengthening the prospects of the language's adaption. I
>> >>> hope we can both agree that change will come.
>> >>>
>> >>> But, I do not believe the change will be revolutionary but, rather,
>> >>> evolutionary. A language that evolves from an existing ecosystem has a
>> >>> much greater likelihood of becoming significant than a green field
>> >>> language.
>> >>>
>> >>> I paint and sculpt as well as do mathematics and physics and, for me,
>> >>> language selection is far closer to math and physics than to the play
>> >>> of colors or shape and form. I, thus, do not agree that choosing a
>> >>> programming language is an exercise in artistry, but rather, its a
>> >>> more rational process. And, if beauty is involved, then it is
>> >>> scientific beauty and not artistic beauty. Are you Picasso? Maybe
>> >>> even Mondrian? Hopefully, not Pollock.
>> >>>
>> >>> Concerning the languages you listed as "the way forward", an important
>> >>> criteria must be: where are the programmers coming from? One can wait
>> >>> for a new generation or one can see if any existing programmers will
>> >>> migrate from their current language to a new language. Some language
>> >>> usages from the web:
>> >>> Java 18%
>> >>> C 16%
>> >>> C++ 9%
>> >>> Python 6%
>> >>> C# 6%
>> >>> Objective-C 3%
>> >>> Ruby 2%
>> >>> Lisp 1%
>> >>> Scheme ~0.5%
>> >>> Haskell ~0.3%
>> >>> Scala ~0.3%
>> >>> Eiffel<0.1%
>> >>> Clojure ~0.0%
>> >>>
>> >>> So, where might future Haskell or Clojure or Eiffel or Scala
>> >>> programmers come from?
>> >>>
>> >>> # So, what about Eiffel?
>> >>>
>> >>> Eiffel (with DbC, "design by contract") is a 25 year old language and
>> >>> its usage stats are down in the noise - well below Scala, Clojure and
>> >>> Haskell - and showing its age. Hard to see a ground swell of C or Java
>> >>> programmers switching to Eiffel.
>> >>>
>> >>> Eiffel's grasp exceeded what could be supported; its notion of
>> >>> "contract" was so big, it was hard to find a wrapper around it all.
>> >>> Category Theory may provide for a pragmatic approach to reasoning
>> >>> about interfaces (contracts) which might not encompass all possible
>> >>> rely/guarantee predicates, but many. As such, the three laws of
>> >>> Monads from Category Theory might yield a more coherent, reasoned
>> >>> approach to DbC and interface design. Curiously, this has been
>> >>> discussed by the author of Scala as a possible approach to adding DbC
>> >>> to Scala. For the Scala-CLR binding there is native support for such
>> >>> constructs while for the Scala-JVM binding, it would have to be done
>> >>> with code.
>> >>>
>> >>>
>> >>> # So, what about Haskell?
>> >>>
>> >>> Haskell is the flag ship FP testbed which has been out there for close
>> >>> to 20 years. There are no large enterprise applications written in
>> >>> Haskell. It has certainly not taking the programming world by storm
>> >>> whatever its merits. In addition, for Haskell, and all FP languages
>> >>> for that matter, the world view required is not shared by most people,
>> >>> Folks do not see the world as math functions (program mangers and
>> >>> customers certainly don't); functional programming in-the-large is an
>> >>> unnatural mapping of external objects and relationship to a FP design.
>> >>> (That said, Category Theory is being used more in Physics and
>> >>> non-computer Mathematics as a means of providing some guidance by
>> >>> helping to find higher level relationships between areas of research,
>> >>> but those are rather rarefied endeavors.) Again, where are the
>> >>> converts to Haskell coming from? Just an occasional graduate student.
>> >>>
>> >>>
>> >>> # So, what about Clojure?
>> >>>
>> >>> Clojure is an interesting case; its immutable data structures are a
>> >>> strength but as soon as you allow users to call into Java libraries
>> >>> any program-level reasoning due to such data structures are suspect -
>> >>> an issue with any FP language which is not 100% pure. In addition,
>> >>> where is the pool of potential converts? Clojure is a rather large
>> >>> leap for the 20% of programmers using Java (or for that matter for the
>> >>> 20% using C/C++) Converts would likely come from the Lisp (1% usage)
>> >>> and Scheme (usage levels in the noise) community.
>> >>>
>> >>> As an aside, I had considered porting the Clojure runtime to Scala.
>> >>> There would have been many advantages over the Java-based
>> >>> runtime, e.g.:
>> >>> Scala with its immutable data structures would be a good fit,
>> >>> Scala's coming parallelized data structures targeted to
>> >>> multi-core environments saving the Clojure group much development
>> >>> effort.
>> >>> Scala would have given the Clojure community delimited continuations
>> >>> which the Scheme folks would like and understand.
>> >>> But, such a port, while interesting and I would certainly have
>> >>> learned Clojure, would not have appreciably increased the number
>> >>> of Scala users - so I choice Wicket.
>> >>>
>> >>>
>> >>> # So, what about Scala?
>> >>>
>> >>> I recently came upon a discussion of Joshua Bloch's "Effective Java",
>> >>> its list of recommended practices and how they map into Scala.
>> >>> Curiously, in each case, the article pointed out that Scala made
>> >>> simpler or completely eliminated the need for the "Effective Java"
>> >>> better-coding-practice. So, if one thinks that "Effective Java" makes
>> >>> sense, so does, at least at the level of the recommendations, a switch
>> >>> to Scala - the state of art has moved on from Java. As I have been
>> >>> advocating, Scala is a better Java; switching from OO Java to OO Scala
>> >>> is relatively easy and certainly Java's warts have become very
>> >>> glaring.
>> >>>
>> >>> As with any language and development team, one needs development
>> >>> standards. In this, Scala is no different than Java, C++, C, etc. To
>> >>> not let programmers use Scala because one don't trust them and that
>> >>> the team's development practices are not being followed or are
>> >>> inadequate is not a problem with the language but rather with those in
>> >>> positions of authority and/or respect for failing to set the proper
>> >>> environment.
>> >>>
>> >>> Scala does allow users to access the existing, significant base of
>> >>> Java libraries so that a whole universe of supporting libraries does
>> >>> not have to be re-created for Scala. Also, if the use of its
>> >>> functional and extended type capabilities are controlled, it offers a
>> >>> relatively easy migration for the average Java programmer (or any of
>> >>> the other OO languages listed above - a large pool of potential
>> >>> converts).
>> >>>
>> >>>
>> >>> The rate of change is increasing, A 100 years ago, change occurred much
>> >>> slower than today. The establishment 100 years ago, those forces that
>> >>> resist change as described by Kuhn, suffered few consequences for
>> >>> their recalcitrance. But, now, change on the order of a few years is
>> >>> the new constant, and it is only getting shorter (we are, in fact,
>> >>> approaching the singularity). So, yesterday's guru, technical
>> >>> innovator is today's stick-in-the-mud detractor - unless one rises
>> >>> above the recurring drama Knuth discussed. Now a day, one might say,
>> >>> Go Meta young man or become a Dunsel.
>> >>>
>> >>>
>> >>> Quis custodiet ipsos custodes
>> >>>
>> >>
>> >
>> > --
>> > Quis custodiet ipsos custodes
>> >
>>
>
Re: Scala-Wicket Help and Advice
Posted by Gustavo Hexsel <gh...@gmail.com>.
Flexible syntax is a big part of it, but combined with operator override,
it's a potential hole for understanding.
They will never officially do that because one big use-case for scala is
DSLs, in which this is an advantage (and the main scala team just got a
reasonably large funding from a group that is interested in using Scala as
DSLs).
I'm with Richard, only strict coding standards will move Scala into
mainstream (ok ok, there are a FEW mainstream projects, but I mean
MAINmainstream). I'm not sure why it was never officially proposed yet...
[]s Gus
On Wed, Jan 19, 2011 at 7:22 AM, Martin Makundi <
martin.makundi@koodaripalvelut.com> wrote:
> The only thing that bugs me about scala is its flexibility of
> accepting different kind of notation. It's that what was the
> "downfall" of html: making complilers flexible to allow various human
> input and as end result none of the browsers work correctly because
> the truth is only "in the eye of the beholder" (or creator only, in
> this case).
>
> Scala maybe needs a bit more syntactical canonicity?
>
> **
> Martin
>
> 2011/1/19 richard emberson <ri...@gmail.com>:
> > Yea,
> >
> > I have consistently advocated using Scala with strong coding
> > standards - standards that are actually believed in and enforced.
> > I have referred to it as OO Scala, Scala which is strong on the
> > Java-like Object-Oriented features plus functional programming
> > in-the-small, but refrains from using functional programming
> > in-the-large, many of Scala's "functional goodies" and advanced
> > type capabilities (and if any of these really have to be used, they
> > should be approved by the group and be documented in detail).
> >
> > The reasons for Scala and using it with limitation are:
> > Scala is a better Java and
> > The use of Scala's "advanced features" must be controlled so that
> > code is understandable, maintainable and, most importantly, so that
> > one can access the existing programmer labor pool and not have to
> > limit one self to the very small number of FP programmers out there.
> >
> > Those who advocate the use of Scala's advanced features on large
> > projects are really advocating that Scala be only a niche language.
> >
> > Richard
> >
> > On 01/18/2011 11:02 PM, Liam Clarke-Hutchinson wrote:
> >>
> >> Hey mate,
> >>
> >> I code Java for my day job, and write my fun code in Scala. I just love
> >> the
> >> flexibility of Scala combined with the power to use all my existing Java
> >> libraries. That said,
> >> I don't see Scala overcoming Java anytime soon because it offers
> >> developers
> >> _too much_ freedom. I had a real bad time using
> >> http://dispatch.databinder.net for a project, because it fully utilized
> a
> >> lot of Scala features to offer a really shit API. Java makes everyone
> >> conform to a base level while preventing soaring, and it's a base level
> >> that's sane. And when it comes to writing business code, as in "Code
> that
> >> makes money", Scala's freedom doesn't offer overly much compared to
> Java's
> >> enforced conformity.
> >>
> >> Don't get me wrong, I<3 Scala, but while half of me wants to use it at
> >> work, the other half is terrified of what the Java developers who write
> >> Spring code like this:
> >>
> >> <bean id="something class="java.lang.String">
> >> <constructor-arg index="0">
> >> <value>${someProperty}</value>
> >> </constructor-arg>
> >> </bean>
> >>
> >> Would do with the power of Scala at their finger tips. (PS, that's real
> >> Spring code that I saw (and refactored) today.)
> >>
> >> On Tue, Jan 18, 2011 at 5:33 PM, richard emberson<
> >> richard.emberson@gmail.com> wrote:
> >>
> >>> I originally mentioned the Kuhn book in the context of the politics of
> >>> change. Altering the focus, you brought up *the truth* as the view
> >>> held by those resisting change, which I believe is not the larger
> >>> insight to be gained from his book. It is still my contention that my
> >>> original interpretation is valid; Scala faces resistance to change and
> >>> the structure of that resistance, maps into those structures
> >>> identified by Kuhn.
> >>>
> >>> Using a term you earlier used, I think it would be naive to believe
> >>> that entrenched business forces will stop the emergence of a new,
> >>> major development language. Such forces were aligned against C, C++
> >>> and Java, but the forces were overcome. In each case, rational
> >>> examination of the languages revealed advantages as well as
> >>> non-rational forces, such as Sun's marketing and glitter in the case
> >>> of Java, strengthening the prospects of the language's adaption. I
> >>> hope we can both agree that change will come.
> >>>
> >>> But, I do not believe the change will be revolutionary but, rather,
> >>> evolutionary. A language that evolves from an existing ecosystem has a
> >>> much greater likelihood of becoming significant than a green field
> >>> language.
> >>>
> >>> I paint and sculpt as well as do mathematics and physics and, for me,
> >>> language selection is far closer to math and physics than to the play
> >>> of colors or shape and form. I, thus, do not agree that choosing a
> >>> programming language is an exercise in artistry, but rather, its a
> >>> more rational process. And, if beauty is involved, then it is
> >>> scientific beauty and not artistic beauty. Are you Picasso? Maybe
> >>> even Mondrian? Hopefully, not Pollock.
> >>>
> >>> Concerning the languages you listed as "the way forward", an important
> >>> criteria must be: where are the programmers coming from? One can wait
> >>> for a new generation or one can see if any existing programmers will
> >>> migrate from their current language to a new language. Some language
> >>> usages from the web:
> >>> Java 18%
> >>> C 16%
> >>> C++ 9%
> >>> Python 6%
> >>> C# 6%
> >>> Objective-C 3%
> >>> Ruby 2%
> >>> Lisp 1%
> >>> Scheme ~0.5%
> >>> Haskell ~0.3%
> >>> Scala ~0.3%
> >>> Eiffel<0.1%
> >>> Clojure ~0.0%
> >>>
> >>> So, where might future Haskell or Clojure or Eiffel or Scala
> >>> programmers come from?
> >>>
> >>> # So, what about Eiffel?
> >>>
> >>> Eiffel (with DbC, "design by contract") is a 25 year old language and
> >>> its usage stats are down in the noise - well below Scala, Clojure and
> >>> Haskell - and showing its age. Hard to see a ground swell of C or Java
> >>> programmers switching to Eiffel.
> >>>
> >>> Eiffel's grasp exceeded what could be supported; its notion of
> >>> "contract" was so big, it was hard to find a wrapper around it all.
> >>> Category Theory may provide for a pragmatic approach to reasoning
> >>> about interfaces (contracts) which might not encompass all possible
> >>> rely/guarantee predicates, but many. As such, the three laws of
> >>> Monads from Category Theory might yield a more coherent, reasoned
> >>> approach to DbC and interface design. Curiously, this has been
> >>> discussed by the author of Scala as a possible approach to adding DbC
> >>> to Scala. For the Scala-CLR binding there is native support for such
> >>> constructs while for the Scala-JVM binding, it would have to be done
> >>> with code.
> >>>
> >>>
> >>> # So, what about Haskell?
> >>>
> >>> Haskell is the flag ship FP testbed which has been out there for close
> >>> to 20 years. There are no large enterprise applications written in
> >>> Haskell. It has certainly not taking the programming world by storm
> >>> whatever its merits. In addition, for Haskell, and all FP languages
> >>> for that matter, the world view required is not shared by most people,
> >>> Folks do not see the world as math functions (program mangers and
> >>> customers certainly don't); functional programming in-the-large is an
> >>> unnatural mapping of external objects and relationship to a FP design.
> >>> (That said, Category Theory is being used more in Physics and
> >>> non-computer Mathematics as a means of providing some guidance by
> >>> helping to find higher level relationships between areas of research,
> >>> but those are rather rarefied endeavors.) Again, where are the
> >>> converts to Haskell coming from? Just an occasional graduate student.
> >>>
> >>>
> >>> # So, what about Clojure?
> >>>
> >>> Clojure is an interesting case; its immutable data structures are a
> >>> strength but as soon as you allow users to call into Java libraries
> >>> any program-level reasoning due to such data structures are suspect -
> >>> an issue with any FP language which is not 100% pure. In addition,
> >>> where is the pool of potential converts? Clojure is a rather large
> >>> leap for the 20% of programmers using Java (or for that matter for the
> >>> 20% using C/C++) Converts would likely come from the Lisp (1% usage)
> >>> and Scheme (usage levels in the noise) community.
> >>>
> >>> As an aside, I had considered porting the Clojure runtime to Scala.
> >>> There would have been many advantages over the Java-based
> >>> runtime, e.g.:
> >>> Scala with its immutable data structures would be a good fit,
> >>> Scala's coming parallelized data structures targeted to
> >>> multi-core environments saving the Clojure group much development
> >>> effort.
> >>> Scala would have given the Clojure community delimited continuations
> >>> which the Scheme folks would like and understand.
> >>> But, such a port, while interesting and I would certainly have
> >>> learned Clojure, would not have appreciably increased the number
> >>> of Scala users - so I choice Wicket.
> >>>
> >>>
> >>> # So, what about Scala?
> >>>
> >>> I recently came upon a discussion of Joshua Bloch's "Effective Java",
> >>> its list of recommended practices and how they map into Scala.
> >>> Curiously, in each case, the article pointed out that Scala made
> >>> simpler or completely eliminated the need for the "Effective Java"
> >>> better-coding-practice. So, if one thinks that "Effective Java" makes
> >>> sense, so does, at least at the level of the recommendations, a switch
> >>> to Scala - the state of art has moved on from Java. As I have been
> >>> advocating, Scala is a better Java; switching from OO Java to OO Scala
> >>> is relatively easy and certainly Java's warts have become very
> >>> glaring.
> >>>
> >>> As with any language and development team, one needs development
> >>> standards. In this, Scala is no different than Java, C++, C, etc. To
> >>> not let programmers use Scala because one don't trust them and that
> >>> the team's development practices are not being followed or are
> >>> inadequate is not a problem with the language but rather with those in
> >>> positions of authority and/or respect for failing to set the proper
> >>> environment.
> >>>
> >>> Scala does allow users to access the existing, significant base of
> >>> Java libraries so that a whole universe of supporting libraries does
> >>> not have to be re-created for Scala. Also, if the use of its
> >>> functional and extended type capabilities are controlled, it offers a
> >>> relatively easy migration for the average Java programmer (or any of
> >>> the other OO languages listed above - a large pool of potential
> >>> converts).
> >>>
> >>>
> >>> The rate of change is increasing, A 100 years ago, change occurred much
> >>> slower than today. The establishment 100 years ago, those forces that
> >>> resist change as described by Kuhn, suffered few consequences for
> >>> their recalcitrance. But, now, change on the order of a few years is
> >>> the new constant, and it is only getting shorter (we are, in fact,
> >>> approaching the singularity). So, yesterday's guru, technical
> >>> innovator is today's stick-in-the-mud detractor - unless one rises
> >>> above the recurring drama Knuth discussed. Now a day, one might say,
> >>> Go Meta young man or become a Dunsel.
> >>>
> >>>
> >>> Quis custodiet ipsos custodes
> >>>
> >>
> >
> > --
> > Quis custodiet ipsos custodes
> >
>
Re: Scala-Wicket Help and Advice
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
The only thing that bugs me about scala is its flexibility of
accepting different kind of notation. It's that what was the
"downfall" of html: making complilers flexible to allow various human
input and as end result none of the browsers work correctly because
the truth is only "in the eye of the beholder" (or creator only, in
this case).
Scala maybe needs a bit more syntactical canonicity?
**
Martin
2011/1/19 richard emberson <ri...@gmail.com>:
> Yea,
>
> I have consistently advocated using Scala with strong coding
> standards - standards that are actually believed in and enforced.
> I have referred to it as OO Scala, Scala which is strong on the
> Java-like Object-Oriented features plus functional programming
> in-the-small, but refrains from using functional programming
> in-the-large, many of Scala's "functional goodies" and advanced
> type capabilities (and if any of these really have to be used, they
> should be approved by the group and be documented in detail).
>
> The reasons for Scala and using it with limitation are:
> Scala is a better Java and
> The use of Scala's "advanced features" must be controlled so that
> code is understandable, maintainable and, most importantly, so that
> one can access the existing programmer labor pool and not have to
> limit one self to the very small number of FP programmers out there.
>
> Those who advocate the use of Scala's advanced features on large
> projects are really advocating that Scala be only a niche language.
>
> Richard
>
> On 01/18/2011 11:02 PM, Liam Clarke-Hutchinson wrote:
>>
>> Hey mate,
>>
>> I code Java for my day job, and write my fun code in Scala. I just love
>> the
>> flexibility of Scala combined with the power to use all my existing Java
>> libraries. That said,
>> I don't see Scala overcoming Java anytime soon because it offers
>> developers
>> _too much_ freedom. I had a real bad time using
>> http://dispatch.databinder.net for a project, because it fully utilized a
>> lot of Scala features to offer a really shit API. Java makes everyone
>> conform to a base level while preventing soaring, and it's a base level
>> that's sane. And when it comes to writing business code, as in "Code that
>> makes money", Scala's freedom doesn't offer overly much compared to Java's
>> enforced conformity.
>>
>> Don't get me wrong, I<3 Scala, but while half of me wants to use it at
>> work, the other half is terrified of what the Java developers who write
>> Spring code like this:
>>
>> <bean id="something class="java.lang.String">
>> <constructor-arg index="0">
>> <value>${someProperty}</value>
>> </constructor-arg>
>> </bean>
>>
>> Would do with the power of Scala at their finger tips. (PS, that's real
>> Spring code that I saw (and refactored) today.)
>>
>> On Tue, Jan 18, 2011 at 5:33 PM, richard emberson<
>> richard.emberson@gmail.com> wrote:
>>
>>> I originally mentioned the Kuhn book in the context of the politics of
>>> change. Altering the focus, you brought up *the truth* as the view
>>> held by those resisting change, which I believe is not the larger
>>> insight to be gained from his book. It is still my contention that my
>>> original interpretation is valid; Scala faces resistance to change and
>>> the structure of that resistance, maps into those structures
>>> identified by Kuhn.
>>>
>>> Using a term you earlier used, I think it would be naive to believe
>>> that entrenched business forces will stop the emergence of a new,
>>> major development language. Such forces were aligned against C, C++
>>> and Java, but the forces were overcome. In each case, rational
>>> examination of the languages revealed advantages as well as
>>> non-rational forces, such as Sun's marketing and glitter in the case
>>> of Java, strengthening the prospects of the language's adaption. I
>>> hope we can both agree that change will come.
>>>
>>> But, I do not believe the change will be revolutionary but, rather,
>>> evolutionary. A language that evolves from an existing ecosystem has a
>>> much greater likelihood of becoming significant than a green field
>>> language.
>>>
>>> I paint and sculpt as well as do mathematics and physics and, for me,
>>> language selection is far closer to math and physics than to the play
>>> of colors or shape and form. I, thus, do not agree that choosing a
>>> programming language is an exercise in artistry, but rather, its a
>>> more rational process. And, if beauty is involved, then it is
>>> scientific beauty and not artistic beauty. Are you Picasso? Maybe
>>> even Mondrian? Hopefully, not Pollock.
>>>
>>> Concerning the languages you listed as "the way forward", an important
>>> criteria must be: where are the programmers coming from? One can wait
>>> for a new generation or one can see if any existing programmers will
>>> migrate from their current language to a new language. Some language
>>> usages from the web:
>>> Java 18%
>>> C 16%
>>> C++ 9%
>>> Python 6%
>>> C# 6%
>>> Objective-C 3%
>>> Ruby 2%
>>> Lisp 1%
>>> Scheme ~0.5%
>>> Haskell ~0.3%
>>> Scala ~0.3%
>>> Eiffel<0.1%
>>> Clojure ~0.0%
>>>
>>> So, where might future Haskell or Clojure or Eiffel or Scala
>>> programmers come from?
>>>
>>> # So, what about Eiffel?
>>>
>>> Eiffel (with DbC, "design by contract") is a 25 year old language and
>>> its usage stats are down in the noise - well below Scala, Clojure and
>>> Haskell - and showing its age. Hard to see a ground swell of C or Java
>>> programmers switching to Eiffel.
>>>
>>> Eiffel's grasp exceeded what could be supported; its notion of
>>> "contract" was so big, it was hard to find a wrapper around it all.
>>> Category Theory may provide for a pragmatic approach to reasoning
>>> about interfaces (contracts) which might not encompass all possible
>>> rely/guarantee predicates, but many. As such, the three laws of
>>> Monads from Category Theory might yield a more coherent, reasoned
>>> approach to DbC and interface design. Curiously, this has been
>>> discussed by the author of Scala as a possible approach to adding DbC
>>> to Scala. For the Scala-CLR binding there is native support for such
>>> constructs while for the Scala-JVM binding, it would have to be done
>>> with code.
>>>
>>>
>>> # So, what about Haskell?
>>>
>>> Haskell is the flag ship FP testbed which has been out there for close
>>> to 20 years. There are no large enterprise applications written in
>>> Haskell. It has certainly not taking the programming world by storm
>>> whatever its merits. In addition, for Haskell, and all FP languages
>>> for that matter, the world view required is not shared by most people,
>>> Folks do not see the world as math functions (program mangers and
>>> customers certainly don't); functional programming in-the-large is an
>>> unnatural mapping of external objects and relationship to a FP design.
>>> (That said, Category Theory is being used more in Physics and
>>> non-computer Mathematics as a means of providing some guidance by
>>> helping to find higher level relationships between areas of research,
>>> but those are rather rarefied endeavors.) Again, where are the
>>> converts to Haskell coming from? Just an occasional graduate student.
>>>
>>>
>>> # So, what about Clojure?
>>>
>>> Clojure is an interesting case; its immutable data structures are a
>>> strength but as soon as you allow users to call into Java libraries
>>> any program-level reasoning due to such data structures are suspect -
>>> an issue with any FP language which is not 100% pure. In addition,
>>> where is the pool of potential converts? Clojure is a rather large
>>> leap for the 20% of programmers using Java (or for that matter for the
>>> 20% using C/C++) Converts would likely come from the Lisp (1% usage)
>>> and Scheme (usage levels in the noise) community.
>>>
>>> As an aside, I had considered porting the Clojure runtime to Scala.
>>> There would have been many advantages over the Java-based
>>> runtime, e.g.:
>>> Scala with its immutable data structures would be a good fit,
>>> Scala's coming parallelized data structures targeted to
>>> multi-core environments saving the Clojure group much development
>>> effort.
>>> Scala would have given the Clojure community delimited continuations
>>> which the Scheme folks would like and understand.
>>> But, such a port, while interesting and I would certainly have
>>> learned Clojure, would not have appreciably increased the number
>>> of Scala users - so I choice Wicket.
>>>
>>>
>>> # So, what about Scala?
>>>
>>> I recently came upon a discussion of Joshua Bloch's "Effective Java",
>>> its list of recommended practices and how they map into Scala.
>>> Curiously, in each case, the article pointed out that Scala made
>>> simpler or completely eliminated the need for the "Effective Java"
>>> better-coding-practice. So, if one thinks that "Effective Java" makes
>>> sense, so does, at least at the level of the recommendations, a switch
>>> to Scala - the state of art has moved on from Java. As I have been
>>> advocating, Scala is a better Java; switching from OO Java to OO Scala
>>> is relatively easy and certainly Java's warts have become very
>>> glaring.
>>>
>>> As with any language and development team, one needs development
>>> standards. In this, Scala is no different than Java, C++, C, etc. To
>>> not let programmers use Scala because one don't trust them and that
>>> the team's development practices are not being followed or are
>>> inadequate is not a problem with the language but rather with those in
>>> positions of authority and/or respect for failing to set the proper
>>> environment.
>>>
>>> Scala does allow users to access the existing, significant base of
>>> Java libraries so that a whole universe of supporting libraries does
>>> not have to be re-created for Scala. Also, if the use of its
>>> functional and extended type capabilities are controlled, it offers a
>>> relatively easy migration for the average Java programmer (or any of
>>> the other OO languages listed above - a large pool of potential
>>> converts).
>>>
>>>
>>> The rate of change is increasing, A 100 years ago, change occurred much
>>> slower than today. The establishment 100 years ago, those forces that
>>> resist change as described by Kuhn, suffered few consequences for
>>> their recalcitrance. But, now, change on the order of a few years is
>>> the new constant, and it is only getting shorter (we are, in fact,
>>> approaching the singularity). So, yesterday's guru, technical
>>> innovator is today's stick-in-the-mud detractor - unless one rises
>>> above the recurring drama Knuth discussed. Now a day, one might say,
>>> Go Meta young man or become a Dunsel.
>>>
>>>
>>> Quis custodiet ipsos custodes
>>>
>>
>
> --
> Quis custodiet ipsos custodes
>
Re: Scala-Wicket Help and Advice
Posted by richard emberson <ri...@gmail.com>.
Yea,
I have consistently advocated using Scala with strong coding
standards - standards that are actually believed in and enforced.
I have referred to it as OO Scala, Scala which is strong on the
Java-like Object-Oriented features plus functional programming
in-the-small, but refrains from using functional programming
in-the-large, many of Scala's "functional goodies" and advanced
type capabilities (and if any of these really have to be used, they
should be approved by the group and be documented in detail).
The reasons for Scala and using it with limitation are:
Scala is a better Java and
The use of Scala's "advanced features" must be controlled so that
code is understandable, maintainable and, most importantly, so that
one can access the existing programmer labor pool and not have to
limit one self to the very small number of FP programmers out there.
Those who advocate the use of Scala's advanced features on large
projects are really advocating that Scala be only a niche language.
Richard
On 01/18/2011 11:02 PM, Liam Clarke-Hutchinson wrote:
> Hey mate,
>
> I code Java for my day job, and write my fun code in Scala. I just love the
> flexibility of Scala combined with the power to use all my existing Java
> libraries. That said,
> I don't see Scala overcoming Java anytime soon because it offers developers
> _too much_ freedom. I had a real bad time using
> http://dispatch.databinder.net for a project, because it fully utilized a
> lot of Scala features to offer a really shit API. Java makes everyone
> conform to a base level while preventing soaring, and it's a base level
> that's sane. And when it comes to writing business code, as in "Code that
> makes money", Scala's freedom doesn't offer overly much compared to Java's
> enforced conformity.
>
> Don't get me wrong, I<3 Scala, but while half of me wants to use it at
> work, the other half is terrified of what the Java developers who write
> Spring code like this:
>
> <bean id="something class="java.lang.String">
> <constructor-arg index="0">
> <value>${someProperty}</value>
> </constructor-arg>
> </bean>
>
> Would do with the power of Scala at their finger tips. (PS, that's real
> Spring code that I saw (and refactored) today.)
>
> On Tue, Jan 18, 2011 at 5:33 PM, richard emberson<
> richard.emberson@gmail.com> wrote:
>
>> I originally mentioned the Kuhn book in the context of the politics of
>> change. Altering the focus, you brought up *the truth* as the view
>> held by those resisting change, which I believe is not the larger
>> insight to be gained from his book. It is still my contention that my
>> original interpretation is valid; Scala faces resistance to change and
>> the structure of that resistance, maps into those structures
>> identified by Kuhn.
>>
>> Using a term you earlier used, I think it would be naive to believe
>> that entrenched business forces will stop the emergence of a new,
>> major development language. Such forces were aligned against C, C++
>> and Java, but the forces were overcome. In each case, rational
>> examination of the languages revealed advantages as well as
>> non-rational forces, such as Sun's marketing and glitter in the case
>> of Java, strengthening the prospects of the language's adaption. I
>> hope we can both agree that change will come.
>>
>> But, I do not believe the change will be revolutionary but, rather,
>> evolutionary. A language that evolves from an existing ecosystem has a
>> much greater likelihood of becoming significant than a green field
>> language.
>>
>> I paint and sculpt as well as do mathematics and physics and, for me,
>> language selection is far closer to math and physics than to the play
>> of colors or shape and form. I, thus, do not agree that choosing a
>> programming language is an exercise in artistry, but rather, its a
>> more rational process. And, if beauty is involved, then it is
>> scientific beauty and not artistic beauty. Are you Picasso? Maybe
>> even Mondrian? Hopefully, not Pollock.
>>
>> Concerning the languages you listed as "the way forward", an important
>> criteria must be: where are the programmers coming from? One can wait
>> for a new generation or one can see if any existing programmers will
>> migrate from their current language to a new language. Some language
>> usages from the web:
>> Java 18%
>> C 16%
>> C++ 9%
>> Python 6%
>> C# 6%
>> Objective-C 3%
>> Ruby 2%
>> Lisp 1%
>> Scheme ~0.5%
>> Haskell ~0.3%
>> Scala ~0.3%
>> Eiffel<0.1%
>> Clojure ~0.0%
>>
>> So, where might future Haskell or Clojure or Eiffel or Scala
>> programmers come from?
>>
>> # So, what about Eiffel?
>>
>> Eiffel (with DbC, "design by contract") is a 25 year old language and
>> its usage stats are down in the noise - well below Scala, Clojure and
>> Haskell - and showing its age. Hard to see a ground swell of C or Java
>> programmers switching to Eiffel.
>>
>> Eiffel's grasp exceeded what could be supported; its notion of
>> "contract" was so big, it was hard to find a wrapper around it all.
>> Category Theory may provide for a pragmatic approach to reasoning
>> about interfaces (contracts) which might not encompass all possible
>> rely/guarantee predicates, but many. As such, the three laws of
>> Monads from Category Theory might yield a more coherent, reasoned
>> approach to DbC and interface design. Curiously, this has been
>> discussed by the author of Scala as a possible approach to adding DbC
>> to Scala. For the Scala-CLR binding there is native support for such
>> constructs while for the Scala-JVM binding, it would have to be done
>> with code.
>>
>>
>> # So, what about Haskell?
>>
>> Haskell is the flag ship FP testbed which has been out there for close
>> to 20 years. There are no large enterprise applications written in
>> Haskell. It has certainly not taking the programming world by storm
>> whatever its merits. In addition, for Haskell, and all FP languages
>> for that matter, the world view required is not shared by most people,
>> Folks do not see the world as math functions (program mangers and
>> customers certainly don't); functional programming in-the-large is an
>> unnatural mapping of external objects and relationship to a FP design.
>> (That said, Category Theory is being used more in Physics and
>> non-computer Mathematics as a means of providing some guidance by
>> helping to find higher level relationships between areas of research,
>> but those are rather rarefied endeavors.) Again, where are the
>> converts to Haskell coming from? Just an occasional graduate student.
>>
>>
>> # So, what about Clojure?
>>
>> Clojure is an interesting case; its immutable data structures are a
>> strength but as soon as you allow users to call into Java libraries
>> any program-level reasoning due to such data structures are suspect -
>> an issue with any FP language which is not 100% pure. In addition,
>> where is the pool of potential converts? Clojure is a rather large
>> leap for the 20% of programmers using Java (or for that matter for the
>> 20% using C/C++) Converts would likely come from the Lisp (1% usage)
>> and Scheme (usage levels in the noise) community.
>>
>> As an aside, I had considered porting the Clojure runtime to Scala.
>> There would have been many advantages over the Java-based
>> runtime, e.g.:
>> Scala with its immutable data structures would be a good fit,
>> Scala's coming parallelized data structures targeted to
>> multi-core environments saving the Clojure group much development
>> effort.
>> Scala would have given the Clojure community delimited continuations
>> which the Scheme folks would like and understand.
>> But, such a port, while interesting and I would certainly have
>> learned Clojure, would not have appreciably increased the number
>> of Scala users - so I choice Wicket.
>>
>>
>> # So, what about Scala?
>>
>> I recently came upon a discussion of Joshua Bloch's "Effective Java",
>> its list of recommended practices and how they map into Scala.
>> Curiously, in each case, the article pointed out that Scala made
>> simpler or completely eliminated the need for the "Effective Java"
>> better-coding-practice. So, if one thinks that "Effective Java" makes
>> sense, so does, at least at the level of the recommendations, a switch
>> to Scala - the state of art has moved on from Java. As I have been
>> advocating, Scala is a better Java; switching from OO Java to OO Scala
>> is relatively easy and certainly Java's warts have become very
>> glaring.
>>
>> As with any language and development team, one needs development
>> standards. In this, Scala is no different than Java, C++, C, etc. To
>> not let programmers use Scala because one don't trust them and that
>> the team's development practices are not being followed or are
>> inadequate is not a problem with the language but rather with those in
>> positions of authority and/or respect for failing to set the proper
>> environment.
>>
>> Scala does allow users to access the existing, significant base of
>> Java libraries so that a whole universe of supporting libraries does
>> not have to be re-created for Scala. Also, if the use of its
>> functional and extended type capabilities are controlled, it offers a
>> relatively easy migration for the average Java programmer (or any of
>> the other OO languages listed above - a large pool of potential
>> converts).
>>
>>
>> The rate of change is increasing, A 100 years ago, change occurred much
>> slower than today. The establishment 100 years ago, those forces that
>> resist change as described by Kuhn, suffered few consequences for
>> their recalcitrance. But, now, change on the order of a few years is
>> the new constant, and it is only getting shorter (we are, in fact,
>> approaching the singularity). So, yesterday's guru, technical
>> innovator is today's stick-in-the-mud detractor - unless one rises
>> above the recurring drama Knuth discussed. Now a day, one might say,
>> Go Meta young man or become a Dunsel.
>>
>>
>> Quis custodiet ipsos custodes
>>
>
--
Quis custodiet ipsos custodes
Re: Scala-Wicket Help and Advice
Posted by Liam Clarke-Hutchinson <li...@steelsky.co.nz>.
Hey mate,
I code Java for my day job, and write my fun code in Scala. I just love the
flexibility of Scala combined with the power to use all my existing Java
libraries. That said,
I don't see Scala overcoming Java anytime soon because it offers developers
_too much_ freedom. I had a real bad time using
http://dispatch.databinder.net for a project, because it fully utilized a
lot of Scala features to offer a really shit API. Java makes everyone
conform to a base level while preventing soaring, and it's a base level
that's sane. And when it comes to writing business code, as in "Code that
makes money", Scala's freedom doesn't offer overly much compared to Java's
enforced conformity.
Don't get me wrong, I <3 Scala, but while half of me wants to use it at
work, the other half is terrified of what the Java developers who write
Spring code like this:
<bean id="something class="java.lang.String">
<constructor-arg index="0">
<value>${someProperty}</value>
</constructor-arg>
</bean>
Would do with the power of Scala at their finger tips. (PS, that's real
Spring code that I saw (and refactored) today.)
On Tue, Jan 18, 2011 at 5:33 PM, richard emberson <
richard.emberson@gmail.com> wrote:
> I originally mentioned the Kuhn book in the context of the politics of
> change. Altering the focus, you brought up *the truth* as the view
> held by those resisting change, which I believe is not the larger
> insight to be gained from his book. It is still my contention that my
> original interpretation is valid; Scala faces resistance to change and
> the structure of that resistance, maps into those structures
> identified by Kuhn.
>
> Using a term you earlier used, I think it would be naive to believe
> that entrenched business forces will stop the emergence of a new,
> major development language. Such forces were aligned against C, C++
> and Java, but the forces were overcome. In each case, rational
> examination of the languages revealed advantages as well as
> non-rational forces, such as Sun's marketing and glitter in the case
> of Java, strengthening the prospects of the language's adaption. I
> hope we can both agree that change will come.
>
> But, I do not believe the change will be revolutionary but, rather,
> evolutionary. A language that evolves from an existing ecosystem has a
> much greater likelihood of becoming significant than a green field
> language.
>
> I paint and sculpt as well as do mathematics and physics and, for me,
> language selection is far closer to math and physics than to the play
> of colors or shape and form. I, thus, do not agree that choosing a
> programming language is an exercise in artistry, but rather, its a
> more rational process. And, if beauty is involved, then it is
> scientific beauty and not artistic beauty. Are you Picasso? Maybe
> even Mondrian? Hopefully, not Pollock.
>
> Concerning the languages you listed as "the way forward", an important
> criteria must be: where are the programmers coming from? One can wait
> for a new generation or one can see if any existing programmers will
> migrate from their current language to a new language. Some language
> usages from the web:
> Java 18%
> C 16%
> C++ 9%
> Python 6%
> C# 6%
> Objective-C 3%
> Ruby 2%
> Lisp 1%
> Scheme ~0.5%
> Haskell ~0.3%
> Scala ~0.3%
> Eiffel <0.1%
> Clojure ~0.0%
>
> So, where might future Haskell or Clojure or Eiffel or Scala
> programmers come from?
>
> # So, what about Eiffel?
>
> Eiffel (with DbC, "design by contract") is a 25 year old language and
> its usage stats are down in the noise - well below Scala, Clojure and
> Haskell - and showing its age. Hard to see a ground swell of C or Java
> programmers switching to Eiffel.
>
> Eiffel's grasp exceeded what could be supported; its notion of
> "contract" was so big, it was hard to find a wrapper around it all.
> Category Theory may provide for a pragmatic approach to reasoning
> about interfaces (contracts) which might not encompass all possible
> rely/guarantee predicates, but many. As such, the three laws of
> Monads from Category Theory might yield a more coherent, reasoned
> approach to DbC and interface design. Curiously, this has been
> discussed by the author of Scala as a possible approach to adding DbC
> to Scala. For the Scala-CLR binding there is native support for such
> constructs while for the Scala-JVM binding, it would have to be done
> with code.
>
>
> # So, what about Haskell?
>
> Haskell is the flag ship FP testbed which has been out there for close
> to 20 years. There are no large enterprise applications written in
> Haskell. It has certainly not taking the programming world by storm
> whatever its merits. In addition, for Haskell, and all FP languages
> for that matter, the world view required is not shared by most people,
> Folks do not see the world as math functions (program mangers and
> customers certainly don't); functional programming in-the-large is an
> unnatural mapping of external objects and relationship to a FP design.
> (That said, Category Theory is being used more in Physics and
> non-computer Mathematics as a means of providing some guidance by
> helping to find higher level relationships between areas of research,
> but those are rather rarefied endeavors.) Again, where are the
> converts to Haskell coming from? Just an occasional graduate student.
>
>
> # So, what about Clojure?
>
> Clojure is an interesting case; its immutable data structures are a
> strength but as soon as you allow users to call into Java libraries
> any program-level reasoning due to such data structures are suspect -
> an issue with any FP language which is not 100% pure. In addition,
> where is the pool of potential converts? Clojure is a rather large
> leap for the 20% of programmers using Java (or for that matter for the
> 20% using C/C++) Converts would likely come from the Lisp (1% usage)
> and Scheme (usage levels in the noise) community.
>
> As an aside, I had considered porting the Clojure runtime to Scala.
> There would have been many advantages over the Java-based
> runtime, e.g.:
> Scala with its immutable data structures would be a good fit,
> Scala's coming parallelized data structures targeted to
> multi-core environments saving the Clojure group much development
> effort.
> Scala would have given the Clojure community delimited continuations
> which the Scheme folks would like and understand.
> But, such a port, while interesting and I would certainly have
> learned Clojure, would not have appreciably increased the number
> of Scala users - so I choice Wicket.
>
>
> # So, what about Scala?
>
> I recently came upon a discussion of Joshua Bloch's "Effective Java",
> its list of recommended practices and how they map into Scala.
> Curiously, in each case, the article pointed out that Scala made
> simpler or completely eliminated the need for the "Effective Java"
> better-coding-practice. So, if one thinks that "Effective Java" makes
> sense, so does, at least at the level of the recommendations, a switch
> to Scala - the state of art has moved on from Java. As I have been
> advocating, Scala is a better Java; switching from OO Java to OO Scala
> is relatively easy and certainly Java's warts have become very
> glaring.
>
> As with any language and development team, one needs development
> standards. In this, Scala is no different than Java, C++, C, etc. To
> not let programmers use Scala because one don't trust them and that
> the team's development practices are not being followed or are
> inadequate is not a problem with the language but rather with those in
> positions of authority and/or respect for failing to set the proper
> environment.
>
> Scala does allow users to access the existing, significant base of
> Java libraries so that a whole universe of supporting libraries does
> not have to be re-created for Scala. Also, if the use of its
> functional and extended type capabilities are controlled, it offers a
> relatively easy migration for the average Java programmer (or any of
> the other OO languages listed above - a large pool of potential
> converts).
>
>
> The rate of change is increasing, A 100 years ago, change occurred much
> slower than today. The establishment 100 years ago, those forces that
> resist change as described by Kuhn, suffered few consequences for
> their recalcitrance. But, now, change on the order of a few years is
> the new constant, and it is only getting shorter (we are, in fact,
> approaching the singularity). So, yesterday's guru, technical
> innovator is today's stick-in-the-mud detractor - unless one rises
> above the recurring drama Knuth discussed. Now a day, one might say,
> Go Meta young man or become a Dunsel.
>
>
> Quis custodiet ipsos custodes
>
Re: Scala-Wicket Help and Advice
Posted by richard emberson <ri...@gmail.com>.
I originally mentioned the Kuhn book in the context of the politics of
change. Altering the focus, you brought up *the truth* as the view
held by those resisting change, which I believe is not the larger
insight to be gained from his book. It is still my contention that my
original interpretation is valid; Scala faces resistance to change and
the structure of that resistance, maps into those structures
identified by Kuhn.
Using a term you earlier used, I think it would be naive to believe
that entrenched business forces will stop the emergence of a new,
major development language. Such forces were aligned against C, C++
and Java, but the forces were overcome. In each case, rational
examination of the languages revealed advantages as well as
non-rational forces, such as Sun's marketing and glitter in the case
of Java, strengthening the prospects of the language's adaption. I
hope we can both agree that change will come.
But, I do not believe the change will be revolutionary but, rather,
evolutionary. A language that evolves from an existing ecosystem has a
much greater likelihood of becoming significant than a green field
language.
I paint and sculpt as well as do mathematics and physics and, for me,
language selection is far closer to math and physics than to the play
of colors or shape and form. I, thus, do not agree that choosing a
programming language is an exercise in artistry, but rather, its a
more rational process. And, if beauty is involved, then it is
scientific beauty and not artistic beauty. Are you Picasso? Maybe
even Mondrian? Hopefully, not Pollock.
Concerning the languages you listed as "the way forward", an important
criteria must be: where are the programmers coming from? One can wait
for a new generation or one can see if any existing programmers will
migrate from their current language to a new language. Some language
usages from the web:
Java 18%
C 16%
C++ 9%
Python 6%
C# 6%
Objective-C 3%
Ruby 2%
Lisp 1%
Scheme ~0.5%
Haskell ~0.3%
Scala ~0.3%
Eiffel <0.1%
Clojure ~0.0%
So, where might future Haskell or Clojure or Eiffel or Scala
programmers come from?
# So, what about Eiffel?
Eiffel (with DbC, "design by contract") is a 25 year old language and
its usage stats are down in the noise - well below Scala, Clojure and
Haskell - and showing its age. Hard to see a ground swell of C or Java
programmers switching to Eiffel.
Eiffel's grasp exceeded what could be supported; its notion of
"contract" was so big, it was hard to find a wrapper around it all.
Category Theory may provide for a pragmatic approach to reasoning
about interfaces (contracts) which might not encompass all possible
rely/guarantee predicates, but many. As such, the three laws of
Monads from Category Theory might yield a more coherent, reasoned
approach to DbC and interface design. Curiously, this has been
discussed by the author of Scala as a possible approach to adding DbC
to Scala. For the Scala-CLR binding there is native support for such
constructs while for the Scala-JVM binding, it would have to be done
with code.
# So, what about Haskell?
Haskell is the flag ship FP testbed which has been out there for close
to 20 years. There are no large enterprise applications written in
Haskell. It has certainly not taking the programming world by storm
whatever its merits. In addition, for Haskell, and all FP languages
for that matter, the world view required is not shared by most people,
Folks do not see the world as math functions (program mangers and
customers certainly don't); functional programming in-the-large is an
unnatural mapping of external objects and relationship to a FP design.
(That said, Category Theory is being used more in Physics and
non-computer Mathematics as a means of providing some guidance by
helping to find higher level relationships between areas of research,
but those are rather rarefied endeavors.) Again, where are the
converts to Haskell coming from? Just an occasional graduate student.
# So, what about Clojure?
Clojure is an interesting case; its immutable data structures are a
strength but as soon as you allow users to call into Java libraries
any program-level reasoning due to such data structures are suspect -
an issue with any FP language which is not 100% pure. In addition,
where is the pool of potential converts? Clojure is a rather large
leap for the 20% of programmers using Java (or for that matter for the
20% using C/C++) Converts would likely come from the Lisp (1% usage)
and Scheme (usage levels in the noise) community.
As an aside, I had considered porting the Clojure runtime to Scala.
There would have been many advantages over the Java-based
runtime, e.g.:
Scala with its immutable data structures would be a good fit,
Scala's coming parallelized data structures targeted to
multi-core environments saving the Clojure group much development
effort.
Scala would have given the Clojure community delimited continuations
which the Scheme folks would like and understand.
But, such a port, while interesting and I would certainly have
learned Clojure, would not have appreciably increased the number
of Scala users - so I choice Wicket.
# So, what about Scala?
I recently came upon a discussion of Joshua Bloch's "Effective Java",
its list of recommended practices and how they map into Scala.
Curiously, in each case, the article pointed out that Scala made
simpler or completely eliminated the need for the "Effective Java"
better-coding-practice. So, if one thinks that "Effective Java" makes
sense, so does, at least at the level of the recommendations, a switch
to Scala - the state of art has moved on from Java. As I have been
advocating, Scala is a better Java; switching from OO Java to OO Scala
is relatively easy and certainly Java's warts have become very
glaring.
As with any language and development team, one needs development
standards. In this, Scala is no different than Java, C++, C, etc. To
not let programmers use Scala because one don't trust them and that
the team's development practices are not being followed or are
inadequate is not a problem with the language but rather with those in
positions of authority and/or respect for failing to set the proper
environment.
Scala does allow users to access the existing, significant base of
Java libraries so that a whole universe of supporting libraries does
not have to be re-created for Scala. Also, if the use of its
functional and extended type capabilities are controlled, it offers a
relatively easy migration for the average Java programmer (or any of
the other OO languages listed above - a large pool of potential
converts).
The rate of change is increasing, A 100 years ago, change occurred much
slower than today. The establishment 100 years ago, those forces that
resist change as described by Kuhn, suffered few consequences for
their recalcitrance. But, now, change on the order of a few years is
the new constant, and it is only getting shorter (we are, in fact,
approaching the singularity). So, yesterday's guru, technical
innovator is today's stick-in-the-mud detractor - unless one rises
above the recurring drama Knuth discussed. Now a day, one might say,
Go Meta young man or become a Dunsel.
Quis custodiet ipsos custodes
Re: Scala-Wicket Help and Advice
Posted by Jonathan Locke <jo...@gmail.com>.
I understand what you are saying, but I also think you are playing semantic
games here. By "truth", I was referring simply to objectively testable
results (the scientific method), not opening up a philosophical discussion
on the nature of truth. But in any case, there are certainly no objectively
testable results possible in terms of what language is best. I think we can
agree on that. Therefore this argument from Kuhn doesn't really apply very
directly. In fact, I'd go so far as to say that the whole discipline of
computer software engineering is a gray area, with some of it (actually very
little) being scientific and the majority of it being a difficult-to-teach
art. So at best, I think all Kuhn is saying that's relevant to this
discussion is that people are slow to change. He's hardly the first to note
that. What's more, in non-scientific areas like programming they may
actually have more reasons than entrenchment to avoid a particular change
(which can't be objectively proved no matter what the method). Certainly
this is true for me, as I am aware of the benefits of Scala and actually
WANT a replacement for Java, but I still don't want to choose Scala for the
reasons I outlined and not simply because I don't want to change my way of
doing things. If I was that type of person, would I have created Wicket?
Something that people told me for years would never be useful because it
bucked the common wisdom that you can't have server side state? Could it be
that there are some reasons besides entrenchment that people are not
flooding to Scala?
But regardless of what we both think about Kuhn, your argument is funny to
me because it's an attempt to apply logical reasoning to what purely
artistic choice. Would Kuhn say that his book applies to the choices of
materials by visual artists? I tend to think not, because there would be no
way to test his theory. And anyway, if you're going to go in this direction,
why isn't it also clear that Eiffel, Haskell and Clojure are The Way
forward, as you are suggesting Scala must be? After all, if this is a
discussion about "science" and politics, surely this is objective as well?
Don't you think the choice of languages in software engineering depends not
so much on would-be-objective assessment of technical excellence, but rather
on subjective experience, artistic temperament and perceived applicability
to the problem at hand? For myself, I love a lot of Scala's features and
said as much when I first ran into it, but after some reflection it simply
does not fit my minimalist artistic aesthetic and it has a lot of dangerous
moving parts that I don't want in the hands of co-workers. You can think
what you like, but this reasoning has nothing to do with any "entrenched
political interests" I might have.
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3207861.html
Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.
Re: Scala-Wicket Help and Advice
Posted by richard emberson <ri...@gmail.com>.
I am sorry, but I can not disagree with you more about Kuhn's "The
Structure of Scientific Revolutions". Its about resistance to change
and not scientific truth and, as such, it has generally applicable.
At its crudest, its about the old, vested guard being unwilling and/or
unable to move with the changes; the intransigent, causing great
damage and delay, either get slowly pushed aside or die off. Its
lessons are applicable to a broad spectrum of endeavors, not just the
Sciences. I recall when Kuhn's book came out, the resistance to his
ideas in the scientific community, rather self-referentially, was a
demonstration of his thesis.
In addition, it has nothing to do with *the truth*. Science is not
about *the truth*. Its about what works; how well it explains the
current observations and the accuracy of its predictions. If you want
to listen to people talk about *the truth*, find an alter. Rather,
Kuhn addressed the bumpy road that leads to scientific advancement
disputing the idealization of an orderly, reasoned progression. He
discusses the political, sociological and cultural resistance to
change in the context of the advancement of science. To resolve this
point, simply show me where on the Kuhn's book Wikipedia page it
mentions *the truth*; its about resistance to change.
So, one can ignore this insight into human behavior, both the
individual human and humans in organizations, and risk becoming the
problem rather than the solution, or one can embrace it, go Meta and
surf the shock wave. Its not so much a matter of one's chronological
age but rather of one's the ability to remain young. Would you rather
sell flavored water or change the world?
Resistance to change is the key. When C++ came out the entrenched in
the C community resisted. When Java came out the entrenched in the
C++ community resisted. Now, with Scala the entrenched in the Java
community resist. Fine. History may not repeat itself, but people do.
Lastly, I still maintain that project coding standards are the key. I
have throughout stated that without appropriate standards, there
are features of Scala that, with the current crop of programmers,
could lead to hard to understand and maintain systems. But that such a
caveat to Scala's use is no more or no less important than requiring
standards for Java or (especially) C++ projects; nothing new here.
When Scala is taught broadly in colleges, the strictures of such
standards can be relaxed. Currently, its a self re-enforcing chain:
Not enough Scala programmer,
Risky to have a Scala project,
Too few Scala projects,
Too few Scala jobs,
Few programmers willing to learning Scala.
My small contribution is to manifest a Java-like Scala web framework
easing, in a small way, Scala's adoption.
Richard
On 01/07/2011 09:30 AM, Jonathan Locke wrote:
>
> Kuhn's "The Structure of Scientific Revolutions" has to do with people
> denying *the truth* when there are radical paradigm shifts in knowledge. I
> hardly think Scala qualifies for this analogy. Most of what Scala does has
> already been done in one form or another. What it represents is the
> application of long-existing knowledge from universities to *industrial*
> problems. As did Java.
>
> I do not deny that Scala is better than Java in terms of its abstract
> approach to a variety of problems that Java doesn't and probably never will
> solve well (and these are problems that I am excited to see solved). What I
> am saying, however, is that your idea that it's going to get widespread
> adoption is very naive regarding the contexts where it would need to be
> applied. I think Scala is going to become difficult to follow in the absence
> of these magical coding guidelines (which are always bent or ignored) much
> more quickly than Java does, which means it is going to prove exceptionally
> hard to manage on a large team. Which is going to make it difficult for
> managers to chose Scala (they don't want to make their own job harder or
> riskier). They have to understand and be comfortable with all these deep and
> dangerous features and techniques. Which really means that they have to be
> fairly top-flight coders. I don't know about you, but relatively few of my
> bosses have been this intellectually adventurous or willing to take on risk
> (and for good reason: they are there (unfortunately perhaps) to produce
> business results, not technical excellence).
>
> I think Scala's forte is going to be allowing very small teams where
> everyone understands all aspects of Scala fairly deeply (i.e., you'd better
> understand monads and Scala's type system fully because SOMEONE on your team
> will use a feature or technique if it exists!) to produce amazing results
> *very* quickly. That is something of a revolution in itself, but I think it
> will be a cottage industry relative to the size rest of the software
> industry. This is not necessarily a bad thing. If you want to work with
> smart people, Scala is going to be a pretty quick way of identifying smart
> people! I know this from experience: I can't even understand on several
> readings a lot of my friend Greg's posts about Scala and monads and
> mathematics. I would need to go back to graduate school in math and I'd
> probably need an IQ upgrade to boot.
>
> I know this sounds awfully Dilbert (and maybe that's who I've become), but
> at a mid-sized or large company (which is where most people work), what you
> want in a language is something that protects you from your co-workers. In
> my experience, even the "advanced" features of C++ and Java have
> consistently been abused and even wrecked whole projects.
>
> All this said, Scala is probably a god-send to small startups and university
> spin-offs. And I think it's an important stake in the ground because it
> references a future wider-scale industrial software revolution that
> eventually will occur when someone more practical sits down and figures out
> how to pack Scala's features (and some things it didn't address) into a
> language that's as easy to learn and read and work with as Java. My advice
> to you is this: don't get caught up in the politics of technology adoption.
> You will only find yourself frustrated and disappointed because at the end
> of the day, it's a business world not a technology world. Instead go find
> the cool kids and hack away in Scala on some crazy new startup that really
> will change the world. Odds are you'll beat the pants off your Java-based
> competitors on time-to-market. And if you're wondering why I don't do that,
> it's because of all this green paper stuff they keep throwing at me. Maybe I
> really have gotten old.
>
> Jon
>
> "Less is more."
> http://www.amazon.com/Coding-Software-Process-Jonathan-Locke/dp/0615404820/
>
--
Quis custodiet ipsos custodes
Re: Scala-Wicket Help and Advice
Posted by Jonathan Locke <jo...@gmail.com>.
Kuhn's "The Structure of Scientific Revolutions" has to do with people
denying *the truth* when there are radical paradigm shifts in knowledge. I
hardly think Scala qualifies for this analogy. Most of what Scala does has
already been done in one form or another. What it represents is the
application of long-existing knowledge from universities to *industrial*
problems. As did Java.
I do not deny that Scala is better than Java in terms of its abstract
approach to a variety of problems that Java doesn't and probably never will
solve well (and these are problems that I am excited to see solved). What I
am saying, however, is that your idea that it's going to get widespread
adoption is very naive regarding the contexts where it would need to be
applied. I think Scala is going to become difficult to follow in the absence
of these magical coding guidelines (which are always bent or ignored) much
more quickly than Java does, which means it is going to prove exceptionally
hard to manage on a large team. Which is going to make it difficult for
managers to chose Scala (they don't want to make their own job harder or
riskier). They have to understand and be comfortable with all these deep and
dangerous features and techniques. Which really means that they have to be
fairly top-flight coders. I don't know about you, but relatively few of my
bosses have been this intellectually adventurous or willing to take on risk
(and for good reason: they are there (unfortunately perhaps) to produce
business results, not technical excellence).
I think Scala's forte is going to be allowing very small teams where
everyone understands all aspects of Scala fairly deeply (i.e., you'd better
understand monads and Scala's type system fully because SOMEONE on your team
will use a feature or technique if it exists!) to produce amazing results
*very* quickly. That is something of a revolution in itself, but I think it
will be a cottage industry relative to the size rest of the software
industry. This is not necessarily a bad thing. If you want to work with
smart people, Scala is going to be a pretty quick way of identifying smart
people! I know this from experience: I can't even understand on several
readings a lot of my friend Greg's posts about Scala and monads and
mathematics. I would need to go back to graduate school in math and I'd
probably need an IQ upgrade to boot.
I know this sounds awfully Dilbert (and maybe that's who I've become), but
at a mid-sized or large company (which is where most people work), what you
want in a language is something that protects you from your co-workers. In
my experience, even the "advanced" features of C++ and Java have
consistently been abused and even wrecked whole projects.
All this said, Scala is probably a god-send to small startups and university
spin-offs. And I think it's an important stake in the ground because it
references a future wider-scale industrial software revolution that
eventually will occur when someone more practical sits down and figures out
how to pack Scala's features (and some things it didn't address) into a
language that's as easy to learn and read and work with as Java. My advice
to you is this: don't get caught up in the politics of technology adoption.
You will only find yourself frustrated and disappointed because at the end
of the day, it's a business world not a technology world. Instead go find
the cool kids and hack away in Scala on some crazy new startup that really
will change the world. Odds are you'll beat the pants off your Java-based
competitors on time-to-market. And if you're wondering why I don't do that,
it's because of all this green paper stuff they keep throwing at me. Maybe I
really have gotten old.
Jon
"Less is more."
http://www.amazon.com/Coding-Software-Process-Jonathan-Locke/dp/0615404820/
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3181566.html
Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.
Re: Scala-Wicket Help and Advice
Posted by richard emberson <ri...@gmail.com>.
Everyone has opinions, myself included.
Curious the mention of Lift. It highlights Scala's
"functional goodies and type classes" which is certainly the
wrong approach - more in line with being less clear and less
simple. It is actually recommended that a Ruby programmer
would have a easier time using it. Kind of like going from one
ghetto to another.
On the other hand, with appropriate coding guidelines, Scala
can be clearer, more precise and simpler while also being
briefer and more powerful than Java ... or should I say Java 7,
or, more to the point, Java 8. With the right approach, one can
migrate the large number of the Java programmers who are not
to old to move forward to a better language; the
politics of "The Structure of Scientific Revolutions" seem to
always come into play.
And, of course, with poor guidelines one can be involved with
a poor Java project, which is to say, guidelines can
make or break how a project does using most any language.
Some may disagree and are comfortable with Java, fine;
without such Java supporters the JVM will not move forward.
Richard
--
Quis custodiet ipsos custodes
Re: Scala-Wicket Help and Advice
Posted by richard emberson <ri...@gmail.com>.
A sympathetic voice on the Wicket mailing list, greetings.
I don't know if you have followed it all but I have ported
Wicket to Scala, replaced the Java collections with Scala
collections, pushed the IModel[T] strong typing down to the
Component object and have plans for more changes. But,
I wanted to get some advice and help. With regards to Scala,
where should the Scala-Wicket be heading?
I also believe that emphasising the non-object oriented features
of Scala will make it harder to attract Java programmers.
So, I want to use Scala's functional, advanced type classes,
implicits, and other such features very carefully if at all.
One idea that I've thought about was to factor out IModel from
Component:
Half the time a user wants a Component with
no model, so, if there was a HasModel trait:
class Model[T](var value: T) {
def getObject: T = value
def setObject(value: T): Unit = this.value = value
}
trait HasModel[T] {
var model: Model[T]
def getDefaultModel: IModel[T] = model
def setDefaultModel(model: IModel[T]): this.type = {
....
this
}
def getDefaultModelObject: Option[T] = {
....
}
def setDefaultModelObject(obj: T): this.type = {
....
this
}
}
The Component hierarchy would have no model support.
The user could add model support when needed:
val form = new Form("hi")
with HasModel[Int] { var model = new Model(42) }
Just an Idea.
Richard
On 01/06/2011 03:43 PM, Gustavo Hexsel wrote:
> I'll have to say I looked at Lift, and although it was greatly improved
> since 1.0, it doesn't have the awesome separation of concerns that wicket
> does. Even in the tutorial, the markup and the templates leak into each
> other. Wicket's greatest asset was always IMO the fact that the HTML itself
> can be almost unmodified between designer and programmer (of course, usually
> it pays to create components).
>
> I've made a couple of toy projects in Scala/Wicket, and the biggest pain
> was to get the collections and generics right. I don't much like the
> implicit conversions (anywhere, even boxing and unboxing end up doing weird
> stuff once in a while), so I always ended up having to do it by hand. It
> made life easier to keep using the Scala collections, and just convert it to
> Java collections in the Wicket Models, but once in a while it still messed
> me up...
>
> I would love to see a wicket api that used the Scala collections and made
> models use SModels or something like that.
>
>
> PS.: that's my opinion as a lurker... not a Wicket dev
>
>
>
> On Thu, Jan 6, 2011 at 12:19 PM, Jonathan Locke<jo...@gmail.com>wrote:
>
>>
>> Not so sure that doing a simple fork of Wicket into Scala is such a great
>> idea. And at the end of the day you probably couldn't call it Wicket
>> without
>> Apache permission, which seems unlikely. But creating a Wicket-inspired
>> framework in Scala sounds like a good idea to me. Have you taken a look at
>> David Pollak's Lift project?
>>
>> Regarding Scala, I think it's a good sign that people are interested in
>> advancing the state of the art. And I think Martin and company have found
>> some of the problems that need solving and to their great credit done
>> something about them, even if only 0.4% of programmers are using Scala so
>> far. Unfortunately, I don't think a large or powerful or killer set of
>> features is what makes or breaks a language in terms of widespread
>> adoption.
>> And I *especially* don't think that economy of expression makes a language
>> "better", particularly where large teams are concerned. Clarity, precision
>> and simplicity are far more important than brevity and power.
>>
>> Jon
>>
>> "Less is more."
>> http://www.amazon.com/Coding-Software-Design-Process-ebook/dp/B0042X99SA/
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3178126.html
>> Sent from the Forum for Wicket Core developers mailing list archive at
>> Nabble.com.
>>
>
--
Quis custodiet ipsos custodes
Re: Scala-Wicket Help and Advice
Posted by Gustavo Hexsel <gh...@gmail.com>.
I'll have to say I looked at Lift, and although it was greatly improved
since 1.0, it doesn't have the awesome separation of concerns that wicket
does. Even in the tutorial, the markup and the templates leak into each
other. Wicket's greatest asset was always IMO the fact that the HTML itself
can be almost unmodified between designer and programmer (of course, usually
it pays to create components).
I've made a couple of toy projects in Scala/Wicket, and the biggest pain
was to get the collections and generics right. I don't much like the
implicit conversions (anywhere, even boxing and unboxing end up doing weird
stuff once in a while), so I always ended up having to do it by hand. It
made life easier to keep using the Scala collections, and just convert it to
Java collections in the Wicket Models, but once in a while it still messed
me up...
I would love to see a wicket api that used the Scala collections and made
models use SModels or something like that.
PS.: that's my opinion as a lurker... not a Wicket dev
On Thu, Jan 6, 2011 at 12:19 PM, Jonathan Locke <jo...@gmail.com>wrote:
>
> Not so sure that doing a simple fork of Wicket into Scala is such a great
> idea. And at the end of the day you probably couldn't call it Wicket
> without
> Apache permission, which seems unlikely. But creating a Wicket-inspired
> framework in Scala sounds like a good idea to me. Have you taken a look at
> David Pollak's Lift project?
>
> Regarding Scala, I think it's a good sign that people are interested in
> advancing the state of the art. And I think Martin and company have found
> some of the problems that need solving and to their great credit done
> something about them, even if only 0.4% of programmers are using Scala so
> far. Unfortunately, I don't think a large or powerful or killer set of
> features is what makes or breaks a language in terms of widespread
> adoption.
> And I *especially* don't think that economy of expression makes a language
> "better", particularly where large teams are concerned. Clarity, precision
> and simplicity are far more important than brevity and power.
>
> Jon
>
> "Less is more."
> http://www.amazon.com/Coding-Software-Design-Process-ebook/dp/B0042X99SA/
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3178126.html
> Sent from the Forum for Wicket Core developers mailing list archive at
> Nabble.com.
>
Re: Scala-Wicket Help and Advice
Posted by Jonathan Locke <jo...@gmail.com>.
Not so sure that doing a simple fork of Wicket into Scala is such a great
idea. And at the end of the day you probably couldn't call it Wicket without
Apache permission, which seems unlikely. But creating a Wicket-inspired
framework in Scala sounds like a good idea to me. Have you taken a look at
David Pollak's Lift project?
Regarding Scala, I think it's a good sign that people are interested in
advancing the state of the art. And I think Martin and company have found
some of the problems that need solving and to their great credit done
something about them, even if only 0.4% of programmers are using Scala so
far. Unfortunately, I don't think a large or powerful or killer set of
features is what makes or breaks a language in terms of widespread adoption.
And I *especially* don't think that economy of expression makes a language
"better", particularly where large teams are concerned. Clarity, precision
and simplicity are far more important than brevity and power.
Jon
"Less is more."
http://www.amazon.com/Coding-Software-Design-Process-ebook/dp/B0042X99SA/
--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Scala-Wicket-Help-and-Advice-tp3174601p3178126.html
Sent from the Forum for Wicket Core developers mailing list archive at Nabble.com.
Re: Scala-Wicket Help and Advice
Posted by Martin Grigorov <mg...@apache.org>.
On Wed, Jan 5, 2011 at 9:38 AM, Juergen Donnerstag <
juergen.donnerstag@gmail.com> wrote:
> Cool. May I ask which tools (IDE) you've been using and what your
> experience with these tools has been.
>
#scala suggests IDEA 10 + SBT plugin as the most mature one.
>
> -Juergen
>
> On Wed, Jan 5, 2011 at 2:34 AM, Jeremy Thomerson
> <je...@wickettraining.com> wrote:
> > On Tue, Jan 4, 2011 at 5:15 PM, richard emberson <
> richard.emberson@gmail.com
> >> wrote:
> >
> >> Dev Wicketers,
> >>
> >> What: I have ported Wicket to Scala
> >> A couple of months ago I took a 1.5 snapshot and ported to Scala.
> >> This encompasses all of the source and test code. As successive 1.5
> >> snapshots were released, I ported those differences to my Scala
> >> version. I am current with 1.5 M3.
> >>
> >> The Java 137,791 loc in 1.5 M3 are now 100,077 loc Scala (not
> >> counting all the println statements I put into the Scala code
> >> for debugging). I used cloc (http://cloc.sourceforge.net/) to
> >> count lines of code.
> >>
> >
> > I haven't used CLOC before. I've used Ohcount (
> > http://www.ohloh.net/p/ohcount) and like it. I'll have to give this a
> try.
> >
> >
> > I have also replaced all of the Java collection classes with
> >> Scala collection classes (though a small number of Java collection
> >> classes remain that did not have comparable Scala implementations).
> >>
> >> I have changed many method return types from the Java returning
> >> some "object" or "null" to Scala returning "Some(object)" or "None"
> >> (using the Scala Option[return-type] construct) - trying to
> >> eliminate nulls.
> >>
> >> Lastly, I pushed the IModel[T] typing down to the Component class
> >> making get/set DefaultModel and get/set DefaultModelObject strong
> >> typed. This included using Scala companion object apply methods
> >> which eliminated having to explicitly declare type parameters in
> >> most end-user code (I had read that one of the objections to
> >> pushing strong typing down to the Component class in Wicket was
> >> that there were "too many notes", end-user code was too verbose).
> >>
> >> It can not interoperate with Java Wicket because Scala compiles to
> >> JVM class files and so all of the classes in Java Wicket also
> >> appear in Scala-Wicket.
> >
> >
> >> I have an "internal" name for my Scala port of Wicket which
> >> acknowledges its Wicket heritage as well as advertises its
> >> enterprise level capabilities. For external communications,
> >> I am currently simply call it Scala-Wicket.
> >>
> >> Why: Scala is a better Java
> >> I was introduced to Scala 9 months ago and quickly determined that
> >> it was a better Java (at least IMO). For Scala to succeed it
> >> requires more programmers to use it. Many on the Scala mailing
> >> lists were from a functional background and seemed not to recognize
> >> that Haskell and Lisp are not blindingly successful but, rather,
> >> niche languages and that the heavy selling of Scala's function and
> >> typing capabilities might turn off Java programmers.
> >>
> >> Scala struck me in many ways as a strong-typed JavaScript, at
> >> least, much of the code did not have to have type declarations
> >> because the compiler could infer types in many cases. In addition,
> >> a whole lot of the Java boil-plate code was not needed. As such,
> >> it could be sold as simply a better Java; a more-to-the-point
> >> object oriented language with functional programming in-the-small.
> >>
> >> To get more Java programmers to try Scala I looked for a
> >> significant Java application with a strong support and user
> >> community that I could port to Scala. I ended up with Wicket.
> >> Wicket is an enterprise level web framework (unlike existing
> >> Scale web frameworks which place restrictions on enterprise IT
> >> organizations, e.g., by requiring sticky sessions). It is well
> >> documented. And, as it turned out, very, very importantly it had
> >> a large number of unit tests (the unit tests saved my butt,
> >> without them I would never had succeeded in getting a port that
> >> worked).
> >>
> >> No, Really, Why:
> >> I like Scala and I took the time to learn it. Right now about
> >> 20% of programmers use Java while only some 0.4% use Scala.
> >> I did not want my effort of learning Scala to be wasted so my
> >> solution is to increase the number of Scala programmers. Where
> >> to get them? Again, my solution is from the existing horde of
> >> Java programmers.
> >>
> >> Plans: Release, Evolve and Proselytize
> >> I would like to release Scala-Wicket.
> >> I do not know if Apache hosts anything other than Java code.
> >> Growing a community is important.
> >>
> >> Still Todo:
> >> Comments: All of the existing class and inline comments are
> >> still Java related. This would have to be a long, on-going
> >> task to edit the comments so they reflect the code's
> >> Scala usage.
> >> Package path: The code still uses the "org.apache.wicket"
> >> package path and this must be changed - unless this became
> >> an Apache project.
> >> Author: I have quite literally looked at and touched every line
> >> of code but I have not yet felt comfortable with adding
> >> myself as an author since, well, many changes were
> >> syntactic and not semantic.
> >> Refactor with Traits: Currently the port uses Scala traits like
> >> Java interfaces but it should be possible to factor the
> >> common code out into the traits. This would result in many
> >> of the interfaces, the "I" files, such as IModel.scala,
> >> going away.
> >> Some general refactoring:
> >> As an example, consider factoring out the IModel[T] from
> >> Component. Half the time a user wants a Component with
> >> no model, so, if there was a HasModel trait:
> >> class Model[T](var value: T) {
> >> def getObject: T = value
> >> def setObject(value: T): Unit = this.value = value
> >> }
> >> trait HasModel[T] {
> >> var model: Model[T]
> >> def getDefaultModel: IModel[T] = model
> >> def setDefaultModel(model: IModel[T]): this.type = {
> >> ....
> >> this
> >> }
> >> def getDefaultModelObject: Option[T] = {
> >> ....
> >> }
> >> def setDefaultModelObject(obj: T): this.type = {
> >> ....
> >> this
> >> }
> >> }
> >> The Component hierarchy would have no model support.
> >> The user could add model support when needed:
> >> val form = new Form("hi")
> >> with HasModel[Int] { var model = new Model(42) }
> >> Just an Idea.
> >> STM: There are a number of Scala STM projects and I do not know
> >> if it is useful to add STM capabilities to Scala-Wicket.
> >> RBAC: I've written a Scala implementation of the NIST RBAC
> >> recommended standard and might consider adding it.
> >> Logging: Adding a Scala-based logging framework to aid user
> >> debugging.
> >> Monitoring and stats: In the last couple of years many web
> >> sites have added monitoring and statistics gathering
> >> capabilities (e.g., who clicks what, where, how long, on
> >> what page does the visitor exit the web site, etc.) in
> >> order to know how the web site is being used and then
> >> improve the web site.
> >> Significant Memory Usage Reduction: I've an idea that would
> >> significantly decrease the memory usage of Scala-Wicket and
> >> I plan to do a test implementation.
> >> Replace Java features: There are still some Java-isms that can
> >> be replaced with Scala equivalents.
> >> Port additional Java Wicket libraries to Scala.
> >> Enable multiple instances of a unit tests to be run at once.
> >> More: ????????????
> >>
> >> I want to avoid using some of the WTF features of Scala (when a
> >> Java programmer looks at the code and says "WTF") in order to
> >> ease and accelerate acceptance by Java programmers; as
> >> examples, implicits can make code hard to understand and
> >> advanced Scala type usages, as James Gosling said, "makes one's
> >> head spin".
> >>
> >>
> >> Help and Advice: How should Scala-Wicket be extended and released
> >>
> >> Scala-Wicket is a port and evolution of Wicket, not a ground-up
> >> re-write. Given that, what would you do differently in Wicket
> >> now that there are years of experience using it?
> >>
> >> How best to get a hosting site, release the code and build a
> >> community?
> >>
> >
> > If you're looking for a place to host it, I'd recommend starting with
> > Github. Git is where the crowd is headed, and Github is the easiest
> place
> > to get up and running with it these days.
> >
> > You mentioned earlier the idea of it being an Apache project. If you
> wanted
> > it to be an Apache project, you would start at the Incubator (
> > http://incubator.apache.org/). The one barrier you'll have initially is
> > that Apache favors "community over code"... so it's not a great place to
> > start a one-man project. Since this is a port of an existing Apache
> > project, you might have more leniency, but you'd have to build a
> community
> > around the project before you could ever "graduate" from the incubator.
> >
> > Probably Github is your best bet for now. Build a community. Then, if
> your
> > community is in favor, move to Apache. By that time, ASF might have full
> > git support.
> >
> >
> >> Are there any mechanism to help fund such an open-source project?
> >>
> >
> > Best bet is to build a community. Of course, if you can find some
> company
> > that wants such a project, you can get monetary support to develop /
> > maintain. But that seems unlikely in this case with the limited number
> of
> > companies looking for Scala out there, and especially since this is an
> > unproven port of a large Java project. So, start by getting folks like
> > jWeekend involved - great coders who are already salivating for Scala.
> Find
> > other individuals such as yourself who are interested, and build a group
> of
> > core committers.
> >
> >
> >> This is not meant to be a general announcement but rather a means
> >> for me to get some initial advice as to how to proceed.
> >>
> >> Any help is appreciated.
> >>
> >> Richard Emberson
> >
> >
> > I'm impressed. Quite an undertaking.
> >
> > --
> > Jeremy Thomerson
> > http://wickettraining.com
> > *Need a CMS for Wicket? Use Brix! http://brixcms.org*
> >
>
Re: Scala-Wicket Help and Advice
Posted by James Carman <ja...@carmanconsulting.com>.
I've got to try it!
On Jan 5, 2011 6:10 PM, "Gerolf Seitz" <ge...@gmail.com> wrote:
>>
>> Is this in IntelliJ IDEA?
>>
>>
> yes
>
>
>> On Wed, Jan 5, 2011 at 6:04 PM, Gerolf Seitz <ge...@gmail.com>
>> wrote:
>> > It's cmd+shift+G (OSX) and it works quite well ;)
>> >
>> > On Wed, Jan 5, 2011 at 11:55 PM, Justin Lee <ev...@gmail.com>
>> wrote:
>> >
>> >> You can paste a java class into a .scala file and it'll autoconvert.
>> >> there's a shortcut keystroke, too, but i don't remember what it is.
>> >>
>> >> On Wed, Jan 5, 2011 at 10:40 AM, richard emberson <
>> >> richard.emberson@gmail.com> wrote:
>> >>
>> >> > No IDE, I use Vim. Also, my build environment is Ant-based
>> >> > using scalac and javac.
>> >> >
>> >> > Of course, what I was doing was porting from Java to Scala.
>> >> > To that end I've got some 400 Vim scripts that aid in the
>> >> > port. For instance,
>> >> >
>> >> > :g/final \([a-zA-Z]\+\) \([a-zA-Z]\+\)\[\]\s*=/s//val \2: Array[\1]
>> =/g
>> >> >
>> >> > converts
>> >> > final B a[] =
>> >> > to
>> >> > val a: Array[B] =
>> >> >
>> >> > I don't know if IDEs provide such scripting with regex support.
>> >> > Also, with a simple Vim script and key combination, I can be
>> >> > viewing a ported Scala file and jump to its corresponding source
>> >> > Java Wicket file - very useful when porting or debugging.
>> >> > Yea, IDEs can do stuff me and my Vim scripts can not do, but my
>> >> > fingers know Vim.
>> >> >
>> >> > I also built a JUnit driver class in Scala (and Java) that allowed
>> >> > me to execute a single test method in a given test class by setting
>> >> > two properties in a file that my Ant script reads. This was vital
>> >> > for hunting down bugs.
>> >> >
>> >> > I looked into the tool that allowed Vim to be the front-end and
>> >> > Eclipse to run in server mode which allows a Vim user to access
>> >> > many of the extra features the IDE offers, but, as of a couple of
>> >> > months ago, there was no Scala support in the tool.
>> >> >
>> >> > The father of Scala, Martin Odersky uses Emacs.
>> >> >
>> >> > Richard
>> >> >
>> >> >
>> >> >
>> >> > On 01/05/2011 12:38 AM, Juergen Donnerstag wrote:
>> >> >
>> >> >> Cool. May I ask which tools (IDE) you've been using and what your
>> >> >> experience with these tools has been.
>> >> >>
>> >> >> -Juergen
>> >> >>
>> >> >> On Wed, Jan 5, 2011 at 2:34 AM, Jeremy Thomerson
>> >> >> <je...@wickettraining.com> wrote:
>> >> >>
>> >> >>> On Tue, Jan 4, 2011 at 5:15 PM, richard emberson<
>> >> >>> richard.emberson@gmail.com
>> >> >>>
>> >> >>>> wrote:
>> >> >>>>
>> >> >>>
>> >> >>> Dev Wicketers,
>> >> >>>>
>> >> >>>> What: I have ported Wicket to Scala
>> >> >>>> A couple of months ago I took a 1.5 snapshot and ported to
>> Scala.
>> >> >>>> This encompasses all of the source and test code. As successive
>> 1.5
>> >> >>>> snapshots were released, I ported those differences to my Scala
>> >> >>>> version. I am current with 1.5 M3.
>> >> >>>>
>> >> >>>> The Java 137,791 loc in 1.5 M3 are now 100,077 loc Scala (not
>> >> >>>> counting all the println statements I put into the Scala code
>> >> >>>> for debugging). I used cloc (http://cloc.sourceforge.net/) to
>> >> >>>> count lines of code.
>> >> >>>>
>> >> >>>>
>> >> >>> I haven't used CLOC before. I've used Ohcount (
>> >> >>> http://www.ohloh.net/p/ohcount) and like it. I'll have to give
>> this a
>> >> >>> try.
>> >> >>>
>> >> >>>
>> >> >>> I have also replaced all of the Java collection classes with
>> >> >>>
>> >> >>>> Scala collection classes (though a small number of Java
>> collection
>> >> >>>> classes remain that did not have comparable Scala
>> implementations).
>> >> >>>>
>> >> >>>> I have changed many method return types from the Java returning
>> >> >>>> some "object" or "null" to Scala returning "Some(object)" or
>> "None"
>> >> >>>> (using the Scala Option[return-type] construct) - trying to
>> >> >>>> eliminate nulls.
>> >> >>>>
>> >> >>>> Lastly, I pushed the IModel[T] typing down to the Component
>> class
>> >> >>>> making get/set DefaultModel and get/set DefaultModelObject
>> strong
>> >> >>>> typed. This included using Scala companion object apply methods
>> >> >>>> which eliminated having to explicitly declare type parameters in
>> >> >>>> most end-user code (I had read that one of the objections to
>> >> >>>> pushing strong typing down to the Component class in Wicket was
>> >> >>>> that there were "too many notes", end-user code was too
>> verbose).
>> >> >>>>
>> >> >>>> It can not interoperate with Java Wicket because Scala compiles
>> to
>> >> >>>> JVM class files and so all of the classes in Java Wicket also
>> >> >>>> appear in Scala-Wicket.
>> >> >>>>
>> >> >>>
>> >> >>>
>> >> >>> I have an "internal" name for my Scala port of Wicket which
>> >> >>>> acknowledges its Wicket heritage as well as advertises its
>> >> >>>> enterprise level capabilities. For external communications,
>> >> >>>> I am currently simply call it Scala-Wicket.
>> >> >>>>
>> >> >>>> Why: Scala is a better Java
>> >> >>>> I was introduced to Scala 9 months ago and quickly determined
>> that
>> >> >>>> it was a better Java (at least IMO). For Scala to succeed it
>> >> >>>> requires more programmers to use it. Many on the Scala mailing
>> >> >>>> lists were from a functional background and seemed not to
>> recognize
>> >> >>>> that Haskell and Lisp are not blindingly successful but, rather,
>> >> >>>> niche languages and that the heavy selling of Scala's function
>> and
>> >> >>>> typing capabilities might turn off Java programmers.
>> >> >>>>
>> >> >>>> Scala struck me in many ways as a strong-typed JavaScript, at
>> >> >>>> least, much of the code did not have to have type declarations
>> >> >>>> because the compiler could infer types in many cases. In
>> addition,
>> >> >>>> a whole lot of the Java boil-plate code was not needed. As such,
>> >> >>>> it could be sold as simply a better Java; a more-to-the-point
>> >> >>>> object oriented language with functional programming
>> in-the-small.
>> >> >>>>
>> >> >>>> To get more Java programmers to try Scala I looked for a
>> >> >>>> significant Java application with a strong support and user
>> >> >>>> community that I could port to Scala. I ended up with Wicket.
>> >> >>>> Wicket is an enterprise level web framework (unlike existing
>> >> >>>> Scale web frameworks which place restrictions on enterprise IT
>> >> >>>> organizations, e.g., by requiring sticky sessions). It is well
>> >> >>>> documented. And, as it turned out, very, very importantly it had
>> >> >>>> a large number of unit tests (the unit tests saved my butt,
>> >> >>>> without them I would never had succeeded in getting a port that
>> >> >>>> worked).
>> >> >>>>
>> >> >>>> No, Really, Why:
>> >> >>>> I like Scala and I took the time to learn it. Right now
>> about
>> >> >>>> 20% of programmers use Java while only some 0.4% use Scala.
>> >> >>>> I did not want my effort of learning Scala to be wasted so
>> my
>> >> >>>> solution is to increase the number of Scala programmers.
>> Where
>> >> >>>> to get them? Again, my solution is from the existing horde
>> of
>> >> >>>> Java programmers.
>> >> >>>>
>> >> >>>> Plans: Release, Evolve and Proselytize
>> >> >>>> I would like to release Scala-Wicket.
>> >> >>>> I do not know if Apache hosts anything other than Java code.
>> >> >>>> Growing a community is important.
>> >> >>>>
>> >> >>>> Still Todo:
>> >> >>>> Comments: All of the existing class and inline comments are
>> >> >>>> still Java related. This would have to be a long,
>> on-going
>> >> >>>> task to edit the comments so they reflect the code's
>> >> >>>> Scala usage.
>> >> >>>> Package path: The code still uses the "org.apache.wicket"
>> >> >>>> package path and this must be changed - unless this
>> became
>> >> >>>> an Apache project.
>> >> >>>> Author: I have quite literally looked at and touched every
>> line
>> >> >>>> of code but I have not yet felt comfortable with adding
>> >> >>>> myself as an author since, well, many changes were
>> >> >>>> syntactic and not semantic.
>> >> >>>> Refactor with Traits: Currently the port uses Scala traits
>> like
>> >> >>>> Java interfaces but it should be possible to factor the
>> >> >>>> common code out into the traits. This would result in
>> many
>> >> >>>> of the interfaces, the "I" files, such as IModel.scala,
>> >> >>>> going away.
>> >> >>>> Some general refactoring:
>> >> >>>> As an example, consider factoring out the IModel[T] from
>> >> >>>> Component. Half the time a user wants a Component with
>> >> >>>> no model, so, if there was a HasModel trait:
>> >> >>>> class Model[T](var value: T) {
>> >> >>>> def getObject: T = value
>> >> >>>> def setObject(value: T): Unit = this.value =
>> value
>> >> >>>> }
>> >> >>>> trait HasModel[T] {
>> >> >>>> var model: Model[T]
>> >> >>>> def getDefaultModel: IModel[T] = model
>> >> >>>> def setDefaultModel(model: IModel[T]): this.type =
>> {
>> >> >>>> ....
>> >> >>>> this
>> >> >>>> }
>> >> >>>> def getDefaultModelObject: Option[T] = {
>> >> >>>> ....
>> >> >>>> }
>> >> >>>> def setDefaultModelObject(obj: T): this.type = {
>> >> >>>> ....
>> >> >>>> this
>> >> >>>> }
>> >> >>>> }
>> >> >>>> The Component hierarchy would have no model support.
>> >> >>>> The user could add model support when needed:
>> >> >>>> val form = new Form("hi")
>> >> >>>> with HasModel[Int] { var model = new Model(42) }
>> >> >>>> Just an Idea.
>> >> >>>> STM: There are a number of Scala STM projects and I do not
>> know
>> >> >>>> if it is useful to add STM capabilities to Scala-Wicket.
>> >> >>>> RBAC: I've written a Scala implementation of the NIST RBAC
>> >> >>>> recommended standard and might consider adding it.
>> >> >>>> Logging: Adding a Scala-based logging framework to aid user
>> >> >>>> debugging.
>> >> >>>> Monitoring and stats: In the last couple of years many web
>> >> >>>> sites have added monitoring and statistics gathering
>> >> >>>> capabilities (e.g., who clicks what, where, how long, on
>> >> >>>> what page does the visitor exit the web site, etc.) in
>> >> >>>> order to know how the web site is being used and then
>> >> >>>> improve the web site.
>> >> >>>> Significant Memory Usage Reduction: I've an idea that would
>> >> >>>> significantly decrease the memory usage of Scala-Wicket
>> and
>> >> >>>> I plan to do a test implementation.
>> >> >>>> Replace Java features: There are still some Java-isms that
>> can
>> >> >>>> be replaced with Scala equivalents.
>> >> >>>> Port additional Java Wicket libraries to Scala.
>> >> >>>> Enable multiple instances of a unit tests to be run at once.
>> >> >>>> More: ????????????
>> >> >>>>
>> >> >>>> I want to avoid using some of the WTF features of Scala (when a
>> >> >>>> Java programmer looks at the code and says "WTF") in order
>> to
>> >> >>>> ease and accelerate acceptance by Java programmers; as
>> >> >>>> examples, implicits can make code hard to understand and
>> >> >>>> advanced Scala type usages, as James Gosling said, "makes
>> one's
>> >> >>>> head spin".
>> >> >>>>
>> >> >>>>
>> >> >>>> Help and Advice: How should Scala-Wicket be extended and released
>> >> >>>>
>> >> >>>> Scala-Wicket is a port and evolution of Wicket, not a ground-up
>> >> >>>> re-write. Given that, what would you do differently in
>> Wicket
>> >> >>>> now that there are years of experience using it?
>> >> >>>>
>> >> >>>> How best to get a hosting site, release the code and build a
>> >> >>>> community?
>> >> >>>>
>> >> >>>>
>> >> >>> If you're looking for a place to host it, I'd recommend starting
>> with
>> >> >>> Github. Git is where the crowd is headed, and Github is the
easiest
>> >> >>> place
>> >> >>> to get up and running with it these days.
>> >> >>>
>> >> >>> You mentioned earlier the idea of it being an Apache project. If
>> you
>> >> >>> wanted
>> >> >>> it to be an Apache project, you would start at the Incubator (
>> >> >>> http://incubator.apache.org/). The one barrier you'll have
>> initially
>> >> is
>> >> >>> that Apache favors "community over code"... so it's not a great
>> place
>> >> to
>> >> >>> start a one-man project. Since this is a port of an existing
Apache
>> >> >>> project, you might have more leniency, but you'd have to build a
>> >> >>> community
>> >> >>> around the project before you could ever "graduate" from the
>> incubator.
>> >> >>>
>> >> >>> Probably Github is your best bet for now. Build a community. Then,
>> if
>> >> >>> your
>> >> >>> community is in favor, move to Apache. By that time, ASF might
have
>> >> full
>> >> >>> git support.
>> >> >>>
>> >> >>>
>> >> >>> Are there any mechanism to help fund such an open-source
>> project?
>> >> >>>>
>> >> >>>>
>> >> >>> Best bet is to build a community. Of course, if you can find some
>> >> >>> company
>> >> >>> that wants such a project, you can get monetary support to develop
/
>> >> >>> maintain. But that seems unlikely in this case with the limited
>> number
>> >> >>> of
>> >> >>> companies looking for Scala out there, and especially since this
is
>> an
>> >> >>> unproven port of a large Java project. So, start by getting folks
>> like
>> >> >>> jWeekend involved - great coders who are already salivating for
>> Scala.
>> >> >>> Find
>> >> >>> other individuals such as yourself who are interested, and build a
>> >> group
>> >> >>> of
>> >> >>> core committers.
>> >> >>>
>> >> >>>
>> >> >>> This is not meant to be a general announcement but rather a means
>> >> >>>> for me to get some initial advice as to how to proceed.
>> >> >>>>
>> >> >>>> Any help is appreciated.
>> >> >>>>
>> >> >>>> Richard Emberson
>> >> >>>>
>> >> >>>
>> >> >>>
>> >> >>> I'm impressed. Quite an undertaking.
>> >> >>>
>> >> >>> --
>> >> >>> Jeremy Thomerson
>> >> >>> http://wickettraining.com
>> >> >>> *Need a CMS for Wicket? Use Brix! http://brixcms.org*
>> >> >>>
>> >> >>>
>> >> >>
>> >> > --
>> >> > Quis custodiet ipsos custodes
>> >> >
>> >>
>> >
>>
Re: Scala-Wicket Help and Advice
Posted by Gerolf Seitz <ge...@gmail.com>.
>
> Is this in IntelliJ IDEA?
>
>
yes
> On Wed, Jan 5, 2011 at 6:04 PM, Gerolf Seitz <ge...@gmail.com>
> wrote:
> > It's cmd+shift+G (OSX) and it works quite well ;)
> >
> > On Wed, Jan 5, 2011 at 11:55 PM, Justin Lee <ev...@gmail.com>
> wrote:
> >
> >> You can paste a java class into a .scala file and it'll autoconvert.
> >> there's a shortcut keystroke, too, but i don't remember what it is.
> >>
> >> On Wed, Jan 5, 2011 at 10:40 AM, richard emberson <
> >> richard.emberson@gmail.com> wrote:
> >>
> >> > No IDE, I use Vim. Also, my build environment is Ant-based
> >> > using scalac and javac.
> >> >
> >> > Of course, what I was doing was porting from Java to Scala.
> >> > To that end I've got some 400 Vim scripts that aid in the
> >> > port. For instance,
> >> >
> >> > :g/final \([a-zA-Z]\+\) \([a-zA-Z]\+\)\[\]\s*=/s//val \2: Array[\1]
> =/g
> >> >
> >> > converts
> >> > final B a[] =
> >> > to
> >> > val a: Array[B] =
> >> >
> >> > I don't know if IDEs provide such scripting with regex support.
> >> > Also, with a simple Vim script and key combination, I can be
> >> > viewing a ported Scala file and jump to its corresponding source
> >> > Java Wicket file - very useful when porting or debugging.
> >> > Yea, IDEs can do stuff me and my Vim scripts can not do, but my
> >> > fingers know Vim.
> >> >
> >> > I also built a JUnit driver class in Scala (and Java) that allowed
> >> > me to execute a single test method in a given test class by setting
> >> > two properties in a file that my Ant script reads. This was vital
> >> > for hunting down bugs.
> >> >
> >> > I looked into the tool that allowed Vim to be the front-end and
> >> > Eclipse to run in server mode which allows a Vim user to access
> >> > many of the extra features the IDE offers, but, as of a couple of
> >> > months ago, there was no Scala support in the tool.
> >> >
> >> > The father of Scala, Martin Odersky uses Emacs.
> >> >
> >> > Richard
> >> >
> >> >
> >> >
> >> > On 01/05/2011 12:38 AM, Juergen Donnerstag wrote:
> >> >
> >> >> Cool. May I ask which tools (IDE) you've been using and what your
> >> >> experience with these tools has been.
> >> >>
> >> >> -Juergen
> >> >>
> >> >> On Wed, Jan 5, 2011 at 2:34 AM, Jeremy Thomerson
> >> >> <je...@wickettraining.com> wrote:
> >> >>
> >> >>> On Tue, Jan 4, 2011 at 5:15 PM, richard emberson<
> >> >>> richard.emberson@gmail.com
> >> >>>
> >> >>>> wrote:
> >> >>>>
> >> >>>
> >> >>> Dev Wicketers,
> >> >>>>
> >> >>>> What: I have ported Wicket to Scala
> >> >>>> A couple of months ago I took a 1.5 snapshot and ported to
> Scala.
> >> >>>> This encompasses all of the source and test code. As successive
> 1.5
> >> >>>> snapshots were released, I ported those differences to my Scala
> >> >>>> version. I am current with 1.5 M3.
> >> >>>>
> >> >>>> The Java 137,791 loc in 1.5 M3 are now 100,077 loc Scala (not
> >> >>>> counting all the println statements I put into the Scala code
> >> >>>> for debugging). I used cloc (http://cloc.sourceforge.net/) to
> >> >>>> count lines of code.
> >> >>>>
> >> >>>>
> >> >>> I haven't used CLOC before. I've used Ohcount (
> >> >>> http://www.ohloh.net/p/ohcount) and like it. I'll have to give
> this a
> >> >>> try.
> >> >>>
> >> >>>
> >> >>> I have also replaced all of the Java collection classes with
> >> >>>
> >> >>>> Scala collection classes (though a small number of Java
> collection
> >> >>>> classes remain that did not have comparable Scala
> implementations).
> >> >>>>
> >> >>>> I have changed many method return types from the Java returning
> >> >>>> some "object" or "null" to Scala returning "Some(object)" or
> "None"
> >> >>>> (using the Scala Option[return-type] construct) - trying to
> >> >>>> eliminate nulls.
> >> >>>>
> >> >>>> Lastly, I pushed the IModel[T] typing down to the Component
> class
> >> >>>> making get/set DefaultModel and get/set DefaultModelObject
> strong
> >> >>>> typed. This included using Scala companion object apply methods
> >> >>>> which eliminated having to explicitly declare type parameters in
> >> >>>> most end-user code (I had read that one of the objections to
> >> >>>> pushing strong typing down to the Component class in Wicket was
> >> >>>> that there were "too many notes", end-user code was too
> verbose).
> >> >>>>
> >> >>>> It can not interoperate with Java Wicket because Scala compiles
> to
> >> >>>> JVM class files and so all of the classes in Java Wicket also
> >> >>>> appear in Scala-Wicket.
> >> >>>>
> >> >>>
> >> >>>
> >> >>> I have an "internal" name for my Scala port of Wicket which
> >> >>>> acknowledges its Wicket heritage as well as advertises its
> >> >>>> enterprise level capabilities. For external communications,
> >> >>>> I am currently simply call it Scala-Wicket.
> >> >>>>
> >> >>>> Why: Scala is a better Java
> >> >>>> I was introduced to Scala 9 months ago and quickly determined
> that
> >> >>>> it was a better Java (at least IMO). For Scala to succeed it
> >> >>>> requires more programmers to use it. Many on the Scala mailing
> >> >>>> lists were from a functional background and seemed not to
> recognize
> >> >>>> that Haskell and Lisp are not blindingly successful but, rather,
> >> >>>> niche languages and that the heavy selling of Scala's function
> and
> >> >>>> typing capabilities might turn off Java programmers.
> >> >>>>
> >> >>>> Scala struck me in many ways as a strong-typed JavaScript, at
> >> >>>> least, much of the code did not have to have type declarations
> >> >>>> because the compiler could infer types in many cases. In
> addition,
> >> >>>> a whole lot of the Java boil-plate code was not needed. As such,
> >> >>>> it could be sold as simply a better Java; a more-to-the-point
> >> >>>> object oriented language with functional programming
> in-the-small.
> >> >>>>
> >> >>>> To get more Java programmers to try Scala I looked for a
> >> >>>> significant Java application with a strong support and user
> >> >>>> community that I could port to Scala. I ended up with Wicket.
> >> >>>> Wicket is an enterprise level web framework (unlike existing
> >> >>>> Scale web frameworks which place restrictions on enterprise IT
> >> >>>> organizations, e.g., by requiring sticky sessions). It is well
> >> >>>> documented. And, as it turned out, very, very importantly it had
> >> >>>> a large number of unit tests (the unit tests saved my butt,
> >> >>>> without them I would never had succeeded in getting a port that
> >> >>>> worked).
> >> >>>>
> >> >>>> No, Really, Why:
> >> >>>> I like Scala and I took the time to learn it. Right now
> about
> >> >>>> 20% of programmers use Java while only some 0.4% use Scala.
> >> >>>> I did not want my effort of learning Scala to be wasted so
> my
> >> >>>> solution is to increase the number of Scala programmers.
> Where
> >> >>>> to get them? Again, my solution is from the existing horde
> of
> >> >>>> Java programmers.
> >> >>>>
> >> >>>> Plans: Release, Evolve and Proselytize
> >> >>>> I would like to release Scala-Wicket.
> >> >>>> I do not know if Apache hosts anything other than Java code.
> >> >>>> Growing a community is important.
> >> >>>>
> >> >>>> Still Todo:
> >> >>>> Comments: All of the existing class and inline comments are
> >> >>>> still Java related. This would have to be a long,
> on-going
> >> >>>> task to edit the comments so they reflect the code's
> >> >>>> Scala usage.
> >> >>>> Package path: The code still uses the "org.apache.wicket"
> >> >>>> package path and this must be changed - unless this
> became
> >> >>>> an Apache project.
> >> >>>> Author: I have quite literally looked at and touched every
> line
> >> >>>> of code but I have not yet felt comfortable with adding
> >> >>>> myself as an author since, well, many changes were
> >> >>>> syntactic and not semantic.
> >> >>>> Refactor with Traits: Currently the port uses Scala traits
> like
> >> >>>> Java interfaces but it should be possible to factor the
> >> >>>> common code out into the traits. This would result in
> many
> >> >>>> of the interfaces, the "I" files, such as IModel.scala,
> >> >>>> going away.
> >> >>>> Some general refactoring:
> >> >>>> As an example, consider factoring out the IModel[T] from
> >> >>>> Component. Half the time a user wants a Component with
> >> >>>> no model, so, if there was a HasModel trait:
> >> >>>> class Model[T](var value: T) {
> >> >>>> def getObject: T = value
> >> >>>> def setObject(value: T): Unit = this.value =
> value
> >> >>>> }
> >> >>>> trait HasModel[T] {
> >> >>>> var model: Model[T]
> >> >>>> def getDefaultModel: IModel[T] = model
> >> >>>> def setDefaultModel(model: IModel[T]): this.type =
> {
> >> >>>> ....
> >> >>>> this
> >> >>>> }
> >> >>>> def getDefaultModelObject: Option[T] = {
> >> >>>> ....
> >> >>>> }
> >> >>>> def setDefaultModelObject(obj: T): this.type = {
> >> >>>> ....
> >> >>>> this
> >> >>>> }
> >> >>>> }
> >> >>>> The Component hierarchy would have no model support.
> >> >>>> The user could add model support when needed:
> >> >>>> val form = new Form("hi")
> >> >>>> with HasModel[Int] { var model = new Model(42) }
> >> >>>> Just an Idea.
> >> >>>> STM: There are a number of Scala STM projects and I do not
> know
> >> >>>> if it is useful to add STM capabilities to Scala-Wicket.
> >> >>>> RBAC: I've written a Scala implementation of the NIST RBAC
> >> >>>> recommended standard and might consider adding it.
> >> >>>> Logging: Adding a Scala-based logging framework to aid user
> >> >>>> debugging.
> >> >>>> Monitoring and stats: In the last couple of years many web
> >> >>>> sites have added monitoring and statistics gathering
> >> >>>> capabilities (e.g., who clicks what, where, how long, on
> >> >>>> what page does the visitor exit the web site, etc.) in
> >> >>>> order to know how the web site is being used and then
> >> >>>> improve the web site.
> >> >>>> Significant Memory Usage Reduction: I've an idea that would
> >> >>>> significantly decrease the memory usage of Scala-Wicket
> and
> >> >>>> I plan to do a test implementation.
> >> >>>> Replace Java features: There are still some Java-isms that
> can
> >> >>>> be replaced with Scala equivalents.
> >> >>>> Port additional Java Wicket libraries to Scala.
> >> >>>> Enable multiple instances of a unit tests to be run at once.
> >> >>>> More: ????????????
> >> >>>>
> >> >>>> I want to avoid using some of the WTF features of Scala (when a
> >> >>>> Java programmer looks at the code and says "WTF") in order
> to
> >> >>>> ease and accelerate acceptance by Java programmers; as
> >> >>>> examples, implicits can make code hard to understand and
> >> >>>> advanced Scala type usages, as James Gosling said, "makes
> one's
> >> >>>> head spin".
> >> >>>>
> >> >>>>
> >> >>>> Help and Advice: How should Scala-Wicket be extended and released
> >> >>>>
> >> >>>> Scala-Wicket is a port and evolution of Wicket, not a ground-up
> >> >>>> re-write. Given that, what would you do differently in
> Wicket
> >> >>>> now that there are years of experience using it?
> >> >>>>
> >> >>>> How best to get a hosting site, release the code and build a
> >> >>>> community?
> >> >>>>
> >> >>>>
> >> >>> If you're looking for a place to host it, I'd recommend starting
> with
> >> >>> Github. Git is where the crowd is headed, and Github is the easiest
> >> >>> place
> >> >>> to get up and running with it these days.
> >> >>>
> >> >>> You mentioned earlier the idea of it being an Apache project. If
> you
> >> >>> wanted
> >> >>> it to be an Apache project, you would start at the Incubator (
> >> >>> http://incubator.apache.org/). The one barrier you'll have
> initially
> >> is
> >> >>> that Apache favors "community over code"... so it's not a great
> place
> >> to
> >> >>> start a one-man project. Since this is a port of an existing Apache
> >> >>> project, you might have more leniency, but you'd have to build a
> >> >>> community
> >> >>> around the project before you could ever "graduate" from the
> incubator.
> >> >>>
> >> >>> Probably Github is your best bet for now. Build a community. Then,
> if
> >> >>> your
> >> >>> community is in favor, move to Apache. By that time, ASF might have
> >> full
> >> >>> git support.
> >> >>>
> >> >>>
> >> >>> Are there any mechanism to help fund such an open-source
> project?
> >> >>>>
> >> >>>>
> >> >>> Best bet is to build a community. Of course, if you can find some
> >> >>> company
> >> >>> that wants such a project, you can get monetary support to develop /
> >> >>> maintain. But that seems unlikely in this case with the limited
> number
> >> >>> of
> >> >>> companies looking for Scala out there, and especially since this is
> an
> >> >>> unproven port of a large Java project. So, start by getting folks
> like
> >> >>> jWeekend involved - great coders who are already salivating for
> Scala.
> >> >>> Find
> >> >>> other individuals such as yourself who are interested, and build a
> >> group
> >> >>> of
> >> >>> core committers.
> >> >>>
> >> >>>
> >> >>> This is not meant to be a general announcement but rather a means
> >> >>>> for me to get some initial advice as to how to proceed.
> >> >>>>
> >> >>>> Any help is appreciated.
> >> >>>>
> >> >>>> Richard Emberson
> >> >>>>
> >> >>>
> >> >>>
> >> >>> I'm impressed. Quite an undertaking.
> >> >>>
> >> >>> --
> >> >>> Jeremy Thomerson
> >> >>> http://wickettraining.com
> >> >>> *Need a CMS for Wicket? Use Brix! http://brixcms.org*
> >> >>>
> >> >>>
> >> >>
> >> > --
> >> > Quis custodiet ipsos custodes
> >> >
> >>
> >
>
Re: Scala-Wicket Help and Advice
Posted by James Carman <ja...@carmanconsulting.com>.
Is this in IntelliJ IDEA?
On Wed, Jan 5, 2011 at 6:04 PM, Gerolf Seitz <ge...@gmail.com> wrote:
> It's cmd+shift+G (OSX) and it works quite well ;)
>
> On Wed, Jan 5, 2011 at 11:55 PM, Justin Lee <ev...@gmail.com> wrote:
>
>> You can paste a java class into a .scala file and it'll autoconvert.
>> there's a shortcut keystroke, too, but i don't remember what it is.
>>
>> On Wed, Jan 5, 2011 at 10:40 AM, richard emberson <
>> richard.emberson@gmail.com> wrote:
>>
>> > No IDE, I use Vim. Also, my build environment is Ant-based
>> > using scalac and javac.
>> >
>> > Of course, what I was doing was porting from Java to Scala.
>> > To that end I've got some 400 Vim scripts that aid in the
>> > port. For instance,
>> >
>> > :g/final \([a-zA-Z]\+\) \([a-zA-Z]\+\)\[\]\s*=/s//val \2: Array[\1] =/g
>> >
>> > converts
>> > final B a[] =
>> > to
>> > val a: Array[B] =
>> >
>> > I don't know if IDEs provide such scripting with regex support.
>> > Also, with a simple Vim script and key combination, I can be
>> > viewing a ported Scala file and jump to its corresponding source
>> > Java Wicket file - very useful when porting or debugging.
>> > Yea, IDEs can do stuff me and my Vim scripts can not do, but my
>> > fingers know Vim.
>> >
>> > I also built a JUnit driver class in Scala (and Java) that allowed
>> > me to execute a single test method in a given test class by setting
>> > two properties in a file that my Ant script reads. This was vital
>> > for hunting down bugs.
>> >
>> > I looked into the tool that allowed Vim to be the front-end and
>> > Eclipse to run in server mode which allows a Vim user to access
>> > many of the extra features the IDE offers, but, as of a couple of
>> > months ago, there was no Scala support in the tool.
>> >
>> > The father of Scala, Martin Odersky uses Emacs.
>> >
>> > Richard
>> >
>> >
>> >
>> > On 01/05/2011 12:38 AM, Juergen Donnerstag wrote:
>> >
>> >> Cool. May I ask which tools (IDE) you've been using and what your
>> >> experience with these tools has been.
>> >>
>> >> -Juergen
>> >>
>> >> On Wed, Jan 5, 2011 at 2:34 AM, Jeremy Thomerson
>> >> <je...@wickettraining.com> wrote:
>> >>
>> >>> On Tue, Jan 4, 2011 at 5:15 PM, richard emberson<
>> >>> richard.emberson@gmail.com
>> >>>
>> >>>> wrote:
>> >>>>
>> >>>
>> >>> Dev Wicketers,
>> >>>>
>> >>>> What: I have ported Wicket to Scala
>> >>>> A couple of months ago I took a 1.5 snapshot and ported to Scala.
>> >>>> This encompasses all of the source and test code. As successive 1.5
>> >>>> snapshots were released, I ported those differences to my Scala
>> >>>> version. I am current with 1.5 M3.
>> >>>>
>> >>>> The Java 137,791 loc in 1.5 M3 are now 100,077 loc Scala (not
>> >>>> counting all the println statements I put into the Scala code
>> >>>> for debugging). I used cloc (http://cloc.sourceforge.net/) to
>> >>>> count lines of code.
>> >>>>
>> >>>>
>> >>> I haven't used CLOC before. I've used Ohcount (
>> >>> http://www.ohloh.net/p/ohcount) and like it. I'll have to give this a
>> >>> try.
>> >>>
>> >>>
>> >>> I have also replaced all of the Java collection classes with
>> >>>
>> >>>> Scala collection classes (though a small number of Java collection
>> >>>> classes remain that did not have comparable Scala implementations).
>> >>>>
>> >>>> I have changed many method return types from the Java returning
>> >>>> some "object" or "null" to Scala returning "Some(object)" or "None"
>> >>>> (using the Scala Option[return-type] construct) - trying to
>> >>>> eliminate nulls.
>> >>>>
>> >>>> Lastly, I pushed the IModel[T] typing down to the Component class
>> >>>> making get/set DefaultModel and get/set DefaultModelObject strong
>> >>>> typed. This included using Scala companion object apply methods
>> >>>> which eliminated having to explicitly declare type parameters in
>> >>>> most end-user code (I had read that one of the objections to
>> >>>> pushing strong typing down to the Component class in Wicket was
>> >>>> that there were "too many notes", end-user code was too verbose).
>> >>>>
>> >>>> It can not interoperate with Java Wicket because Scala compiles to
>> >>>> JVM class files and so all of the classes in Java Wicket also
>> >>>> appear in Scala-Wicket.
>> >>>>
>> >>>
>> >>>
>> >>> I have an "internal" name for my Scala port of Wicket which
>> >>>> acknowledges its Wicket heritage as well as advertises its
>> >>>> enterprise level capabilities. For external communications,
>> >>>> I am currently simply call it Scala-Wicket.
>> >>>>
>> >>>> Why: Scala is a better Java
>> >>>> I was introduced to Scala 9 months ago and quickly determined that
>> >>>> it was a better Java (at least IMO). For Scala to succeed it
>> >>>> requires more programmers to use it. Many on the Scala mailing
>> >>>> lists were from a functional background and seemed not to recognize
>> >>>> that Haskell and Lisp are not blindingly successful but, rather,
>> >>>> niche languages and that the heavy selling of Scala's function and
>> >>>> typing capabilities might turn off Java programmers.
>> >>>>
>> >>>> Scala struck me in many ways as a strong-typed JavaScript, at
>> >>>> least, much of the code did not have to have type declarations
>> >>>> because the compiler could infer types in many cases. In addition,
>> >>>> a whole lot of the Java boil-plate code was not needed. As such,
>> >>>> it could be sold as simply a better Java; a more-to-the-point
>> >>>> object oriented language with functional programming in-the-small.
>> >>>>
>> >>>> To get more Java programmers to try Scala I looked for a
>> >>>> significant Java application with a strong support and user
>> >>>> community that I could port to Scala. I ended up with Wicket.
>> >>>> Wicket is an enterprise level web framework (unlike existing
>> >>>> Scale web frameworks which place restrictions on enterprise IT
>> >>>> organizations, e.g., by requiring sticky sessions). It is well
>> >>>> documented. And, as it turned out, very, very importantly it had
>> >>>> a large number of unit tests (the unit tests saved my butt,
>> >>>> without them I would never had succeeded in getting a port that
>> >>>> worked).
>> >>>>
>> >>>> No, Really, Why:
>> >>>> I like Scala and I took the time to learn it. Right now about
>> >>>> 20% of programmers use Java while only some 0.4% use Scala.
>> >>>> I did not want my effort of learning Scala to be wasted so my
>> >>>> solution is to increase the number of Scala programmers. Where
>> >>>> to get them? Again, my solution is from the existing horde of
>> >>>> Java programmers.
>> >>>>
>> >>>> Plans: Release, Evolve and Proselytize
>> >>>> I would like to release Scala-Wicket.
>> >>>> I do not know if Apache hosts anything other than Java code.
>> >>>> Growing a community is important.
>> >>>>
>> >>>> Still Todo:
>> >>>> Comments: All of the existing class and inline comments are
>> >>>> still Java related. This would have to be a long, on-going
>> >>>> task to edit the comments so they reflect the code's
>> >>>> Scala usage.
>> >>>> Package path: The code still uses the "org.apache.wicket"
>> >>>> package path and this must be changed - unless this became
>> >>>> an Apache project.
>> >>>> Author: I have quite literally looked at and touched every line
>> >>>> of code but I have not yet felt comfortable with adding
>> >>>> myself as an author since, well, many changes were
>> >>>> syntactic and not semantic.
>> >>>> Refactor with Traits: Currently the port uses Scala traits like
>> >>>> Java interfaces but it should be possible to factor the
>> >>>> common code out into the traits. This would result in many
>> >>>> of the interfaces, the "I" files, such as IModel.scala,
>> >>>> going away.
>> >>>> Some general refactoring:
>> >>>> As an example, consider factoring out the IModel[T] from
>> >>>> Component. Half the time a user wants a Component with
>> >>>> no model, so, if there was a HasModel trait:
>> >>>> class Model[T](var value: T) {
>> >>>> def getObject: T = value
>> >>>> def setObject(value: T): Unit = this.value = value
>> >>>> }
>> >>>> trait HasModel[T] {
>> >>>> var model: Model[T]
>> >>>> def getDefaultModel: IModel[T] = model
>> >>>> def setDefaultModel(model: IModel[T]): this.type = {
>> >>>> ....
>> >>>> this
>> >>>> }
>> >>>> def getDefaultModelObject: Option[T] = {
>> >>>> ....
>> >>>> }
>> >>>> def setDefaultModelObject(obj: T): this.type = {
>> >>>> ....
>> >>>> this
>> >>>> }
>> >>>> }
>> >>>> The Component hierarchy would have no model support.
>> >>>> The user could add model support when needed:
>> >>>> val form = new Form("hi")
>> >>>> with HasModel[Int] { var model = new Model(42) }
>> >>>> Just an Idea.
>> >>>> STM: There are a number of Scala STM projects and I do not know
>> >>>> if it is useful to add STM capabilities to Scala-Wicket.
>> >>>> RBAC: I've written a Scala implementation of the NIST RBAC
>> >>>> recommended standard and might consider adding it.
>> >>>> Logging: Adding a Scala-based logging framework to aid user
>> >>>> debugging.
>> >>>> Monitoring and stats: In the last couple of years many web
>> >>>> sites have added monitoring and statistics gathering
>> >>>> capabilities (e.g., who clicks what, where, how long, on
>> >>>> what page does the visitor exit the web site, etc.) in
>> >>>> order to know how the web site is being used and then
>> >>>> improve the web site.
>> >>>> Significant Memory Usage Reduction: I've an idea that would
>> >>>> significantly decrease the memory usage of Scala-Wicket and
>> >>>> I plan to do a test implementation.
>> >>>> Replace Java features: There are still some Java-isms that can
>> >>>> be replaced with Scala equivalents.
>> >>>> Port additional Java Wicket libraries to Scala.
>> >>>> Enable multiple instances of a unit tests to be run at once.
>> >>>> More: ????????????
>> >>>>
>> >>>> I want to avoid using some of the WTF features of Scala (when a
>> >>>> Java programmer looks at the code and says "WTF") in order to
>> >>>> ease and accelerate acceptance by Java programmers; as
>> >>>> examples, implicits can make code hard to understand and
>> >>>> advanced Scala type usages, as James Gosling said, "makes one's
>> >>>> head spin".
>> >>>>
>> >>>>
>> >>>> Help and Advice: How should Scala-Wicket be extended and released
>> >>>>
>> >>>> Scala-Wicket is a port and evolution of Wicket, not a ground-up
>> >>>> re-write. Given that, what would you do differently in Wicket
>> >>>> now that there are years of experience using it?
>> >>>>
>> >>>> How best to get a hosting site, release the code and build a
>> >>>> community?
>> >>>>
>> >>>>
>> >>> If you're looking for a place to host it, I'd recommend starting with
>> >>> Github. Git is where the crowd is headed, and Github is the easiest
>> >>> place
>> >>> to get up and running with it these days.
>> >>>
>> >>> You mentioned earlier the idea of it being an Apache project. If you
>> >>> wanted
>> >>> it to be an Apache project, you would start at the Incubator (
>> >>> http://incubator.apache.org/). The one barrier you'll have initially
>> is
>> >>> that Apache favors "community over code"... so it's not a great place
>> to
>> >>> start a one-man project. Since this is a port of an existing Apache
>> >>> project, you might have more leniency, but you'd have to build a
>> >>> community
>> >>> around the project before you could ever "graduate" from the incubator.
>> >>>
>> >>> Probably Github is your best bet for now. Build a community. Then, if
>> >>> your
>> >>> community is in favor, move to Apache. By that time, ASF might have
>> full
>> >>> git support.
>> >>>
>> >>>
>> >>> Are there any mechanism to help fund such an open-source project?
>> >>>>
>> >>>>
>> >>> Best bet is to build a community. Of course, if you can find some
>> >>> company
>> >>> that wants such a project, you can get monetary support to develop /
>> >>> maintain. But that seems unlikely in this case with the limited number
>> >>> of
>> >>> companies looking for Scala out there, and especially since this is an
>> >>> unproven port of a large Java project. So, start by getting folks like
>> >>> jWeekend involved - great coders who are already salivating for Scala.
>> >>> Find
>> >>> other individuals such as yourself who are interested, and build a
>> group
>> >>> of
>> >>> core committers.
>> >>>
>> >>>
>> >>> This is not meant to be a general announcement but rather a means
>> >>>> for me to get some initial advice as to how to proceed.
>> >>>>
>> >>>> Any help is appreciated.
>> >>>>
>> >>>> Richard Emberson
>> >>>>
>> >>>
>> >>>
>> >>> I'm impressed. Quite an undertaking.
>> >>>
>> >>> --
>> >>> Jeremy Thomerson
>> >>> http://wickettraining.com
>> >>> *Need a CMS for Wicket? Use Brix! http://brixcms.org*
>> >>>
>> >>>
>> >>
>> > --
>> > Quis custodiet ipsos custodes
>> >
>>
>
Re: Scala-Wicket Help and Advice
Posted by Cemal Bayramoglu <jW...@cabouge.com>.
Richard,
This would effectively result in Java code translated directly to
Scala, pretty naively.
>From what you describe, you have already manually done much better than that.
As you have already hinted at in your previous posts, one of the key
points of this would be to take advantage of the fantastic features
(OO & functional) of Scala, rather than effectively implementing Java
idioms in Scala.
Regards - Cemal
jWeekend
Training, Consulting, Development
http://jWeekend.com
On 5 January 2011 23:23, richard emberson <ri...@gmail.com> wrote:
> So there is an IDE that you can point at a directory tree and
> tell it to convert all of the Java files to Scala files.
> Does it do a 100% conversion, 90%, 50% or 10% (on average)?
> Do you have a link to a page documenting this feature?
>
> Thanks
> Richard
>
> On 01/05/2011 03:04 PM, Gerolf Seitz wrote:
>>
>> It's cmd+shift+G (OSX) and it works quite well ;)
>>
>> On Wed, Jan 5, 2011 at 11:55 PM, Justin Lee<ev...@gmail.com> wrote:
>>
>>> You can paste a java class into a .scala file and it'll autoconvert.
>>> there's a shortcut keystroke, too, but i don't remember what it is.
>>>
>>> On Wed, Jan 5, 2011 at 10:40 AM, richard emberson<
>>> richard.emberson@gmail.com> wrote:
>>>
>>>> No IDE, I use Vim. Also, my build environment is Ant-based
>>>> using scalac and javac.
>>>>
>>>> Of course, what I was doing was porting from Java to Scala.
>>>> To that end I've got some 400 Vim scripts that aid in the
>>>> port. For instance,
>>>>
>>>> :g/final \([a-zA-Z]\+\) \([a-zA-Z]\+\)\[\]\s*=/s//val \2: Array[\1] =/g
>>>>
>>>> converts
>>>> final B a[] =
>>>> to
>>>> val a: Array[B] =
>>>>
>>>> I don't know if IDEs provide such scripting with regex support.
>>>> Also, with a simple Vim script and key combination, I can be
>>>> viewing a ported Scala file and jump to its corresponding source
>>>> Java Wicket file - very useful when porting or debugging.
>>>> Yea, IDEs can do stuff me and my Vim scripts can not do, but my
>>>> fingers know Vim.
>>>>
>>>> I also built a JUnit driver class in Scala (and Java) that allowed
>>>> me to execute a single test method in a given test class by setting
>>>> two properties in a file that my Ant script reads. This was vital
>>>> for hunting down bugs.
>>>>
>>>> I looked into the tool that allowed Vim to be the front-end and
>>>> Eclipse to run in server mode which allows a Vim user to access
>>>> many of the extra features the IDE offers, but, as of a couple of
>>>> months ago, there was no Scala support in the tool.
>>>>
>>>> The father of Scala, Martin Odersky uses Emacs.
>>>>
>>>> Richard
>>>>
>>>>
>>>>
>>>> On 01/05/2011 12:38 AM, Juergen Donnerstag wrote:
>>>>
>>>>> Cool. May I ask which tools (IDE) you've been using and what your
>>>>> experience with these tools has been.
>>>>>
>>>>> -Juergen
>>>>>
>>>>> On Wed, Jan 5, 2011 at 2:34 AM, Jeremy Thomerson
>>>>> <je...@wickettraining.com> wrote:
>>>>>
>>>>>> On Tue, Jan 4, 2011 at 5:15 PM, richard emberson<
>>>>>> richard.emberson@gmail.com
>>>>>>
>>>>>>> wrote:
>>>>>>>
>>>>>>
>>>>>> Dev Wicketers,
>>>>>>>
>>>>>>> What: I have ported Wicket to Scala
>>>>>>> A couple of months ago I took a 1.5 snapshot and ported to Scala.
>>>>>>> This encompasses all of the source and test code. As successive
>>>>>>> 1.5
>>>>>>> snapshots were released, I ported those differences to my Scala
>>>>>>> version. I am current with 1.5 M3.
>>>>>>>
>>>>>>> The Java 137,791 loc in 1.5 M3 are now 100,077 loc Scala (not
>>>>>>> counting all the println statements I put into the Scala code
>>>>>>> for debugging). I used cloc (http://cloc.sourceforge.net/) to
>>>>>>> count lines of code.
>>>>>>>
>>>>>>>
>>>>>> I haven't used CLOC before. I've used Ohcount (
>>>>>> http://www.ohloh.net/p/ohcount) and like it. I'll have to give this a
>>>>>> try.
>>>>>>
>>>>>>
>>>>>> I have also replaced all of the Java collection classes with
>>>>>>
>>>>>>> Scala collection classes (though a small number of Java collection
>>>>>>> classes remain that did not have comparable Scala
>>>>>>> implementations).
>>>>>>>
>>>>>>> I have changed many method return types from the Java returning
>>>>>>> some "object" or "null" to Scala returning "Some(object)" or
>>>>>>> "None"
>>>>>>> (using the Scala Option[return-type] construct) - trying to
>>>>>>> eliminate nulls.
>>>>>>>
>>>>>>> Lastly, I pushed the IModel[T] typing down to the Component class
>>>>>>> making get/set DefaultModel and get/set DefaultModelObject strong
>>>>>>> typed. This included using Scala companion object apply methods
>>>>>>> which eliminated having to explicitly declare type parameters in
>>>>>>> most end-user code (I had read that one of the objections to
>>>>>>> pushing strong typing down to the Component class in Wicket was
>>>>>>> that there were "too many notes", end-user code was too verbose).
>>>>>>>
>>>>>>> It can not interoperate with Java Wicket because Scala compiles to
>>>>>>> JVM class files and so all of the classes in Java Wicket also
>>>>>>> appear in Scala-Wicket.
>>>>>>>
>>>>>>
>>>>>>
>>>>>> I have an "internal" name for my Scala port of Wicket which
>>>>>>>
>>>>>>> acknowledges its Wicket heritage as well as advertises its
>>>>>>> enterprise level capabilities. For external communications,
>>>>>>> I am currently simply call it Scala-Wicket.
>>>>>>>
>>>>>>> Why: Scala is a better Java
>>>>>>> I was introduced to Scala 9 months ago and quickly determined that
>>>>>>> it was a better Java (at least IMO). For Scala to succeed it
>>>>>>> requires more programmers to use it. Many on the Scala mailing
>>>>>>> lists were from a functional background and seemed not to
>>>>>>> recognize
>>>>>>> that Haskell and Lisp are not blindingly successful but, rather,
>>>>>>> niche languages and that the heavy selling of Scala's function and
>>>>>>> typing capabilities might turn off Java programmers.
>>>>>>>
>>>>>>> Scala struck me in many ways as a strong-typed JavaScript, at
>>>>>>> least, much of the code did not have to have type declarations
>>>>>>> because the compiler could infer types in many cases. In addition,
>>>>>>> a whole lot of the Java boil-plate code was not needed. As such,
>>>>>>> it could be sold as simply a better Java; a more-to-the-point
>>>>>>> object oriented language with functional programming in-the-small.
>>>>>>>
>>>>>>> To get more Java programmers to try Scala I looked for a
>>>>>>> significant Java application with a strong support and user
>>>>>>> community that I could port to Scala. I ended up with Wicket.
>>>>>>> Wicket is an enterprise level web framework (unlike existing
>>>>>>> Scale web frameworks which place restrictions on enterprise IT
>>>>>>> organizations, e.g., by requiring sticky sessions). It is well
>>>>>>> documented. And, as it turned out, very, very importantly it had
>>>>>>> a large number of unit tests (the unit tests saved my butt,
>>>>>>> without them I would never had succeeded in getting a port that
>>>>>>> worked).
>>>>>>>
>>>>>>> No, Really, Why:
>>>>>>> I like Scala and I took the time to learn it. Right now about
>>>>>>> 20% of programmers use Java while only some 0.4% use Scala.
>>>>>>> I did not want my effort of learning Scala to be wasted so my
>>>>>>> solution is to increase the number of Scala programmers. Where
>>>>>>> to get them? Again, my solution is from the existing horde of
>>>>>>> Java programmers.
>>>>>>>
>>>>>>> Plans: Release, Evolve and Proselytize
>>>>>>> I would like to release Scala-Wicket.
>>>>>>> I do not know if Apache hosts anything other than Java code.
>>>>>>> Growing a community is important.
>>>>>>>
>>>>>>> Still Todo:
>>>>>>> Comments: All of the existing class and inline comments are
>>>>>>> still Java related. This would have to be a long,
>>>>>>> on-going
>>>>>>> task to edit the comments so they reflect the code's
>>>>>>> Scala usage.
>>>>>>> Package path: The code still uses the "org.apache.wicket"
>>>>>>> package path and this must be changed - unless this became
>>>>>>> an Apache project.
>>>>>>> Author: I have quite literally looked at and touched every
>>>>>>> line
>>>>>>> of code but I have not yet felt comfortable with adding
>>>>>>> myself as an author since, well, many changes were
>>>>>>> syntactic and not semantic.
>>>>>>> Refactor with Traits: Currently the port uses Scala traits
>>>>>>> like
>>>>>>> Java interfaces but it should be possible to factor the
>>>>>>> common code out into the traits. This would result in many
>>>>>>> of the interfaces, the "I" files, such as IModel.scala,
>>>>>>> going away.
>>>>>>> Some general refactoring:
>>>>>>> As an example, consider factoring out the IModel[T] from
>>>>>>> Component. Half the time a user wants a Component with
>>>>>>> no model, so, if there was a HasModel trait:
>>>>>>> class Model[T](var value: T) {
>>>>>>> def getObject: T = value
>>>>>>> def setObject(value: T): Unit = this.value = value
>>>>>>> }
>>>>>>> trait HasModel[T] {
>>>>>>> var model: Model[T]
>>>>>>> def getDefaultModel: IModel[T] = model
>>>>>>> def setDefaultModel(model: IModel[T]): this.type = {
>>>>>>> ....
>>>>>>> this
>>>>>>> }
>>>>>>> def getDefaultModelObject: Option[T] = {
>>>>>>> ....
>>>>>>> }
>>>>>>> def setDefaultModelObject(obj: T): this.type = {
>>>>>>> ....
>>>>>>> this
>>>>>>> }
>>>>>>> }
>>>>>>> The Component hierarchy would have no model support.
>>>>>>> The user could add model support when needed:
>>>>>>> val form = new Form("hi")
>>>>>>> with HasModel[Int] { var model = new Model(42) }
>>>>>>> Just an Idea.
>>>>>>> STM: There are a number of Scala STM projects and I do not
>>>>>>> know
>>>>>>> if it is useful to add STM capabilities to Scala-Wicket.
>>>>>>> RBAC: I've written a Scala implementation of the NIST RBAC
>>>>>>> recommended standard and might consider adding it.
>>>>>>> Logging: Adding a Scala-based logging framework to aid user
>>>>>>> debugging.
>>>>>>> Monitoring and stats: In the last couple of years many web
>>>>>>> sites have added monitoring and statistics gathering
>>>>>>> capabilities (e.g., who clicks what, where, how long, on
>>>>>>> what page does the visitor exit the web site, etc.) in
>>>>>>> order to know how the web site is being used and then
>>>>>>> improve the web site.
>>>>>>> Significant Memory Usage Reduction: I've an idea that would
>>>>>>> significantly decrease the memory usage of Scala-Wicket
>>>>>>> and
>>>>>>> I plan to do a test implementation.
>>>>>>> Replace Java features: There are still some Java-isms that can
>>>>>>> be replaced with Scala equivalents.
>>>>>>> Port additional Java Wicket libraries to Scala.
>>>>>>> Enable multiple instances of a unit tests to be run at once.
>>>>>>> More: ????????????
>>>>>>>
>>>>>>> I want to avoid using some of the WTF features of Scala (when a
>>>>>>> Java programmer looks at the code and says "WTF") in order to
>>>>>>> ease and accelerate acceptance by Java programmers; as
>>>>>>> examples, implicits can make code hard to understand and
>>>>>>> advanced Scala type usages, as James Gosling said, "makes
>>>>>>> one's
>>>>>>> head spin".
>>>>>>>
>>>>>>>
>>>>>>> Help and Advice: How should Scala-Wicket be extended and released
>>>>>>>
>>>>>>> Scala-Wicket is a port and evolution of Wicket, not a ground-up
>>>>>>> re-write. Given that, what would you do differently in Wicket
>>>>>>> now that there are years of experience using it?
>>>>>>>
>>>>>>> How best to get a hosting site, release the code and build a
>>>>>>> community?
>>>>>>>
>>>>>>>
>>>>>> If you're looking for a place to host it, I'd recommend starting with
>>>>>> Github. Git is where the crowd is headed, and Github is the easiest
>>>>>> place
>>>>>> to get up and running with it these days.
>>>>>>
>>>>>> You mentioned earlier the idea of it being an Apache project. If you
>>>>>> wanted
>>>>>> it to be an Apache project, you would start at the Incubator (
>>>>>> http://incubator.apache.org/). The one barrier you'll have initially
>>>
>>> is
>>>>>>
>>>>>> that Apache favors "community over code"... so it's not a great place
>>>
>>> to
>>>>>>
>>>>>> start a one-man project. Since this is a port of an existing Apache
>>>>>> project, you might have more leniency, but you'd have to build a
>>>>>> community
>>>>>> around the project before you could ever "graduate" from the
>>>>>> incubator.
>>>>>>
>>>>>> Probably Github is your best bet for now. Build a community. Then,
>>>>>> if
>>>>>> your
>>>>>> community is in favor, move to Apache. By that time, ASF might have
>>>
>>> full
>>>>>>
>>>>>> git support.
>>>>>>
>>>>>>
>>>>>> Are there any mechanism to help fund such an open-source project?
>>>>>>>
>>>>>>>
>>>>>> Best bet is to build a community. Of course, if you can find some
>>>>>> company
>>>>>> that wants such a project, you can get monetary support to develop /
>>>>>> maintain. But that seems unlikely in this case with the limited
>>>>>> number
>>>>>> of
>>>>>> companies looking for Scala out there, and especially since this is an
>>>>>> unproven port of a large Java project. So, start by getting folks
>>>>>> like
>>>>>> jWeekend involved - great coders who are already salivating for Scala.
>>>>>> Find
>>>>>> other individuals such as yourself who are interested, and build a
>>>
>>> group
>>>>>>
>>>>>> of
>>>>>> core committers.
>>>>>>
>>>>>>
>>>>>> This is not meant to be a general announcement but rather a means
>>>>>>>
>>>>>>> for me to get some initial advice as to how to proceed.
>>>>>>>
>>>>>>> Any help is appreciated.
>>>>>>>
>>>>>>> Richard Emberson
>>>>>>>
>>>>>>
>>>>>>
>>>>>> I'm impressed. Quite an undertaking.
>>>>>>
>>>>>> --
>>>>>> Jeremy Thomerson
>>>>>> http://wickettraining.com
>>>>>> *Need a CMS for Wicket? Use Brix! http://brixcms.org*
>>>>>>
>>>>>>
>>>>>
>>>> --
>>>> Quis custodiet ipsos custodes
>>>>
>>>
>>
>
> --
> Quis custodiet ipsos custodes
>
Re: Scala-Wicket Help and Advice
Posted by richard emberson <ri...@gmail.com>.
So there is an IDE that you can point at a directory tree and
tell it to convert all of the Java files to Scala files.
Does it do a 100% conversion, 90%, 50% or 10% (on average)?
Do you have a link to a page documenting this feature?
Thanks
Richard
On 01/05/2011 03:04 PM, Gerolf Seitz wrote:
> It's cmd+shift+G (OSX) and it works quite well ;)
>
> On Wed, Jan 5, 2011 at 11:55 PM, Justin Lee<ev...@gmail.com> wrote:
>
>> You can paste a java class into a .scala file and it'll autoconvert.
>> there's a shortcut keystroke, too, but i don't remember what it is.
>>
>> On Wed, Jan 5, 2011 at 10:40 AM, richard emberson<
>> richard.emberson@gmail.com> wrote:
>>
>>> No IDE, I use Vim. Also, my build environment is Ant-based
>>> using scalac and javac.
>>>
>>> Of course, what I was doing was porting from Java to Scala.
>>> To that end I've got some 400 Vim scripts that aid in the
>>> port. For instance,
>>>
>>> :g/final \([a-zA-Z]\+\) \([a-zA-Z]\+\)\[\]\s*=/s//val \2: Array[\1] =/g
>>>
>>> converts
>>> final B a[] =
>>> to
>>> val a: Array[B] =
>>>
>>> I don't know if IDEs provide such scripting with regex support.
>>> Also, with a simple Vim script and key combination, I can be
>>> viewing a ported Scala file and jump to its corresponding source
>>> Java Wicket file - very useful when porting or debugging.
>>> Yea, IDEs can do stuff me and my Vim scripts can not do, but my
>>> fingers know Vim.
>>>
>>> I also built a JUnit driver class in Scala (and Java) that allowed
>>> me to execute a single test method in a given test class by setting
>>> two properties in a file that my Ant script reads. This was vital
>>> for hunting down bugs.
>>>
>>> I looked into the tool that allowed Vim to be the front-end and
>>> Eclipse to run in server mode which allows a Vim user to access
>>> many of the extra features the IDE offers, but, as of a couple of
>>> months ago, there was no Scala support in the tool.
>>>
>>> The father of Scala, Martin Odersky uses Emacs.
>>>
>>> Richard
>>>
>>>
>>>
>>> On 01/05/2011 12:38 AM, Juergen Donnerstag wrote:
>>>
>>>> Cool. May I ask which tools (IDE) you've been using and what your
>>>> experience with these tools has been.
>>>>
>>>> -Juergen
>>>>
>>>> On Wed, Jan 5, 2011 at 2:34 AM, Jeremy Thomerson
>>>> <je...@wickettraining.com> wrote:
>>>>
>>>>> On Tue, Jan 4, 2011 at 5:15 PM, richard emberson<
>>>>> richard.emberson@gmail.com
>>>>>
>>>>>> wrote:
>>>>>>
>>>>>
>>>>> Dev Wicketers,
>>>>>>
>>>>>> What: I have ported Wicket to Scala
>>>>>> A couple of months ago I took a 1.5 snapshot and ported to Scala.
>>>>>> This encompasses all of the source and test code. As successive 1.5
>>>>>> snapshots were released, I ported those differences to my Scala
>>>>>> version. I am current with 1.5 M3.
>>>>>>
>>>>>> The Java 137,791 loc in 1.5 M3 are now 100,077 loc Scala (not
>>>>>> counting all the println statements I put into the Scala code
>>>>>> for debugging). I used cloc (http://cloc.sourceforge.net/) to
>>>>>> count lines of code.
>>>>>>
>>>>>>
>>>>> I haven't used CLOC before. I've used Ohcount (
>>>>> http://www.ohloh.net/p/ohcount) and like it. I'll have to give this a
>>>>> try.
>>>>>
>>>>>
>>>>> I have also replaced all of the Java collection classes with
>>>>>
>>>>>> Scala collection classes (though a small number of Java collection
>>>>>> classes remain that did not have comparable Scala implementations).
>>>>>>
>>>>>> I have changed many method return types from the Java returning
>>>>>> some "object" or "null" to Scala returning "Some(object)" or "None"
>>>>>> (using the Scala Option[return-type] construct) - trying to
>>>>>> eliminate nulls.
>>>>>>
>>>>>> Lastly, I pushed the IModel[T] typing down to the Component class
>>>>>> making get/set DefaultModel and get/set DefaultModelObject strong
>>>>>> typed. This included using Scala companion object apply methods
>>>>>> which eliminated having to explicitly declare type parameters in
>>>>>> most end-user code (I had read that one of the objections to
>>>>>> pushing strong typing down to the Component class in Wicket was
>>>>>> that there were "too many notes", end-user code was too verbose).
>>>>>>
>>>>>> It can not interoperate with Java Wicket because Scala compiles to
>>>>>> JVM class files and so all of the classes in Java Wicket also
>>>>>> appear in Scala-Wicket.
>>>>>>
>>>>>
>>>>>
>>>>> I have an "internal" name for my Scala port of Wicket which
>>>>>> acknowledges its Wicket heritage as well as advertises its
>>>>>> enterprise level capabilities. For external communications,
>>>>>> I am currently simply call it Scala-Wicket.
>>>>>>
>>>>>> Why: Scala is a better Java
>>>>>> I was introduced to Scala 9 months ago and quickly determined that
>>>>>> it was a better Java (at least IMO). For Scala to succeed it
>>>>>> requires more programmers to use it. Many on the Scala mailing
>>>>>> lists were from a functional background and seemed not to recognize
>>>>>> that Haskell and Lisp are not blindingly successful but, rather,
>>>>>> niche languages and that the heavy selling of Scala's function and
>>>>>> typing capabilities might turn off Java programmers.
>>>>>>
>>>>>> Scala struck me in many ways as a strong-typed JavaScript, at
>>>>>> least, much of the code did not have to have type declarations
>>>>>> because the compiler could infer types in many cases. In addition,
>>>>>> a whole lot of the Java boil-plate code was not needed. As such,
>>>>>> it could be sold as simply a better Java; a more-to-the-point
>>>>>> object oriented language with functional programming in-the-small.
>>>>>>
>>>>>> To get more Java programmers to try Scala I looked for a
>>>>>> significant Java application with a strong support and user
>>>>>> community that I could port to Scala. I ended up with Wicket.
>>>>>> Wicket is an enterprise level web framework (unlike existing
>>>>>> Scale web frameworks which place restrictions on enterprise IT
>>>>>> organizations, e.g., by requiring sticky sessions). It is well
>>>>>> documented. And, as it turned out, very, very importantly it had
>>>>>> a large number of unit tests (the unit tests saved my butt,
>>>>>> without them I would never had succeeded in getting a port that
>>>>>> worked).
>>>>>>
>>>>>> No, Really, Why:
>>>>>> I like Scala and I took the time to learn it. Right now about
>>>>>> 20% of programmers use Java while only some 0.4% use Scala.
>>>>>> I did not want my effort of learning Scala to be wasted so my
>>>>>> solution is to increase the number of Scala programmers. Where
>>>>>> to get them? Again, my solution is from the existing horde of
>>>>>> Java programmers.
>>>>>>
>>>>>> Plans: Release, Evolve and Proselytize
>>>>>> I would like to release Scala-Wicket.
>>>>>> I do not know if Apache hosts anything other than Java code.
>>>>>> Growing a community is important.
>>>>>>
>>>>>> Still Todo:
>>>>>> Comments: All of the existing class and inline comments are
>>>>>> still Java related. This would have to be a long, on-going
>>>>>> task to edit the comments so they reflect the code's
>>>>>> Scala usage.
>>>>>> Package path: The code still uses the "org.apache.wicket"
>>>>>> package path and this must be changed - unless this became
>>>>>> an Apache project.
>>>>>> Author: I have quite literally looked at and touched every line
>>>>>> of code but I have not yet felt comfortable with adding
>>>>>> myself as an author since, well, many changes were
>>>>>> syntactic and not semantic.
>>>>>> Refactor with Traits: Currently the port uses Scala traits like
>>>>>> Java interfaces but it should be possible to factor the
>>>>>> common code out into the traits. This would result in many
>>>>>> of the interfaces, the "I" files, such as IModel.scala,
>>>>>> going away.
>>>>>> Some general refactoring:
>>>>>> As an example, consider factoring out the IModel[T] from
>>>>>> Component. Half the time a user wants a Component with
>>>>>> no model, so, if there was a HasModel trait:
>>>>>> class Model[T](var value: T) {
>>>>>> def getObject: T = value
>>>>>> def setObject(value: T): Unit = this.value = value
>>>>>> }
>>>>>> trait HasModel[T] {
>>>>>> var model: Model[T]
>>>>>> def getDefaultModel: IModel[T] = model
>>>>>> def setDefaultModel(model: IModel[T]): this.type = {
>>>>>> ....
>>>>>> this
>>>>>> }
>>>>>> def getDefaultModelObject: Option[T] = {
>>>>>> ....
>>>>>> }
>>>>>> def setDefaultModelObject(obj: T): this.type = {
>>>>>> ....
>>>>>> this
>>>>>> }
>>>>>> }
>>>>>> The Component hierarchy would have no model support.
>>>>>> The user could add model support when needed:
>>>>>> val form = new Form("hi")
>>>>>> with HasModel[Int] { var model = new Model(42) }
>>>>>> Just an Idea.
>>>>>> STM: There are a number of Scala STM projects and I do not know
>>>>>> if it is useful to add STM capabilities to Scala-Wicket.
>>>>>> RBAC: I've written a Scala implementation of the NIST RBAC
>>>>>> recommended standard and might consider adding it.
>>>>>> Logging: Adding a Scala-based logging framework to aid user
>>>>>> debugging.
>>>>>> Monitoring and stats: In the last couple of years many web
>>>>>> sites have added monitoring and statistics gathering
>>>>>> capabilities (e.g., who clicks what, where, how long, on
>>>>>> what page does the visitor exit the web site, etc.) in
>>>>>> order to know how the web site is being used and then
>>>>>> improve the web site.
>>>>>> Significant Memory Usage Reduction: I've an idea that would
>>>>>> significantly decrease the memory usage of Scala-Wicket and
>>>>>> I plan to do a test implementation.
>>>>>> Replace Java features: There are still some Java-isms that can
>>>>>> be replaced with Scala equivalents.
>>>>>> Port additional Java Wicket libraries to Scala.
>>>>>> Enable multiple instances of a unit tests to be run at once.
>>>>>> More: ????????????
>>>>>>
>>>>>> I want to avoid using some of the WTF features of Scala (when a
>>>>>> Java programmer looks at the code and says "WTF") in order to
>>>>>> ease and accelerate acceptance by Java programmers; as
>>>>>> examples, implicits can make code hard to understand and
>>>>>> advanced Scala type usages, as James Gosling said, "makes one's
>>>>>> head spin".
>>>>>>
>>>>>>
>>>>>> Help and Advice: How should Scala-Wicket be extended and released
>>>>>>
>>>>>> Scala-Wicket is a port and evolution of Wicket, not a ground-up
>>>>>> re-write. Given that, what would you do differently in Wicket
>>>>>> now that there are years of experience using it?
>>>>>>
>>>>>> How best to get a hosting site, release the code and build a
>>>>>> community?
>>>>>>
>>>>>>
>>>>> If you're looking for a place to host it, I'd recommend starting with
>>>>> Github. Git is where the crowd is headed, and Github is the easiest
>>>>> place
>>>>> to get up and running with it these days.
>>>>>
>>>>> You mentioned earlier the idea of it being an Apache project. If you
>>>>> wanted
>>>>> it to be an Apache project, you would start at the Incubator (
>>>>> http://incubator.apache.org/). The one barrier you'll have initially
>> is
>>>>> that Apache favors "community over code"... so it's not a great place
>> to
>>>>> start a one-man project. Since this is a port of an existing Apache
>>>>> project, you might have more leniency, but you'd have to build a
>>>>> community
>>>>> around the project before you could ever "graduate" from the incubator.
>>>>>
>>>>> Probably Github is your best bet for now. Build a community. Then, if
>>>>> your
>>>>> community is in favor, move to Apache. By that time, ASF might have
>> full
>>>>> git support.
>>>>>
>>>>>
>>>>> Are there any mechanism to help fund such an open-source project?
>>>>>>
>>>>>>
>>>>> Best bet is to build a community. Of course, if you can find some
>>>>> company
>>>>> that wants such a project, you can get monetary support to develop /
>>>>> maintain. But that seems unlikely in this case with the limited number
>>>>> of
>>>>> companies looking for Scala out there, and especially since this is an
>>>>> unproven port of a large Java project. So, start by getting folks like
>>>>> jWeekend involved - great coders who are already salivating for Scala.
>>>>> Find
>>>>> other individuals such as yourself who are interested, and build a
>> group
>>>>> of
>>>>> core committers.
>>>>>
>>>>>
>>>>> This is not meant to be a general announcement but rather a means
>>>>>> for me to get some initial advice as to how to proceed.
>>>>>>
>>>>>> Any help is appreciated.
>>>>>>
>>>>>> Richard Emberson
>>>>>>
>>>>>
>>>>>
>>>>> I'm impressed. Quite an undertaking.
>>>>>
>>>>> --
>>>>> Jeremy Thomerson
>>>>> http://wickettraining.com
>>>>> *Need a CMS for Wicket? Use Brix! http://brixcms.org*
>>>>>
>>>>>
>>>>
>>> --
>>> Quis custodiet ipsos custodes
>>>
>>
>
--
Quis custodiet ipsos custodes
Re: Scala-Wicket Help and Advice
Posted by Gerolf Seitz <ge...@gmail.com>.
It's cmd+shift+G (OSX) and it works quite well ;)
On Wed, Jan 5, 2011 at 11:55 PM, Justin Lee <ev...@gmail.com> wrote:
> You can paste a java class into a .scala file and it'll autoconvert.
> there's a shortcut keystroke, too, but i don't remember what it is.
>
> On Wed, Jan 5, 2011 at 10:40 AM, richard emberson <
> richard.emberson@gmail.com> wrote:
>
> > No IDE, I use Vim. Also, my build environment is Ant-based
> > using scalac and javac.
> >
> > Of course, what I was doing was porting from Java to Scala.
> > To that end I've got some 400 Vim scripts that aid in the
> > port. For instance,
> >
> > :g/final \([a-zA-Z]\+\) \([a-zA-Z]\+\)\[\]\s*=/s//val \2: Array[\1] =/g
> >
> > converts
> > final B a[] =
> > to
> > val a: Array[B] =
> >
> > I don't know if IDEs provide such scripting with regex support.
> > Also, with a simple Vim script and key combination, I can be
> > viewing a ported Scala file and jump to its corresponding source
> > Java Wicket file - very useful when porting or debugging.
> > Yea, IDEs can do stuff me and my Vim scripts can not do, but my
> > fingers know Vim.
> >
> > I also built a JUnit driver class in Scala (and Java) that allowed
> > me to execute a single test method in a given test class by setting
> > two properties in a file that my Ant script reads. This was vital
> > for hunting down bugs.
> >
> > I looked into the tool that allowed Vim to be the front-end and
> > Eclipse to run in server mode which allows a Vim user to access
> > many of the extra features the IDE offers, but, as of a couple of
> > months ago, there was no Scala support in the tool.
> >
> > The father of Scala, Martin Odersky uses Emacs.
> >
> > Richard
> >
> >
> >
> > On 01/05/2011 12:38 AM, Juergen Donnerstag wrote:
> >
> >> Cool. May I ask which tools (IDE) you've been using and what your
> >> experience with these tools has been.
> >>
> >> -Juergen
> >>
> >> On Wed, Jan 5, 2011 at 2:34 AM, Jeremy Thomerson
> >> <je...@wickettraining.com> wrote:
> >>
> >>> On Tue, Jan 4, 2011 at 5:15 PM, richard emberson<
> >>> richard.emberson@gmail.com
> >>>
> >>>> wrote:
> >>>>
> >>>
> >>> Dev Wicketers,
> >>>>
> >>>> What: I have ported Wicket to Scala
> >>>> A couple of months ago I took a 1.5 snapshot and ported to Scala.
> >>>> This encompasses all of the source and test code. As successive 1.5
> >>>> snapshots were released, I ported those differences to my Scala
> >>>> version. I am current with 1.5 M3.
> >>>>
> >>>> The Java 137,791 loc in 1.5 M3 are now 100,077 loc Scala (not
> >>>> counting all the println statements I put into the Scala code
> >>>> for debugging). I used cloc (http://cloc.sourceforge.net/) to
> >>>> count lines of code.
> >>>>
> >>>>
> >>> I haven't used CLOC before. I've used Ohcount (
> >>> http://www.ohloh.net/p/ohcount) and like it. I'll have to give this a
> >>> try.
> >>>
> >>>
> >>> I have also replaced all of the Java collection classes with
> >>>
> >>>> Scala collection classes (though a small number of Java collection
> >>>> classes remain that did not have comparable Scala implementations).
> >>>>
> >>>> I have changed many method return types from the Java returning
> >>>> some "object" or "null" to Scala returning "Some(object)" or "None"
> >>>> (using the Scala Option[return-type] construct) - trying to
> >>>> eliminate nulls.
> >>>>
> >>>> Lastly, I pushed the IModel[T] typing down to the Component class
> >>>> making get/set DefaultModel and get/set DefaultModelObject strong
> >>>> typed. This included using Scala companion object apply methods
> >>>> which eliminated having to explicitly declare type parameters in
> >>>> most end-user code (I had read that one of the objections to
> >>>> pushing strong typing down to the Component class in Wicket was
> >>>> that there were "too many notes", end-user code was too verbose).
> >>>>
> >>>> It can not interoperate with Java Wicket because Scala compiles to
> >>>> JVM class files and so all of the classes in Java Wicket also
> >>>> appear in Scala-Wicket.
> >>>>
> >>>
> >>>
> >>> I have an "internal" name for my Scala port of Wicket which
> >>>> acknowledges its Wicket heritage as well as advertises its
> >>>> enterprise level capabilities. For external communications,
> >>>> I am currently simply call it Scala-Wicket.
> >>>>
> >>>> Why: Scala is a better Java
> >>>> I was introduced to Scala 9 months ago and quickly determined that
> >>>> it was a better Java (at least IMO). For Scala to succeed it
> >>>> requires more programmers to use it. Many on the Scala mailing
> >>>> lists were from a functional background and seemed not to recognize
> >>>> that Haskell and Lisp are not blindingly successful but, rather,
> >>>> niche languages and that the heavy selling of Scala's function and
> >>>> typing capabilities might turn off Java programmers.
> >>>>
> >>>> Scala struck me in many ways as a strong-typed JavaScript, at
> >>>> least, much of the code did not have to have type declarations
> >>>> because the compiler could infer types in many cases. In addition,
> >>>> a whole lot of the Java boil-plate code was not needed. As such,
> >>>> it could be sold as simply a better Java; a more-to-the-point
> >>>> object oriented language with functional programming in-the-small.
> >>>>
> >>>> To get more Java programmers to try Scala I looked for a
> >>>> significant Java application with a strong support and user
> >>>> community that I could port to Scala. I ended up with Wicket.
> >>>> Wicket is an enterprise level web framework (unlike existing
> >>>> Scale web frameworks which place restrictions on enterprise IT
> >>>> organizations, e.g., by requiring sticky sessions). It is well
> >>>> documented. And, as it turned out, very, very importantly it had
> >>>> a large number of unit tests (the unit tests saved my butt,
> >>>> without them I would never had succeeded in getting a port that
> >>>> worked).
> >>>>
> >>>> No, Really, Why:
> >>>> I like Scala and I took the time to learn it. Right now about
> >>>> 20% of programmers use Java while only some 0.4% use Scala.
> >>>> I did not want my effort of learning Scala to be wasted so my
> >>>> solution is to increase the number of Scala programmers. Where
> >>>> to get them? Again, my solution is from the existing horde of
> >>>> Java programmers.
> >>>>
> >>>> Plans: Release, Evolve and Proselytize
> >>>> I would like to release Scala-Wicket.
> >>>> I do not know if Apache hosts anything other than Java code.
> >>>> Growing a community is important.
> >>>>
> >>>> Still Todo:
> >>>> Comments: All of the existing class and inline comments are
> >>>> still Java related. This would have to be a long, on-going
> >>>> task to edit the comments so they reflect the code's
> >>>> Scala usage.
> >>>> Package path: The code still uses the "org.apache.wicket"
> >>>> package path and this must be changed - unless this became
> >>>> an Apache project.
> >>>> Author: I have quite literally looked at and touched every line
> >>>> of code but I have not yet felt comfortable with adding
> >>>> myself as an author since, well, many changes were
> >>>> syntactic and not semantic.
> >>>> Refactor with Traits: Currently the port uses Scala traits like
> >>>> Java interfaces but it should be possible to factor the
> >>>> common code out into the traits. This would result in many
> >>>> of the interfaces, the "I" files, such as IModel.scala,
> >>>> going away.
> >>>> Some general refactoring:
> >>>> As an example, consider factoring out the IModel[T] from
> >>>> Component. Half the time a user wants a Component with
> >>>> no model, so, if there was a HasModel trait:
> >>>> class Model[T](var value: T) {
> >>>> def getObject: T = value
> >>>> def setObject(value: T): Unit = this.value = value
> >>>> }
> >>>> trait HasModel[T] {
> >>>> var model: Model[T]
> >>>> def getDefaultModel: IModel[T] = model
> >>>> def setDefaultModel(model: IModel[T]): this.type = {
> >>>> ....
> >>>> this
> >>>> }
> >>>> def getDefaultModelObject: Option[T] = {
> >>>> ....
> >>>> }
> >>>> def setDefaultModelObject(obj: T): this.type = {
> >>>> ....
> >>>> this
> >>>> }
> >>>> }
> >>>> The Component hierarchy would have no model support.
> >>>> The user could add model support when needed:
> >>>> val form = new Form("hi")
> >>>> with HasModel[Int] { var model = new Model(42) }
> >>>> Just an Idea.
> >>>> STM: There are a number of Scala STM projects and I do not know
> >>>> if it is useful to add STM capabilities to Scala-Wicket.
> >>>> RBAC: I've written a Scala implementation of the NIST RBAC
> >>>> recommended standard and might consider adding it.
> >>>> Logging: Adding a Scala-based logging framework to aid user
> >>>> debugging.
> >>>> Monitoring and stats: In the last couple of years many web
> >>>> sites have added monitoring and statistics gathering
> >>>> capabilities (e.g., who clicks what, where, how long, on
> >>>> what page does the visitor exit the web site, etc.) in
> >>>> order to know how the web site is being used and then
> >>>> improve the web site.
> >>>> Significant Memory Usage Reduction: I've an idea that would
> >>>> significantly decrease the memory usage of Scala-Wicket and
> >>>> I plan to do a test implementation.
> >>>> Replace Java features: There are still some Java-isms that can
> >>>> be replaced with Scala equivalents.
> >>>> Port additional Java Wicket libraries to Scala.
> >>>> Enable multiple instances of a unit tests to be run at once.
> >>>> More: ????????????
> >>>>
> >>>> I want to avoid using some of the WTF features of Scala (when a
> >>>> Java programmer looks at the code and says "WTF") in order to
> >>>> ease and accelerate acceptance by Java programmers; as
> >>>> examples, implicits can make code hard to understand and
> >>>> advanced Scala type usages, as James Gosling said, "makes one's
> >>>> head spin".
> >>>>
> >>>>
> >>>> Help and Advice: How should Scala-Wicket be extended and released
> >>>>
> >>>> Scala-Wicket is a port and evolution of Wicket, not a ground-up
> >>>> re-write. Given that, what would you do differently in Wicket
> >>>> now that there are years of experience using it?
> >>>>
> >>>> How best to get a hosting site, release the code and build a
> >>>> community?
> >>>>
> >>>>
> >>> If you're looking for a place to host it, I'd recommend starting with
> >>> Github. Git is where the crowd is headed, and Github is the easiest
> >>> place
> >>> to get up and running with it these days.
> >>>
> >>> You mentioned earlier the idea of it being an Apache project. If you
> >>> wanted
> >>> it to be an Apache project, you would start at the Incubator (
> >>> http://incubator.apache.org/). The one barrier you'll have initially
> is
> >>> that Apache favors "community over code"... so it's not a great place
> to
> >>> start a one-man project. Since this is a port of an existing Apache
> >>> project, you might have more leniency, but you'd have to build a
> >>> community
> >>> around the project before you could ever "graduate" from the incubator.
> >>>
> >>> Probably Github is your best bet for now. Build a community. Then, if
> >>> your
> >>> community is in favor, move to Apache. By that time, ASF might have
> full
> >>> git support.
> >>>
> >>>
> >>> Are there any mechanism to help fund such an open-source project?
> >>>>
> >>>>
> >>> Best bet is to build a community. Of course, if you can find some
> >>> company
> >>> that wants such a project, you can get monetary support to develop /
> >>> maintain. But that seems unlikely in this case with the limited number
> >>> of
> >>> companies looking for Scala out there, and especially since this is an
> >>> unproven port of a large Java project. So, start by getting folks like
> >>> jWeekend involved - great coders who are already salivating for Scala.
> >>> Find
> >>> other individuals such as yourself who are interested, and build a
> group
> >>> of
> >>> core committers.
> >>>
> >>>
> >>> This is not meant to be a general announcement but rather a means
> >>>> for me to get some initial advice as to how to proceed.
> >>>>
> >>>> Any help is appreciated.
> >>>>
> >>>> Richard Emberson
> >>>>
> >>>
> >>>
> >>> I'm impressed. Quite an undertaking.
> >>>
> >>> --
> >>> Jeremy Thomerson
> >>> http://wickettraining.com
> >>> *Need a CMS for Wicket? Use Brix! http://brixcms.org*
> >>>
> >>>
> >>
> > --
> > Quis custodiet ipsos custodes
> >
>
Re: Scala-Wicket Help and Advice
Posted by Justin Lee <ev...@gmail.com>.
You can paste a java class into a .scala file and it'll autoconvert.
there's a shortcut keystroke, too, but i don't remember what it is.
On Wed, Jan 5, 2011 at 10:40 AM, richard emberson <
richard.emberson@gmail.com> wrote:
> No IDE, I use Vim. Also, my build environment is Ant-based
> using scalac and javac.
>
> Of course, what I was doing was porting from Java to Scala.
> To that end I've got some 400 Vim scripts that aid in the
> port. For instance,
>
> :g/final \([a-zA-Z]\+\) \([a-zA-Z]\+\)\[\]\s*=/s//val \2: Array[\1] =/g
>
> converts
> final B a[] =
> to
> val a: Array[B] =
>
> I don't know if IDEs provide such scripting with regex support.
> Also, with a simple Vim script and key combination, I can be
> viewing a ported Scala file and jump to its corresponding source
> Java Wicket file - very useful when porting or debugging.
> Yea, IDEs can do stuff me and my Vim scripts can not do, but my
> fingers know Vim.
>
> I also built a JUnit driver class in Scala (and Java) that allowed
> me to execute a single test method in a given test class by setting
> two properties in a file that my Ant script reads. This was vital
> for hunting down bugs.
>
> I looked into the tool that allowed Vim to be the front-end and
> Eclipse to run in server mode which allows a Vim user to access
> many of the extra features the IDE offers, but, as of a couple of
> months ago, there was no Scala support in the tool.
>
> The father of Scala, Martin Odersky uses Emacs.
>
> Richard
>
>
>
> On 01/05/2011 12:38 AM, Juergen Donnerstag wrote:
>
>> Cool. May I ask which tools (IDE) you've been using and what your
>> experience with these tools has been.
>>
>> -Juergen
>>
>> On Wed, Jan 5, 2011 at 2:34 AM, Jeremy Thomerson
>> <je...@wickettraining.com> wrote:
>>
>>> On Tue, Jan 4, 2011 at 5:15 PM, richard emberson<
>>> richard.emberson@gmail.com
>>>
>>>> wrote:
>>>>
>>>
>>> Dev Wicketers,
>>>>
>>>> What: I have ported Wicket to Scala
>>>> A couple of months ago I took a 1.5 snapshot and ported to Scala.
>>>> This encompasses all of the source and test code. As successive 1.5
>>>> snapshots were released, I ported those differences to my Scala
>>>> version. I am current with 1.5 M3.
>>>>
>>>> The Java 137,791 loc in 1.5 M3 are now 100,077 loc Scala (not
>>>> counting all the println statements I put into the Scala code
>>>> for debugging). I used cloc (http://cloc.sourceforge.net/) to
>>>> count lines of code.
>>>>
>>>>
>>> I haven't used CLOC before. I've used Ohcount (
>>> http://www.ohloh.net/p/ohcount) and like it. I'll have to give this a
>>> try.
>>>
>>>
>>> I have also replaced all of the Java collection classes with
>>>
>>>> Scala collection classes (though a small number of Java collection
>>>> classes remain that did not have comparable Scala implementations).
>>>>
>>>> I have changed many method return types from the Java returning
>>>> some "object" or "null" to Scala returning "Some(object)" or "None"
>>>> (using the Scala Option[return-type] construct) - trying to
>>>> eliminate nulls.
>>>>
>>>> Lastly, I pushed the IModel[T] typing down to the Component class
>>>> making get/set DefaultModel and get/set DefaultModelObject strong
>>>> typed. This included using Scala companion object apply methods
>>>> which eliminated having to explicitly declare type parameters in
>>>> most end-user code (I had read that one of the objections to
>>>> pushing strong typing down to the Component class in Wicket was
>>>> that there were "too many notes", end-user code was too verbose).
>>>>
>>>> It can not interoperate with Java Wicket because Scala compiles to
>>>> JVM class files and so all of the classes in Java Wicket also
>>>> appear in Scala-Wicket.
>>>>
>>>
>>>
>>> I have an "internal" name for my Scala port of Wicket which
>>>> acknowledges its Wicket heritage as well as advertises its
>>>> enterprise level capabilities. For external communications,
>>>> I am currently simply call it Scala-Wicket.
>>>>
>>>> Why: Scala is a better Java
>>>> I was introduced to Scala 9 months ago and quickly determined that
>>>> it was a better Java (at least IMO). For Scala to succeed it
>>>> requires more programmers to use it. Many on the Scala mailing
>>>> lists were from a functional background and seemed not to recognize
>>>> that Haskell and Lisp are not blindingly successful but, rather,
>>>> niche languages and that the heavy selling of Scala's function and
>>>> typing capabilities might turn off Java programmers.
>>>>
>>>> Scala struck me in many ways as a strong-typed JavaScript, at
>>>> least, much of the code did not have to have type declarations
>>>> because the compiler could infer types in many cases. In addition,
>>>> a whole lot of the Java boil-plate code was not needed. As such,
>>>> it could be sold as simply a better Java; a more-to-the-point
>>>> object oriented language with functional programming in-the-small.
>>>>
>>>> To get more Java programmers to try Scala I looked for a
>>>> significant Java application with a strong support and user
>>>> community that I could port to Scala. I ended up with Wicket.
>>>> Wicket is an enterprise level web framework (unlike existing
>>>> Scale web frameworks which place restrictions on enterprise IT
>>>> organizations, e.g., by requiring sticky sessions). It is well
>>>> documented. And, as it turned out, very, very importantly it had
>>>> a large number of unit tests (the unit tests saved my butt,
>>>> without them I would never had succeeded in getting a port that
>>>> worked).
>>>>
>>>> No, Really, Why:
>>>> I like Scala and I took the time to learn it. Right now about
>>>> 20% of programmers use Java while only some 0.4% use Scala.
>>>> I did not want my effort of learning Scala to be wasted so my
>>>> solution is to increase the number of Scala programmers. Where
>>>> to get them? Again, my solution is from the existing horde of
>>>> Java programmers.
>>>>
>>>> Plans: Release, Evolve and Proselytize
>>>> I would like to release Scala-Wicket.
>>>> I do not know if Apache hosts anything other than Java code.
>>>> Growing a community is important.
>>>>
>>>> Still Todo:
>>>> Comments: All of the existing class and inline comments are
>>>> still Java related. This would have to be a long, on-going
>>>> task to edit the comments so they reflect the code's
>>>> Scala usage.
>>>> Package path: The code still uses the "org.apache.wicket"
>>>> package path and this must be changed - unless this became
>>>> an Apache project.
>>>> Author: I have quite literally looked at and touched every line
>>>> of code but I have not yet felt comfortable with adding
>>>> myself as an author since, well, many changes were
>>>> syntactic and not semantic.
>>>> Refactor with Traits: Currently the port uses Scala traits like
>>>> Java interfaces but it should be possible to factor the
>>>> common code out into the traits. This would result in many
>>>> of the interfaces, the "I" files, such as IModel.scala,
>>>> going away.
>>>> Some general refactoring:
>>>> As an example, consider factoring out the IModel[T] from
>>>> Component. Half the time a user wants a Component with
>>>> no model, so, if there was a HasModel trait:
>>>> class Model[T](var value: T) {
>>>> def getObject: T = value
>>>> def setObject(value: T): Unit = this.value = value
>>>> }
>>>> trait HasModel[T] {
>>>> var model: Model[T]
>>>> def getDefaultModel: IModel[T] = model
>>>> def setDefaultModel(model: IModel[T]): this.type = {
>>>> ....
>>>> this
>>>> }
>>>> def getDefaultModelObject: Option[T] = {
>>>> ....
>>>> }
>>>> def setDefaultModelObject(obj: T): this.type = {
>>>> ....
>>>> this
>>>> }
>>>> }
>>>> The Component hierarchy would have no model support.
>>>> The user could add model support when needed:
>>>> val form = new Form("hi")
>>>> with HasModel[Int] { var model = new Model(42) }
>>>> Just an Idea.
>>>> STM: There are a number of Scala STM projects and I do not know
>>>> if it is useful to add STM capabilities to Scala-Wicket.
>>>> RBAC: I've written a Scala implementation of the NIST RBAC
>>>> recommended standard and might consider adding it.
>>>> Logging: Adding a Scala-based logging framework to aid user
>>>> debugging.
>>>> Monitoring and stats: In the last couple of years many web
>>>> sites have added monitoring and statistics gathering
>>>> capabilities (e.g., who clicks what, where, how long, on
>>>> what page does the visitor exit the web site, etc.) in
>>>> order to know how the web site is being used and then
>>>> improve the web site.
>>>> Significant Memory Usage Reduction: I've an idea that would
>>>> significantly decrease the memory usage of Scala-Wicket and
>>>> I plan to do a test implementation.
>>>> Replace Java features: There are still some Java-isms that can
>>>> be replaced with Scala equivalents.
>>>> Port additional Java Wicket libraries to Scala.
>>>> Enable multiple instances of a unit tests to be run at once.
>>>> More: ????????????
>>>>
>>>> I want to avoid using some of the WTF features of Scala (when a
>>>> Java programmer looks at the code and says "WTF") in order to
>>>> ease and accelerate acceptance by Java programmers; as
>>>> examples, implicits can make code hard to understand and
>>>> advanced Scala type usages, as James Gosling said, "makes one's
>>>> head spin".
>>>>
>>>>
>>>> Help and Advice: How should Scala-Wicket be extended and released
>>>>
>>>> Scala-Wicket is a port and evolution of Wicket, not a ground-up
>>>> re-write. Given that, what would you do differently in Wicket
>>>> now that there are years of experience using it?
>>>>
>>>> How best to get a hosting site, release the code and build a
>>>> community?
>>>>
>>>>
>>> If you're looking for a place to host it, I'd recommend starting with
>>> Github. Git is where the crowd is headed, and Github is the easiest
>>> place
>>> to get up and running with it these days.
>>>
>>> You mentioned earlier the idea of it being an Apache project. If you
>>> wanted
>>> it to be an Apache project, you would start at the Incubator (
>>> http://incubator.apache.org/). The one barrier you'll have initially is
>>> that Apache favors "community over code"... so it's not a great place to
>>> start a one-man project. Since this is a port of an existing Apache
>>> project, you might have more leniency, but you'd have to build a
>>> community
>>> around the project before you could ever "graduate" from the incubator.
>>>
>>> Probably Github is your best bet for now. Build a community. Then, if
>>> your
>>> community is in favor, move to Apache. By that time, ASF might have full
>>> git support.
>>>
>>>
>>> Are there any mechanism to help fund such an open-source project?
>>>>
>>>>
>>> Best bet is to build a community. Of course, if you can find some
>>> company
>>> that wants such a project, you can get monetary support to develop /
>>> maintain. But that seems unlikely in this case with the limited number
>>> of
>>> companies looking for Scala out there, and especially since this is an
>>> unproven port of a large Java project. So, start by getting folks like
>>> jWeekend involved - great coders who are already salivating for Scala.
>>> Find
>>> other individuals such as yourself who are interested, and build a group
>>> of
>>> core committers.
>>>
>>>
>>> This is not meant to be a general announcement but rather a means
>>>> for me to get some initial advice as to how to proceed.
>>>>
>>>> Any help is appreciated.
>>>>
>>>> Richard Emberson
>>>>
>>>
>>>
>>> I'm impressed. Quite an undertaking.
>>>
>>> --
>>> Jeremy Thomerson
>>> http://wickettraining.com
>>> *Need a CMS for Wicket? Use Brix! http://brixcms.org*
>>>
>>>
>>
> --
> Quis custodiet ipsos custodes
>
Re: Scala-Wicket Help and Advice
Posted by richard emberson <ri...@gmail.com>.
No IDE, I use Vim. Also, my build environment is Ant-based
using scalac and javac.
Of course, what I was doing was porting from Java to Scala.
To that end I've got some 400 Vim scripts that aid in the
port. For instance,
:g/final \([a-zA-Z]\+\) \([a-zA-Z]\+\)\[\]\s*=/s//val \2: Array[\1] =/g
converts
final B a[] =
to
val a: Array[B] =
I don't know if IDEs provide such scripting with regex support.
Also, with a simple Vim script and key combination, I can be
viewing a ported Scala file and jump to its corresponding source
Java Wicket file - very useful when porting or debugging.
Yea, IDEs can do stuff me and my Vim scripts can not do, but my
fingers know Vim.
I also built a JUnit driver class in Scala (and Java) that allowed
me to execute a single test method in a given test class by setting
two properties in a file that my Ant script reads. This was vital
for hunting down bugs.
I looked into the tool that allowed Vim to be the front-end and
Eclipse to run in server mode which allows a Vim user to access
many of the extra features the IDE offers, but, as of a couple of
months ago, there was no Scala support in the tool.
The father of Scala, Martin Odersky uses Emacs.
Richard
On 01/05/2011 12:38 AM, Juergen Donnerstag wrote:
> Cool. May I ask which tools (IDE) you've been using and what your
> experience with these tools has been.
>
> -Juergen
>
> On Wed, Jan 5, 2011 at 2:34 AM, Jeremy Thomerson
> <je...@wickettraining.com> wrote:
>> On Tue, Jan 4, 2011 at 5:15 PM, richard emberson<richard.emberson@gmail.com
>>> wrote:
>>
>>> Dev Wicketers,
>>>
>>> What: I have ported Wicket to Scala
>>> A couple of months ago I took a 1.5 snapshot and ported to Scala.
>>> This encompasses all of the source and test code. As successive 1.5
>>> snapshots were released, I ported those differences to my Scala
>>> version. I am current with 1.5 M3.
>>>
>>> The Java 137,791 loc in 1.5 M3 are now 100,077 loc Scala (not
>>> counting all the println statements I put into the Scala code
>>> for debugging). I used cloc (http://cloc.sourceforge.net/) to
>>> count lines of code.
>>>
>>
>> I haven't used CLOC before. I've used Ohcount (
>> http://www.ohloh.net/p/ohcount) and like it. I'll have to give this a try.
>>
>>
>> I have also replaced all of the Java collection classes with
>>> Scala collection classes (though a small number of Java collection
>>> classes remain that did not have comparable Scala implementations).
>>>
>>> I have changed many method return types from the Java returning
>>> some "object" or "null" to Scala returning "Some(object)" or "None"
>>> (using the Scala Option[return-type] construct) - trying to
>>> eliminate nulls.
>>>
>>> Lastly, I pushed the IModel[T] typing down to the Component class
>>> making get/set DefaultModel and get/set DefaultModelObject strong
>>> typed. This included using Scala companion object apply methods
>>> which eliminated having to explicitly declare type parameters in
>>> most end-user code (I had read that one of the objections to
>>> pushing strong typing down to the Component class in Wicket was
>>> that there were "too many notes", end-user code was too verbose).
>>>
>>> It can not interoperate with Java Wicket because Scala compiles to
>>> JVM class files and so all of the classes in Java Wicket also
>>> appear in Scala-Wicket.
>>
>>
>>> I have an "internal" name for my Scala port of Wicket which
>>> acknowledges its Wicket heritage as well as advertises its
>>> enterprise level capabilities. For external communications,
>>> I am currently simply call it Scala-Wicket.
>>>
>>> Why: Scala is a better Java
>>> I was introduced to Scala 9 months ago and quickly determined that
>>> it was a better Java (at least IMO). For Scala to succeed it
>>> requires more programmers to use it. Many on the Scala mailing
>>> lists were from a functional background and seemed not to recognize
>>> that Haskell and Lisp are not blindingly successful but, rather,
>>> niche languages and that the heavy selling of Scala's function and
>>> typing capabilities might turn off Java programmers.
>>>
>>> Scala struck me in many ways as a strong-typed JavaScript, at
>>> least, much of the code did not have to have type declarations
>>> because the compiler could infer types in many cases. In addition,
>>> a whole lot of the Java boil-plate code was not needed. As such,
>>> it could be sold as simply a better Java; a more-to-the-point
>>> object oriented language with functional programming in-the-small.
>>>
>>> To get more Java programmers to try Scala I looked for a
>>> significant Java application with a strong support and user
>>> community that I could port to Scala. I ended up with Wicket.
>>> Wicket is an enterprise level web framework (unlike existing
>>> Scale web frameworks which place restrictions on enterprise IT
>>> organizations, e.g., by requiring sticky sessions). It is well
>>> documented. And, as it turned out, very, very importantly it had
>>> a large number of unit tests (the unit tests saved my butt,
>>> without them I would never had succeeded in getting a port that
>>> worked).
>>>
>>> No, Really, Why:
>>> I like Scala and I took the time to learn it. Right now about
>>> 20% of programmers use Java while only some 0.4% use Scala.
>>> I did not want my effort of learning Scala to be wasted so my
>>> solution is to increase the number of Scala programmers. Where
>>> to get them? Again, my solution is from the existing horde of
>>> Java programmers.
>>>
>>> Plans: Release, Evolve and Proselytize
>>> I would like to release Scala-Wicket.
>>> I do not know if Apache hosts anything other than Java code.
>>> Growing a community is important.
>>>
>>> Still Todo:
>>> Comments: All of the existing class and inline comments are
>>> still Java related. This would have to be a long, on-going
>>> task to edit the comments so they reflect the code's
>>> Scala usage.
>>> Package path: The code still uses the "org.apache.wicket"
>>> package path and this must be changed - unless this became
>>> an Apache project.
>>> Author: I have quite literally looked at and touched every line
>>> of code but I have not yet felt comfortable with adding
>>> myself as an author since, well, many changes were
>>> syntactic and not semantic.
>>> Refactor with Traits: Currently the port uses Scala traits like
>>> Java interfaces but it should be possible to factor the
>>> common code out into the traits. This would result in many
>>> of the interfaces, the "I" files, such as IModel.scala,
>>> going away.
>>> Some general refactoring:
>>> As an example, consider factoring out the IModel[T] from
>>> Component. Half the time a user wants a Component with
>>> no model, so, if there was a HasModel trait:
>>> class Model[T](var value: T) {
>>> def getObject: T = value
>>> def setObject(value: T): Unit = this.value = value
>>> }
>>> trait HasModel[T] {
>>> var model: Model[T]
>>> def getDefaultModel: IModel[T] = model
>>> def setDefaultModel(model: IModel[T]): this.type = {
>>> ....
>>> this
>>> }
>>> def getDefaultModelObject: Option[T] = {
>>> ....
>>> }
>>> def setDefaultModelObject(obj: T): this.type = {
>>> ....
>>> this
>>> }
>>> }
>>> The Component hierarchy would have no model support.
>>> The user could add model support when needed:
>>> val form = new Form("hi")
>>> with HasModel[Int] { var model = new Model(42) }
>>> Just an Idea.
>>> STM: There are a number of Scala STM projects and I do not know
>>> if it is useful to add STM capabilities to Scala-Wicket.
>>> RBAC: I've written a Scala implementation of the NIST RBAC
>>> recommended standard and might consider adding it.
>>> Logging: Adding a Scala-based logging framework to aid user
>>> debugging.
>>> Monitoring and stats: In the last couple of years many web
>>> sites have added monitoring and statistics gathering
>>> capabilities (e.g., who clicks what, where, how long, on
>>> what page does the visitor exit the web site, etc.) in
>>> order to know how the web site is being used and then
>>> improve the web site.
>>> Significant Memory Usage Reduction: I've an idea that would
>>> significantly decrease the memory usage of Scala-Wicket and
>>> I plan to do a test implementation.
>>> Replace Java features: There are still some Java-isms that can
>>> be replaced with Scala equivalents.
>>> Port additional Java Wicket libraries to Scala.
>>> Enable multiple instances of a unit tests to be run at once.
>>> More: ????????????
>>>
>>> I want to avoid using some of the WTF features of Scala (when a
>>> Java programmer looks at the code and says "WTF") in order to
>>> ease and accelerate acceptance by Java programmers; as
>>> examples, implicits can make code hard to understand and
>>> advanced Scala type usages, as James Gosling said, "makes one's
>>> head spin".
>>>
>>>
>>> Help and Advice: How should Scala-Wicket be extended and released
>>>
>>> Scala-Wicket is a port and evolution of Wicket, not a ground-up
>>> re-write. Given that, what would you do differently in Wicket
>>> now that there are years of experience using it?
>>>
>>> How best to get a hosting site, release the code and build a
>>> community?
>>>
>>
>> If you're looking for a place to host it, I'd recommend starting with
>> Github. Git is where the crowd is headed, and Github is the easiest place
>> to get up and running with it these days.
>>
>> You mentioned earlier the idea of it being an Apache project. If you wanted
>> it to be an Apache project, you would start at the Incubator (
>> http://incubator.apache.org/). The one barrier you'll have initially is
>> that Apache favors "community over code"... so it's not a great place to
>> start a one-man project. Since this is a port of an existing Apache
>> project, you might have more leniency, but you'd have to build a community
>> around the project before you could ever "graduate" from the incubator.
>>
>> Probably Github is your best bet for now. Build a community. Then, if your
>> community is in favor, move to Apache. By that time, ASF might have full
>> git support.
>>
>>
>>> Are there any mechanism to help fund such an open-source project?
>>>
>>
>> Best bet is to build a community. Of course, if you can find some company
>> that wants such a project, you can get monetary support to develop /
>> maintain. But that seems unlikely in this case with the limited number of
>> companies looking for Scala out there, and especially since this is an
>> unproven port of a large Java project. So, start by getting folks like
>> jWeekend involved - great coders who are already salivating for Scala. Find
>> other individuals such as yourself who are interested, and build a group of
>> core committers.
>>
>>
>>> This is not meant to be a general announcement but rather a means
>>> for me to get some initial advice as to how to proceed.
>>>
>>> Any help is appreciated.
>>>
>>> Richard Emberson
>>
>>
>> I'm impressed. Quite an undertaking.
>>
>> --
>> Jeremy Thomerson
>> http://wickettraining.com
>> *Need a CMS for Wicket? Use Brix! http://brixcms.org*
>>
>
--
Quis custodiet ipsos custodes
Re: Scala-Wicket Help and Advice
Posted by Juergen Donnerstag <ju...@gmail.com>.
Cool. May I ask which tools (IDE) you've been using and what your
experience with these tools has been.
-Juergen
On Wed, Jan 5, 2011 at 2:34 AM, Jeremy Thomerson
<je...@wickettraining.com> wrote:
> On Tue, Jan 4, 2011 at 5:15 PM, richard emberson <richard.emberson@gmail.com
>> wrote:
>
>> Dev Wicketers,
>>
>> What: I have ported Wicket to Scala
>> A couple of months ago I took a 1.5 snapshot and ported to Scala.
>> This encompasses all of the source and test code. As successive 1.5
>> snapshots were released, I ported those differences to my Scala
>> version. I am current with 1.5 M3.
>>
>> The Java 137,791 loc in 1.5 M3 are now 100,077 loc Scala (not
>> counting all the println statements I put into the Scala code
>> for debugging). I used cloc (http://cloc.sourceforge.net/) to
>> count lines of code.
>>
>
> I haven't used CLOC before. I've used Ohcount (
> http://www.ohloh.net/p/ohcount) and like it. I'll have to give this a try.
>
>
> I have also replaced all of the Java collection classes with
>> Scala collection classes (though a small number of Java collection
>> classes remain that did not have comparable Scala implementations).
>>
>> I have changed many method return types from the Java returning
>> some "object" or "null" to Scala returning "Some(object)" or "None"
>> (using the Scala Option[return-type] construct) - trying to
>> eliminate nulls.
>>
>> Lastly, I pushed the IModel[T] typing down to the Component class
>> making get/set DefaultModel and get/set DefaultModelObject strong
>> typed. This included using Scala companion object apply methods
>> which eliminated having to explicitly declare type parameters in
>> most end-user code (I had read that one of the objections to
>> pushing strong typing down to the Component class in Wicket was
>> that there were "too many notes", end-user code was too verbose).
>>
>> It can not interoperate with Java Wicket because Scala compiles to
>> JVM class files and so all of the classes in Java Wicket also
>> appear in Scala-Wicket.
>
>
>> I have an "internal" name for my Scala port of Wicket which
>> acknowledges its Wicket heritage as well as advertises its
>> enterprise level capabilities. For external communications,
>> I am currently simply call it Scala-Wicket.
>>
>> Why: Scala is a better Java
>> I was introduced to Scala 9 months ago and quickly determined that
>> it was a better Java (at least IMO). For Scala to succeed it
>> requires more programmers to use it. Many on the Scala mailing
>> lists were from a functional background and seemed not to recognize
>> that Haskell and Lisp are not blindingly successful but, rather,
>> niche languages and that the heavy selling of Scala's function and
>> typing capabilities might turn off Java programmers.
>>
>> Scala struck me in many ways as a strong-typed JavaScript, at
>> least, much of the code did not have to have type declarations
>> because the compiler could infer types in many cases. In addition,
>> a whole lot of the Java boil-plate code was not needed. As such,
>> it could be sold as simply a better Java; a more-to-the-point
>> object oriented language with functional programming in-the-small.
>>
>> To get more Java programmers to try Scala I looked for a
>> significant Java application with a strong support and user
>> community that I could port to Scala. I ended up with Wicket.
>> Wicket is an enterprise level web framework (unlike existing
>> Scale web frameworks which place restrictions on enterprise IT
>> organizations, e.g., by requiring sticky sessions). It is well
>> documented. And, as it turned out, very, very importantly it had
>> a large number of unit tests (the unit tests saved my butt,
>> without them I would never had succeeded in getting a port that
>> worked).
>>
>> No, Really, Why:
>> I like Scala and I took the time to learn it. Right now about
>> 20% of programmers use Java while only some 0.4% use Scala.
>> I did not want my effort of learning Scala to be wasted so my
>> solution is to increase the number of Scala programmers. Where
>> to get them? Again, my solution is from the existing horde of
>> Java programmers.
>>
>> Plans: Release, Evolve and Proselytize
>> I would like to release Scala-Wicket.
>> I do not know if Apache hosts anything other than Java code.
>> Growing a community is important.
>>
>> Still Todo:
>> Comments: All of the existing class and inline comments are
>> still Java related. This would have to be a long, on-going
>> task to edit the comments so they reflect the code's
>> Scala usage.
>> Package path: The code still uses the "org.apache.wicket"
>> package path and this must be changed - unless this became
>> an Apache project.
>> Author: I have quite literally looked at and touched every line
>> of code but I have not yet felt comfortable with adding
>> myself as an author since, well, many changes were
>> syntactic and not semantic.
>> Refactor with Traits: Currently the port uses Scala traits like
>> Java interfaces but it should be possible to factor the
>> common code out into the traits. This would result in many
>> of the interfaces, the "I" files, such as IModel.scala,
>> going away.
>> Some general refactoring:
>> As an example, consider factoring out the IModel[T] from
>> Component. Half the time a user wants a Component with
>> no model, so, if there was a HasModel trait:
>> class Model[T](var value: T) {
>> def getObject: T = value
>> def setObject(value: T): Unit = this.value = value
>> }
>> trait HasModel[T] {
>> var model: Model[T]
>> def getDefaultModel: IModel[T] = model
>> def setDefaultModel(model: IModel[T]): this.type = {
>> ....
>> this
>> }
>> def getDefaultModelObject: Option[T] = {
>> ....
>> }
>> def setDefaultModelObject(obj: T): this.type = {
>> ....
>> this
>> }
>> }
>> The Component hierarchy would have no model support.
>> The user could add model support when needed:
>> val form = new Form("hi")
>> with HasModel[Int] { var model = new Model(42) }
>> Just an Idea.
>> STM: There are a number of Scala STM projects and I do not know
>> if it is useful to add STM capabilities to Scala-Wicket.
>> RBAC: I've written a Scala implementation of the NIST RBAC
>> recommended standard and might consider adding it.
>> Logging: Adding a Scala-based logging framework to aid user
>> debugging.
>> Monitoring and stats: In the last couple of years many web
>> sites have added monitoring and statistics gathering
>> capabilities (e.g., who clicks what, where, how long, on
>> what page does the visitor exit the web site, etc.) in
>> order to know how the web site is being used and then
>> improve the web site.
>> Significant Memory Usage Reduction: I've an idea that would
>> significantly decrease the memory usage of Scala-Wicket and
>> I plan to do a test implementation.
>> Replace Java features: There are still some Java-isms that can
>> be replaced with Scala equivalents.
>> Port additional Java Wicket libraries to Scala.
>> Enable multiple instances of a unit tests to be run at once.
>> More: ????????????
>>
>> I want to avoid using some of the WTF features of Scala (when a
>> Java programmer looks at the code and says "WTF") in order to
>> ease and accelerate acceptance by Java programmers; as
>> examples, implicits can make code hard to understand and
>> advanced Scala type usages, as James Gosling said, "makes one's
>> head spin".
>>
>>
>> Help and Advice: How should Scala-Wicket be extended and released
>>
>> Scala-Wicket is a port and evolution of Wicket, not a ground-up
>> re-write. Given that, what would you do differently in Wicket
>> now that there are years of experience using it?
>>
>> How best to get a hosting site, release the code and build a
>> community?
>>
>
> If you're looking for a place to host it, I'd recommend starting with
> Github. Git is where the crowd is headed, and Github is the easiest place
> to get up and running with it these days.
>
> You mentioned earlier the idea of it being an Apache project. If you wanted
> it to be an Apache project, you would start at the Incubator (
> http://incubator.apache.org/). The one barrier you'll have initially is
> that Apache favors "community over code"... so it's not a great place to
> start a one-man project. Since this is a port of an existing Apache
> project, you might have more leniency, but you'd have to build a community
> around the project before you could ever "graduate" from the incubator.
>
> Probably Github is your best bet for now. Build a community. Then, if your
> community is in favor, move to Apache. By that time, ASF might have full
> git support.
>
>
>> Are there any mechanism to help fund such an open-source project?
>>
>
> Best bet is to build a community. Of course, if you can find some company
> that wants such a project, you can get monetary support to develop /
> maintain. But that seems unlikely in this case with the limited number of
> companies looking for Scala out there, and especially since this is an
> unproven port of a large Java project. So, start by getting folks like
> jWeekend involved - great coders who are already salivating for Scala. Find
> other individuals such as yourself who are interested, and build a group of
> core committers.
>
>
>> This is not meant to be a general announcement but rather a means
>> for me to get some initial advice as to how to proceed.
>>
>> Any help is appreciated.
>>
>> Richard Emberson
>
>
> I'm impressed. Quite an undertaking.
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket? Use Brix! http://brixcms.org*
>
Re: Scala-Wicket Help and Advice
Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Tue, Jan 4, 2011 at 5:15 PM, richard emberson <richard.emberson@gmail.com
> wrote:
> Dev Wicketers,
>
> What: I have ported Wicket to Scala
> A couple of months ago I took a 1.5 snapshot and ported to Scala.
> This encompasses all of the source and test code. As successive 1.5
> snapshots were released, I ported those differences to my Scala
> version. I am current with 1.5 M3.
>
> The Java 137,791 loc in 1.5 M3 are now 100,077 loc Scala (not
> counting all the println statements I put into the Scala code
> for debugging). I used cloc (http://cloc.sourceforge.net/) to
> count lines of code.
>
I haven't used CLOC before. I've used Ohcount (
http://www.ohloh.net/p/ohcount) and like it. I'll have to give this a try.
I have also replaced all of the Java collection classes with
> Scala collection classes (though a small number of Java collection
> classes remain that did not have comparable Scala implementations).
>
> I have changed many method return types from the Java returning
> some "object" or "null" to Scala returning "Some(object)" or "None"
> (using the Scala Option[return-type] construct) - trying to
> eliminate nulls.
>
> Lastly, I pushed the IModel[T] typing down to the Component class
> making get/set DefaultModel and get/set DefaultModelObject strong
> typed. This included using Scala companion object apply methods
> which eliminated having to explicitly declare type parameters in
> most end-user code (I had read that one of the objections to
> pushing strong typing down to the Component class in Wicket was
> that there were "too many notes", end-user code was too verbose).
>
> It can not interoperate with Java Wicket because Scala compiles to
> JVM class files and so all of the classes in Java Wicket also
> appear in Scala-Wicket.
> I have an "internal" name for my Scala port of Wicket which
> acknowledges its Wicket heritage as well as advertises its
> enterprise level capabilities. For external communications,
> I am currently simply call it Scala-Wicket.
>
> Why: Scala is a better Java
> I was introduced to Scala 9 months ago and quickly determined that
> it was a better Java (at least IMO). For Scala to succeed it
> requires more programmers to use it. Many on the Scala mailing
> lists were from a functional background and seemed not to recognize
> that Haskell and Lisp are not blindingly successful but, rather,
> niche languages and that the heavy selling of Scala's function and
> typing capabilities might turn off Java programmers.
>
> Scala struck me in many ways as a strong-typed JavaScript, at
> least, much of the code did not have to have type declarations
> because the compiler could infer types in many cases. In addition,
> a whole lot of the Java boil-plate code was not needed. As such,
> it could be sold as simply a better Java; a more-to-the-point
> object oriented language with functional programming in-the-small.
>
> To get more Java programmers to try Scala I looked for a
> significant Java application with a strong support and user
> community that I could port to Scala. I ended up with Wicket.
> Wicket is an enterprise level web framework (unlike existing
> Scale web frameworks which place restrictions on enterprise IT
> organizations, e.g., by requiring sticky sessions). It is well
> documented. And, as it turned out, very, very importantly it had
> a large number of unit tests (the unit tests saved my butt,
> without them I would never had succeeded in getting a port that
> worked).
>
> No, Really, Why:
> I like Scala and I took the time to learn it. Right now about
> 20% of programmers use Java while only some 0.4% use Scala.
> I did not want my effort of learning Scala to be wasted so my
> solution is to increase the number of Scala programmers. Where
> to get them? Again, my solution is from the existing horde of
> Java programmers.
>
> Plans: Release, Evolve and Proselytize
> I would like to release Scala-Wicket.
> I do not know if Apache hosts anything other than Java code.
> Growing a community is important.
>
> Still Todo:
> Comments: All of the existing class and inline comments are
> still Java related. This would have to be a long, on-going
> task to edit the comments so they reflect the code's
> Scala usage.
> Package path: The code still uses the "org.apache.wicket"
> package path and this must be changed - unless this became
> an Apache project.
> Author: I have quite literally looked at and touched every line
> of code but I have not yet felt comfortable with adding
> myself as an author since, well, many changes were
> syntactic and not semantic.
> Refactor with Traits: Currently the port uses Scala traits like
> Java interfaces but it should be possible to factor the
> common code out into the traits. This would result in many
> of the interfaces, the "I" files, such as IModel.scala,
> going away.
> Some general refactoring:
> As an example, consider factoring out the IModel[T] from
> Component. Half the time a user wants a Component with
> no model, so, if there was a HasModel trait:
> class Model[T](var value: T) {
> def getObject: T = value
> def setObject(value: T): Unit = this.value = value
> }
> trait HasModel[T] {
> var model: Model[T]
> def getDefaultModel: IModel[T] = model
> def setDefaultModel(model: IModel[T]): this.type = {
> ....
> this
> }
> def getDefaultModelObject: Option[T] = {
> ....
> }
> def setDefaultModelObject(obj: T): this.type = {
> ....
> this
> }
> }
> The Component hierarchy would have no model support.
> The user could add model support when needed:
> val form = new Form("hi")
> with HasModel[Int] { var model = new Model(42) }
> Just an Idea.
> STM: There are a number of Scala STM projects and I do not know
> if it is useful to add STM capabilities to Scala-Wicket.
> RBAC: I've written a Scala implementation of the NIST RBAC
> recommended standard and might consider adding it.
> Logging: Adding a Scala-based logging framework to aid user
> debugging.
> Monitoring and stats: In the last couple of years many web
> sites have added monitoring and statistics gathering
> capabilities (e.g., who clicks what, where, how long, on
> what page does the visitor exit the web site, etc.) in
> order to know how the web site is being used and then
> improve the web site.
> Significant Memory Usage Reduction: I've an idea that would
> significantly decrease the memory usage of Scala-Wicket and
> I plan to do a test implementation.
> Replace Java features: There are still some Java-isms that can
> be replaced with Scala equivalents.
> Port additional Java Wicket libraries to Scala.
> Enable multiple instances of a unit tests to be run at once.
> More: ????????????
>
> I want to avoid using some of the WTF features of Scala (when a
> Java programmer looks at the code and says "WTF") in order to
> ease and accelerate acceptance by Java programmers; as
> examples, implicits can make code hard to understand and
> advanced Scala type usages, as James Gosling said, "makes one's
> head spin".
>
>
> Help and Advice: How should Scala-Wicket be extended and released
>
> Scala-Wicket is a port and evolution of Wicket, not a ground-up
> re-write. Given that, what would you do differently in Wicket
> now that there are years of experience using it?
>
> How best to get a hosting site, release the code and build a
> community?
>
If you're looking for a place to host it, I'd recommend starting with
Github. Git is where the crowd is headed, and Github is the easiest place
to get up and running with it these days.
You mentioned earlier the idea of it being an Apache project. If you wanted
it to be an Apache project, you would start at the Incubator (
http://incubator.apache.org/). The one barrier you'll have initially is
that Apache favors "community over code"... so it's not a great place to
start a one-man project. Since this is a port of an existing Apache
project, you might have more leniency, but you'd have to build a community
around the project before you could ever "graduate" from the incubator.
Probably Github is your best bet for now. Build a community. Then, if your
community is in favor, move to Apache. By that time, ASF might have full
git support.
> Are there any mechanism to help fund such an open-source project?
>
Best bet is to build a community. Of course, if you can find some company
that wants such a project, you can get monetary support to develop /
maintain. But that seems unlikely in this case with the limited number of
companies looking for Scala out there, and especially since this is an
unproven port of a large Java project. So, start by getting folks like
jWeekend involved - great coders who are already salivating for Scala. Find
other individuals such as yourself who are interested, and build a group of
core committers.
> This is not meant to be a general announcement but rather a means
> for me to get some initial advice as to how to proceed.
>
> Any help is appreciated.
>
> Richard Emberson
I'm impressed. Quite an undertaking.
--
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket? Use Brix! http://brixcms.org*
Re: Scala-Wicket Help and Advice
Posted by Cemal Bayramoglu <jW...@cabouge.com>.
Richard,
This is an interesting idea that several people have discussed over
the last few years. I congratulate you on having taken it so far and
look forward to seeing your implementation.
As long as it can evolve in a way that can not do any harm to Wicket
(ie the quality is exceptional, the community accepts and supports it
etc), jWeekend is also interested in supporting this project. Let me
know if you 'd like to discuss further.
In the meantime, you may also like to take a look at unfiltered [1],
another relatively new Scala project, developed by some pretty smart
guys, one of which was a big Wicket fan too (Nathan created
databinder) which you may be able to gainfully integrate.
Regards - Cemal
jWeekend
Training, Consulting, Development
http://jWeekend.com
[1] https://github.com/n8han/unfiltered
On 4 January 2011 23:15, richard emberson <ri...@gmail.com> wrote:
> Dev Wicketers,
>
> What: I have ported Wicket to Scala
> A couple of months ago I took a 1.5 snapshot and ported to Scala.
> This encompasses all of the source and test code. As successive 1.5
> snapshots were released, I ported those differences to my Scala
> version. I am current with 1.5 M3.
>
> The Java 137,791 loc in 1.5 M3 are now 100,077 loc Scala (not
> counting all the println statements I put into the Scala code
> for debugging). I used cloc (http://cloc.sourceforge.net/) to
> count lines of code.
>
> I have also replaced all of the Java collection classes with
> Scala collection classes (though a small number of Java collection
> classes remain that did not have comparable Scala implementations).
>
> I have changed many method return types from the Java returning
> some "object" or "null" to Scala returning "Some(object)" or "None"
> (using the Scala Option[return-type] construct) - trying to
> eliminate nulls.
>
> Lastly, I pushed the IModel[T] typing down to the Component class
> making get/set DefaultModel and get/set DefaultModelObject strong
> typed. This included using Scala companion object apply methods
> which eliminated having to explicitly declare type parameters in
> most end-user code (I had read that one of the objections to
> pushing strong typing down to the Component class in Wicket was
> that there were "too many notes", end-user code was too verbose).
>
> It can not interoperate with Java Wicket because Scala compiles to
> JVM class files and so all of the classes in Java Wicket also
> appear in Scala-Wicket.
>
> I have an "internal" name for my Scala port of Wicket which
> acknowledges its Wicket heritage as well as advertises its
> enterprise level capabilities. For external communications,
> I am currently simply call it Scala-Wicket.
>
> Why: Scala is a better Java
> I was introduced to Scala 9 months ago and quickly determined that
> it was a better Java (at least IMO). For Scala to succeed it
> requires more programmers to use it. Many on the Scala mailing
> lists were from a functional background and seemed not to recognize
> that Haskell and Lisp are not blindingly successful but, rather,
> niche languages and that the heavy selling of Scala's function and
> typing capabilities might turn off Java programmers.
>
> Scala struck me in many ways as a strong-typed JavaScript, at
> least, much of the code did not have to have type declarations
> because the compiler could infer types in many cases. In addition,
> a whole lot of the Java boil-plate code was not needed. As such,
> it could be sold as simply a better Java; a more-to-the-point
> object oriented language with functional programming in-the-small.
>
> To get more Java programmers to try Scala I looked for a
> significant Java application with a strong support and user
> community that I could port to Scala. I ended up with Wicket.
> Wicket is an enterprise level web framework (unlike existing
> Scale web frameworks which place restrictions on enterprise IT
> organizations, e.g., by requiring sticky sessions). It is well
> documented. And, as it turned out, very, very importantly it had
> a large number of unit tests (the unit tests saved my butt,
> without them I would never had succeeded in getting a port that
> worked).
>
> No, Really, Why:
> I like Scala and I took the time to learn it. Right now about
> 20% of programmers use Java while only some 0.4% use Scala.
> I did not want my effort of learning Scala to be wasted so my
> solution is to increase the number of Scala programmers. Where
> to get them? Again, my solution is from the existing horde of
> Java programmers.
>
> Plans: Release, Evolve and Proselytize
> I would like to release Scala-Wicket.
> I do not know if Apache hosts anything other than Java code.
> Growing a community is important.
>
> Still Todo:
> Comments: All of the existing class and inline comments are
> still Java related. This would have to be a long, on-going
> task to edit the comments so they reflect the code's
> Scala usage.
> Package path: The code still uses the "org.apache.wicket"
> package path and this must be changed - unless this became
> an Apache project.
> Author: I have quite literally looked at and touched every line
> of code but I have not yet felt comfortable with adding
> myself as an author since, well, many changes were
> syntactic and not semantic.
> Refactor with Traits: Currently the port uses Scala traits like
> Java interfaces but it should be possible to factor the
> common code out into the traits. This would result in many
> of the interfaces, the "I" files, such as IModel.scala,
> going away.
> Some general refactoring:
> As an example, consider factoring out the IModel[T] from
> Component. Half the time a user wants a Component with
> no model, so, if there was a HasModel trait:
> class Model[T](var value: T) {
> def getObject: T = value
> def setObject(value: T): Unit = this.value = value
> }
> trait HasModel[T] {
> var model: Model[T]
> def getDefaultModel: IModel[T] = model
> def setDefaultModel(model: IModel[T]): this.type = {
> ....
> this
> }
> def getDefaultModelObject: Option[T] = {
> ....
> }
> def setDefaultModelObject(obj: T): this.type = {
> ....
> this
> }
> }
> The Component hierarchy would have no model support.
> The user could add model support when needed:
> val form = new Form("hi")
> with HasModel[Int] { var model = new Model(42) }
> Just an Idea.
> STM: There are a number of Scala STM projects and I do not know
> if it is useful to add STM capabilities to Scala-Wicket.
> RBAC: I've written a Scala implementation of the NIST RBAC
> recommended standard and might consider adding it.
> Logging: Adding a Scala-based logging framework to aid user
> debugging.
> Monitoring and stats: In the last couple of years many web
> sites have added monitoring and statistics gathering
> capabilities (e.g., who clicks what, where, how long, on
> what page does the visitor exit the web site, etc.) in
> order to know how the web site is being used and then
> improve the web site.
> Significant Memory Usage Reduction: I've an idea that would
> significantly decrease the memory usage of Scala-Wicket and
> I plan to do a test implementation.
> Replace Java features: There are still some Java-isms that can
> be replaced with Scala equivalents.
> Port additional Java Wicket libraries to Scala.
> Enable multiple instances of a unit tests to be run at once.
> More: ????????????
>
> I want to avoid using some of the WTF features of Scala (when a
> Java programmer looks at the code and says "WTF") in order to
> ease and accelerate acceptance by Java programmers; as
> examples, implicits can make code hard to understand and
> advanced Scala type usages, as James Gosling said, "makes one's
> head spin".
>
>
> Help and Advice: How should Scala-Wicket be extended and released
>
> Scala-Wicket is a port and evolution of Wicket, not a ground-up
> re-write. Given that, what would you do differently in Wicket
> now that there are years of experience using it?
>
> How best to get a hosting site, release the code and build a
> community?
>
> Are there any mechanism to help fund such an open-source project?
>
> This is not meant to be a general announcement but rather a means
> for me to get some initial advice as to how to proceed.
>
> Any help is appreciated.
>
> Richard Emberson
>
>
> --
> Quis custodiet ipsos custodes
>
Re: Scala-Wicket Help and Advice
Posted by James Carman <ja...@carmanconsulting.com>.
I haven't had time to read all of this (hard to get through it all on
my phone), but I don't think that mere "port" of Wicket to Scala is
what is needed. I'd rather see a project built for Scala from the
ground up based on some of the concepts from Wicket. Wicket wasn't
designed with a functional programming language in mind and I think
there are a lot of places where the functional style could simplify
things quite a bit. I am very interested in seeing what you have put
together. Are you planning on putting the code up on Github or
something?
On Tue, Jan 4, 2011 at 6:15 PM, richard emberson
<ri...@gmail.com> wrote:
> Dev Wicketers,
>
> What: I have ported Wicket to Scala
> A couple of months ago I took a 1.5 snapshot and ported to Scala.
> This encompasses all of the source and test code. As successive 1.5
> snapshots were released, I ported those differences to my Scala
> version. I am current with 1.5 M3.
>
> The Java 137,791 loc in 1.5 M3 are now 100,077 loc Scala (not
> counting all the println statements I put into the Scala code
> for debugging). I used cloc (http://cloc.sourceforge.net/) to
> count lines of code.
>
> I have also replaced all of the Java collection classes with
> Scala collection classes (though a small number of Java collection
> classes remain that did not have comparable Scala implementations).
>
> I have changed many method return types from the Java returning
> some "object" or "null" to Scala returning "Some(object)" or "None"
> (using the Scala Option[return-type] construct) - trying to
> eliminate nulls.
>
> Lastly, I pushed the IModel[T] typing down to the Component class
> making get/set DefaultModel and get/set DefaultModelObject strong
> typed. This included using Scala companion object apply methods
> which eliminated having to explicitly declare type parameters in
> most end-user code (I had read that one of the objections to
> pushing strong typing down to the Component class in Wicket was
> that there were "too many notes", end-user code was too verbose).
>
> It can not interoperate with Java Wicket because Scala compiles to
> JVM class files and so all of the classes in Java Wicket also
> appear in Scala-Wicket.
>
> I have an "internal" name for my Scala port of Wicket which
> acknowledges its Wicket heritage as well as advertises its
> enterprise level capabilities. For external communications,
> I am currently simply call it Scala-Wicket.
>
> Why: Scala is a better Java
> I was introduced to Scala 9 months ago and quickly determined that
> it was a better Java (at least IMO). For Scala to succeed it
> requires more programmers to use it. Many on the Scala mailing
> lists were from a functional background and seemed not to recognize
> that Haskell and Lisp are not blindingly successful but, rather,
> niche languages and that the heavy selling of Scala's function and
> typing capabilities might turn off Java programmers.
>
> Scala struck me in many ways as a strong-typed JavaScript, at
> least, much of the code did not have to have type declarations
> because the compiler could infer types in many cases. In addition,
> a whole lot of the Java boil-plate code was not needed. As such,
> it could be sold as simply a better Java; a more-to-the-point
> object oriented language with functional programming in-the-small.
>
> To get more Java programmers to try Scala I looked for a
> significant Java application with a strong support and user
> community that I could port to Scala. I ended up with Wicket.
> Wicket is an enterprise level web framework (unlike existing
> Scale web frameworks which place restrictions on enterprise IT
> organizations, e.g., by requiring sticky sessions). It is well
> documented. And, as it turned out, very, very importantly it had
> a large number of unit tests (the unit tests saved my butt,
> without them I would never had succeeded in getting a port that
> worked).
>
> No, Really, Why:
> I like Scala and I took the time to learn it. Right now about
> 20% of programmers use Java while only some 0.4% use Scala.
> I did not want my effort of learning Scala to be wasted so my
> solution is to increase the number of Scala programmers. Where
> to get them? Again, my solution is from the existing horde of
> Java programmers.
>
> Plans: Release, Evolve and Proselytize
> I would like to release Scala-Wicket.
> I do not know if Apache hosts anything other than Java code.
> Growing a community is important.
>
> Still Todo:
> Comments: All of the existing class and inline comments are
> still Java related. This would have to be a long, on-going
> task to edit the comments so they reflect the code's
> Scala usage.
> Package path: The code still uses the "org.apache.wicket"
> package path and this must be changed - unless this became
> an Apache project.
> Author: I have quite literally looked at and touched every line
> of code but I have not yet felt comfortable with adding
> myself as an author since, well, many changes were
> syntactic and not semantic.
> Refactor with Traits: Currently the port uses Scala traits like
> Java interfaces but it should be possible to factor the
> common code out into the traits. This would result in many
> of the interfaces, the "I" files, such as IModel.scala,
> going away.
> Some general refactoring:
> As an example, consider factoring out the IModel[T] from
> Component. Half the time a user wants a Component with
> no model, so, if there was a HasModel trait:
> class Model[T](var value: T) {
> def getObject: T = value
> def setObject(value: T): Unit = this.value = value
> }
> trait HasModel[T] {
> var model: Model[T]
> def getDefaultModel: IModel[T] = model
> def setDefaultModel(model: IModel[T]): this.type = {
> ....
> this
> }
> def getDefaultModelObject: Option[T] = {
> ....
> }
> def setDefaultModelObject(obj: T): this.type = {
> ....
> this
> }
> }
> The Component hierarchy would have no model support.
> The user could add model support when needed:
> val form = new Form("hi")
> with HasModel[Int] { var model = new Model(42) }
> Just an Idea.
> STM: There are a number of Scala STM projects and I do not know
> if it is useful to add STM capabilities to Scala-Wicket.
> RBAC: I've written a Scala implementation of the NIST RBAC
> recommended standard and might consider adding it.
> Logging: Adding a Scala-based logging framework to aid user
> debugging.
> Monitoring and stats: In the last couple of years many web
> sites have added monitoring and statistics gathering
> capabilities (e.g., who clicks what, where, how long, on
> what page does the visitor exit the web site, etc.) in
> order to know how the web site is being used and then
> improve the web site.
> Significant Memory Usage Reduction: I've an idea that would
> significantly decrease the memory usage of Scala-Wicket and
> I plan to do a test implementation.
> Replace Java features: There are still some Java-isms that can
> be replaced with Scala equivalents.
> Port additional Java Wicket libraries to Scala.
> Enable multiple instances of a unit tests to be run at once.
> More: ????????????
>
> I want to avoid using some of the WTF features of Scala (when a
> Java programmer looks at the code and says "WTF") in order to
> ease and accelerate acceptance by Java programmers; as
> examples, implicits can make code hard to understand and
> advanced Scala type usages, as James Gosling said, "makes one's
> head spin".
>
>
> Help and Advice: How should Scala-Wicket be extended and released
>
> Scala-Wicket is a port and evolution of Wicket, not a ground-up
> re-write. Given that, what would you do differently in Wicket
> now that there are years of experience using it?
>
> How best to get a hosting site, release the code and build a
> community?
>
> Are there any mechanism to help fund such an open-source project?
>
> This is not meant to be a general announcement but rather a means
> for me to get some initial advice as to how to proceed.
>
> Any help is appreciated.
>
> Richard Emberson
>
>
> --
> Quis custodiet ipsos custodes
>