-
Website
http://tirania.org/blog -
Original page
http://tirania.org/blog/archive/2008/Sep-08.html -
Subscribe
All Comments -
Community
-
Top Commenters
-
Max "WorldMaker" Battcher
7 comments · 1 points
-
psantosl
18 comments · 1 points
-
whitemice
8 comments · 1 points
-
barrkel
6 comments · 3 points
-
Ed Ropple
27 comments · 13 points
-
-
Popular Threads
-
C# Support for Tuples - Miguel de Icaza
1 day ago · 27 comments
-
C# String Interpolation - Miguel de Icaza
4 days ago · 62 comments
-
Nine Months Later: Mono 2.6 and MonoDevelop 2.2 - Miguel de Icaza
1 week ago · 46 comments
-
Releasing Moonlight 2, Roadmap to Moonlight 3 and 4 - Miguel de Icaza
1 week ago · 31 comments
-
New Moonlight Covenant has been posted - Miguel de Icaza
2 days ago · 6 comments
-
C# Support for Tuples - Miguel de Icaza
console.dir(console)
One thing that sticks out for me is that it sucks that you have to LoadAssembly() or LoadPackage() and then import with the "using" statement. A nice extension might be to modify the "using" statement to make it easier. For example:
using System.Xml.Linq;
might first try to look for an equally named assembly (System.Xml.Linq.dll) and load from there. If there isn't a 1:1 mapping, you could do something like:
using Mono.Unix from Mono.Posix;
or
using Gtk from pkg:gtk-sharp-2.0;
and have it load from a differently-named assembly or pkg-config package.
I like your suggestion for extending the using syntax to import namespaces; We could also have:
using * from pkg:gtk-sharp-2.0;
The feature shall be implemented shortly.
As for "manhole", keep your eyes open for the next post, I did not want to give everything away on the maiden post of Mono.CSharp.Evaluate().
I use booish and booi all the time, this will be another great tool for debugging.
I really love what you've done here. It definitelly makes things a lot easier to try out, and I suspect that you took a clue from the interactive Python prompt.
As for suggestions on what to improve on, I recommend taking a look at the IPython Tutorial (http://ipython.scipy.org/doc/manual/html/intera...). IPython is a full-featured interactive Python interpreter which every Python developer just loves.
Manually changing stuff after I initially wrote it
Perhaps a method to list objects one has created in the shell would be useful in addition to an Inspect method.
What is the effect of GC on objects allocated in the shell? Are they persistent for the session without fear of being reclaimed?
As for lifetime, standard .NET lifetime applies: if there is a reference to the object, it stays alive. Any variables that you do not manually point to null will keep references to any objects you created.
Our compiler is dual-licensed MIT X11 or GPL (pick your choice).
But additionally, our compiler being written in C# significantly simplified the process of adding a REPL mode to it.
Making it run under the .NET framework is the subject of a separate post.
As for powershell: could you provide more information? I am not familiar with it, and I am curious as to what you have in mind.
This blog starts to sheds some light on PowerShell's Adaptive Type System (ATS) and its use of adapters to .NET types
http://blogs.msdn.com/powershell/archive/2008/0...
this one shows more of the underlying type adaptor relationships
http://blogs.msdn.com/powershell/archive/2006/1...
And the free sample chapter 1 "Object and Object Types" from the Apress book "Pro Windows PowerShell" should finish off your questions
http://www.apress.com/book/view/1590599403
http://msdn.microsoft.com/en-us/library/aa34768...
i was missing a shell like in python,what you can add is things like auto-completion,and enumerating the properties of a object like in IPython
Remaining anonymous as I'm ashamed I don't know enough mono to know if this is already possible. :P
Currently it executes as scripts all the files in ~/.config/csharp, but we should make it also run any scripts specified on the command line.
Ok, maybe something like /usr/bin/monoscript (or better name) so that it supports F# and the rest of the family too!
I'm intrigued about Joe's comment about Twisted's "manhole", as I never tried it...
Keep the good work,
-- nachokb
An Inspect() method is not a bad idear at all. You might look at some of the enhancements people have created for Python, which behaves like this by default, in the iPython shell.
-Doug
I refactored the C# shell into an Evaluator class, and it should now be easier to integrate in other applications, hopefully with the DLR as well.
At this point, the real question is: which features do we need in the CSharpEvaluator class to make it useful for the above scenario?
http://www.mono-project.com/Mono_Project_Roadmap
? Is there a chance that Mono 2.2. will be released in November?
C# is not a dynamic language, and don't have a REPL.
And .NET have IronPython, IronRuby and PowerShell, all have REPL's.
So you can't say that .NET sucks.
And yes, Microsoft sucks.
But Mono isn't Microsoft.
Troll.