IDE binding internals
Posted: Wed Jan 08, 2014 6:48 pm
Subject:
How to make a Language Binding (LB) for the Cobra Language
to one of these IDEs:
- SD: SharpDevelop
- MD: MonoDevelop
- XS: Xamarin Studio
- VS: Visual Studio
I want to understand how an LB can be made,
I am not a user of one of these IDEs, I just want to understand how it works.
Hence
1. in the last years, occasionally, I studied the source code of these LBs:
- C#, Boo, IronPython in SD3, SD4,
- C# in SD5, MD/XS.
2. And because I could not understand it, I implemented such an LB (Cobra for SD4), and gradually I got the feeling that I understand it. That was when it had all the usual LB-features for the most frequent expression kinds. Now it became a little bit dull, just work, and certain bugs in the Cobra compiler..., so I stopped.
3. But some time ago I looked into the source of SD5:
they changed a lot of things, currently C# is the only working LB,
all the other SD4 LBs do not work anymore.
So, maybe, understanding SD5, that could be a new challenge.
4. And of course, I peeked a little bit into the source code of the LB of nerdzero:
- Cobra in MD/XS
5. The usual LBs are all similar. You have to make
- a parser or an AST conversion visitor
- expression finder
- resolver
Much work!
The LB of nerdero is quite different:
- it just uses the resolved AST of the Cobra compiler.
Much simpler!
Very, very interesting!
I wonder if this approach can lead to an LB with all the features of a C# LB.
Maybe it is a shortcut to the summit, or a dead-end street.
How to make a Language Binding (LB) for the Cobra Language
to one of these IDEs:
- SD: SharpDevelop
- MD: MonoDevelop
- XS: Xamarin Studio
- VS: Visual Studio
I want to understand how an LB can be made,
I am not a user of one of these IDEs, I just want to understand how it works.
Hence
1. in the last years, occasionally, I studied the source code of these LBs:
- C#, Boo, IronPython in SD3, SD4,
- C# in SD5, MD/XS.
2. And because I could not understand it, I implemented such an LB (Cobra for SD4), and gradually I got the feeling that I understand it. That was when it had all the usual LB-features for the most frequent expression kinds. Now it became a little bit dull, just work, and certain bugs in the Cobra compiler..., so I stopped.
3. But some time ago I looked into the source of SD5:
they changed a lot of things, currently C# is the only working LB,
all the other SD4 LBs do not work anymore.
So, maybe, understanding SD5, that could be a new challenge.
4. And of course, I peeked a little bit into the source code of the LB of nerdzero:
- Cobra in MD/XS
5. The usual LBs are all similar. You have to make
- a parser or an AST conversion visitor
- expression finder
- resolver
Much work!
The LB of nerdero is quite different:
- it just uses the resolved AST of the Cobra compiler.
Much simpler!
Very, very interesting!
I wonder if this approach can lead to an LB with all the features of a C# LB.
Maybe it is a shortcut to the summit, or a dead-end street.