Running on .Net

13 views
Skip to first unread message

taotree

unread,
Aug 3, 2010, 3:16:16 AM8/3/10
to Clojure
I have a 3rd party platform I am working to write add-ons for and so
am restricted to .Net. I'd like to write in Clojure. ClojureCLR looked
too intimidating to get it going and ikvmc was very easy for Java, so
I thought I'd try it with Clojure.

I ran ikvmc on clojure.jar and saw a number of errors (or something),
but ignored them, and it did create clojure.dll. I ran ikvmc on my
own .class files that were generated by the compile macro.

Trying to call a method on my class (with clojure.dll referenced)
resulted in:

Unhandled Exception: System.TypeInitializationException: The type
initializer fo
r 'test.clojure.MyClass' threw an exception. --->
System.TypeInitializationExcep
tion: The type initializer for 'clojure.lang.RT' threw an exception.
---> java.l
ang.RuntimeException: java.io.FileNotFoundException: Could not locate
clojure/co
re__init.class or clojure/core.clj on classpath:
--- End of inner exception stack trace ---
at clojure.lang.Namespace..ctor(Symbol )
at clojure.lang.Namespace.findOrCreate(Symbol name)
at clojure.lang.Var.internPrivate(String nsName, String sym)
at test.clojure.MyClass..cctor()
--- End of inner exception stack trace ---
at test.clojure.MyClass.main(String[] strarr)
at <StartupCode$FSTestApp>.$Mentics.Series.App.main@() in C:\Users
\jshellman\
Documents\Visual Studio 2008\Projects\FSTestForNT\FSTestApp
\Mentics.Series.App.f
s:line 14

Hadi Hariri

unread,
Aug 3, 2010, 8:30:06 AM8/3/10
to clojure
I've gotten ClojureCLR running on .NET. If you're interested in trying
it, ping me and I'll help with what I can.

I'm also interested to know if there's some kind of installer or
package provided for it yet because as you say it does take a bit to
setup. I'd be eager to help in that area if there's interest.

> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

eyeris

