Re: [julia-users] Julia and Object-Oriented Programming

2015-10-23 Thread ssarkarayushnetdev
Inheritance should be understood in terms of properties (and operations on properties) of a classes and sub-classes. In functional programming language, application of functions like *func_1*(x, y, *func_2*(z, p)) is implicitly exploiting the idea of inheritance. Making such relationships expli

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-23 Thread Brendan Tracey
On Friday, October 23, 2015 at 7:38:37 AM UTC-6, Abe Schneider wrote: > > An OO approach is really just specifying an interface in a formal manner. > The second you write any type of interface, you always risk making a choice > that will haunt you down the road. I don't see the difference between

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-23 Thread Brendan Tracey
On Friday, October 23, 2015 at 7:22:28 AM UTC-6, Abe Schneider wrote: > > Ah, okay, that is different then. What's the advantage of creating a new > method versus copying the fields? I would imagine there is a penalty with > each deference you have to follow in order to make that work. > The a

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-23 Thread Abe Schneider
An OO approach is really just specifying an interface in a formal manner. The second you write any type of interface, you always risk making a choice that will haunt you down the road. I don't see the difference between: class Foo { float getX() { ... } float getY() { ... } } and: type Foo

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-23 Thread Abe Schneider
Ah, okay, that is different then. What's the advantage of creating a new method versus copying the fields? I would imagine there is a penalty with each deference you have to follow in order to make that work. I'm not familiar with Scala, so sorry if I'm telling you something you > know, but in

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-22 Thread ssarkarayushnetdev
It is very nice to exchange thoughts with mathematicians. If classes, instances, types, inheritance, polymorphism and many other things in OOP were derived from concepts in mathematics then there should be no contradiction between scientific computing and OOP. It is just matter of correct inte

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-22 Thread ssarkarayushnetdev
Thank you for the link. I guess an intermediate layer of C application should be written for specific function calls, parameter passing and result set accumulation or manipulation. From Scala compiler (and executor) this application can be accessed through Native Interfaces (JNA4Scala !!). I am

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-22 Thread vavasis
One way to build a code-base that everyone can share is to specify interfaces to datatypes as in methods in C++ base classes. Another way is for each individual to write his/her own code, and then read everyone else's code, and then meet at coffee shops and talk on the phone to get things to w

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-22 Thread Spencer Russell
Julia has a well-developed C API, so you can embed it inside other applications. Info on using it is here: http://docs.julialang.org/en/release-0.4/manual/embedding/ -s > On Oct 22, 2015, at 3:07 PM, ssarkarayushnet...@gmail.com wrote

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-22 Thread ssarkarayushnetdev
I found that you are one of the core developers of Julia language. Could you please explain how Julia compiler and executor can be called through APIs ? Are there any documentations for APIs. Is it possible to call Julia compiler and executor through programming interfaces from Scala compiler /

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-22 Thread ssarkarayushnetdev
This is where Object Oriented programming can be useful. If you define a Trait and then several abstract classes extending the trait at many levels, it will be possible to define complex polynomial ( p(x)=det(A-x*B) ) specific abstract classes at deeper levels for computing coefficients. OOP co

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-22 Thread ggggg
What is the other option here? It seemed like with the OO/Julia way you are complaining about you at least have working (but slow) code handling your new polynomial type. In a case where your new type doesn't work with "obtainCoefficient", it won't work with any of your other code either. You w

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-22 Thread Brendan Tracey
> I do like this approach to composition/delegation, but it requires > automatically adding a lot of methods to the delegator, i.e. Unicycle in > this example, from all of its components, which feels kind of nasty and > dangerous, especially since we allow dynamic addition of methods > after

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-22 Thread Abe Schneider
I think this is generally in-line with what I've been advocating for, and not that different from Scala's mix-ins: trait Wheel { // ... } trait Frame { // ... } class Unicycle extends trait Wheel, Frame { // ... } is essentially doing the same thing (i.e. copying the member variables an

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-21 Thread ssarkarayushnetdev
Both Scala and Java are object oriented programming languages. These OOP languages were used to build Hadoop Map-Reduce, Spark, Mlib and many other big data programming / tools framework. Julia should be seamlessly integrated with these mainstream big data and machine learning frameworks for an

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-21 Thread vavasis
Earlier I posted a statement in this thread that object-oriented programming is in many cases not suitable for scientific software because it forces the designer to make decisions too early in the design process that become unwelcome constraints as the project progresses. If I understand what

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-21 Thread Stefan Karpinski
Excellent idea. You should make a PR against the Scala GitHub repo and see how it goes. On Wed, Oct 21, 2015 at 3:31 PM, wrote: > How is the idea that any function defined with Julia tag gets into a first > class object with name *Julia* in a combined ScalaJulia language : > > *Julia* function s

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-21 Thread ssarkarayushnetdev
How is the idea that any function defined with Julia tag gets into a first class object with name *Julia* in a combined ScalaJulia language : *Julia* function sphere_vol(r) # julia allows Unicode names (in UTF-8 encoding) # so

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-21 Thread Tom Breloff
I think this discussion shows complementary definitions of traits: - verb-based traits: a type agrees to implement all the verbs appropriate to the given "verb trait" - noun-based traits: a type agrees to contain certain underlying data (and thus the getter/setter verbs could be implic

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-21 Thread Stefan Karpinski
On Tue, Oct 20, 2015 at 7:00 PM, Brendan Tracey wrote: > > > Above, a relatively simple macro can replace all the "Type..." with the > fields of the composed types, applying multiple inheritance of the > structures without the baggage required in classic OOP. Then you can > compose your type fro

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-21 Thread Stefan Karpinski
On Tue, Oct 20, 2015 at 7:00 PM, Brendan Tracey wrote: > The US Supreme Court may get involved if you call it Scalia. Hard to know > in which direction. The watershed Scalia vs. Scalia case of 2016.

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-20 Thread Brendan Tracey
On Tuesday, October 20, 2015 at 3:39:00 PM UTC-6, Stefan Karpinski wrote: > > ScalaJulia is a skunkworks project Martin and I have been working on for a > while now. The hardest part so far has been deciding between whether to > call it ScalaJulia or JuliaScala. Other names we considered: Julal

Re: [julia-users] Julia and Object-Oriented Programming

2015-10-20 Thread Stefan Karpinski
ScalaJulia is a skunkworks project Martin and I have been working on for a while now. The hardest part so far has been deciding between whether to call it ScalaJulia or JuliaScala. Other names we considered: Julala, Scalia. On Tuesday, October 20, 2015, Sisyphuss wrote: > I'm sorry, but I didn't

[julia-users] Julia and Object-Oriented Programming

2015-10-18 Thread Sisyphuss
When I'm learning Julia, I am always thinking what is the correct way to do OOP in this language. It seems to me that what I learned in C++ does not apply in Julia. It took me long to realize that the equivalent of Class of C++ in Julia is not Type, but Module. Module is the basic function unit