>
> In fact, I'm beginning to thing that we ought to provide a Julia package
> ("GretlLink"?) on pkg.julialang.org for communication with gretl with
> functions such as the above and more, ideally written by a specialist
> (Andreas, are you interested?). So in practice, a "using GretlLink"
> statement would be implicit every time we enter a "foreign" environment,
> possibly preceded by a 'Pkg.Add("GretlLink")' if necessary.


I'd like to help here, but I'm also bit swamped. I'm pretty up to date on
the Julia side, but I'm not sure what it would take to make a good foreign
environment in Gretl. If either of you can explain what is supposed to
happen on the Julia side then I can probably do it without too much
difficulty.

On Thu, Jan 21, 2016 at 3:38 AM, <oleg_komashko(a)ukr.net> wrote:

> A couple of Gretl scripts for
> the same set of tests
> (parseintperf(),mandelperf(),pisum())
> Oleh
>
> 21 січня 2016, 09:29:49, від "Riccardo (Jack) Lucchetti" <
> r.lucchetti(a)univpm.it>:
>
> On Wed, 20 Jan 2016, Allin Cottrell wrote:
>
> > Perhaps we should offer a prize for the first example of actual time-saving
> > (and/or improvement in accuracy) in sending a calculation of the sort that
> > might be required in gretl out to julia for computation.
>
> Easy: just take Oleh's recursion example.
>
> <hansl>
> set echo off
> set messages off
>
> function scalar fib(scalar n)
>      return n<2 ? n : fib(n-1) + fib(n-2)
> end function
>
> set stopwatch
> eval fib(30)
> native = $stopwatch
>
> foreign language=julia
>       function fib(n)
>               if n<2
>                       return n
>               else
>                       return fib(n-1)+fib(n-2)
>               end
>       end
>       println(fib(30))
> end foreign
> julia = $stopwatch
>
> print native julia
> </hansl>
>
> <output>
> 832040
> 832040
>
>
>           native =  71.920384
>
>            julia =  4.4912745
> </output>
>
> -------------------------------------------------------
>    Riccardo (Jack) Lucchetti
>    Dipartimento di Scienze Economiche e Sociali (DiSES)
>
>    Università Politecnica delle Marche
>    (formerly known as Università di Ancona)
>
>    r.lucchetti(a)univpm.it
>    http://www2.econ.univpm.it/servizi/hpp/lucchetti
> -------------------------------------------------------
>
> _______________________________________________
> Gretl-devel mailing 
> listGretl-devel(a)lists.wfu.eduhttp://lists.wfu.edu/mailman/listinfo/gretl-devel
>
> !
>
> _______________________________________________
> Gretl-devel mailing list
> Gretl-devel(a)lists.wfu.edu
> http://lists.wfu.edu/mailman/listinfo/gretl-devel
>
In fact, I'm beginning to thing that we ought to provide a Julia package ("GretlLink"?) on pkg.julialang.org for communication with gretl with functions such as the above and more, ideally written by a specialist (Andreas, are you interested?). So in practice, a "using GretlLink" statement would be implicit every time we enter a "foreign" environment, possibly preceded by a 'Pkg.Add("GretlLink")' if necessary.

I'd like to help here, but I'm also bit swamped. I'm pretty up to date on the Julia side, but I'm not sure what it would take to make a good foreign environment in Gretl. If either of you can explain what is supposed to happen on the Julia side then I can probably do it without too much difficulty.

On Thu, Jan 21, 2016 at 3:38 AM, <[email protected]> wrote:
A couple of Gretl scripts for
the same set of tests
(parseintperf(),mandelperf(),pisum())
Oleh

21 січня 2016, 09:29:49, від "Riccardo (Jack) Lucchetti" <[email protected]>:

On Wed, 20 Jan 2016, Allin Cottrell wrote:

> Perhaps we should offer a prize for the first example of actual time-saving 
> (and/or improvement in accuracy) in sending a calculation of the sort that 
> might be required in gretl out to julia for computation.

Easy: just take Oleh's recursion example.

<hansl>
set echo off
set messages off

function scalar fib(scalar n)
     return n<2 ? n : fib(n-1) + fib(n-2)
end function

set stopwatch
eval fib(30)
native = $stopwatch

foreign language=julia
 	function fib(n)
 		if n<2
 			return n
 		else
 			return fib(n-1)+fib(n-2)
 		end
 	end
 	println(fib(30))
end foreign
julia = $stopwatch

print native julia
</hansl>

<output>
832040
832040


          native =  71.920384

           julia =  4.4912745
</output>

-------------------------------------------------------
   Riccardo (Jack) Lucchetti
   Dipartimento di Scienze Economiche e Sociali (DiSES)

   Università Politecnica delle Marche
   (formerly known as Università di Ancona)

   [email protected]
   http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------
_______________________________________________
Gretl-devel mailing list
[email protected]
http://lists.wfu.edu/mailman/listinfo/gretl-devel
!

_______________________________________________
Gretl-devel mailing list
[email protected]
http://lists.wfu.edu/mailman/listinfo/gretl-devel

Reply via email to