Which language?

10 views
Skip to first unread message

andrey...@gmail.com

unread,
Mar 17, 2011, 10:36:29 PM3/17/11
to Tuura project
Seems to be an important question to answer before starting to
implement anything :-)

Ulan

unread,
Mar 18, 2011, 7:46:06 AM3/18/11
to Tuura project
My proposal: backend on C++/mysql, frontend either on python/flask,
or ruby/(sinatra|rails).


On Mar 18, 3:36 am, "Andrey.Mok...@gmail.com"

Ivan

unread,
Mar 18, 2011, 8:11:32 AM3/18/11
to Tuura project
I suggest Scala/Lift (http://liftweb.net) for consideration as I find
dynamically typed languages disgusting.

andrey...@gmail.com

unread,
Mar 18, 2011, 9:41:57 AM3/18/11
to tuurap...@googlegroups.com
I agree with Ulan about the backend: C++/mysql should do fine.

I also agree with Ivan that I don't like dynamically typed languages :) I have no experience with Scala/Lift though. 
Ulan, why not try .net for the frontent? You do have positive experience with it (KRSU olymp server has great frontend in my opinion).
We can use crossplatform solutions if you no longer work on Windows and has no access to Visual Studio.

Ivan V. Polyakov

unread,
Mar 18, 2011, 9:53:18 AM3/18/11
to tuurap...@googlegroups.com
As far as I know .Net does not have a good web framework (with support
for Ajax etc.), Ruby seems quite popular specifically because of its
web framework which probably means it is good.

My opinion does not matter much though as I have only written stuff
for web using Perl :) Which is probably why I hate dynamic languages,
uploading/executing the same page 10 times in a row just to get rid of
typos is not particularly fun.

Scala is just a fun language with plenty of modern (as in functional
:) ) features that compiles into Java bytecode. I don't know if its
web framework (Lift) is actually good, but people generally say good
things.

Ulan

unread,
Mar 18, 2011, 10:22:52 AM3/18/11
to Tuura project
> Which is probably why I hate dynamic languages,
> uploading/executing the same page 10 times in a row just to get rid of
> typos is not particularly fun.
Unit tests take care of this, right? :)
I also don't have any web-development experience with python/ruby. It
might be that the rails is too heavyweight for our purposes. We could
start with mini-frameworks like flask or sinatra. The good thing about
python/flask is that there is no steep learning curve. The code is
self explaining and anyone can start contributing early.

The lift framework seems to be exciting, may be it is worth learning
scala. So I have nothing against this option.

I would prefer not to use .net because it would bind us (eventually)
to the MS stack (I don't know how good Mono is).

On Mar 18, 2:53 pm, "Ivan V. Polyakov" <ivpolya...@gmail.com> wrote:
> As far as I know .Net does not have a good web framework (with support
> for Ajax etc.), Ruby seems quite popular specifically because of its
> web framework which probably means it is good.
>
> My opinion does not matter much though as I have only written stuff
> for web using Perl :) Which is probably why I hate dynamic languages,
> uploading/executing the same page 10 times in a row just to get rid of
> typos is not particularly fun.
>
> Scala is just a fun language with plenty of modern (as in functional
> :) ) features that compiles into Java bytecode. I don't know if its
> web framework (Lift) is actually good, but people generally say good
> things.
>
> On Fri, Mar 18, 2011 at 1:41 PM, Andrey.Mok...@gmail.com

Andrey Mokhov

unread,
Mar 18, 2011, 11:37:46 AM3/18/11
to Tuura project
Perhaps, Arseniy can comment on how good Mono is -- I'll ask him to
join the discussion.

If Ulan agrees to Scala/Lift -- then it's fine with me too. I'd like
to learn something new.

Ivan V. Polyakov

unread,
Mar 18, 2011, 11:41:30 AM3/18/11
to tuurap...@googlegroups.com
Unit tests are not that easy to set up if you have the DB acting weird
or if you have different runtimes locally and on the server :) Perl
implementation on Windows used to deviate from the standard Linux
implementation and this caused issues. Anyway, this is irrelevant.

I think the best way is to write a specification for some simple
dynamic page and try to implement it in Ruby/Scala/Python and see how
it goes.

Ivan V. Polyakov

unread,
Mar 18, 2011, 11:42:06 AM3/18/11
to tuurap...@googlegroups.com
Arseniy has been assimilated and no longer cares about anything that
is not Haskell %)

Rotsor

unread,
Mar 18, 2011, 12:05:47 PM3/18/11
to Tuura project
> Perhaps, Arseniy can comment on how good Mono is -- I'll ask him to
> join the discussion.
I only used Mono for toy projects (like home billing and contest
problem solving), so my opinion is far from expert.
However, I had no significant problems using it so far. In my
experience, the Mono JIT optimiser is not as good as the Microsoft's,
but feature-wise the mono project is not lagging far behind. For
example, mono C# compiler supports C# 4.

