Forums

Java Back End

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

Re: Java Back End

Postby Charles » Thu Jul 21, 2011 12:13 am

Hops, did you know about the "extern" feature in Cobra?

Also, is the email address I have for you any good? You don't reply.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Java Back End

Postby hopscc » Fri Jul 22, 2011 4:29 am

Yeah - thats the thing that was renamed from 'fake' for providing/describing info of a class implemented elsewhere ( like in c# alongside cobra code) - also p/Invoke tweaking.

What are you thinking of wrt that ?

Sorry about email - The address you have is correct - unfortunately I tend to chk it at rather irregular intervals
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Re: Java Back End

Postby Charles » Fri Jul 22, 2011 5:44 am

hopscc wrote:Yeah - thats the thing that was renamed from 'fake' for providing/describing info of a class implemented elsewhere ( like in c# alongside cobra code) - also p/Invoke tweaking.

What are you thinking of wrt that ?

I forget if I mentioned this before, but "extern" was made exactly for specifying external signatures. I needed this for the first Cobra compiler which was written in Python (not IronPython). You can use it for the JVM work or any other back-end.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Java Back End

Postby hopscc » Mon Jul 25, 2011 7:32 am

Theres a new patch on the ticket.
Passes all tests and compiles itself.
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Re: Java Back End

Postby Charles » Mon Jul 25, 2011 6:01 pm

Applied. Thanks.

-- I think when people run on -platform:jvm they are going to want the regular jvm casing for packages like "java.util".

-- We haven't discussed this before, but it seems that Cobra should see Java's getFoo and setFoo methods as properties. These were actually called properties in the context of "Java Beans" several years ago; see:

http://download.oracle.com/javase/tutorial/javabeans/properties/index.html
http://download.oracle.com/javase/tutorial/javabeans/properties/properties.html

I haven't really checked if your JVM back-end is doing that or if you commented on it.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Java Back End

Postby hopscc » Tue Jul 26, 2011 8:00 am

re Regular jvm package casing
Maybe so but they're not going to get it without a rework of some of the non platform dependent pieces of the compiler.

I started off doing package naming exactly for the reason cited and found it wasnt gonna work with some of the existing coding assumptions
- see Expr.cobra IdentifierExpr._bindInt with use of canBeUndottedMember to
determine whether or not to do a local symbol lookup or defer to a (later) namespace search .... or something.
(actually found this was broken when tracking the java/xjava question you asked previously).
I'm goanna go with the existing high level flow/assumptions unless its really impossible, at least until theres something more complete working

Java Properties
Yes java properties/bean properties use get/set ( and 'is') prefixes on methods - thats in JvmJarSig.cobra - JavaClassType.chkForProp
Java (libraries) doesnt use properties anything like .Net - either as commonly or even consistently named as per the above - so at best its an imperfect mapping.
I also started off doing a similar mapping for indexers but there are too many false hits for the indexer pattern (get/set method with one index arg /index arg and value) so thats been suppressed for the moment.
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Re: Java Back End

Postby hopscc » Wed Aug 03, 2011 3:33 am

patch3 on ticket
- set properties and some minor tweaks ('is' prefixed props NYI).
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Re: Java Back End

Postby Charles » Wed Aug 03, 2011 7:41 am

Thanks. Applied.

What does "NYI" mean?
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: Java Back End

Postby ObtuseAngle » Wed Aug 03, 2011 4:27 pm

Not Yet Implemented, I suspect.
99 programming bugs in the code, 99 bugs in the code, fix 1 bug and compile it again, 101 programming bugs in the code
ObtuseAngle
 
Posts: 42
Location: Gippsland, Australia

Re: Java Back End

Postby Charles » Wed Aug 03, 2011 5:28 pm

Ah thanks.

Hops, what do you mean by "'is' prefixed props"? I presume that props will be implied by methods named "getFoo" and "setFoo" allowing "print obj.foo" and "obj.foo = bar". What does any of that have to do with "is"? Maybe you already covered this in this thread or in your docs, but if so, I'm not recalling correctly.
Charles
 
Posts: 2515
Location: Los Angeles, CA

PreviousNext

Return to Discussion

Who is online

Users browsing this forum: No registered users and 95 guests