Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Calling J from Python

Reply
Thread Tools

Calling J from Python

 
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      02-05-2007
Gosi a écrit :
> On Feb 5, 2:59 pm, "Diez B. Roggisch" <d...@nospam.web.de> wrote:
>
>>Gosi wrote:
>>
>>>It is quite easy to call J from Python

>>
>>http://groups.google.com/group/J-Pro...ead/thread/5e8...
>>
>>What is J, and why should we care?
>>
>>Diez

>
>
> J is in many ways similar to Python.
>
> J has very many advanced operations.
>
> http://www.jsoftware.com/
>

"""
Our policy on source for our binaries is between the extremes of
Microsoft proprietary source and Linux open source. You can have the
benefits of open source for J binaries, but under a license and a fee.
"""

Good bye J.
 
Reply With Quote
 
 
 
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      02-05-2007
Gosi a écrit :
> On Feb 5, 2:59 pm, "Diez B. Roggisch" <d...@nospam.web.de> wrote:
>
>>Gosi wrote:
>>
>>>It is quite easy to call J from Python

>>
>>http://groups.google.com/group/J-Pro...ead/thread/5e8...
>>
>>What is J, and why should we care?
>>
>>Diez

>
>
> J is in many ways similar to Python.


So are Javascript and Ruby.

> J has very many advanced operations.


what's an "advanced operation" ?

 
Reply With Quote
 
 
 
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      02-05-2007
Larry Bates a écrit :
>
> def avg(l):
> return float(sum(l))/len(l)
>
>
>>>>avg([1,2,3,4])

>
> 2.5


def avg(*args):
return float(sum(args)) / len(args))

>
> Which can actually be read and debugged in the future!


in_my_arms(tm)
 
Reply With Quote
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      02-05-2007
Alexander Schmolck a écrit :
> Larry Bates <> writes:
>
>
>>And why is that superior to this:
>>
>>def avg(l):
>> return float(sum(l))/len(l)
>>
>>
>>>>>avg([1,2,3,4])

>>
>>2.5

>
>
> Apart from being less to type and it is superior in that it's generalizes much
> better, e.g:
>
> avg&.^. NB. geomtric mean
> avg&.% NB. harmonic mean
> avg M NB. column mean of matrix M
> avg"1 M NB. row mean of matrix M
> 'as


Would my beloved wife's life depend on it, I just couldn't say what all
this garbage is supposed to mean. If that's supposed to be "superior",
I'm quite happy with my inferior favorite languages...
 
Reply With Quote
 
Laurent Pointal
Guest
Posts: n/a
 
      02-05-2007
Bruno Desthuilliers wrote:

> Gosi a écrit :
>> On Feb 5, 2:59 pm, "Diez B. Roggisch" <d...@nospam.web.de> wrote:
>> J has very many advanced operations.

>
> what's an "advanced operation" ?


An operation which dont stay in place.

 
Reply With Quote
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      02-05-2007
Diez B. Roggisch a écrit :
> Gosi wrote:
>
>
>>On Feb 5, 2:59 pm, "Diez B. Roggisch" <d...@nospam.web.de> wrote:
>>
>>>Gosi wrote:
>>>
>>>>It is quite easy to call J from Python
>>>
>>>http://groups.google.com/group/J-Pro...ead/thread/5e8...
>>>
>>>What is J, and why should we care?
>>>
>>>Diez

>>
>>J is in many ways similar to Python.
>>
>>J has very many advanced operations.

>
>
> What exactly do you call "similar to python" when the following is a program
> written in it? Compared to that, even Perl is a wonder of readability...
>
> m =: >@(0&{)
> v =: >@(1&{)
> h =: >@(2&{)
> qu =: >@(3&{)
> z =: i.@0:
> ret =: |.@}:
> init =: z;z;z;i.
> f1m =: (m,{.@qu);v;h;}.@qu
> f5m =: (z;(v,{:@m);h;qu,ret@m) @ (f1m^:5)
> f1h =: (z;z;(h,{:@v);(qu,ret@v)) @ (f5m^:12)
> f12h =: (z;z;z;qu,ret@h,{:@h) @ (f1h^:12)
> perm =: qu @ f12h @ init
> ord =: *./ @ (#&>"_) @ C.
> days =: -: @ ord @ perm


Yuck. I'd rather program in b**k.

 
Reply With Quote
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      02-05-2007
Alexander Schmolck a écrit :
> Bjoern Schliessmann <usenet-mail-> writes:
>
>
>>Alexander Schmolck wrote:
>>
>>
>>>Apart from being less to type

>>
>>Cool. Less to type.

>
>
> Yes. Readability is more important in many context, but for something designed
> for interactive experimentation and exploration little typing is absolutely
> essential. Would you use a calculator that would require Java-style
> boilerplate to add two numbers?


No, thanks. But hopefully we have Python :

Python 2.4.1 (#1, Jul 23 2005, 00:37:37)
[GCC 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)] on
linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 3 + 4

7
>>>


!-)
 
Reply With Quote
 
Alexander Schmolck
Guest
Posts: n/a
 
      02-05-2007
Bruno Desthuilliers <> writes:

> No, thanks. But hopefully we have Python :
>
> Python 2.4.1 (#1, Jul 23 2005, 00:37:37)
> [GCC 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)] on linux2
>
> Type "help", "copyright", "credits" or "license" for more information.
> >>> 3 + 4

> 7
> >>>


My calculuator even gives a pretty good answer if I divide them (without
importing anything from the __future__).

'as

 
Reply With Quote
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      02-05-2007
Laurent Pointal a écrit :
> Bruno Desthuilliers wrote:
>
>
>>Gosi a écrit :
>>
>>>On Feb 5, 2:59 pm, "Diez B. Roggisch" <d...@nospam.web.de> wrote:
>>>J has very many advanced operations.

>>
>>what's an "advanced operation" ?

>
>
> An operation which dont stay in place.
>


You meant something like a good camembert ?-)
 
Reply With Quote
 
greg
Guest
Posts: n/a
 
      02-06-2007
Alexander Schmolck wrote:
> For example I once wrote this (slow) code to display
> part of a mandelbrot fractal:
>
> load'viewmat'
> viewmat+/2&>((j.~/~(%~i99)&+@:*^i.32)0
>
> It'll likely require you more typing in python,


Yes, but with Python you wouldn't have to spend a
couple of weeks sitting and thinking before starting
to type that line...

--
Greg
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
c++ calling java calling c++ ... Klaus Friese C++ 7 08-15-2005 09:23 PM
calling virtual function results in calling function of base class... Andreas Lagemann C++ 8 01-10-2005 11:03 PM
calling virtual function results in calling function of base class ... tiwy C++ 0 01-09-2005 11:17 PM
Calling FormsAuthentication.SignOut() after calling Response.Flush =?Utf-8?B?TWFydGluIExlZQ==?= ASP .Net 1 09-28-2004 12:47 PM
Server Side button calling page_load before calling it's own click event. Ryan Ternier ASP .Net 4 07-29-2004 01:06 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57