From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Cao Jin Newsgroups: gmane.lisp.guile.user Subject: Re: [ANN] An impudent introduction to Guile Date: Sat, 6 Feb 2016 17:16:13 +0800 Message-ID: <56B5B9DD.6070300@null.net> References: <0MfmrK-1aduFO2FHA-00NEPX@mail.gmx.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------000202020004060004090503" X-Trace: ger.gmane.org 1454750208 27599 80.91.229.3 (6 Feb 2016 09:16:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Feb 2016 09:16:48 +0000 (UTC) Cc: "guile-user@gnu.org" To: Panicz Maciej Godek Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Feb 06 10:16:36 2016 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aRyyp-0002B0-Pa for guile-user@m.gmane.org; Sat, 06 Feb 2016 10:16:36 +0100 Original-Received: from localhost ([::1]:52495 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRyyo-00081q-Lu for guile-user@m.gmane.org; Sat, 06 Feb 2016 04:16:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35542) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRyyc-00081N-Oj for guile-user@gnu.org; Sat, 06 Feb 2016 04:16:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRyyZ-0006dp-FI for guile-user@gnu.org; Sat, 06 Feb 2016 04:16:22 -0500 Original-Received: from mout.gmx.com ([74.208.4.200]:57490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRyyZ-0006dl-8M for guile-user@gnu.org; Sat, 06 Feb 2016 04:16:19 -0500 Original-Received: from [192.168.0.104] ([114.111.166.41]) by mail.gmx.com (mrgmxus002) with ESMTPSA (Nemesis) id 0MWC5f-1aYJY11I9B-00XMVc; Sat, 06 Feb 2016 10:16:17 +0100 X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 In-Reply-To: X-Provags-ID: V03:K0:f1opEUvldCCtEylF7StAVQ5a1PbmxDyTrsHOUSiRA+pGsXcMB7w 0QdF5dIBxtxdihijyP4ESmuPBL9PN0TWLgreowm3jzQQOmunmoS17smGnqOeqBlCqwK9qk7 vfK+QSTXdFH4LlyzvZKm37GxNy7ccC/xhMz6pgpqWAeonWnrLgY3rAZzPx/Wrl20/R9g6O4 xZ8HdLHjrmavSIfyPg+Yw== X-UI-Out-Filterresults: notjunk:1;V01:K0:hF8gcacGVro=:MFilpawBnXw+j1UhkIgpYo yAh4qy/np8a73a2AHk0y/UeMFOQ6IooGY7fEKaFGxxV0VeBnACClob3pAK2ndCauCH31mPC4k GKajM2lDee4wGXoWVdnm8vDLNJmROgirdDz8QkxiK2H1IJ5PKBzqs1DdPl+T8j0H9HwHOb45v 3sNF9zX6FT6nNeziG5mhNxXwnggMhZtyrfNIHSWDBmJg3nhdBLyD92EpoOo7oOgDzoE2pLkfX uWZQjPJFQmajl/mC9MnT8o5i3oP0/ebU2fEQjbi9eMpXWfEQH1rR+7oyojYGnoc1qrwx3aHB/ wwjbkJn1Kn52uZ9BwtZM3lnc3K1yhDIrAeh2Q+uJcvN+RVTHkss4BSpQL2ZW4nr5xdT4v+3TW KU+rAbtIdGzaQGOUnYqV0KNXeEIvvybZa2pHt3inpsbquXiVonYaxD+TnF5mUQsEn/5VA9mf9 4Uz0InyanN2HuYrQrVWqaSA+EoUMqsSR0Kc8pkFgrx0ZGK+XfzLo+kyo5DxtJZy5CHwz/Ge0w cG4Mu5nMjKaPlv5dXRLRWQj4oXoXT0MAodVtg8vdC3YSJWLi/xYlwshJ87L6Xjta17mRVfq/Z SxU9MQSjxprJNWOrT9DX6ioUdh6tMH/XKCzsJNcoVOSmvMQw/hmVkxmRcKZ0+apNpnn5AyeoS WhUpFpsmwzhNHv7BDt7h2Hgo2foZdvCqOa1ZjXspdkag+vDLuqxw8u3c0mGeaU8naBJ13j301 Oi3dmkvgTe26oYnUH7+NFR4rDiYtmfNlURm2mzIwzvXd2uhpKcItqzVhwBWHzHWLkC5Jp08b X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 74.208.4.200 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:12366 Archived-At: This is a multi-part message in MIME format. --------------000202020004060004090503 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Panicz, Thank you for these information. On 2/6/2016 14:08, Panicz Maciej Godek wrote: > Hi > > 2016-02-06 1:47 GMT+01:00 Cao Jin >:= > > It's interesting. I have used Matlab for many years, but never > tried R. As for as I know, there are tons of state-of-the-art > library in R and Matlab. > > After skimming your paper, I wander that > 1) Are these library used in your code example implemented by > yourself? Or other libraries are called, such as LAPACK for linear > algebra? > > > Everything is either written from scratch, or uses one of the helper > libraries (two such libraries are included in the repo; the other is > SRFI-1). > The point of the book is that it is not a tutorial on using libraries, > but it explains some methods and translates these explanations to > Scheme, so that they can be modified and extended easily. > =20 > If you are looking for some serious numerical libraries for Scheme, > there's a very powerful scmutils package available > > http://www.cs.rochester.edu/~gildea/guile-scmutils/ > > > I've actually used its code for Singular Value Decomposition to > perform Principal Component Analysis. OK, I will try it later. > > 2) Is it easy to use scheme and your library, or maybe some > others, to do computational job? In practice, those who use R or > Matlab want their idea to be proved quickly, not to spend time on > coding style, right? > > I think it depends on a point of view. I initially tried using R, but > it was causing many unexpected problems, but I already knew Scheme > quite well, and for me even implementing the libraries from scratch > wasn't that much of a job. > But the book is mostly about fun, and about understanding. > Also, interfacing Guile with Emacs through Geiser is an incredible > productivity boost. > > Interestingly, when I benchmarked the genetic algorithm that I wrote > with genalg package from R, the Scheme version run in Guile actually > outperformed the R version, although it was written in completely > performance-naive style. > It's great to see this result. > On the other hand, if you wanted to use the decision trees classifier, > you'd probably want to apply memoization. > > If scheme can do most computational job as python numpy does, I > will switch to it. > > > I think that in practice Scheme can be even more convinient, as it > provides native support for complex numbers > > I also think it would be helpful to interface Guile with plot > generation. I see that Nala has a guile-plot package, but I haven't > tried it. I personally wrote some code for generating LaTeX pgfplots > for the project, and can add it to the repo if you llike. > As described above, I think it is worth trying Scheme for numerical computing. Your work is appreciated! Regards, Lop --------------000202020004060004090503 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Hi Panicz,

