'Internals' questions

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

'Internals' questions

Phil B
I need to do a couple of things that are mucking around a bit at Cuis/VM
internals and could use some help getting started:

1) How can I have one block called just after the image starts up (i.e.
all other image state has been restored (esp. FFI) and things are about
to be handed off to the user) and another just before the image saves
and/or shuts down.

2) What's the best way to get the pathname for the currently running
image?

Thanks,
Phil


_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: 'Internals' questions

Phil B
Found the answer (sort of, still working out why things aren't working
as expected on startup/shutdown):  The Smalltalk object handles both
issues.

On Fri, 2015-01-23 at 04:59 -0500, Phil (list) wrote:
> I need to do a couple of things that are mucking around a bit at Cuis/VM
> internals and could use some help getting started:
>
> 1) How can I have one block called just after the image starts up (i.e.
> all other image state has been restored (esp. FFI) and things are about
> to be handed off to the user) and another just before the image saves
> and/or shuts down.

Smalltalk addToStartUpList: and Smalltalk addToShutDownList:

>
> 2) What's the best way to get the pathname for the currently running
> image?

Smalltalk imagePath

>
> Thanks,
> Phil

Now if I could only stop forgetting that the Smalltalk object exists...



_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: 'Internals' questions

Casey Ransberger-2

> On Jan 26, 2015, at 9:13 AM, "Phil (list)" <[hidden email]> wrote:
>
> Now if I could only stop forgetting that the Smalltalk object exists...

There are no objects, really. As a matter of fact, it's all just technical theatre:D

Whatcha doin' with FFI?
_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: 'Internals' questions

Phil B
On Mon, 2015-01-26 at 17:05 -0800, Casey Ransberger wrote:
> > On Jan 26, 2015, at 9:13 AM, "Phil (list)" <[hidden email]> wrote:
> >
> > Now if I could only stop forgetting that the Smalltalk object exists...
>
> There are no objects, really. As a matter of fact, it's all just technical theatre:D
>

lol.. you mean it's not turtles all the way down?

> Whatcha doin' with FFI?

Prototyping a database app idea I have.  I was starting down the path to
yet another silly web app in a language I won't mention.  Then realized
'hey, I could probably do a big chunk of this in Smalltalk in a fraction
of the time'... if only I could automate the database sync at
startup/shutdown.

Probably going to start with SQLite and if everything goes well move
over to a multi-user DB down the line.


_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: 'Internals' questions

Casey Ransberger-2
Inline

> On Jan 26, 2015, at 6:31 PM, "Phil (list)" <[hidden email]> wrote:
>
> On Mon, 2015-01-26 at 17:05 -0800, Casey Ransberger wrote:
>>> On Jan 26, 2015, at 9:13 AM, "Phil (list)" <[hidden email]> wrote:
>>>
>>> Now if I could only stop forgetting that the Smalltalk object exists...
>>
>> There are no objects, really. As a matter of fact, it's all just technical theatre:D
>
> lol.. you mean it's not turtles all the way down?

No, it isn't. It's imaginary turtles all the way down, and that's how I fell in love!

>> Whatcha doin' with FFI?
>
> Prototyping a database app idea I have.  I was starting down the path to
> yet another silly web app in a language I won't mention.  Then realized
> 'hey, I could probably do a big chunk of this in Smalltalk in a fraction
> of the time'... if only I could automate the database sync at
> startup/shutdown.
>
> Probably going to start with SQLite and if everything goes well move
> over to a multi-user DB down the line.

Before you spend too much time inventing that, you should know that there's a database interface, not an ORM like... oh whatever that thing was called, but a DB interface that uses FFI and you can make queries with Smalltalk statements. If you google around a bit, you'll find it. I think it might have been called DBX or something like that. Development seems to have shifted to Pharo, but...

I suspect it might be more productive to make the existing thing work with Cuis than to invent another thing that does the same job. DB interfaces over FF interfaces are going to be complicated beasts, and likely a lot of work.

Anyway, cool to hear about someone with a want to do database stuff with Cuis!

Cheers,

Casey

>
> _______________________________________________
> Cuis mailing list
> [hidden email]
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: 'Internals' questions

Phil B
On Mon, 2015-01-26 at 20:53 -0800, Casey Ransberger wrote:

> >> Whatcha doin' with FFI?
> >
> > Prototyping a database app idea I have.  I was starting down the path to
> > yet another silly web app in a language I won't mention.  Then realized
> > 'hey, I could probably do a big chunk of this in Smalltalk in a fraction
> > of the time'... if only I could automate the database sync at
> > startup/shutdown.
> >
> > Probably going to start with SQLite and if everything goes well move
> > over to a multi-user DB down the line.
>
> Before you spend too much time inventing that, you should know that there's a database interface, not an ORM like... oh whatever that thing was called, but a DB interface that uses FFI and you can make queries with Smalltalk statements. If you google around a bit, you'll find it. I think it might have been called DBX or something like that. Development seems to have shifted to Pharo, but...
>
> I suspect it might be more productive to make the existing thing work with Cuis than to invent another thing that does the same job. DB interfaces over FF interfaces are going to be complicated beasts, and likely a lot of work.

Thanks for the tip, I'll look into it.  It sounds like it might do the
trick as I'm definitely *not* looking for ORM here, just a basic
interface to the database (sometimes a table is just a table.)

>
> Anyway, cool to hear about someone with a want to do database stuff with Cuis!
>

Someone has to do it! :-)

> Cheers,
>
> Casey
>



_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: 'Internals' questions

Pierce Ng-2
On Tue, Jan 27, 2015 at 04:13:46AM -0500, Phil (list) wrote:
> > Anyway, cool to hear about someone with a want to do database stuff with
> > Cuis!
> Someone has to do it! :-)

