473,689 Members | 2,890 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling J from Python

It is quite easy to call J from Python

http://groups.google.com/group/J-Pro...84b75667f5f64e

Feb 5 '07 #1
50 2886
Gosi wrote:
It is quite easy to call J from Python

http://groups.google.com/group/J-Pro...84b75667f5f64e

What is J, and why should we care?

Diez
Feb 5 '07 #2
On Feb 5, 2:59 pm, "Diez B. Roggisch" <d...@nospam.we b.dewrote:
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/

Feb 5 '07 #3
Gosi wrote:
J is in many ways similar to Python.
The only one I see at the moment is that they're both some kind of
programming languages.
J has very many advanced operations.
Sure.

Mh, just looking at some "advanced" J source taken from
wikipedia.org makes me feel sick:

| Here's a J program to calculate the average of a list of numbers:
| avg=: +/ % #
| avg 1 2 3 4
| 2.5

In the meantime, do you now have an answer to why we should care?

Regards,
Björn

--
BOFH excuse #314:

You need to upgrade your VESA local bus to a MasterCard local bus.

Feb 5 '07 #4
hg
Bjoern Schliessmann wrote:
Gosi wrote:
>J is in many ways similar to Python.

The only one I see at the moment is that they're both some kind of
programming languages.
>J has very many advanced operations.

Sure.

Mh, just looking at some "advanced" J source taken from
wikipedia.org makes me feel sick:

| Here's a J program to calculate the average of a list of numbers:
| avg=: +/ % #
| avg 1 2 3 4
| 2.5

In the meantime, do you now have an answer to why we should care?

Regards,
Björn

--
BOFH excuse #314:

You need to upgrade your VESA local bus to a MasterCard local bus.

Be nice !

Feb 5 '07 #5

GosiJ is in many ways similar to Python.

GosiJ has very many advanced operations.

Gosihttp://www.jsoftware.com/

Doesn't look like open source of any variety. If a person uses Python with
various add-ons (RPy, numpy, matplotlib, etc) why would they want to switch
to a closed source product?

Skip
Feb 5 '07 #6
Gosi wrote:
On Feb 5, 2:59 pm, "Diez B. Roggisch" <d...@nospam.we b.dewrote:
>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;q u,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
http://www.jsoftware.com/jwiki/Essay..._Clock_Problem
Diez
Feb 5 '07 #7
On Feb 5, 12:23 pm, "Diez B. Roggisch" <d...@nospam.we b.dewrote:
Gosi wrote:
On Feb 5, 2:59 pm, "Diez B. Roggisch" <d...@nospam.we b.dewrote:
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...

(cryptic gibberish snipped)

http://www.jsoftware.com/jwiki/Essay..._Clock_Problem

Diez
Please avoid posting code looking like garbled profanities in c.l.py.
This was outright offensive.

George

Feb 5 '07 #8
sk**@pobox.com writes:
GosiJ is in many ways similar to Python.

GosiJ has very many advanced operations.

Gosihttp://www.jsoftware.com/

Doesn't look like open source of any variety. If a person uses Python with
various add-ons (RPy, numpy, matplotlib, etc) why would they want to switch
to a closed source product?
You wouldn't, if for nothing else because python has far better scientific
libraries. If you've got an interest in programming languages as such J (or
some other APL) is worth a look though; it's also handy for quick mathematical
experimentation (J's array primitives are more expressive than what numpy
offers and python doesn't support rationals, so it's not just concise due to
perl-style crypticness). For example I once wrote this (slow) code to display
part of a mandelbrot fractal:

load'viewmat'
viewmat+/2&>:|((j.~/~(%~i:)99)&+@:* :)^:(i.32)0

It'll likely require you more typing in python, but then you'd need to do such
things quite a lot for seeing an amortization in terms of less time spent with
your PC; I think most people will find they need a seizable learning
investment to get anywhere with J and python already is very expressive for
the kind of things J is good at.

'as

Feb 5 '07 #9
Bjoern Schliessmann wrote:
Gosi wrote:
>J is in many ways similar to Python.

The only one I see at the moment is that they're both some kind of
programming languages.
>J has very many advanced operations.

