Initial thoughts on file streams

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Initial thoughts on file streams

brweber2
I have no idea if I'm going down the correct path, so before I do any heavy lifting I'd love to get some feedback on my initial idea for file streams.


Like I said, I'm not sure if I'm heading off in the wrong direction or if I'm in the general neighborhood... (and I also haven't tested it yet to make sure it is correct).

Here is the java code:


And the asm that I would use: 


Reply | Threaded
Open this post in threaded view
|

Re: Initial thoughts on file streams

brweber2
Ohhh google.  You are too smart for your own good.  Let's try this again:

[hidden email]:b5b1b191b012abc9fa57.git

[hidden email]:295646aee8bfd59ba8c3.git
Reply | Threaded
Open this post in threaded view
|

Re: Initial thoughts on file streams

James Ladd
Can we have a link/url ?

On Sat, Dec 24, 2011 at 3:14 PM, brweber2 <[hidden email]> wrote:
Ohhh google.  You are too smart for your own good.  Let's try this again:

[hidden email]:b5b1b191b012abc9fa57.git

[hidden email]:295646aee8bfd59ba8c3.git

Reply | Threaded
Open this post in threaded view
|

Re: Initial thoughts on file streams

brweber2
In reply to this post by brweber2
Final take.  

https://gist.github.com/1516269

The java is on the bottom and the asm on the top.
Reply | Threaded
Open this post in threaded view
|

Re: Initial thoughts on file streams

James Ladd
I think I can see where you are going with this.
Essentially getting the java right and working, then using the ASM output to turn the java into the equivalent <> instructions - YES?
This will almost work. The part that will get tricky is that the only object you can pass into or get back from java is a ProtoObject.
So you need to wrap and unwrap these accordingly to your needs.

For example, when you get a ProtoObject that is a Smalltalk String it has a javavalue that is the Java String.
You can see this sort of thing in action in Primitives.java

When a Character is returned you need to new the Character and set its javavalue.

Your FileStream.st will end up having an initialize that calls javavalue to store the RandomAccessFile you open during
initialisation or which ever method opens the actual file.

Does this help?

Given Im just about to go into Christmas mode with my twins I can't add more right now. However, Ill keep a check on my email.

On Sat, Dec 24, 2011 at 3:19 PM, brweber2 <[hidden email]> wrote:
Final take.  


The java is on the bottom and the asm on the top.

Reply | Threaded
Open this post in threaded view
|

Re: Initial thoughts on file streams

brweber2
That's exactly what I was thinking of doing.  I'll modify all the parameters and return values to be ProtoObjects and I'll give this a whirl.  

Thanks for the quick response.  I've got a couple of young boys, so I'll be pretty busy the next couple of days as well, but I'll be back online as soon as I can. :)

Thanks again and Merry Christmas!
Reply | Threaded
Open this post in threaded view
|

Re: Initial thoughts on file streams

James Ladd
Your welcome and it is great to have your contribution.
I hope to be around when you need help.

On Sat, Dec 24, 2011 at 3:47 PM, brweber2 <[hidden email]> wrote:
That's exactly what I was thinking of doing.  I'll modify all the parameters and return values to be ProtoObjects and I'll give this a whirl.  

Thanks for the quick response.  I've got a couple of young boys, so I'll be pretty busy the next couple of days as well, but I'll be back online as soon as I can. :)

Thanks again and Merry Christmas!

Reply | Threaded
Open this post in threaded view
|

Re: Initial thoughts on file streams

SeanTAllen
In reply to this post by brweber2
That is from GNU Smalltalk, which is GPL, if you are going to crib from somewhere it needs to be from something in the Squeak/Pharo family.
There is much to like about GNU Smalltalk but for legal/license reasons, we can't use anything from it.

On Fri, Dec 23, 2011 at 11:11 PM, brweber2 <[hidden email]> wrote:
I have no idea if I'm going down the correct path, so before I do any heavy lifting I'd love to get some feedback on my initial idea for file streams.


Like I said, I'm not sure if I'm heading off in the wrong direction or if I'm in the general neighborhood... (and I also haven't tested it yet to make sure it is correct).

Here is the java code:


And the asm that I would use: