Regarding IronRuby... How true it sounds from this blog

On Wed, 30 Apr 2008 21:49:46 -0600, Curt H.
[email protected] wrote:

This isn’t dynamic, though. There has to be a single manifest for the
assembly that lists all the netmodules. I imagine it would be desirable
to be able to add a new library simply by copying it into the
appropriate directory without having to register it or relink the
assembly.

I obviously need to catch up on this thread to better understand the
topic
at hand.

/me is catching up…


/M:D

M. David P.
Co-Founder & Chief Architect, 3rd&Urban, LLC
Email: [email protected] | [email protected]
Mobile: (206) 999-0588
http://3rdandUrban.com | http://amp.fm |
M. David Peterson

On Wed, Apr 30, 2008 at 8:43 PM, Tomas M. <
[email protected]> wrote:

The only issue that needs to be solved is how to efficiently discover
libraries embedded in .NET assemblies.

It’s certainly the primary issue. :slight_smile:

On Wed, 30 Apr 2008 21:54:58 -0600, M. David P.
[email protected] wrote:

load

did I say load keyword? YIKES! I need to stop being such a language
whore. :wink:

I mean require and the related thread is @
http://rubyforge.org/pipermail/ironruby-core/2008-February/000858.html


/M:D

M. David P.
Co-Founder & Chief Architect, 3rd&Urban, LLC
Email: [email protected] | [email protected]
Mobile: (206) 999-0588
http://3rdandUrban.com | http://amp.fm |
M. David Peterson

Actually couldn’t you have something like…

openssl.rb:

require ‘IronRuby.Libraries.dll, version=xxxxxx, blahblabh’

and then just “require ‘openssl’” in your app?

On Wed, Apr 30, 2008 at 11:58 PM, Curt H.
[email protected] wrote:

libraries embedded in .NET assemblies.
http://rubyforge.org/mailman/listinfo/ironruby-core


Michael L.
[Polymath Prokrammer]
http://blog.prokrams.com

Michael L.:

The only issue with this is we’ll have to have some mechanism for them
to be referenced with require ‘zlib’, requrie ‘yaml’, et. al. in order
to maintain compatibility.

Agreed - we still have to build the require mechanism for libraries that
are hosted in different assemblies or within the same assembly.

Thanks,
-John

That could be easily fixed by including ‘zlib.rb’, ‘yaml.rb’ next to
IronRuby.exe. These files would do
require 'IronRuby.ZLib, version=1.0.0.0, …" to load the .NET
assemblies. I need to think about our loader story more, but this idea
seems to provide a nice way how to configure where the extensions are
located, which version should be used etc.

Tomas

Yes, I think I’ve already mentioned it :slight_smile:

You would need to identify the library inside the assembly. But that
could be easy - just add the type name:

require ‘MyTypeThatContainsLibInitializer, IronRuby.Libraries,
version=xxxxxx, blahblabh’

Tomas

On Wed, 30 Apr 2008 19:38:02 -0600, Tomas M.
[email protected] wrote:

I need to figure out how to do loading of Ruby libraries contained in an
assembly, but I think it could be done.

Didn’t we have this (or a very similar) conversation a while back?


/M:D

M. David P.
Co-Founder & Chief Architect, 3rd&Urban, LLC
Email: [email protected] | [email protected]
Mobile: (206) 999-0588
http://3rdandUrban.com | http://amp.fm |
M. David Peterson

On Wed, 30 Apr 2008 22:18:54 -0600, Tomas M.
[email protected] wrote:

Interesting has this e-mail just arrived?

Not sure. I’ve been away most of the day, so have no clue when it
officially arrived. The timestamp suggests it arrived soon after you
sent
it, but that, quite obviously, means nothing given the timestamp
wouldn’t
have been effected by a delayed delivery.

I’ve noticed there tends to be somewhat of a delay in delivery of mail
sent to the IronRuby list, though I haven’t seen anything quite as
delayed
as 9 hours.