I wrote an SQLite wrapper *for Pharo* using NativeBoost. It is now part of
PharoExtras on smalltalkhub.com.

Not sure how well NativeBoost fits with the Cuis philosophy though.

Pierce

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: 'Internals' questions

Juan Vuletich-4
In reply to this post by Casey Ransberger-2
Hi folks,

(inline)

On 1/27/2015 1:53 AM, Casey Ransberger wrote:

> Inline
>
>> On Jan 26, 2015, at 6:31 PM, "Phil (list)"<[hidden email]>  wrote:
>>
>> On Mon, 2015-01-26 at 17:05 -0800, Casey Ransberger wrote:
>>>> On Jan 26, 2015, at 9:13 AM, "Phil (list)"<[hidden email]>  wrote:
>>>>
>>>> Now if I could only stop forgetting that the Smalltalk object exists...
>>> There are no objects, really. As a matter of fact, it's all just technical theatre:D
>> lol.. you mean it's not turtles all the way down?
> No, it isn't. It's imaginary turtles all the way down, and that's how I fell in love!
>
>>> Whatcha doin' with FFI?
>> Prototyping a database app idea I have.  I was starting down the path to
>> yet another silly web app in a language I won't mention.  Then realized
>> 'hey, I could probably do a big chunk of this in Smalltalk in a fraction
>> of the time'... if only I could automate the database sync at
>> startup/shutdown.
>>
>> Probably going to start with SQLite and if everything goes well move
>> over to a multi-user DB down the line.
> Before you spend too much time inventing that, you should know that there's a database interface, not an ORM like... oh whatever that thing was called, but a DB interface that uses FFI and you can make queries with Smalltalk statements. If you google around a bit, you'll find it. I think it might have been called DBX or something like that. Development seems to have shifted to Pharo, but...
>
> I suspect it might be more productive to make the existing thing work with Cuis than to invent another thing that does the same job. DB interfaces over FF interfaces are going to be complicated beasts, and likely a lot of work.
>

Also, check
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/blob/master/Documentation/OptionalPackagesForCuis.md 
to see what others have been doing, and for opportunities to
collaborate, etc.

> Anyway, cool to hear about someone with a want to do database stuff with Cuis!
>
> Cheers,
>
> Casey

Cheers,
Juan Vuletich

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: 'Internals' questions

Juan Vuletich-4
In reply to this post by Pierce Ng-2
Hi folks,

(below)

On 1/27/2015 11:06 AM, Pierce Ng wrote:

> On Tue, Jan 27, 2015 at 04:13:46AM -0500, Phil (list) wrote:
>>> Anyway, cool to hear about someone with a want to do database stuff with
>>> Cuis!
>> Someone has to do it! :-)
> I wrote an SQLite wrapper *for Pharo* using NativeBoost. It is now part of
> PharoExtras on smalltalkhub.com.
>
> Not sure how well NativeBoost fits with the Cuis philosophy though.
>
> Pierce

The main objective of Cuis is to become your Dynabook. We don't want
artificial barriers on what you can do with it. If you need to access
existing external code, an FFI (like NativeBoost) is the way to go. For
instance, ExternalClipboard.pck.st (in the main Cuis repo) uses FFI to
access the host OS clipboard in Windows. On the other hand, it is
desirable, at least for the base image, to be completely portable and
open for study and enhancement, like "Design Principles Behind
Smalltalk". That's why there's no use of FFI in the base image itself.
But on your own solutions, it is you who chooses the balance between
these criteria and the convenience of calling existing and well tested
external code.

So, here, the decision would be whether to port NativeBoost to Cuis
(that would be a very welcome optional package!), or convert your code
to use the classic FFI (that is already available).

Cheers,
Juan Vuletich

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: 'Internals' questions

Phil B
In reply to this post by Juan Vuletich-4
On Wed, 2015-01-28 at 10:07 -0300, Juan Vuletich wrote:

>
> Also, check
> https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/blob/master/Documentation/OptionalPackagesForCuis.md 
> to see what others have been doing, and for opportunities to
> collaborate, etc.
>

Yep... that's part of why I thought of Cuis for this project: Hannes
already ported a SQLite interface :-)


_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: 'Internals' questions

Phil B
On Wed, 2015-01-28 at 11:37 -0500, Phil (list) wrote:

> On Wed, 2015-01-28 at 10:07 -0300, Juan Vuletich wrote:
>
> >
> > Also, check
> > https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/blob/master/Documentation/OptionalPackagesForCuis.md 
> > to see what others have been doing, and for opportunities to
> > collaborate, etc.
> >
>
> Yep... that's part of why I thought of Cuis for this project: Hannes
> already ported a SQLite interface :-)

I forgot to mention: some stuff I ported isn't on the list...
https://github.com/pbella/Cuis-Ports


_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
Reply | Threaded
Open this post in threaded view
|

Re: 'Internals' questions

Juan Vuletich-4
On 1/28/2015 1:40 PM, Phil (list) wrote:

> On Wed, 2015-01-28 at 11:37 -0500, Phil (list) wrote:
>> On Wed, 2015-01-28 at 10:07 -0300, Juan Vuletich wrote:
>>
>>> Also, check
>>> https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/blob/master/Documentation/OptionalPackagesForCuis.md
>>> to see what others have been doing, and for opportunities to
>>> collaborate, etc.
>>>
>> Yep... that's part of why I thought of Cuis for this project: Hannes
>> already ported a SQLite interface :-)
> I forgot to mention: some stuff I ported isn't on the list...
> https://github.com/pbella/Cuis-Ports
>

Thanks! Just added yours.

Cheers,
Juan Vuletich

_______________________________________________
Cuis mailing list
[hidden email]
http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org