Buddy I'm telling you this OMeta thing is hot as coals. I don't understand its internals terribly well, which is why I haven't tried porting it. But it's fantastic.
Have a look at the writings page at the VPRI website to get a feel for what it's about. Short version: inspired by Meta-2, but that just deals with streams of characters, whereas OMeta deals with streams of _any object_. Thus: many complex functions of compiler design are reduced to the exact same thing; transforming input into output in a grammatically concise way. It won't likely perform as well as the compiler we're using now, but I'll bet a dollar that it can express our current compiler infrastructure in an order of magnitude less code, if we use it artfully. For folks experimenting with language designs on high-end workstations, the performance of the compiler rapidly becomes irrelevant, and the simpler description drops way less cognitive load on your head. It would be very cool to have a Cuis compiler written in OMeta to compare and contrast with the one we have inherited from Smalltalk. The performance of the two would be interesting to compare, as would be the number of source lines of code, as well as that foggy "legibility" thing. If there's a single thing that I'd like to see supported in Cuis, the parasitic metalanguage is it. It's like an upgrade that makes every language your toy. --C _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
On 5/16/15, 6:18 PM, "Casey Ransberger" <[hidden email]> wrote:
> Buddy I'm telling you this OMeta thing is hot as coals. I don't understand its > internals terribly well, which is why I haven't tried porting it. But it's > fantastic. > > Have a look at the writings page at the VPRI website to get a feel for what > it's about. Short version: inspired by Meta-2, but that just deals with > streams of characters, whereas OMeta deals with streams of _any object_. Thus: > many complex functions of compiler design are reduced to the exact same thing; > transforming input into output in a grammatically concise way. > > It won't likely perform as well as the compiler we're using now, but I'll bet > a dollar that it can express our current compiler infrastructure in an order > of magnitude less code, if we use it artfully. > > For folks experimenting with language designs on high-end workstations, the > performance of the compiler rapidly becomes irrelevant, and the simpler > description drops way less cognitive load on your head. > > It would be very cool to have a Cuis compiler written in OMeta to compare and > contrast with the one we have inherited from Smalltalk. The performance of the > two would be interesting to compare, as would be the number of source lines of > code, as well as that foggy "legibility" thing. > > If there's a single thing that I'd like to see supported in Cuis, the > parasitic metalanguage is it. > > It's like an upgrade that makes every language your toy. > > --C This is the info I looking for. Say what. For now I start to study how to load OMeta. I use for this my http://squeakros.org/CuiSantafesino.2.zip fork as is more Squeak compatible. Try and see what you could do with only 509 classes and 2.8 MB size. Only possible thanks to Juan, of course. But haves DragAndDrop, could read simple Squeak Morphs, and could try to load Squeak 4.4 to 3.9 older classes which not was in the image. The weird lessons was submitted here as this is a cool list with smart people. And we have Juan for advice .... Edgar @morplenauta en twitter _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
In reply to this post by Casey Ransberger-2
On Sat, 2015-05-16 at 14:18 -0700, Casey Ransberger wrote:
> It would be very cool to have a Cuis compiler written in OMeta to compare and contrast with the one we have inherited from Smalltalk. The performance of the two would be interesting to compare, as would be the number of source lines of code, as well as that foggy "legibility" thing. We've been so busy on the other thread(s), I forgot to show you this (just a starting point, but still): 'From Cuis 2.0 of 4 January 2010 [latest update: #393] on 20 May 2015 at 5:21:43 am'! !classDefinition: #O2SqueakRecognizer category: #OMeta2! OMeta2 subclass: #O2SqueakRecognizer instanceVariableNames: '' classVariableNames: 'TypeTable' poolDictionaries: '' category: 'OMeta2'! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 00:43'! arrayConstr = "{" expr ("." expr)* ("." | empty) "}" | "{" "}"! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 00:57'! arrayLit = "#" "(" (literal | arrayLit | spaces tsArraySymbol)* ")"! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 00:57'! binary = spaces tsBinary! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 00:58'! binaryExpr = binaryExpr binaryMsg | unaryExpr! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 00:58'! binaryMsg = binary unaryExpr! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:08'! block = "[" ( (":" identifier)+ "|" | empty ) ( "|" identifier* "|" | empty ) ( expr ("." expr)* ("." "^" expr | empty) | "^" expr | empty ) ( "." | empty ) "]"! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 00:58'! cascade = identifier | binaryMsg | keywordMsg! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 00:59'! expr = identifier (":=" | "_") expr | msgExpr! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:18'! identifier = spaces tsIdentifier ~$:! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:19'! keyword = spaces tsKeyword! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:19'! keywordExpr = binaryExpr keywordMsg! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:19'! keywordMsg = keywordMsg keywordMsgPart | keywordMsgPart! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:20'! keywordMsgPart = keyword binaryExpr! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:20'! literal = spaces ( tsNumber | tsCharacter | tsString | tsSymbol ) ! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:21'! msgExpr = (keywordExpr | binaryExpr) (";" cascade)*! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:30'! squeakExpr = <expr>! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'pb 2/11/2010 01:28'! squeakExprs = <expr>$. <squeakExprs> | <expr>! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:23'! symbol = "#" spaces ( tsString | tsKeyword (tsIdentifier | empty) )! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:23'! tcBinaryChar = char:x ?[(TypeTable at: x asciiValue) == #xBinary]! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:25'! tsArraySymbol = tsKeyword+ (tsIdentifier | empty) | tsIdentifier! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:25'! tsBinary = ($| | tcBinaryChar) tcBinaryChar*! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:25'! tsCharacter = $$ char! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:26'! tsIdentifier = letter (letter | digit)*! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:31'! tsKeyword = tsIdentifier $:! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:26'! tsNatural = digit+! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:27'! tsNumber = ($+ | $- | empty) tsNatural! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:28'! tsString = $' ($' $' | ~$' char)* $'! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:28'! tsSymbol = $# spaces (tsString | tsArraySymbol)! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:28'! unaryExpr = unit identifier*! ! !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 01:29'! unit = literal | identifier | arrayLit | arrayConstr | block | "(" expr ")" ! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! !classDefinition: 'O2SqueakRecognizer class' category: nil! O2SqueakRecognizer class instanceVariableNames: ''! !O2SqueakRecognizer class methodsFor: 'as yet unclassified' stamp: 'aw 2/20/2009 02:04'! initialize TypeTable := #(#xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xDelimiter #xDelimiter #xBinary #xDelimiter #xDelimiter #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #doIt #xBinary #xDelimiter #xBinary #xDoubleQuote #xLitQuote #xDollar #xBinary #xBinary #xSingleQuote #leftParenthesis #rightParenthesis #xBinary #xBinary #xBinary #xBinary #period #xBinary #xDigit #xDigit #xDigit #xDigit #xDigit #xDigit #xDigit #xDigit #xDigit #xDigit #xColon #semicolon #xBinary #xBinary #xBinary #xBinary #xBinary #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #leftBracket #xBinary #rightBracket #upArrow #leftArrow #xBinary #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #leftBrace #verticalBar #rightBrace #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xLetter #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xLetter #xBinary #xBinary #xBinary #xBinary #xLetter #xBinary #xBinary #xBinary #xBinary #xBinary #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xBinary #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xBinary #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xBinary)! ! O2SqueakRecognizer initialize! _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
This is a file-out of which component from which source?
On 5/20/15, Phil (list) <[hidden email]> wrote: > On Sat, 2015-05-16 at 14:18 -0700, Casey Ransberger wrote: >> It would be very cool to have a Cuis compiler written in OMeta to compare >> and contrast with the one we have inherited from Smalltalk. The >> performance of the two would be interesting to compare, as would be the >> number of source lines of code, as well as that foggy "legibility" thing. >> > > We've been so busy on the other thread(s), I forgot to show you this > (just a starting point, but still): > > 'From Cuis 2.0 of 4 January 2010 [latest update: #393] on 20 May 2015 at > 5:21:43 am'! > !classDefinition: #O2SqueakRecognizer category: #OMeta2! > OMeta2 subclass: #O2SqueakRecognizer > instanceVariableNames: '' > classVariableNames: 'TypeTable' > poolDictionaries: '' > category: 'OMeta2'! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 00:43'! > arrayConstr = > > "{" expr ("." expr)* ("." | empty) "}" > | "{" "}"! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 00:57'! > arrayLit = > > "#" "(" (literal | arrayLit | spaces tsArraySymbol)* ")"! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 00:57'! > binary = > > spaces tsBinary! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 00:58'! > binaryExpr = > > binaryExpr binaryMsg > | unaryExpr! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 00:58'! > binaryMsg = > > binary unaryExpr! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:08'! > block = > > "[" > ( (":" identifier)+ "|" > | empty > ) > > ( "|" identifier* "|" > | empty > ) > > ( expr ("." expr)* ("." "^" expr | empty) > | "^" expr > | empty > ) > > ( "." > | empty > ) > > "]"! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 00:58'! > cascade = > > identifier > | binaryMsg > | keywordMsg! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 00:59'! > expr = > > identifier (":=" | "_") expr > | msgExpr! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:18'! > identifier = > > spaces tsIdentifier ~$:! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:19'! > keyword = > > spaces tsKeyword! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:19'! > keywordExpr = > > binaryExpr keywordMsg! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:19'! > keywordMsg = > > keywordMsg keywordMsgPart > | keywordMsgPart! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:20'! > keywordMsgPart = > > keyword binaryExpr! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:20'! > literal = > > spaces ( tsNumber > | tsCharacter > | tsString > | tsSymbol > ) > ! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:21'! > msgExpr = > > (keywordExpr | binaryExpr) (";" cascade)*! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:30'! > squeakExpr = > > <expr>! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'pb > 2/11/2010 01:28'! > squeakExprs = > <expr>$. <squeakExprs> > | <expr>! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:23'! > symbol = > > "#" spaces > ( tsString > | tsKeyword (tsIdentifier | empty) > )! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:23'! > tcBinaryChar = > > char:x ?[(TypeTable at: x asciiValue) == #xBinary]! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:25'! > tsArraySymbol = > > tsKeyword+ (tsIdentifier | empty) > | tsIdentifier! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:25'! > tsBinary = > > ($| | tcBinaryChar) tcBinaryChar*! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:25'! > tsCharacter = > > $$ char! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:26'! > tsIdentifier = > > letter (letter | digit)*! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:31'! > tsKeyword = > > tsIdentifier $:! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:26'! > tsNatural = > > digit+! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:27'! > tsNumber = > > ($+ | $- | empty) tsNatural! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:28'! > tsString = > > $' ($' $' | ~$' char)* $'! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:28'! > tsSymbol = > > $# spaces (tsString | tsArraySymbol)! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:28'! > unaryExpr = > > unit identifier*! ! > > !O2SqueakRecognizer methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 01:29'! > unit = > > literal > | identifier > | arrayLit > | arrayConstr > | block > | "(" expr ")" > ! ! > > "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! > > !classDefinition: 'O2SqueakRecognizer class' category: nil! > O2SqueakRecognizer class > instanceVariableNames: ''! > > !O2SqueakRecognizer class methodsFor: 'as yet unclassified' stamp: 'aw > 2/20/2009 02:04'! > initialize > > TypeTable := #(#xBinary #xBinary #xBinary #xBinary #xBinary #xBinary > #xBinary #xBinary #xDelimiter #xDelimiter #xBinary #xDelimiter > #xDelimiter #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary > #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary > #xBinary #xBinary #doIt #xBinary #xDelimiter #xBinary #xDoubleQuote > #xLitQuote #xDollar #xBinary #xBinary #xSingleQuote #leftParenthesis > #rightParenthesis #xBinary #xBinary #xBinary #xBinary #period #xBinary > #xDigit #xDigit #xDigit #xDigit #xDigit #xDigit #xDigit #xDigit #xDigit > #xDigit #xColon #semicolon #xBinary #xBinary #xBinary #xBinary #xBinary > #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter > #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter > #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter > #xLetter #xLetter #leftBracket #xBinary #rightBracket #upArrow > #leftArrow #xBinary #xLetter #xLetter #xLetter #xLetter #xLetter > #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter > #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter > #xLetter #xLetter #xLetter #xLetter #xLetter #leftBrace #verticalBar > #rightBrace #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary > #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary > #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary > #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary > #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary > #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xLetter #xBinary > #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary #xBinary > #xBinary #xLetter #xBinary #xBinary #xBinary #xBinary #xLetter #xBinary > #xBinary #xBinary #xBinary #xBinary #xLetter #xLetter #xLetter #xLetter > #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter > #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter > #xLetter #xLetter #xLetter #xBinary #xLetter #xLetter #xLetter #xLetter > #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter > #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter > #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter #xLetter > #xLetter #xLetter #xLetter #xBinary #xLetter #xLetter #xLetter #xLetter > #xLetter #xLetter #xLetter #xLetter #xBinary)! ! > > > O2SqueakRecognizer initialize! > > > > > _______________________________________________ > Cuis mailing list > [hidden email] > http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org > _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
On Wed, 2015-05-20 at 13:05 +0000, H. Hirzel wrote:
> This is a file-out of which component from which source? > A Smalltalk/Squeak scanner/parser from OMeta 2 (it ships as part of the OMeta which is why it's a tricky package to load: parts of it are written in itself). This is what 'pure' OMeta code looks like... in most real world usage there would be squeak code on the right-hand side action ('=> [some squeak code]') when a rule of interest is matched that might, for example, populate an AST. Fascinating, I'd never looked at how this code was used before until you asked: In OMeta it's used to determine whether it's looking at Squeak code since it will get handed both OMeta and Squeak code. The fascinating part is that it's written twice: once in Smalltalk as part of the stage 1 in bootstrap and then again in stage 2 in OMeta once the foundation exists. So Casey can partially get his wish now: look at how stage 1 does it vs stage 2 to see the difference between pure Smalltalk and OMeta. For example the arrayConstr method in Squeak: arrayConstr ^ self ometaOr: {[true ifTrue: [self apply: #token withArgs: {'{'}. self apply: #expr. self many: [true ifTrue: [self apply: #token withArgs: {'.'}. self apply: #expr]]. self ometaOr: {[self apply: #token withArgs: {'.'}]. [self apply: #empty]}. self apply: #token withArgs: {'}'}]]. [true ifTrue: [self apply: #token withArgs: {'{'}. self apply: #token withArgs: {'}'}]]} and here's the OMeta version: arrayConstr = "{" expr ("." expr)* ("." | empty) "}" | "{" "}" > > > On 5/20/15, Phil (list) <[hidden email]> wrote: > > On Sat, 2015-05-16 at 14:18 -0700, Casey Ransberger wrote: > >> It would be very cool to have a Cuis compiler written in OMeta to compare > >> and contrast with the one we have inherited from Smalltalk. The > >> performance of the two would be interesting to compare, as would be the > >> number of source lines of code, as well as that foggy "legibility" thing. > >> > > > > We've been so busy on the other thread(s), I forgot to show you this > > (just a starting point, but still): > > <snip> _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
On Wed, 2015-05-20 at 13:50 -0400, Phil (list) wrote:
> On Wed, 2015-05-20 at 13:05 +0000, H. Hirzel wrote: > > This is a file-out of which component from which source? > > > > A Smalltalk/Squeak scanner/parser from OMeta 2 (it ships as part of the > OMeta which is why it's a tricky package to load: parts of it are > written in itself). This is what 'pure' OMeta code looks like... in > most real world usage there would be squeak code on the right-hand side > action ('=> [some squeak code]') when a rule of interest is matched that > might, for example, populate an AST. > > Fascinating, I'd never looked at how this code was used before until you > asked: In OMeta it's used to determine whether it's looking at Squeak > code since it will get handed both OMeta and Squeak code. The > fascinating part is that it's written twice: once in Smalltalk as part > of the stage 1 in bootstrap and then again in stage 2 in OMeta once the > foundation exists. So Casey can partially get his wish now: look at how > stage 1 does it vs stage 2 to see the difference between pure Smalltalk > and OMeta. For example the arrayConstr method in Squeak: > > arrayConstr > ^ self ometaOr: {[true > ifTrue: [self apply: #token withArgs: {'{'}. > self apply: #expr. > self > many: [true > ifTrue: [self apply: #token withArgs: {'.'}. > self apply: #expr]]. > self ometaOr: {[self apply: #token withArgs: {'.'}]. [self apply: > #empty]}. > self apply: #token withArgs: {'}'}]]. [true > ifTrue: [self apply: #token withArgs: {'{'}. > self apply: #token withArgs: {'}'}]]} > > and here's the OMeta version: > > arrayConstr = > > "{" expr ("." expr)* ("." | empty) "}" > | "{" "}" > > > > > > > On 5/20/15, Phil (list) <[hidden email]> wrote: > > > On Sat, 2015-05-16 at 14:18 -0700, Casey Ransberger wrote: > > >> It would be very cool to have a Cuis compiler written in OMeta to compare > > >> and contrast with the one we have inherited from Smalltalk. The > > >> performance of the two would be interesting to compare, as would be the > > >> number of source lines of code, as well as that foggy "legibility" thing. > > >> > > > > > > We've been so busy on the other thread(s), I forgot to show you this > > > (just a starting point, but still): > > > > > <snip> Having gone through this exercise in the various threads has gotten me to the point where I believe OMeta 2 functionality can best be summarized thusly: https://youtu.be/-1TTN-Ev2KI?t=55s _______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
I need to find the time to understand all these interesting topics, but I fear to become as the guy of the video :D
2015-05-20 15:18 GMT-03:00 Phil (list) <[hidden email]>:
_______________________________________________ Cuis mailing list [hidden email] http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org |
Free forum by Nabble | Edit this page |