/M:D

M. David P.
Co-Founder & Chief Architect, 3rd&Urban, LLC
Email: [email protected] | [email protected]
Mobile: (206) 999-0588
http://3rdandUrban.com | http://amp.fm |
M. David Peterson

Splitting into different DLLs complicate things for Silverlight.

On the desktop you can have the assembly loading be dynamic with a
foo.rb wrapper for a library. However, Silverlight (today) requires the
DLL would have to be downloaded to the client first before loading. In
other words, the AppManifest.xaml (and the XAP, but that’s optional)
would have to know about ALL the IronRuby Library DLLs you “could” want
to use. We automate the generation of this file and XAP, so that tool
(Chiron) would need to know this. While this isn’t a direct problem, it
does make the # of assemblies you need to include with your app go from
2 to n. Splitting could potentially save download size, but figuring out
which DLLs to include is hard (see below).

Are there other options for how to get DLLs onto a client machine?

To get this option out of the way, we can’t bake this logic (download an
assembly when you require it) into our Silverlight integration, or even
push the responsibility on the libraries themselves. Downloading in SL
requires asynchronous requests, and we can’t pause user code to do this
(aka. Continuations). We could technically implement it by hacking on
XmlHttpRequest directly to get synchronous support, but ugh. If network
connection gets flakey your browser hangs … not very pleasant.

Do we introduce a config.rb to Silverlight that lets you define the
closure of all the assemblies you’ll need? This file gets loaded first,
it triggers the downloads the necessary assemblies, and then load the
real program?

Again, the AppManifest solution will work, but it’s not very
dynamic-language-esc, and becomes more apparent if we split the
libraries out. I’m just brainstorming for better solutions to this.
Ideas?

~Jimmy

Whoa, if you want to actually understand the first paragraph, read this
version =P

Interesting has this e-mail just arrived?

Tomas

Well… it wasn’t in my reader when I sent the exact same thing :wink:

On Thu, May 1, 2008 at 12:18 AM, Tomas M.
[email protected] wrote:

Subject: Re: [Ironruby-core] Opening up our tree to external committers
Subject: Re: [Ironruby-core] Opening up our tree to external committers

Those directories would compile into stand-alone assemblies, but this gives folks a place to build and collaborate. I’m leaning towards treating those projects as living on a level above our current libraries + runtime:

Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core


Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core


Michael L.
[Polymath Prokrammer]
http://blog.prokrams.com

Would a multi-file assembly be a good fit for this? I haven’t worked
much
with them, so I’m not sure about including multiple namespaces within
one,
but I would imagine it’s entirely possible.

On Wed, Apr 30, 2008 at 10:02 PM, Michael L. <

On Thu, May 1, 2008 at 2:37 AM, Jimmy S. <
[email protected]> wrote:

potentially save download size, but figuring out which DLLs to include is
connection gets flakey your browser hangs … not very pleasant.
~Jimmy
Wouldn’t this, then, lend itself toward a solution towards that proposed
by
/M:D? I don’t know multi-file assemblies that well, but it seems the
best
solution in that, iirc, only the .netmodules needed are loaded as they
are
called, but they’re already linked by the primary assembly. This might
be
more complicated to maintain and cleanly build; I don’t know. I also
don’t
quite understand the “not dynamic” comment, but again, I’m not too
familiar
with multi-file assemblies.

(Also, apologies for the duplicate in the other thread.)

-R2

Sorry, I see this is being discussed elsewhere. Kindly disregard. :slight_smile:

-R2

IronPython has the following scheme for loading Python modules:

  1.   IronPython looks for all the PythonModuleAttribute custom 
    

attributes inside any assembly registered with IronPython using
“clr.AddReference(assemblyName)” which is similar to “require” in Ruby.
The assembly-level attributes point to all the Python modules available
inside the assembly. For eg, “[assembly: PythonModuleAttribute(“nt”,
typeof(IronPython.Modules.PythonNT))]” indicates that the “PythonNT” C#
type implements the “nt” Python module. A single assembly can contain
multiple Python modules.

  1.   On startup, IronPython registers IronPython.Modules.dll 
    

