473,386 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

is there a way to get an assembly to parse its own source code at runtime ?

We have an old system that uses Scheme as its scripting language, that
many developers need to use, but 99% of our people know C# & .NET, not
Scheme. This system is not going away anytime soon. Some of us had the
bright idea to make a system to allow you to write the scripts in C#
(using VS.NET, with Intellisense, debugging, etc., and being able to
run the scripts from VS.NET), and then have it generate Scheme code
from its own source code. We can do it the old "one-two" way... for
every line of C# code you have one line of scheme generating code.
However this wouldn't work too well for SELECT CASE or IF/THEN/ELSE
blocks for the logic that is not running. So there would have to be a
completely seperate code base that the Scheme generator uses. Which is
hokey, since then you have to code your app twice. I was thinking maybe
there is a way to get an assembly to parse its own source code at
runtime? We could just write another app that works on the blah.cs
files, but the other way just sounds more fun.

Nov 22 '05 #1
1 1199
I think the compile on the fly option will work for me... Has anyone
done this? If you have a text file "mycode.txt" with c# code in it, how
would you compile it from within your running app and then execute that
code (say, a method of a stateless object - myobject.mymethod) ?

Mad Scientist Jr wrote:
We have an old system that uses Scheme as its scripting language, that many developers need to use, but 99% of our people know C# & .NET, not Scheme. This system is not going away anytime soon. Some of us had the bright idea to make a system to allow you to write the scripts in C#
(using VS.NET, with Intellisense, debugging, etc., and being able to
run the scripts from VS.NET), and then have it generate Scheme code
from its own source code. We can do it the old "one-two" way... for
every line of C# code you have one line of scheme generating code.
However this wouldn't work too well for SELECT CASE or IF/THEN/ELSE
blocks for the logic that is not running. So there would have to be a
completely seperate code base that the Scheme generator uses. Which is hokey, since then you have to code your app twice. I was thinking maybe there is a way to get an assembly to parse its own source code at
runtime? We could just write another app that works on the blah.cs
files, but the other way just sounds more fun.


Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Carlos G Benevides | last post by:
I have a ASP.Net web application that has two assemblies that run under com+. Under Windows 2000 the two assemblies are added to com+ automatically when instantiated from the web site. For this...
1
by: Mad Scientist Jr | last post by:
We have an old system that uses Scheme as its scripting language, that many developers need to use, but 99% of our people know C# & .NET, not Scheme. This system is not going away anytime soon....
2
by: Carl Mercier | last post by:
Hi! I have 2 different applications/assembly. The first one creates an object and serializes it to a textfile on disk. The second one has the the exact same class (copied/pasted). It reads...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
1
by: Robert | last post by:
I have a server where the main web application (root) is now migrated to 2.0. It's web.config has a line where it adds the system.data.oracleclient in the configuration and assembiles section. ...
2
by: john | last post by:
Maybe I haven't had that "a-ha" moment yet, but I think the new approach to web projects is a step in the wrong direction. My main beef is that control over the assembly generation process has...
2
by: Luis Arvayo | last post by:
I am compiling and executing c# code at runtime and I need to define in CompilerParameters.ReferencedAssemblies one of my own assemblies together with the standard System.dll u others. Example:...
4
by: =?Utf-8?B?SmFu?= | last post by:
I have a .NET 2.0 application divided in two assemblies; the exe and a dll. The application generates a plugin-dll which is then loaded in a separate AppDomain (along with a second instance of my...
2
by: Chen Zhuo | last post by:
Hi all experts, We are having a problem with the exact time when a C# dll gets loaded in managed C++. The scenario is like: In managed.cpp: #using MyCSharp.dll
3
by: cristalink | last post by:
Hi, I have a C++/CLI DLL which I marked with in a cpp file. Is there a standard tool from Microsoft that takes a .DLL file and displays all the .NET attributes of the assembly? Thanks, ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.