However, I'd prefer to see this project in something other than .NET
(probably mostly because of my repulsion towards APS.NET WebForms)

Scala/Lift would be nice, but, as Ivan said, HappStack would be
perfect! (if go functional, why not go all the way to Haskell?)

Ulan

unread,
Mar 18, 2011, 12:11:43 PM3/18/11
to Tuura project
Okay, count my vote for HappStack. %)

Andrey Mokhov

unread,
Mar 18, 2011, 12:12:48 PM3/18/11
to Tuura project
Great, so we have several options. Let's do what Ivan suggests --
implement a simple dynamic page using all methods and see which
implementation we prefer.

Ivan V. Polyakov

unread,
Mar 18, 2011, 12:19:50 PM3/18/11
to tuurap...@googlegroups.com
I agree that could be fun, but somehow I don't think that Haskell is
the most elegant solution for pushing html around :)

Rotsor

unread,
Mar 19, 2011, 4:38:35 AM3/19/11
to Tuura project
As there were no concrete ideas on what to implement in all possible
languages, I hacked around something random.

So, here goes the crown of creation:
http://www.honey-net.eu:8000/ (sources in http://code.google.com/r/rotsor-tuura-hs/)

The most important parts are the transactional persistence, provided
by the Happstack State, and the formlet framework used to make a form.

The persistent state schema lies in src/Database.hs. It defines
several simple Haskell types and uses Template Haskell (TH) to derive
a lot of useful class instances for them, implementing serialisation,
comparison, display, and even reflection. Most of those instances are
used by Happstack for something. The state operations (readTuuraDb,
addProblem) are defined as functions in src/TuuraQueries.hs. There
also is some TH action promoting them to serialisable types (needed
for, e.g., transaction log replay). I hope to learn some day how all
this really works, but for now it just works (saves everything and
restores on server restart).

Next, src/Pages/AddProblem.hs shows the use of formlets. Those allow a
single function (like problemForm) to specify the form display,
validation and result processing in one place in a type-safe manner.
Very nice.

I've not looked into ajax options yet and I'm afraid to... Ajax is
just scary.

Ulan

unread,
Mar 19, 2011, 7:38:55 AM3/19/11
to Tuura project
At first glance the code looks terrifying. :)

I guess if we make clean MVC separation and hide away boilerplate,
this could work. I see some kind of version control is used for the
persistence. How difficult is it to migrate from one schema to
another?

PS
We should make all examples with some kind of session (login/logout).

On Mar 19, 9:38 am, Rotsor <rot...@gmail.com> wrote:
> As there were no concrete ideas on what to implement in all possible
> languages, I hacked around something random.
>
> So, here goes the crown of creation:http://www.honey-net.eu:8000/(sources inhttp://code.google.com/r/rotsor-tuura-hs/)

Andrey Mokhov

unread,
Mar 19, 2011, 8:29:14 AM3/19/11
to Tuura project
Terrifying indeed :)

Well, let's provide alternatives solutions in other languages. Should
we start a separate topic for that?

Rotsor

unread,
Mar 19, 2011, 12:22:33 PM3/19/11
to Tuura project
Let's continue the Haskell talk in http://groups.google.com/group/tuuraproject/t/747cfc3e0662e1f7
too keep this topic free from low-level detail.

Splash

unread,
Mar 20, 2011, 3:15:30 AM3/20/11
to Tuura project
> However, I'd prefer to see this project in something other than .NET
> (probably mostly because of my repulsion towards APS.NET WebForms)

WebForms is not the only option in ASP.NET. Take a look at MVC. It's
built on top of ASP.NET stask and could co-exists with WebForms. So
you can use MVC and\or WebForms in one project.

If you want the project to run not only on Windows, you'd probably
take a look at a BLToolkit's DataAccess part.

Andrey Mokhov

unread,
Mar 20, 2011, 8:03:19 AM3/20/11
to Tuura project
> WebForms is not the only option in ASP.NET. Take a look at MVC. It's
> built on top of ASP.NET stask and could co-exists with WebForms. So
> you can use MVC and\or WebForms in one project.
>
> If you want the project to run not only on Windows, you'd probably
> take a look at a BLToolkit's DataAccess part.

Could you implement a simple example in ASP.NET? It would be helpful
to see a direct comparison with Rotsor's implementation in HappStack.
I am a complete noob in web-programming and need to see examples
before I believe one approach to be better than another one.

Vitaly Lopatkin

unread,
Mar 20, 2011, 2:06:27 PM3/20/11
to Tuura project
Reply all
Reply to author
Forward
0 new messages