5

So basically I'm not comparing Scheme with Clojure here, I want to compare realizations. There are:

Clojure-clr which can be installed even using Visual Studio extension but it's still going a bit buggy for me to use it this way. After you create and save such project you can't open it again...

And IronScheme, there is no VS addin for IronScheme yet as far as I know but maybe it got better .NET support I never used it and can't know about it.

So what of this two (or maybe even there is something else with lisp-like syntax) got better CLR support?

cnd
  • 32,616
  • 62
  • 183
  • 313
  • Just stick to VS2008SP1. There is an editor plugin for it. IMO VS2010 is too buggy to even attempt decent support. Hopefully the showstopper bugs will be fixed in VS11+. I will investigate porting the editor plugin to it then. – leppie Feb 03 '12 at 05:18
  • So I'm just following newer version because VS 2008 have no many 2010 features and I can't be sure when I need them. – cnd Feb 03 '12 at 10:19
  • You call them features, I call them bugs :) – leppie Feb 03 '12 at 12:48
  • WRT to a newer VS plugin. If someone with some experience with the horrid API would prepare me some scaffolding and guidance, I am sure I would be able to dish one out in a few evenings. VS2008's SDK really scared the heck out of me, and I went back for more, mistakenly. – leppie Feb 03 '12 at 13:59

2 Answers2

3

I have already answered about VS in a comment.

In terms of .NET interoperability, IronScheme is probably better, due to being designed and written in .NET and liberal reuse of existing .NET types.

In terms of being a .NET consumer, IronScheme provides excellent support for most .NET features (eg generics etc).

In terms of being a .NET producer, IronScheme still lacks a bit. Example, cannot create generic methods or classes. Typed fields (on records) were only recently introduced and even that is a bit limiting (no support for mutual recursive field type definitions).

Example what a mean by above:

class Foo { Bar bar; } 
class Bar { Foo foo; }

To produce something like this, is not possible currently, but something that is doable (to some extent).

With some developments towards the end of last year (2011), I have made it possible to write code in IronScheme that runs as fast (or even faster) than that in C#. The method IL output of the code matches F#'s closely (by pure coincidence). I dont even bother benching against IronPython/IronRuby anymore. :)

Feel free to ask more, if needed.

Also, there might be some informative discussions on the Codeplex discussion board for IronScheme. I normally respond very quickly.

leppie
  • 115,091
  • 17
  • 196
  • 297
  • Thought your repository is on GitHub. So will it be easier to use IronScheme with another languages providing valid .NET types. I were thinking that is possible in ClojureCLR too. It's hard to compare this way for me... This initialization in Clojure https://gist.github.com/1584097 scares me. I really like (clr-reference System.Windows.Forms) more. But I will not switch to VS2008, I will try to run some embedded in C# examples with it. – cnd Feb 03 '12 at 10:34
  • @ヒザキ: I mirror the SVN from Codeplex on Github. – leppie Feb 03 '12 at 11:10
  • @leppie Actually, ClojureCLR is written in C#/.NET too. It's a port of the JVM version to the CLR. – Daniel Cotter Feb 03 '12 at 13:36
  • @DanielCotter: I understand that, but how many native CLR types are used? How much CLR-specific optimization was made? Etc. If IronScheme was ported to the JVM, it will likely run like a legless dog ;p – leppie Feb 03 '12 at 13:44
  • @DanielCotter: IOW how much converting to and from Clojure/CLR types are needed during interop. Is a clojure array/vector an `object[]`? Is a bytevector a `byte[]`? I dont know. (Sorry, I dont know the native type names in clojure). – leppie Feb 03 '12 at 13:48
  • @leppie Because Clojure compiles down to another language's native code (Java bytecode, .NET bytecode, and Javascript, currently), there will always be conversion to and from another language's native types. However, I know Clojure is blazing fast on the JVM, and I'd be willing to bet that it is equally fast on the CLR, although I don't have the benchmarks to prove it. I'd be out of my depth commenting on optimizations in the compiler, so I'll leave it at that. – Daniel Cotter Feb 03 '12 at 15:08
1

There's been a lot of activity lately on VsClojure, and there should be an update soon that will fix a lot of the issues you're running into. Also, regarding the specific problem you're running into when opening a project, if you start Visual Studio first and then open the solution / project, it should work. It just doesn't work from the shell. Here are some blogs that might help you get started:

http://clojureclr.blogspot.com/
http://www.myclojureadventure.com/
http://clrviaclojure.blogspot.com/

Daniel Cotter
  • 1,342
  • 2
  • 15
  • 27