- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
[lib.web] new stateless strictly typed web framework
Sun, 2009-07-12, 08:05
Hello everyone. :)
First, thanks to Martin & Co for wonderful language.
I'd like to announce I'm working on a stateless strictly typed web
framework I call "lib.web". My goals are:
1) 100% statelessness, for good upward & downward scalability. Currently
I'm concerned about running heavily loaded sites on VPS.
2) Heavy usage of Scala's strict typization to minimize mistypings,
enforce API restrictions vi type system and so on.
----------
Currently I have some aspects well-defined:
1) Request dispatching and error handling. I mean features that
ideologically correspond and web.xml
directives but implemented using pure Scala strictly typed approach
(pattern matching on Request and ErrorRequest objects, in fact).
2) Request parameter validation and conversion. I'll just show a simple
example:
val age = request.param("age")(VRequired & VTrimInt, CTrimInt, 0)
Here you CANNOT omit VRequired (or VOptional), you CANNOT use CTrimInt
converter (to integer) without using VTrimInt integer validator, you CAN
add custom error message to any validator, you CAN use long validation
chains with full-circuit and short-circuit "and" and parenthesis, you
CAN create your own validators and converters to any type and define how
they can be used together. All mentioned "CANNOT"s are checked in
compile time.
3) Templates as pure Scala functions (data) => XML. I know this is
questionable decision and ready to explain my viewpoint (I've already
trained on russian programmers forum =)). In two words, my arguments are
strict typization, no overhead, ability to use any template engine for
those who need it (in fact, some can be added in future as a module),
and no such need for me because I always merge designers' markup into
code by myself (fixing it by the way or even redoing completely).
----------
I released all mentioned stuff as version 0.1.0. It contains heavily
commented working examples which you can read through like a book and
run using maven (mvn jetty:run) or see working on my site.
Please download, look and try: http://dimgel.ru/lib.web/files/
Please read doc/en/README.txt first. Readmes and examples are written in
two languages: english and russian.
I'm looking for your feedback. :)
Sun, 2009-07-12, 08:57
#2
Re: [lib.web] new stateless strictly typed web framework
Marius Danciu wrote:
> Kudos for you framework and best of luck with it.
Thanks. I'll try. ;)
Sun, 2009-07-12, 18:27
#3
Re: [lib.web] new stateless strictly typed web framework
On Sun, Jul 12, 2009 at 12:28 AM, Marius Danciu <marius.danciu@gmail.com> wrote:
Dmitry,
Kudos for you framework and best of luck with it.
Cool stuff!
Br's,
Marius
On Sun, Jul 12, 2009 at 10:01 AM, Dmitry Grigoriev <mail@dimgel.ru> wrote:Hello everyone. :)
First, thanks to Martin & Co for wonderful language.
I'd like to announce I'm working on a stateless strictly typed web
framework I call "lib.web". My goals are:
1) 100% statelessness, for good upward & downward scalability. Currently
I'm concerned about running heavily loaded sites on VPS.
2) Heavy usage of Scala's strict typization to minimize mistypings,
enforce API restrictions vi type system and so on.
----------
Currently I have some aspects well-defined:
1) Request dispatching and error handling. I mean features that
ideologically correspond <servlet-mapping> and <error-page> web.xml
directives but implemented using pure Scala strictly typed approach
(pattern matching on Request and ErrorRequest objects, in fact).
2) Request parameter validation and conversion. I'll just show a simple
example:
val age = request.param("age")(VRequired & VTrimInt, CTrimInt, 0)
Here you CANNOT omit VRequired (or VOptional), you CANNOT use CTrimInt
converter (to integer) without using VTrimInt integer validator, you CAN
add custom error message to any validator, you CAN use long validation
chains with full-circuit and short-circuit "and" and parenthesis, you
CAN create your own validators and converters to any type and define how
they can be used together. All mentioned "CANNOT"s are checked in
compile time.
3) Templates as pure Scala functions (data) => XML. I know this is
questionable decision and ready to explain my viewpoint (I've already
trained on russian programmers forum =)). In two words, my arguments are
strict typization, no overhead, ability to use any template engine for
those who need it (in fact, some can be added in future as a module),
and no such need for me because I always merge designers' markup into
code by myself (fixing it by the way or even redoing completely).
----------
I released all mentioned stuff as version 0.1.0. It contains heavily
commented working examples which you can read through like a book and
run using maven (mvn jetty:run) or see working on my site.
Please download, look and try: http://dimgel.ru/lib.web/files/
Please read doc/en/README.txt first. Readmes and examples are written in
two languages: english and russian.
I'm looking for your feedback. :)
Sun, 2009-07-12, 18:57
#4
Re: Re: [lib.web] new stateless strictly typed web framework
Curious, but it seems like it does not contain enough information for experimenting with it.
2009/7/12 Dmitry Grigoriev <mail@dimgel.ru>
2009/7/12 Dmitry Grigoriev <mail@dimgel.ru>
Marius Danciu wrote:
> Kudos for you framework and best of luck with it.
Thanks. I'll try. ;)
Mon, 2009-07-13, 04:27
#5
Re: [lib.web] new stateless strictly typed web framework
Vlad Patryshev wrote:
> Curious, but it seems like it does not contain enough information for
> experimenting with it.
I'd agree it does not contain much functionality yet, :) but what kind
of information do you need? Have you read example sources? I mentioned
they are heavily commented (in english and russian) and can be read
through much like a book.
Mon, 2009-07-13, 04:37
#6
Re: [lib.web] new stateless strictly typed web framework
David Pollak wrote:
> Cool stuff!
Thanks. :)
Mon, 2009-07-13, 16:47
#7
Re: [lib.web] 0.1.0 requires jetty 6.1.14 maven plugin
I just found that running `mvn jetty:run` on clean maven installation
uses jetty 6.1.16 which does not enable directory listings by default,
making it impossible to navigate examples hierarchy.
If you found this problem, please specify exact jetty version 6.1.14 in
pom.xml, instead of [6.1.6,).
Kudos for you framework and best of luck with it.
Br's,
Marius
On Sun, Jul 12, 2009 at 10:01 AM, Dmitry Grigoriev <mail@dimgel.ru> wrote: