3 ms·
After ME spending the last year working with Lisp and Ocaml, why would ANYONE use .NET?
by HelloBeautiful 16y ago
After ME spending the last year working with Lisp and Ocaml, why would ANYONE use .NET?
- gte525u 16y agoI'm both a lisper and unix user. I've historically been an embedded developer, but I'm currently leading a team developing a (greenfield) .NET application for testing embedded systems. Choice was pretty simple for the following reasons: a) Mature VM/Languages (although there are alternatives) b) Existing Team knowledge-base. This is a biggie. I have another former lisper on the team and I could drag the rest kicking and screaming to lisp or python, but, it's really not worth the effort of convincing management we'll be more productive in language X. c) Vendor support. We're using a ~$10k interface card. They offer drivers for Windows or VxWorks. The drivers come as either a user-space C Library or a .NET wrapper. Any other language choice I have to either justify to management writing an FFI wrapper to the C library or write it and maintain it on my own time. d) WPF is very code generator friendly. A majority of our application forms are generated using either XSLT or python. e) Easy UIs for what has to be customized. In short, I'm more productive in python or lisp. My team is more productive in C# and WPF. That being said, I'll try to add scripting in the next version using iron python, but, the core will stay in C#. EDIT: typo in first paragraph.
- icey 16y agof) tons and tons of documentation on msdn g) a vibrant Q&A community in the form of StackOverflow Adding IronPython support is a trivial exercise. Its seriously 2 lines of code to add, plus a few lines to define the scope.
- icey 16y agoI realized saying "it's a trivial exercise" without showing some code isn't very useful, so here's everything you need: 1) Add these imports to your class: using IronPython.Hosting; using Microsoft.Scripting; using Microsoft.Scripting.Hosting; 2) Instantiate your engine & scope in the appropriate location: mEngine = Python.CreateEngine(); mScope = mEngine.CreateScope(); 3) Add variables to your scope like this: mScope.SetVariable("ThisIsWhatTheScriptSees", mReferenceToYourObject); mScope.SetVariable("Cars", mCars); mScope.SetVariable("Dog", mDog); 4) Load your script up: var source = mEngine.CreateScriptSourceFromString(strYourScript, SourceCodeKind.Statements); 5) Run it! source.Execute(mScope); * You can call the stuff you added to your scope from inside your script: if Dog.IsTame: name = Dog.CheckName() for car in Cars: car.BeepHorn() * Alright, this is a little more than 2 lines, but I think you get the drift. Good luck!
- MichaelGG 16y agoF#