[erlang-questions] Erlang/YAWS vs Free Pascal/Xitami
Jilani Khaldi
jilani@REDACTED
Wed Mar 26 12:18:25 CET 2008
Richard A. O'Keefe wrote:
> On 25 Mar 2008, at 8:58 pm, Jilani Khaldi wrote:
>
>> Which is better for my web application?
>> http://www.dotpas.org/cgi-bin/articles/a01
>
> First, the Erlang code can be substantially simplified to
[..]
Already done in the second test.
> Second, if you were using Apache, it would make sense to use
> org.apache.commons.math.stat.descriptive.moment.Variance
> to do the variance calculation, and it is clearly "better" to have
> code just sitting there waiting for you to use it than to have to write
> it and test it yourself. (Of course, ideally Erlang would have a
> 'stats:' module with at least mean/1, var/1, and sd/1 in it.)
I prefer my own full-blown, mature and stable statistical library
written more then 20 years ago in Turbo Pascal, used in many serious
applications and updated over the years.
> But third is most important: what do you mean by "better"?
You are right. Better is subjetive, so I add in the title "for my
application" and after I have given its main characteristics.
> - Better = it takes you less time to write it?
> That depends in part on how well you know the language and its libraries.
I didn't mention time because it is not so important. I am writing it in
my spare time and it is not commercial => less stress.
I know a lot better Object Pascal than Erlang and writing it in Object
Pascal is straightforward without the need or the help of anyone. But I
think this is a good occasion to learn Erlang seriously writing a whole
application than just continuing to play with the language for years.
> - Better = it is more reliable once written?
> I'd say Erlang every time; on the other hand these days there are web
> servers written in Haskell, so you might want the security of strong
> (polymorphic) typing as well as the safety of assignment-freedom.
I already have tried Ada (GNAT) with AWS
(https://libre.adacore.com/aws/main.html) and I like it but the problem
is *long time compilation* of code. FPC (Free Pascal Compiler) is an
order of magnitude faster than GCC. It is very very fast to compile and
it does a lot of controls on the code like Ada which eliminates a lot of
stupid typing errors that in scripted language will easily pass and they
are very difficult to track later. By its nature an Object Pascal
program once it is compiled without errors and warnings, it is generally
reliable and will run almost as expected.
However the tools *are* Erlang/YAWS + Mnesia *or* Free Pascal/Xitami +
Firebird and *very soon* I will decide. In the white paper of the
application I will explain why I have chosen the "right" tools.
> - Better = runs in less time on your machine?
> First get it working, then measure. Once it is fast enough, stop
> worrying.
> "Fast enough" depends on workload, of course.
Yes, and this is what I am doing now.
> - Better = runs in less memory on your machine?
> For an application that only needs one process, Pascal is likely to do
> better than Erlang here. For an application that needs many processes,
> Erlang is likely to do better than Pascal.
In fact, this point is very important seen the application has to run
(for the moment) on an obsolete computer and every single application
needs only one process. However, if an application needs many threads
Object Pascal handles them very well. At least, if I need more power
hardware is very cheap nowadays.
Thank you for your comments!
JK
--
***
Jilani KHALDI
http://www.dotpas.org
More information about the erlang-questions
mailing list