Jump to content
  • Advertisement
Sign in to follow this  
Baiame

[.net] Creating one's own .NET language

This topic is 3906 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. My father is an interactive computer musician, and we've discussed an idea for a piece of software for relatively easy (and unlimited) creation of interactive art. It would have an integrated language. One requirement of this language is that when compiled and optimized, its executable code isn't terribly slower than the equivalent optimized code created by a low-level language compiler (approximately 50% performance is acceptable); the point is that users are not pressured to implement parts of their projects externally. Another requirement is reflection. Users must be able to preview projects without significant delays, though a huge performance hit for these previews is acceptable. Is .NET suitable considering these requirements? If so, is it possible for a couple moderately skilled programmers to implement their own .NET language within a few years? If not, what are the alternatives, and why might they be better choices? Thanks for your ideas. Note that I don't intend to work on this project directly.

Share this post


Link to post
Share on other sites
Advertisement
Creating a compiler for .NET is actually easier than if you were to write your own front and backend for a specific machine.

The intermediate language(IL) is very easy to work with. Straightforward instruction set. Its stack based, which means you can pretty much generate code that mirrors what your parsing. No need to worry about register allocation or machine specifics.

The framework itself also has the Reflection.Emit namespace-- which lets you output code and assemblies with ease.

And you avoid the need to write a runtime system, since .NET is your runtime. No need to worry about memory management.

You should still try to emit efficient IL, but the JIT will kick in, and do whatever optimizations available to it. In my experience, .NET has always been plenty fast.

Basically, you're cutting out big(huge?) chunks of the work involved if you go with .NET. I dunno, I think you could hammer out a compiler in a few months, not years. Depending on the complexity of your language of course...

What exactly would your language look like anyways? Is it purely for music, or for visuals too? I'm trying to think of how this would work :)

Disclaimer: I've yet to create a full blown, production quality compiler. But I've messed around with a few toy ones, and I've got serious plans for my own language..which I'm almost positive will be .NET( for all the reasons stated above )

Share this post


Link to post
Share on other sites
Thanks POedBoy.

Good to hear that the CIL's easy to work with, and about Reflection.Emit.

The language will have an entirely visual interface, cater for OOP, procedural, and probably some table-oriented programming. It'll (if it ever gets made...) be as much for visual stuff as for music. Thanks for your interest.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!