Hey guys, I am encountering a situation in which I kind of have hit a wall and was curious of opinions that are more experienced than my own. I am currently using C# with a SQL backend, but due to what I'm trying to do I'd be willing to indulge in a new programming language if it fits what I need.
I'm designing a program in which it would make my life a 100x's easier if I could dynamically declare functions, methods, and classes on the fly based around values that are retrieved via a database. My thought experiment has led me down the path of:
1 ) Create a proxy application that monitors the primary application that would be using the function.
2 ) Determine if the function exists and if it does not load the class into memory, add the function, save, and rebuild the primary application.
3 ) Start the primary application
This methodology is riddled with potential headaches. Working in databases for the past two years I'd just handle it as such:
declare @sql = 'create function ' @foo ' (@param_name bigint) returns bigint ...'
exec(@sql)
declare @functionCall = 'exec ' @foo '(' cast(@param, as nvarchar(10) ')'
exec (@functionCall) And bam! Good to go.
I've resorted to having a class that works as basically as a router that chooses the method to pass parameters to based upon a value. This is not ideal due to the fact of having to predefine these functions and I may or may not know if I have the functions I need until I need to execute them...
Essentially what I'd like to do is define parts of the function once in the database assemble it as a string at run time and execute it on the fly. I think I could accomplish this with Javascript...But if there is another language you can think of that could do that, (or a technique for doing it in C#) I'd love to hear about it.
My gnawing question is, "Does this have anything to do with the 'enlightenment' that I see all over the place when Lisp developers talk about loving their language so much?" I have a co-worker who said it probably can be done with Python. I'm down with that, but are there any other opinions?
Thanks!