automatically. Hence, all Python modules from the dll become accessible.

  1.   Python loads site.py on startup. The site.py that ships with 
    

IronPython looks inside a specific folder and registers all assemblies
in that folder. So a user can drop an assembly in this folder, and all
the Python modules in the assembly will become accessible. I believe Seo
uses this to good measure in FePy to make his own set of Python modules
available to users.

  1.   Accessible modules are put on a stand-by list. They get 
    

activated only if the user does “import someModule” which is similar to
“require” in Ruby. Until then, the user is not exposed to the fact that
the modules are accessible.

Could a similar scheme work for IronRuby? All the small IronRuby
libraries owned by external committers could live in an assembly like
IronRuby.Libraries.Staging.dll, and this could be placed in some
well-known folder relative to IronRuby.dll. Size should not be much of
an issue in Silverlight as you would expect that the IronRuby runtime
and libraries would be cached on the user’s machine most of the time. If
it does become an issue, we can later break up
IronRuby.Libraries.Staging.dll into smaller pieces. Once the DLR gets
more stable, IronRuby.Libraries.Staging.dll can be merged into
IronRuby.Libraries.dll.

Thanks,
Shri
Want to work on IronPython, IronRuby,
F#http://blogs.msdn.com/ironpython/archive/2008/02/25/ironpython-ironruby-and-f-openings-in-dev-test-and-pm.aspx?
Visit IronPython Blog | Microsoft Learn

From: [email protected]
[mailto:[email protected]] On Behalf Of Ryan R.
Sent: Thursday, May 01, 2008 6:49 AM
To: [email protected]
Subject: Re: [Ironruby-core] Opening up our tree to external committers

On Thu, May 1, 2008 at 2:37 AM, Jimmy S.
<[email protected]mailto:[email protected]>
wrote:
Splitting into different DLLs complicate things for Silverlight.

On the desktop you can have the assembly loading be dynamic with a
foo.rb wrapper for a library. However, Silverlight (today) requires the
DLL would have to be downloaded to the client first before loading. In
other words, the AppManifest.xaml (and the XAP, but that’s optional)
would have to know about ALL the IronRuby Library DLLs you “could” want
to use. We automate the generation of this file and XAP, so that tool
(Chiron) would need to know this. While this isn’t a direct problem, it
does make the # of assemblies you need to include with your app go from
2 to n. Splitting could potentially save download size, but figuring out
which DLLs to include is hard (see below).

Are there other options for how to get DLLs onto a client machine?

To get this option out of the way, we can’t bake this logic (download an
assembly when you require it) into our Silverlight integration, or even
push the responsibility on the libraries themselves. Downloading in SL
requires asynchronous requests, and we can’t pause user code to do this
(aka. Continuations). We could technically implement it by hacking on
XmlHttpRequest directly to get synchronous support, but ugh. If network
connection gets flakey your browser hangs … not very pleasant.

Do we introduce a config.rb to Silverlight that lets you define the
closure of all the assemblies you’ll need? This file gets loaded first,
it triggers the downloads the necessary assemblies, and then load the
real program?

Again, the AppManifest solution will work, but it’s not very
dynamic-language-esc, and becomes more apparent if we split the
libraries out. I’m just brainstorming for better solutions to this.
Ideas?

~Jimmy

Wouldn’t this, then, lend itself toward a solution towards that proposed
by /M:D? I don’t know multi-file assemblies that well, but it seems the
best solution in that, iirc, only the .netmodules needed are loaded as
they are called, but they’re already linked by the primary assembly.
This might be more complicated to maintain and cleanly build; I don’t
know. I also don’t quite understand the “not dynamic” comment, but
again, I’m not too familiar with multi-file assemblies.

(Also, apologies for the duplicate in the other thread.)

-R2