[Mono-list] Thanks
Thanks to all those people who make Mono possible especially those who slog it out every day with difficult requests like Miguel, Gonzalo, Ravindra, all the volunteers and Novell for picking up Ximian and helping to propell Mono forward. Dilton __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Re: Time problems on Mono
On Mon, 2004-12-13 at 04:31 -0800, Jordi wrote: > Thanks for the explanation Jon...its good to know things like that. > I guess that the both of them (Mono JIT and Mono interpreter) are the > runtimes that could be used. Aren't they?. Yes, though it should also be mentioned that the interpreter is barely maintained anymore, may be (is?) very buggy, and no one cares about it. The JIT is much more interesting and important for most developers, and is the only runtime that supports Generics, among other things. > What I was told about Mono, is that firstly builds up a pre-compiled > native code, and then, this code is compiled by the just-in-time > runtime depending on the processor you are using (ie: x86, SPARC,...). > Is this right?. Not exactly. Assuming the JIT is used, code is compiled at least twice before being executed: 1. By the language compiler (mcs), compiling the input language (C#) into Common Intermediate Language (CIL). This creates the assemblies (.dll and .exe files) that we all know and love. 2. By the JIT compiler during program execution. This converts the CIL into machine code for the executing processor (x86, etc.). (1) can't be avoided. (2) can be avoided by using Ahead Of Time compilation (also referred to as "pre-JITing" in some literature). Under Mono, this involves using ``mono --aot'', while under .NET this uses NGEN.EXE. The idea is to precompile the CIL into machine code, thus eliminating the need to generate code at runtime. Skipping (2) may or may not result in faster performing code, for a variety of reasons (which differ between Mono and .NET). You'd have to test your particular program to know for sure. - Jon ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] RE: Interop
On Mon, 2004-12-13 at 15:54 +0100, Javier Miguel Gonzalez wrote: > I have to deliver some libraries (DLL's written in Delphi 7) for use in > unmanaged environments, and I am planning to migrate them to C# with mono > and let them run in linux/unix too. The callback-based/delegate mechanism is probably the better approach, as it will permit easier migration from .NET, as well as the portability between .NET and Mono. > > See: http://www.go-mono.com/embedded-api.html > > Do you know were can I find samples of use? > > In the last section of document says 'See the sample programs in > mono/sample/embed for examples of embedding the Mono runtime in your > application.'. Where are mono/sample/embed?? It's located in subversion. See: http://primates.ximian.com/~miguel/svn-migration.html http://mono.myrealbox.com/source/trunk/mono/samples/embed/ - Jon ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Interop
On 12/13/04 03:35:03, Javier Miguel Gonzalez wrote: Hello, I want to call a .Net function (in a class) from unmanaged code, like VC+ + 6 or Delphi 7. Do you know if it is possible? Are there something like JNI in .Net? I have read this articles: http://www.blong.com/Conferences/BorCon2004/Interop1/Win32AndDotNetInterop.h tm#InversePInvoke http://www.codeproject.com/csharp/Win32_to_NET.asp ...but I feel that this methods are not so much standard. Are in Mono something better to do it than in MS .Net Framework? You could also check out SWIG at http://www.swig.org, which has C# support and works with the Microsoft runtime, mono, and Portable.NET. There are a lot of examples on wrapping code provided by SWIG as well. John ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Interop
You can take a look a this articles about Win32 api interop : http://www.developerland.com/CSharpGeneral/COMInterop/198.aspx http://www.developerland.com/CSharpGeneral/General/146.aspx Hope it helps Marc, - Original Message - From: "John Lenz" <[EMAIL PROTECTED]> To: "Javier Miguel Gonzalez" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, December 14, 2004 2:59 AM Subject: Re: [Mono-list] Interop On 12/13/04 03:35:03, Javier Miguel Gonzalez wrote: Hello, I want to call a .Net function (in a class) from unmanaged code, like VC+ + 6 or Delphi 7. Do you know if it is possible? Are there something like JNI in .Net? I have read this articles: http://www.blong.com/Conferences/BorCon2004/Interop1/Win32AndDotNetInterop.h tm#InversePInvoke http://www.codeproject.com/csharp/Win32_to_NET.asp ...but I feel that this methods are not so much standard. Are in Mono something better to do it than in MS .Net Framework? You could also check out SWIG at http://www.swig.org, which has C# support and works with the Microsoft runtime, mono, and Portable.NET. There are a lot of examples on wrapping code provided by SWIG as well. John ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Re: Time problems on Mono
At 09:42 PM 12/12/2004 +0900, Shudo Kazuyuki wrote: [snip] >Note that the ported C# version still uses jagged 2-dimentional arrays >in the same way as the original Java version, not rectangular arrays. >The Java version achieves the pivoting (row exchange) by an exchange >of pointer values in an array. Pivoting by a pointer exchange is >possible because the arrays are jagged arrays. In C#, arrays can be >rectangular arrays (similar to C and FORTRAN), and performance of >array accesses will be improved. On the other hand, pivoting gets >slow a little with rectangular arrays. I expect the C# version will >be improved with rectangular arrays. [snip] Actually, my understanding is that jagged arrays tend to perform better. Rectangular arrays have the following points that make them useful in certain situations: - They are a single object, and not a tree of objects like jagged arrays. - Their memory overhead is O(1), not O(n^(d - 1)). - They are created in a single allocation operation, whereas jagged arrays require many allocations. Therefore, rectangular arrays will tend to be allocated more quickly and use less memory overall, but their actual use is slower because two dimensions must be checked on every access. With jagged arrays, an optimizing compiler can often separate out the different bounds checks. For instance: int[][] array = ...; int sum = 0; for (int i=0; i < array.Length; i++) for (int j=0; j < array[i].Length; j++) sum += array[i][j]; The compiler can eliminate all bounds checks from this because the loop fits a pattern guaranteed to stay within bounds. Also, the "array[i]" access can be "hoisted", so that the compiler acts as if the code were as follows: int[][] array = ...; int sum = 0; for (int i=0; i < array.Length; i++) { int[] inner_array = array[i]; for (int j=0; j < inner_array.Length; j++) sum += inner_array[j]; } These optimizations are harder to perform for rectangular arrays, and more importantly, regardless of the difficulty level, the Microsoft runtime opts not to perform them. As such, rectangular arrays should usually be avoided. By the way, does anyone know where mono stands with rectangular array optimization? In particular, is mono able to eliminate the bounds checks from something like this?: int[,] array = ...; int sum = 0; for (int i=0; i < array.GetLength(0); i++) for (int j=0; j < array.GetLength(1); j++) sum += array[i,j]; Jonathan Gilbert ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] Web Services in Mono
Hello, > I have implemented part of WSE 2.0 in Mono, specifically enough to get > interop via Kerberos with a Windows box. > It's tested sufficiently to work for the purposes of my company, but I > haven't written any testing code yet. > > I'd be happy to make it available, just let me know where to send it. > > The Kerberos portion is written using unmanaged code and uses a > simplified C interface to the Heimdal libraries. If you could post this to the mailing list (maybe hosting the code on a web server?), we could review it. Would you be willing to license the code under the terms of the MIT X11? That would allow us to distribute it with Mono as well. Even if incomplete, it might help other people in the same situation. Miguel ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] C -> C# strings
Hello, > The primary difference between Ansi and Unicode under Mono is that Ansi > uses a char* while Unicode is an "unsigned short*" -- that is, 8-bit vs. > 16-bit character strings. The actual string encoding has nothing to do > with it (though unfortunately Microsoft chose Ansi to mean "local code > page", unnecessarily tying the two concepts). For example, Ansi could > be codepage 1252, 1256, or UTF-8 encoding, while Unicode could use > either the UCS-2 or UTF-16 encodings, which are (subtly) different. > > Further confusing things, Mono chooses not pay attention to the code > page at all, and assumes that all Ansi strings are in UTF-8, period. The good news: In the upcoming ECMA specification, we are going to get two new encodings. The bad news: the bits are "implementation specific" and wont be guaranteed to work compatibly across platforms. Miguel. ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Problem calling Mono.Posix methods from embedded Mono.
Hi, I'm having problems calling Mono.Posix methods when embedded in C code. For example, if I use the test-invoke sample to invoke the following program: public class test_posix { public static void Main(string[] args) { Mono.Posix.Syscall.chroot(".."); } } I get the following error: Unhandled Exception: System.DllNotFoundException: libc in <0x00061> (wrapper managed-to-native) Mono.Posix.Syscall:chroot (string) in <0xf> test_posix:Main (string[]) Running the exe file straight from mono works fine. Am I missing something? Or is this a bug? Or maybe in the package I'm using (Debian 1.0.4)? Daniel ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] XSP server in a VirtualHost environment (suexec?)
I am in the process of implementing a large scale PHP4/PHP5/ASP.NET (mono) hosting environment on Apache2. I currently have my PHP4 and PHP5 cgis compiled and have the running suexec. I recently setup the XSP server and mod_mono in attempt to get name based virtualhosting up and running for asp.net as well. Right now Im at a point where I have the name based virtual hosts up and running with ASP.NET using unique mono_sockets and .wapi directories per application (located in the users home directory). However these files are created/owned by apache right now, meaning that wherever they are located needs to have write permissions by apache (kinda iffy). My ultimate goal however, is to get this system up and running with all user code running as its corresponding user as to minimize administration issues (directory permissions etc) and to limit the scope of their application to their home directory (chroot). My currently setup for user accounts is using the JailChroot project so all users are chrooted to their home directories upon login of any sort. I have done the same with the suexec/cgi for php4 and php5. I would like to ultimately produce the same result with ASP.NET. I spoke with someone lastnight in #mono that suggested running separate instances of the XSP server for each application I want to host, then proxying the requests for asp.net files with apache and mod_proxy to the appropriate XSP server (each would also have to be running on a different port). I realize that in this case, there would have to be a huge number of xsp servers running and Id be curious about the resources needed by this. This just doesnt seem very scalable to me. I realize I could break off my XSP servers to a privately accessible cluster but it seems like this would still make it hard to get some solid redundancy for this platform, seeing that the mod_proxy would be forwarding to a specific private IP. Anyone have any ideas on how to implement this sort of application server environment? Input of any sort would be much appreciated, -- Jesse ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] Web Services in Mono
I have implemented part of WSE 2.0 in Mono, specifically enough to get interop via Kerberos with a Windows box. It's tested sufficiently to work for the purposes of my company, but I haven't written any testing code yet. I'd be happy to make it available, just let me know where to send it. The Kerberos portion is written using unmanaged code and uses a simplified C interface to the Heimdal libraries. -- Alex Wheeler -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Miguel de Icaza Sent: Thursday, December 09, 2004 6:37 PM To: Kirk Marple Cc: 'mono' Subject: Re: [Mono-list] Web Services in Mono Hello, > I'd talked to Miguel once about this, and it sounds like Microsoft's > Web Services Enhancements (WSE2) aren't on the Mono roadmap, and that > Indigo would be the focal point down the road. > > We have a service-oriented application that we'll be porting to Mono > in the next 6-9 months. > > What are others doing for creating Web services in Mono, when they > need more than just a basic .asmx file? > > Specifically I'm talking about support for WS-* standards like > WS-Addressing, WS-SecureConversation... and WS-Messaging for non-HTTP > transport. > > Are people generating this stuff by hand? Or is nobody there yet with > Mono? If there is enough momentum to implement this functionality, we can certainly host the source code (in fact, there is a little bit of code already), but it is not something that my team has plans on working on. ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] RE: Interop
> On Mon, 2004-12-13 at 10:35 +0100, Javier Miguel Gonzalez wrote: > > I want to call a .Net function (in a class) from unmanaged > code, like > > VC++ 6 or Delphi 7. > > > > Do you know if it is possible? > > Maybe. It depends on what syntax/functionality you want to enable. I have to deliver some libraries (DLL's written in Delphi 7) for use in unmanaged environments, and I am planning to migrate them to C# with mono and let them run in linux/unix too. > > Are in Mono something better to do it than in MS .Net Framework? > Define "better". If you want portability between Mono and .NET, > delegates are the only portable approach. > If you don't mind being tied to Mono, then you could use the embedding > API, which permits unmanaged code to add additional internal calls, > create new managed objects, and invoke them. > > See: http://www.go-mono.com/embedded-api.html Do you know were can I find samples of use? In the last section of document says 'See the sample programs in mono/sample/embed for examples of embedding the Mono runtime in your application.'. Where are mono/sample/embed?? Thanks for your help jmiguel ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] Re: Time problems on Mono
Gregory Bowyer wrote > > for ( int n=0; n<=(1000* 1000 * 1000) ;n+=1 ) > > { > > sum *= 1.0; > > } > Not meaning to flame but isn't that test a bit of a no brainer for > performance issues, I mean its simply an aggressive loop that > will take > any langugage / platform a while to work through No there is some obvius places for an optimizer. Whithout any optimisazion a floating point opreration wll be preformed each tim the loop iterates. First an analysis of the expression will show that the variable isn't changed. Secondly the variable is not referenced outside the loop so an optimizert could remove the variable completely. So if the optimizer can see just one of them it would speed up the loop a lot. And aperantly ms-.net saw one them and mono did not. but yes it is a very simple test. -- Martin Hansen ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Re: Time problems on Mono
Sorry, I don't know what happened but I've sent an empty mail by mistake. Thanks for the explanation Jon...its good to know things like that. I guess that the both of them (Mono JIT and Mono interpreter) are the runtimes that could be used. Aren't they?. What I was told about Mono, is that firstly builds up a pre-compiled native code, and then, this code is compiled by the just-in-time runtime depending on the processor you are using (ie: x86, SPARC,...). Is this right?. regards, Jordi Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone.
Re: [Mono-list] Cygwin woes
Hi, Using Cygwin allows you to compile against cygwin1.dll library or using mingw interface (-mno-cygiwin) to compile against msvcrt.dll. But, you can not mix dlls compiled from different method. Check out the cygwin fac. What is happening is that your dll test.dll is compiled against cygwin1.dll (by using the second method) and mono is compiled against msvcrt.dll. You can also use objdump -p /path/to/the/binary to see against what dll is compiled some program. On windows, if you still want to use cygwin you need to use -mno-cygwin. .-Francis -- Francis Brosnan Blázquez <[EMAIL PROTECTED]> ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Re: Time problems on Mono
Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more.
Re: [Mono-list] Interop
On Mon, 2004-12-13 at 10:35 +0100, Javier Miguel Gonzalez wrote: > I want to call a .Net function (in a class) from unmanaged code, like > VC++ 6 or Delphi 7. > > Do you know if it is possible? Maybe. It depends on what syntax/functionality you want to enable. > Are there something like JNI in .Net? Platform Invoke (P/Invoke) is the closest equivalent to JNI, though P/Invoke doesn't permit use of .NET classes from unmanaged code, nor does it offer an equivalent to JNI's reflection mechanisms. > I have read this articles: > > http://www.blong.com/Conferences/BorCon2004/Interop1/Win32AndDotNetInterop.h > tm#InversePInvoke This won't work on Mono/Linux, principally because it assumes that the PE file format is the platform's native file format. Inverse P/Invoke allows you to make a library export that invokes a .NET function. However, this library export is a "normal" PE export. While this makes things brain-dead simple for Windows platforms, it doesn't work for platforms which don't use PE for the native file format, such as Linux (which uses ELF). > http://www.codeproject.com/csharp/Win32_to_NET.asp This is the recommended approach, and is supported by both Mono and .NET. Delegates are your friend. :-) One thing the above article doesn't mention is that the function pointer the unmanaged code receives lives only as long as the managed delegate. Once the managed delegate is GC'd, so is the function pointer that the unmanaged code has, so if the unmanaged code invokes the function pointer, you could crash the program. > Are in Mono something better to do it than in MS .Net Framework? Define "better". If you want portability between Mono and .NET, delegates are the only portable approach. If you don't mind being tied to Mono, then you could use the embedding API, which permits unmanaged code to add additional internal calls, create new managed objects, and invoke them. See: http://www.go-mono.com/embedded-api.html - Jon ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Re: Time problems on Mono
On Mon, 2004-12-13 at 01:48 -0800, Jordi wrote: > Sorry for my ignorance but what's the difference between Mono JIT and > Mono Interpreter??. You've hit on it already. The interpreter (mint) is slower than molasses in January, while the JIT (mono) is fast. More accurately, the JIT is a JIT, converting the CIL into machine code optimized for your particular processor, which executes directly on the processor. Once JIT is complete, there is *no* execution overhead (except for GC, which is arguably a separate but related issue). The interpreter, on the other hand, doesn't do that. It instead interprets each CIL instruction, with no optimization at all. It's like the difference between running a shell script and a C program. - Jon ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Re: Time problems on Mono
> There is a work arround about this: > http://www.shudo.net/jit/perf/ Yes. I have ported the Java version of Linpack benchmark to C#.The porting work was reasonably easy due to similarity between the two languages. hi again, I don't have many benchmarks experience in order to get the results of the Shudo's web interpreted, but in my opinion, for the results shown on this web, Mono (JIT) performs well enough while Mono (Interpreter) was not so well...in fact was the slowest, isn't it?. Sorry for my ignorance but what's the difference between Mono JIT and Mono Interpreter??. I don't have already any test case that could demostrate the issue that has started that thread, in which I said C#-Mono is slower than C#-.Net. The thing is that I must isolate where the time problem is exactly in my code and then try to make a, as simple as possible, sample test that could be then studied properly. I'll like to comment too one thing that I found strange. It is that when I want to calculate execution times (in milliseconds) over Mono in a WinOS the results appeared as the next example: WIN MONO profilePut: 409355 ms Why the WinOS result had no decimal part and have it on LinuxOS?, for example: LINUX MONO profilePut: 251915,130 ms Any idea? bye Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. Learn more.
[Mono-list] Interop
Hello, I want to call a .Net function (in a class) from unmanaged code, like VC++ 6 or Delphi 7. Do you know if it is possible? Are there something like JNI in .Net? I have read this articles: http://www.blong.com/Conferences/BorCon2004/Interop1/Win32AndDotNetInterop.h tm#InversePInvoke http://www.codeproject.com/csharp/Win32_to_NET.asp ...but I feel that this methods are not so much standard. Are in Mono something better to do it than in MS .Net Framework? Thanks in advance jmiguel ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list