Thank you for these information.

On 2/6/2016 14:08, Panicz Maciej Godek wrote:
Hi

2016-02-06 1:47 GMT+01:00 Cao Jin <lop@null.net>:
It's interesting. I have used Matlab for many years, but never tried R. As for as I know, there are tons of state-of-the-art library in R and Matlab.

After skimming your paper, I wander that
1) Are these library used in your code example implemented by yourself? Or other libraries are called, such as LAPACK for linear algebra?

Everything is either written from scratch, or uses one of the helper libraries (two such libraries are included in the repo; the other is SRFI-1).
The point of the book is that it is not a tutorial on using libraries, but it explains some methods and translates these explanations to Scheme, so that they can be modified and extended easily.
 
If you are looking  for some serious numerical libraries for Scheme, there's a very powerful scmutils package available

http://www.cs.rochester.edu/~gildea/guile-scmutils/

I've actually used its code for Singular Value Decomposition to perform Principal Component Analysis.
OK, I will try it later.

2) Is it easy to use scheme and your library, or maybe some others, to do computational job? In practice, those who use R or Matlab want their idea to be proved quickly, not to spend time on coding style, right?

I think it depends on a point of view. I initially tried using R, but it was causing many unexpected problems, but I already knew Scheme quite well, and for me even implementing the libraries from scratch wasn't that much of  a job.
But the book is mostly about fun, and about understanding.
Also, interfacing Guile with Emacs through Geiser is an incredible productivity boost.

Interestingly, when I benchmarked the genetic algorithm that I wrote with genalg package from R, the Scheme version run in Guile actually outperformed the R version, although it was written in completely performance-naive style.

It's great to see this result.

On the other hand, if you wanted to use the decision trees classifier, you'd probably want to apply memoization.

If scheme can do most computational job as python numpy does, I will switch to it.

I think that in practice Scheme can be even more convinient, as it provides native support for complex numbers

I also think it would be helpful to interface Guile with plot generation. I see that Nala has a guile-plot package, but I haven't tried it. I personally wrote some code for generating LaTeX pgfplots for the project, and can add it to the repo if you llike.


As described above, I think it is worth trying Scheme for numerical computing. Your work is appreciated!

Regards,
Lop

--------------000202020004060004090503--