unread,
Aug 3, 2010, 12:56:06 PM8/3/10
to Clojure
I really wish that ClojureCLR had a binary distribution. I like
clojure a lot but I have a .Net background and a lot of .Net code to
interact with. If ClojureCLR had a stable, dependable binary
distribution I would be able to use it at work much more than I
already do. I don't care much about 1.2 features like defrecord. What
I care about is start-up speed, ease of embeddability, and Visual
Studio integration (not Intellisense, just AOT'ing .clj files).



On Aug 3, 7:30 am, Hadi Hariri <hadihar...@gmail.com> wrote:
> I've gotten ClojureCLR running on .NET. If you're interested in trying
> it, ping me and I'll help with what I can.
>
> I'm also interested to know if there's some kind of installer or
> package provided for it yet because as you say it does take a bit to
> setup. I'd be eager to help in that area if there's interest.
>

Hadi Hariri

unread,
Aug 3, 2010, 12:58:52 PM8/3/10
to clojure
For the binary distribution, it's not hard. I could setup a CI project
at http://teamcity.codebetter.com and put together some binaries to
download.

Regarding Stability and speed, it's way too early for me to comment
since I'm a newbie with Clojure so I couldn't really comment.

Timothy Baldridge

unread,
Aug 3, 2010, 1:47:41 PM8/3/10
to clo...@googlegroups.com
> I really wish that ClojureCLR had a binary distribution. I like
> clojure a lot but I have a .Net background and a lot of .Net code to
> interact with. If ClojureCLR had a stable, dependable binary
> distribution I would be able to use it at work much more than I
> already do. I don't care much about 1.2 features like defrecord. What
> I care about is start-up speed, ease of embeddability, and Visual
> Studio integration (not Intellisense, just AOT'ing .clj files).

+1 for all of that

That paragraph basically explains why I haven't started using clojure
at my work yet.

Timothy Baldridge

dmiller

unread,
Aug 3, 2010, 4:11:13 PM8/3/10
to Clojure
I can move creating a binary distribution to the to top of the list.

I could use some guidance from the interested on what would serve the
purpose on this and other things mentioned here.

on the distribution: Do you want just a zip of of DLLs? An
installer? Do you want installation to the GAC?

on 'stable, dependable': Is there any strategy on creating new
releases that makes sense? Assume anyone wanting to stay on the
bleeding edge will build for themselves?

start-up speed: I'm running some experiments on that. The problem
is mostly the monolithic nature of the assemblies created and the
amount of environment initialization. Suggestions welcomed.

Ease of embeddability: please elaborate on the problems.

AOT'ing clj files: Ditto.

-David

Daniel Gagnon

unread,
Aug 3, 2010, 7:19:20 PM8/3/10
to clo...@googlegroups.com
What I'd like is easy instructions for going from zero to repl so I can try it out.

Timothy Baldridge

unread,
Aug 3, 2010, 4:21:54 PM8/3/10
to clo...@googlegroups.com
Personally I'd like to see it in a .zip of assemblies. GAC can make it
a bit hard to copy around...90% of my 3rd party assemblies, I just
throw in a folder and reference in VC# where they get copied into the
build directory.

Unfortunately, I haven't gotten ClojureCLR to compile, so I can't
speak to the startup times. For the most part, a 1-2 sec startup isn't
bad in my book though.


Timothy

eyeris

unread,
Aug 4, 2010, 1:25:32 AM8/4/10
to Clojure
I would like a zip of DLLs that are as widely compatible as possible
across CLR/DLR versions accompanied by a clear list of which versions
are compatible.

Regarding releases, I'm glad to lag behind the bleeding edge by a lot
in order to have a stable platform. What I want to be able to do is
grab the DLLs, add them as references to my VS project, and compile,
much like I do with NetBeans and the JVM clojure.

I have to admit that I haven't tried ClojureCLR since right around the
1.1 release, so I don't remember the details of the problems that I
encountered. I am in the process of migrating a lot of stuff from VS
2008 to VS 2010. Once I finish that I will try ClojureCLR again and
get back to you regarding embedding and AOT.

eyeris

unread,
Aug 4, 2010, 2:59:16 PM8/4/10
to Clojure
I tried to build the latest ClojureCLR using VS 2008. I used the DLR
1.0 release. I successfully replaced your DLR project references and
built them:

http://imgur.com/SgUmu.jpg

Then I added a DLR reference to the Clojure project and built it,
resulting in these two errors "The extern alias MSC was not specified
in a /reference option":

http://imgur.com/LWjOs.jpg

Your installing-clojureclr page says "I know for sure that will work.
I hope to bring everything up to VS2010 (and because of DLR, no more
VS2008 for building) by 7/23/2010." but I didn't see anything in the
commit history to suggest that you've done this.

Hadi Hariri

unread,
Aug 4, 2010, 5:48:18 PM8/4/10
to clojure
If you're building inside the IDE, go to the Clojure.project and
locate the Microsoft.Scripting.Core assembly in References. Click
Properties and in the Aliases, set it to "global,MSC" (without the
quotes). It should be default "global"

dmiller

unread,
Aug 4, 2010, 9:45:36 PM8/4/10
to Clojure
the 7/23 date is, as they say, not operational. I've edited that out.
I'll go as far as 'soon'. (The new PC I was going supposed to move to
and install VS2010 on has to be replaced due to the possibility that
the hard disk will fry.)

You cannot use DLR 1.0. I need things that are not in that release.
As stated on the wiki page:

'For the time being go "http://dlr.codeplex.com/SourceControl/
changeset/changes/48032":here to get version 48032.'

With a binary distribution, at least I can package an approved version
of the DLR.


-David

eyeris

unread,
Aug 10, 2010, 12:34:54 AM8/10/10
to Clojure
I was able to build ClojureCLR using the DLR 1.0 source and the latest
clojure-clr in VS 2010. I am able to run Clojure.Main.exe and
Clojure.Compile.exe. Is there a way to integrate these into VS, so
that I can add .clj files to a project and set the build action to
"Build" or "Build with Clojure.Compile.exe" and get a .dll out the
other side?
> > > > start-up speed:  I'mrunningsome experiments on that.   The problem
> > > > is mostly the monolithic nature of the assemblies created and the
> > > > amount of environment initialization.  Suggestions welcomed.
>
> > > > Ease of embeddability: please elaborate on the problems.
>
> > > > AOT'ing clj files:  Ditto.
>
> > > > -David
>
> > > > On Aug 3, 12:47 pm, Timothy Baldridge <tbaldri...@gmail.com> wrote:
>
> > > > > > I really wish that ClojureCLR had a binary distribution. I like
> > > > > > clojure a lot but I have a .Netbackground and a lot of .Netcode to
Reply all
Reply to author
Forward
0 new messages