Sure.

Mh, just looking at some "advanced" J source taken from
wikipedia.org makes me feel sick:

| Here's a J program to calculate the average of a list of numbers:
| avg=: +/ % #
| avg 1 2 3 4
| 2.5

In the meantime, do you now have an answer to why we should care?

Regards,
Björn
And why is that superior to this:

def avg(l):
return float(sum(l))/len(l)
>>>avg([1,2,3,4])
2.5
Which can actually be read and debugged in the future!

-Larry
Feb 5 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1642
by: Bill Orcutt | last post by:
Having seen the number of lost souls asking questions about embedding Python in the archives of this group, I hesitate to add myself to their number, but I've hit a problem I can't quite get my head around. I have a simple C program that embeds a python interpreter to execute python commands and return stdout, and to a point everything works as intended. The problem that each command seems to be executed in its own context and knows...
0
2290
by: Natsu Mizutani | last post by:
Hello, I'm trying to wrap a c++ library using MPI inside with boost.python (or SWIG). I managed to find that calling `MPI::Init()` embeded in a c++ funtion would not work. So, I decided to use `pyMPI`. To avoid overhead of pickling and unpickling while calling `mpi.send` in Python, I'd rather call c++ functions `MPI::Isend()` etc. embeded in a c++ function.
2
2393
by: Satish Chimakurthi | last post by:
Hi all, My question is surely a basic one, but somehow, I am not able to figure it out. I have a python file "satish.py" as follows: *satish.py* def main(): y()
9
3764
by: F. GEIGER | last post by:
I've dev'ed a Python prototype of an app, that besides the internals making it up has a gui. While test-driven dev'ing the app's internals in Python is fun as usual, dev'ing the GUI is not so funny, at least for me. I guess dev'ing a GUI in a test-driven way is not possible, or is it? I'm using wxPython, so if anyone has an idea... For now most of the time I extend and change the gui things, then run it, do the clicks to go thru the...
11
9091
by: Kamilche | last post by:
What a debug nightmare! I just spent HOURS running my script through the debugger, sprinkling in log statements, and the like, tracking down my problem. I called a function without the ending parentheses. I sure do WISH Python would trap it when I try to do the following: MyFunc instead of:
1
1576
by: Stephen Kellett | last post by:
Hello everyone, I'm trying to do something in C calling Python and its failing. I'd be grateful if you could take a look and hopefully you have an answer. What I'm trying to do is determine the address of the "collect" function in the "gc" module. I want to do this so that we can determine when a garbage collection happens, regardless of how it is triggered (explicitly by a user call, or implicitly by the behaviour of the program...
1
1917
by: Gerald Klix | last post by:
I read the whol email thread carefully and could not find any sentence by Guido, which states that he does not accept ctypes for the standard library. He just declined to rewrite winreg. Did I miss something? Cya, Gerald -----Ursprüngliche Nachricht----- Von: python-list-bounces+gerald.klix=klix.ch@python.org Im Auftrag von
10
13295
by: Finger.Octopus | last post by:
Hello, I have been trying to call the super constructor from my derived class but its not working as expected. See the code: class HTMLMain: def __init__(self): self.text = "<HTML><BODY>"; print(self.text); def __del__(self): self.text = "</BODY></HTML>"; print(self.text);
47
4956
by: teju | last post by:
hi, i am trying 2 merge 2 projects into one project.One project is using c language and the other one is using c++ code. both are working very fine independently.But now i need to merge both and my c++ code should call c code.but when i tried to call a function in c code externing that function in my c++ code, i am getting unresolved external symbol error. Whatever i try its giving more and more errrors...so is it possible to merge 2...
16
3777
by: Jaco Naude | last post by:
Hi there, This is my first post over here and I hope someone can give me some guidance. I'm trying to embed Python into a Visual C++ 2008 application and I'm getting linker problems. I've compiled a DLL of the Python source code using the pythoncode VC++ project in the PCbuild folder of the source download and this works 100% without any warnings etc. I've done this in Debug and Release mode without any problems.
0
8594
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9076
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8786
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7621
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6454
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5810
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4547
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2219
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.