From lenglish5 at cox.net Sun Sep 18 19:25:11 2011 From: lenglish5 at cox.net (Lawson English) Date: Sun Sep 18 19:24:43 2011 Subject: [Ometa] Lua to squeak translation? Message-ID: <4E76A807.3060303@cox.net> I've seen evidence of a javascript to lua translator done in OMeta, but I was wondering if anyone had ever tired the other way 'round? I'm looking at the feasibility of porting a game http://www.naev.org to squeak, and most of the AI and higher level glue is done in Lua. Thanks. Lawson From jwkozaczuk at gmail.com Thu Sep 22 07:48:04 2011 From: jwkozaczuk at gmail.com (Waldek Kozaczuk) Date: Thu Sep 22 07:47:36 2011 Subject: [Ometa] OMeta/JS question Message-ID: I have read somewhere in the paper that OMeta/JS OMeta parser and translator (BSOMetaParser and BSOMetaTranslator) where were generated using OMeta itself. I struggle to understand how this was achieved using only ometa-base.js. Or was it generated using another implementation of OMeta (like COLA or Squeak)? If so it means that first implementation of OMeta was simply hand coded? If the former is true how would I use OMeta class only (and whatever is in ometa-base.js) to generate bs-ometa-compiler.js out of bs-ometa-compiler.txt? I am sorry if I do not make sense asking some of these questions. Thanks, Waldek -------------- next part -------------- An HTML attachment was scrubbed... URL: http://vpri.org/pipermail/ometa/attachments/20110922/02e94d69/attachme= nt.htm From jwkozaczuk at gmail.com Thu Sep 22 07:50:15 2011 From: jwkozaczuk at gmail.com (Waldek Kozaczuk) Date: Thu Sep 22 07:49:47 2011 Subject: [Ometa] OMeta Scala implementation Message-ID: Is there existing Scala implementation of OMeta? Would there be much value in it considering that Scala itself allows for building DSLs? Thanks, Waldek -------------- next part -------------- An HTML attachment was scrubbed... URL: http://vpri.org/pipermail/ometa/attachments/20110922/eb4b427a/attachme= nt.htm From justin.m.chase at gmail.com Fri Sep 23 12:27:31 2011 From: justin.m.chase at gmail.com (Justin Chase) Date: Fri Sep 23 12:27:04 2011 Subject: [Ometa] OMeta/JS question In-Reply-To: References: Message-ID: SSB3YXMgaG9waW5nIHNvbWVvbmUgZWxzZSB3b3VsZCBhbnN3ZXIgeW91IGhlcmUgc2luY2UgSS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IgaXMg dHJ1ZSBob3cgd291bGQgSSB1c2UgT01ldGEgY2xhc3Mgb25seSAoYW5kIHdoYXRldmVyIGlzIGlu Cj4gb21ldGEtYmFzZS5qcykgdG8gZ2VuZXJhdGUgYnMtb21ldGEtY29tcGlsZXIuanMgb3V0IG9m Cj4gYnMtb21ldGEtY29tcGlsZXIudHh0Pwo+Cj4gSSBhbSBzb3JyeSBpZiBJIGRvIG5vdCBtYWtl IHNlbnNlIGFza2luZyBzb21lIG9mIHRoZXNlIHF1ZXN0aW9ucy4KPgo+IFRoYW5rcywKPiBXYWxk ZWsKPgo+IF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCj4g T01ldGEgbWFpbGluZyBsaXN0Cj4gT01ldGFAdnByaS5vcmcKPiBodHRwOi8vdnByaS5vcmcvbWFp bG1hbi9saXN0aW5mby9vbWV0YQo+Cj4KCgotLSAKSnVzdGluIENoYXNlCmh0dHA6Ly93d3cuanVz dGlubWNoYXNlLmNvbQotLS0tLS0tLS0tLS0tLSBuZXh0IHBhcnQgLS0tLS0tLS0tLS0tLS0KQW4g SFRNTCBhdHRhY2htZW50IHdhcyBzY3J1YmJlZC4uLgpVUkw6IGh0dHA6Ly92cHJpLm9yZy9waXBl cm1haWwvb21ldGEvYXR0YWNobWVudHMvMjAxMTA5MjMvMTBlYWI4ZjYvYXR0YWNobWVudC5odG0K From jwkozaczuk at gmail.com Fri Sep 23 12:54:58 2011 From: jwkozaczuk at gmail.com (Waldek Kozaczuk) Date: Fri Sep 23 12:54:25 2011 Subject: [Ometa] OMeta/JS question In-Reply-To: References: Message-ID: First of thank you for answering my question. Yeah I think you are right about it and that probably was the case with the very first implementation of OMeta for for the first host language. But I would guess that if I wanted to implement OMeta in another host language I would be able to leverage existing OMeta implementation (for example OMeta/JS) to generate new host language code. I would still need to provide ometa-base.js equivalent to express the right side (after -> sign) of the rules in new host language. Am I wrong? Then eventually once I have the new host language code generated this way for OMetaParser and OMetaTranslator grammars I should be able to re-generate this code using new OMeta implementation. Does it make sense? What I am really after how do I go about implementing OMeta for another host language? On Fri, Sep 23, 2011 at 3:27 PM, Justin Chase wro= te: > I was hoping someone else would answer you here since I don't know for su= re > but in general I think that compilers are usually written by hand at firs= t, > with the first goal being the abillity to bootstrap itself and actually be > written in older versions of itself. I don't know that is how OMeta was d= one > specifically but I would be willing to wager it was. > > On Thu, Sep 22, 2011 at 9:48 AM, Waldek Kozaczuk wr= ote: > >> >> I have read somewhere in the paper that OMeta/JS OMeta parser and >> translator (BSOMetaParser and BSOMetaTranslator) where were generated us= ing >> OMeta itself. I struggle to understand how this was achieved using only >> ometa-base.js. Or was it generated using another implementation of OMeta >> (like COLA or Squeak)? If so it means that first implementation of OMeta= was >> simply hand coded? >> >> If the former is true how would I use OMeta class only (and whatever is = in >> ometa-base.js) to generate bs-ometa-compiler.js out of >> bs-ometa-compiler.txt? >> >> I am sorry if I do not make sense asking some of these questions. >> >> Thanks, >> Waldek >> >> _______________________________________________ >> OMeta mailing list >> OMeta@vpri.org >> http://vpri.org/mailman/listinfo/ometa >> >> > > > -- > Justin Chase > http://www.justinmchase.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://vpri.org/pipermail/ometa/attachments/20110923/469257cf/attachme= nt.htm From justin.m.chase at gmail.com Fri Sep 23 13:10:46 2011 From: justin.m.chase at gmail.com (Justin Chase) Date: Fri Sep 23 13:10:18 2011 Subject: [Ometa] OMeta/JS question In-Reply-To: References: Message-ID: T3V0IG9mIGN1cmlvc2l0eSwgd2hpY2ggaG9zdCBsYW5ndWFnZT8KCkkgYmFzaWNhbGx5IHdlbnQg dGhyb3VnaCB0aGlzIHByb2Nlc3MgZm9yIC5uZXQgYWxzby4gSSBkaWRuJ3QgYWN0dWFsbHkgdXNl Cm9tZXRhIGF0IGFsbCBidXQgbGV2ZXJhZ2VkIGNvbmNlcHRzIGFuZCByZWJ1aWx0IHRoZW0gb24g dGhhdCBwbGF0Zm9ybS4gTXkKZ2VuZX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iYXNlLmpzKSB0byBnZW5lcmF0ZSBicy1vbWV0 YS1jb21waWxlci5qcyBvdXQgb2YKPj4+IGJzLW9tZXRhLWNvbXBpbGVyLnR4dD8KPj4+Cj4+PiBJ IGFtIHNvcnJ5IGlmIEkgZG8gbm90IG1ha2Ugc2Vuc2UgYXNraW5nIHNvbWUgb2YgdGhlc2UgcXVl c3Rpb25zLgo+Pj4KPj4+IFRoYW5rcywKPj4+IFdhbGRlawo+Pj4KPj4+IF9fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCj4+PiBPTWV0YSBtYWlsaW5nIGxpc3QK Pj4+IE9NZXRhQHZwcmkub3JnCj4+PiBodHRwOi8vdnByaS5vcmcvbWFpbG1hbi9saXN0aW5mby9v bWV0YQo+Pj4KPj4+Cj4+Cj4+Cj4+IC0tCj4+IEp1c3RpbiBDaGFzZQo+PiBodHRwOi8vd3d3Lmp1 c3Rpbm1jaGFzZS5jb20KPj4KPgo+CgoKLS0gCkp1c3RpbiBDaGFzZQpodHRwOi8vd3d3Lmp1c3Rp bm1jaGFzZS5jb20KLS0tLS0tLS0tLS0tLS0gbmV4dCBwYXJ0IC0tLS0tLS0tLS0tLS0tCkFuIEhU TUwgYXR0YWNobWVudCB3YXMgc2NydWJiZWQuLi4KVVJMOiBodHRwOi8vdnByaS5vcmcvcGlwZXJt YWlsL29tZXRhL2F0dGFjaG1lbnRzLzIwMTEwOTIzLzNhYmVlZmE3L2F0dGFjaG1lbnQtMDAwMS5o dG0K From jwkozaczuk at gmail.com Fri Sep 23 14:11:52 2011 From: jwkozaczuk at gmail.com (Waldek Kozaczuk) Date: Fri Sep 23 14:11:21 2011 Subject: [Ometa] OMeta/JS question In-Reply-To: References: Message-ID: Thanks. I think I get it (at least at some level). I am thinking of Scala (which provides already pretty decent support to create DSLs). It is interesting that there seems to be no implementation of OMeta for any JVM-based language. On Fri, Sep 23, 2011 at 4:10 PM, Justin Chase wro= te: > Out of curiosity, which host language? > > I basically went through this process for .net also. I didn't actually use > ometa at all but leveraged concepts and rebuilt them on that platform. My > general strategy was something like this: > > 1. Create functions for all pattern matching operations > 2. Manually author all steps of the compiler, calling these functions. > 1. Tokenize step > 2. Interleave step > 3. Lang parse step (a general purpose language) > 4. Grammar parse step > 5. Grammar transform step (code generate host language) > 3. Write many many unit tests. > 4. Repeat 3 > 5. Repeat 4 > 6. I mentioned many many unit tests? > 7. Leverage previously generated code to parse step 2.1 and delete hand > written code. > 8. Repeat 7 for 2.2-2.5 > 9. Bootstrapped! > 10. Add language features and have fun. > > > Here is my current Grammar grammar in case you are interested: > > http://metasharp.codeplex.com/SourceControl/changeset/view/ff67516a1d3a#s= rc%2fMetaSharp.Transformation%2fGrammar%2fGrammarParser.g > > Step 2.3 was important for me to, as you put it, be able to express the > right side of productions in the host language. I am actually host langua= ge > agnostic in this case, I made my own host language, the AST of which can > compile into C#, VB, Boo. Or theoretically it could go to almost anything. > > > On Fri, Sep 23, 2011 at 2:54 PM, Waldek Kozaczuk wr= ote: > >> First of thank you for answering my question. >> >> Yeah I think you are right about it and that probably was the case with >> the very first implementation of OMeta for for the first host language. >> >> But I would guess that if I wanted to implement OMeta in another host >> language I would be able to leverage existing OMeta implementation (for >> example OMeta/JS) to generate new host language code. I would still need= to >> provide ometa-base.js equivalent to express the right side (after -> sig= n) >> of the rules in new host language. Am I wrong? >> >> Then eventually once I have the new host language code generated this way >> for OMetaParser and OMetaTranslator grammars I should be able to re-gene= rate >> this code using new OMeta implementation. >> >> Does it make sense? >> >> What I am really after how do I go about implementing OMeta for another >> host language? >> >> >> On Fri, Sep 23, 2011 at 3:27 PM, Justin Chase = wrote: >> >>> I was hoping someone else would answer you here since I don't know for >>> sure but in general I think that compilers are usually written by hand = at >>> first, with the first goal being the abillity to bootstrap itself and >>> actually be written in older versions of itself. I don't know that is h= ow >>> OMeta was done specifically but I would be willing to wager it was. >>> >>> On Thu, Sep 22, 2011 at 9:48 AM, Waldek Kozaczuk = wrote: >>> >>>> >>>> I have read somewhere in the paper that OMeta/JS OMeta parser and >>>> translator (BSOMetaParser and BSOMetaTranslator) where were generated = using >>>> OMeta itself. I struggle to understand how this was achieved using only >>>> ometa-base.js. Or was it generated using another implementation of OMe= ta >>>> (like COLA or Squeak)? If so it means that first implementation of OMe= ta was >>>> simply hand coded? >>>> >>>> If the former is true how would I use OMeta class only (and whatever is >>>> in ometa-base.js) to generate bs-ometa-compiler.js out of >>>> bs-ometa-compiler.txt? >>>> >>>> I am sorry if I do not make sense asking some of these questions. >>>> >>>> Thanks, >>>> Waldek >>>> >>>> _______________________________________________ >>>> OMeta mailing list >>>> OMeta@vpri.org >>>> http://vpri.org/mailman/listinfo/ometa >>>> >>>> >>> >>> >>> -- >>> Justin Chase >>> http://www.justinmchase.com >>> >> >> > > > -- > Justin Chase > http://www.justinmchase.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://vpri.org/pipermail/ometa/attachments/20110923/cf0d1c57/attachme= nt.htm From neleai at seznam.cz Sat Sep 24 03:56:02 2011 From: neleai at seznam.cz (=?utf-8?B?T25kxZllaiBCw61sa2E=?=) Date: Sat Sep 24 06:46:11 2011 Subject: [Ometa] OMeta/JS question In-Reply-To: References: Message-ID: <20110924105602.GA1853@domone> I would recommand you use my ruby ometa implementation at https://github.com/neleai/ruby-ometa instead ometa/JS. Ometa/JS is full of duplication for example you have to rewrite all these 'helpfull functions' which in ruby-ometa are translated automaticaly as standard prologue. And there are also some handy features in my implementation. On Fri, Sep 23, 2011 at 05:11:52PM -0400, Waldek Kozaczuk wrote: > >>> >>> >>> >>> -- >>> Justin Chase >>> http://www.justinmchase.com >>> >> > >> > > > -- > Justin Chase > http://www.justinmchase.com > > --20cf301b622b1e8d8104ada242f2 Content-Type: text/html; charset=ISO-8859-1 > Content-Transfer-Encoding: quoted-printable Thanks. I think I get it (at > least at some level). > I am thinking of Scala (which provides already pretty decent support to > create DSLs). It is interesting that there seems to be no implementation > of OMeta for any JVM-based language. > > On Fri, Sep 23, 2011 at 4:10 PM, Justin Chase > <[1]justin.m.chase@gmail.com> wrote: > > Out of curiosity, which host language? > ? > I basically went through this process for .net also. I didn't actually > use ometa at all but leveraged concepts and rebuilt them on that > platform. My general strategy was something like this: > > ?1.?Create functions for all pattern matching operations > ?2.?Manually?author all steps of the compiler, calling these functions. > > ?1.?Tokenize step > ?2.?Interleave step > ?3.?Lang parse step (a general purpose language) > ?4.?Grammar?parse step? > ?5.?Grammar transform step (code generate host language) > > ?3.?Write many many unit tests. > ?4.?Repeat 3 > ?5.?Repeat 4 > ?6.?I mentioned many many unit tests? > ?7.?Leverage previously generated code to parse step 2.1 and delete hand > written code. > ?8.?Repeat 7 for 2.2-2.5 > ?9.?Bootstrapped! > 10.?Add language features and have fun. > > ? > Here is my current Grammar grammar in case you are interested: > [2]http://metasharp.codeplex.com/SourceControl/changeset/view/ff67516a1d3a#src%2fMetaSharp.Transformation%2fGrammar%2fGrammarParser.g > ? > Step 2.3 was important for me to, as you put it, be able to express the > right side of productions in the host language. I am actually host > language agnostic in this case, I made my own host language, the AST of > which can compile into C#, VB, Boo. Or theoretically it could go to > almost anything. > ? > ? > On Fri, Sep 23, 2011 at 2:54 PM, Waldek Kozaczuk > <[3]jwkozaczuk@gmail.com> wrote: > > First of thank you for answering my question. > Yeah I think you are right about it and that probably was the case > with the very first implementation of OMeta for for the first host > language.? > But I would guess that if I wanted to implement OMeta in another host > language I would be able to leverage existing OMeta implementation > (for example OMeta/JS) to generate new host language code. I would > still need to provide ometa-base.js equivalent to express the right > side (after -> sign) of the rules in new host language. Am I wrong? > Then eventually once I have the new host language code generated this > way for?OMetaParser and?OMetaTranslator grammars I should be able to > re-generate this code using new OMeta implementation.? > Does it make sense?? > What I am really after how do I go about implementing OMeta for > another host language? > On Fri, Sep 23, 2011 at 3:27 PM, Justin Chase > <[4]justin.m.chase@gmail.com> wrote: > > I was hoping someone else would answer you here since I don't know > for sure but in general I think that compilers are usually written > by hand at first, with the first goal being the abillity to > bootstrap itself and actually be written in older versions of > itself. I don't know that is how OMeta was done specifically but I > would be willing to wager it was. > > On Thu, Sep 22, 2011 at 9:48 AM, Waldek Kozaczuk > <[5]jwkozaczuk@gmail.com> wrote: > > I have read somewhere in the paper that OMeta/JS OMeta parser and > translator (BSOMetaParser and BSOMetaTranslator) where were > generated using OMeta itself. I struggle to understand how this > was achieved using only ometa-base.js. Or was it generated using > another implementation of OMeta (like COLA or Squeak)? If so it > means that first implementation of OMeta was simply hand coded? > If the former is true how would I use OMeta class only (and > whatever is in ometa-base.js) to generate bs-ometa-compiler.js out > of bs-ometa-compiler.txt?? > I am sorry if I do not make sense asking some of these questions. > Thanks, > Waldek > _______________________________________________ > OMeta mailing list > [6]OMeta@vpri.org > [7]http://vpri.org/mailman/listinfo/ometa > > -- > Justin Chase > [8]http://www.justinmchase.com > References > > Visible links > 1. mailto:justin.m.chase@gmail.com > 2. http://metasharp.codeplex.com/SourceControl/changeset/view/ff67516a1d3a#src%2fMetaSharp.Transformation%2fGrammar%2fGrammarParser.g > 3. mailto:jwkozaczuk@gmail.com > 4. mailto:justin.m.chase@gmail.com > 5. mailto:jwkozaczuk@gmail.com > 6. mailto:OMeta@vpri.org > 7. http://vpri.org/mailman/listinfo/ometa > 8. http://www.justinmchase.com/ > tinmchase= > .com
>
> > --20cf301b622b1e8d8104ada242f2-- > > --===============132 -- fractal radiation jamming the backbone