目前的進度是實現(xiàn)了generic constraint的數(shù)據(jù)結(jié)構(gòu)但是沒有加入語法分析和語義分析的內(nèi)容。generic constraint比較簡單,就如同C#的那個where,我可以寫:
1 concept T : IEq
2 {
3
4 }
5
6 concept T : ISort
7 where T : IEq
8 {
9
10 }
11
12 generic<T>
13 where T : ISort
14 function void Sort(T* values, int count)
15 {
16
17 }
2 {
3

4 }
5
6 concept T : ISort
7 where T : IEq
8 {
9

10 }
11
12 generic<T>
13 where T : ISort
14 function void Sort(T* values, int count)
15 {
16

17 }
這是很重要的,因為沒有了where,在Sort下面就沒辦法使用ISort和IEq里面定義的函數(shù)了。在NativeX可以成為一門真正可以使用的中間語言之前,還必須實現(xiàn)下面的功能:
1、 generic constraint
2、concept instance函數(shù)調(diào)用
3、異常處理
4、外部函數(shù)接口
5、調(diào)試器接口
6、裝載的時候檢查元數(shù)據(jù)引入表是否匹配了所有已經(jīng)加載的assembly
剩下的事情也不多了,就慢慢做吧。做完之后就可以開始寫一些parser來驗證這個NativeX究竟行不行了,我可以將Python和Basic都修改成一個類似C的語言(可以處理指針,沒有垃圾收集,等),然后把它編譯成NativeX的語法樹,這樣就可以開發(fā)一個支持多語言的編程接口并測試它了。