World: r3wp
[Dialects] Questions about how to create dialects
older newer | first last |
Gregg 1-Aug-2007 [248] | I never got into Forth more than playing around, but I *love* the idea of the immersive experience. REBOL is that in many ways for me, because I can think about so many things using REBOL as a context. I think the idea of dialects could lead us to domain specific environments that are like Forth, in that they are highly focused and immersive. |
btiffin 1-Aug-2007 [249] | Forth Inc will send you a copy of of Swiift http://www.forth.com it has a block editor, but they've moved away from supporting it so they could 'do Windows'...a pity. And wait...did I say Forth was "just another language"? Where did THAT come from? Long live REBOL. :) |
Geomol 1-Aug-2007 [250x2] | :-) |
Ok, I'll read some more of this. I've already started a dialect (more like an intepreter as with BASIC). I'll have a real REBOL dialect (that can be used in the middle of REBOL scripts) in mind as well, as I go along. | |
Richard Boyd 20-Sep-2007 [252] | [InfoQ Article] Language-oriented programming : an evolutionary step beyond object-oriented programming? http://www.infoq.com/news/2007/09/Language-oriented-programming Fowler defined this concept as “the general style of development which operates about the idea of building software around a set of domain specific languages”. According to Martin Fowler object-oriented domain modelling allows to “build up a vocabulary” but the grammar – ways to combine these vocabularies – is not defined; DSLs add this grammar side. Therefore language-oriented programming inducts “this shift of moving from thinking about vocabulary, which is objects, to the notion of a language that combines vocabulary and grammar.” |
Brock 20-Sep-2007 [253x2] | Interesting article Richard. |
I wonder of any of those well versed in languages (Greg, btiffin, Geomol, Max to name a few) would want to respond to this posted question related to the above article "What language you would use to develop DSL?" ? | |
btiffin 20-Sep-2007 [255] | If I had to quickly pick an order; REBOL, Forth, SNOBOL, Lisp. If I was told I HAD to do it in a class based object oriented language I'd probably pick SmallTalk ... no ... I'd probably just leave. To be honest, I've rarley seen a DSL that didn't require a programmer to script it anyway, so... I find the whole thing kind of moot. Moot is the wrong word. A non-coder MIGHT be able to VID up a GUI but I doubt it would do much...or by the time they were done, the non-coder would have unknowningly become a coder. I've not seen a DSL I'd turn over to Bob the manager to write progams in. Even languages written to be specific; Erlang for telephony, Forth for telescopes, are still programmer languages. REBOL comes soooo close to being a data language that humans can use...but unfortunately nope; Programmers required. The magic all happens when you can build up layers, and stand on the shoulders of giants. Something hardware engineers have been doing since day 1...programmers might learn by day 32'767 if we get lucky. No doubt our smartest programmers will be fussing with strings 50 years from now with the same basic problems and mind sets faced 50 years ago. |
Terry 21-Sep-2007 [256] | A. It doesn't matter what language you use. That's like two kids that speak English saying.. "lets invent a new language.. what language should we use to invent it with?" |
Gregg 21-Sep-2007 [257x2] | I'm going to try to make time to respond on the ML later today. It's a good topic. |
It matters if it's a dialect Terry. If you wanted to create a special language to discuss neclear physics, do you think it would make a difference if you based it on a Mathematical foundation versus Basque? | |
btiffin 21-Sep-2007 [259] | Read this today, re programming language choice; http://www.paulgraham.com/icad.html Down near the bottom is the Appendix: Power. and leads to http://www.paulgraham.com/accgen.html I can read the languages he uses as examples, but only a few of them come close to the readability of foo: func [n] [func [i] [n: n + i]] or am I just too sucked into REBOL/Think? It's too bad the page has extra space around the brackets, as at a quick glance REBOL would be in the top four shortest. It's as quick grokable (meaning a quick glance implies a function returning a function that accumulates) as Dylan, LUA, Javascript and NewtonScript. And who uses Javascript? :) |
Ladislav 23-Sep-2007 [260x4] | hmm, but foo: func [n] [func [i] [n: n + i]] is wrong |
foo: closure [n] [func [i] [n: n + i]] is necessary for this to work reliably | |
example: f1: foo 1 f2: foo 2 f1 1 should yield 2, not 3! | |
another reliable implementation not using closure: foo: func [n] [use [m] [m: n func [i] [m: m + i]]] | |
btiffin 23-Sep-2007 [264] | Learn something new here everyday. :) |
RobertS 23-Sep-2007 [265] | In this context I am not going to offer the Curl examples for DSL and pass-the-proc except to say that ... no , I won't say that either ;-) |
Terry 24-Sep-2007 [266] | But Gregg, the reference was towards a "language that combines vocabulary and grammar"... sounds more like "Energy equals mass times the speed of light squared", rather than E = MC2 |
Gregg 24-Sep-2007 [267] | I understand; my point was that mathematics, as a foundation, allows you to express things in a domain that Basque, historically, does not. A DSL doesn't *have* to be an extension or outgrowth of an existing language, but that can often help. In order for tha that to work, you need to choose a base language that suits your needs. |
Brock 13-Jun-2008 [268] | Has anyone written a dialect to capture live sports action? Here are some examples of the types of items needed to be captured... Volleyball... http://www.wnmu.edu/athletic/stats/07vb/29wnmu.htm#GAME.PLY Hockey... http://www.nhl.com/scores/htmlreports/20072008/PL030416.HTM Soccer... http://www.uefa.com/competitions/ucl/fixturesresults/round=15109/match=301604/report=mbm.html |
Henrik 13-Jun-2008 [269] | what would the dialect do? |
Brock 13-Jun-2008 [270] | What I am going to attempt is a dialect that will respond to single key-strokes to tell the story of a match and at the same time capture the statics for the live game. Hopefully the end result will lead to many different tools based on this data such as statistics visualizations in the form of data summaries/reports and charts. |
Henrik 13-Jun-2008 [271] | It looks pretty parse friendly. |
Brock 13-Jun-2008 [272x4] | The sport I am most interested in doing this for is Volleyball as I have experience coaching this sport. |
Yes, I was thinking parse would likely be the way to go. | |
Each skill would be given a character on the keyboard and would expect it to be followed by a player number and the level of success of the player attempting the skill. | |
As I haven't worked much with Dialects I wasn't terribly sure how to start, so was looking for some dialect examples that might influence my starting point. | |
Henrik 13-Jun-2008 [276] | well, first I'd build the skeleton for the dialect for parsing a single line. then I might add some actions to it and then expand it to handle multiple lines. |
Brock 13-Jun-2008 [277x3] | The first line of the volleyball page http://www.wnmu.edu/athletic/stats/07vb/29wnmu.htm#GAME.PLY , the line starting 1-0, _might_ be represented by the following keystrokes... s43a23b50 So, s = set attempt, 4 = player Cola Svec, 3 = set attempt level 3 - perfect set a = attack attempt, 2 = player Jeri Walkowiak, 3 = attack attempt level 3 - kill b = block attempt, 5 = player Jessica Lindgren, 0 = block attempt level 0 - error |
I might need to add a team designator like H = Home, V = visitor as it could be complicated to catch live play and may need to establish which team inorder to correctly identify a player. I may also need to use a separator between each keystroke if I want to identify the player by jersey number. | |
I will need to start playing with this to see if I can come up with something and then maybe get some feedback on my attempts. I don't know when I would get to this but thought I'd through it out there. | |
BrianH 13-Jun-2008 [280] | If this is typing in real time, space would be the best seperator, |
eFishAnt 23-Jun-2008 [281x4] | anyone know how to parse this: |
{<table><table></table><tr></tr></table>} | |
It is a table with an empty table inside, and also a Table-Cell | |
for some reason, using recursion...I just can't seem to put my finger on the right combo. | |
Chris 23-Jun-2008 [285] | What's the goal? |
eFishAnt 23-Jun-2008 [286x5] | parse rules that will give a true if parse/all {<table><table></table><tr></tr></table>} RULES |
(using recursion) | |
like Tables: [Table Tables | Table] | |
Table: ["<table>" Content "</table>"] | |
...and so forth. | |
Chris 23-Jun-2008 [291] | rule: use [table row][ row: [<tr> </tr>] table: [<table> any [table | row] </table>] [table] ] |
eFishAnt 23-Jun-2008 [292] | As Robert de Niro said in one of my favorite movies of all time, "Analyze This" "...hey, you...you're good!" |
Chris 4-Aug-2008 [293x3] | rfc: I have a (not so) little function that attempts to match a block of values to a given specification. Example: >> probe match [%image.png :red 300x100 /old][ [ file: file! | url! [ size: opt pair! [ attributes: any get-word! | refinement! [ ] make object! [ file: %image.png size: 300x100 attributes: [:red /old] ] There's not much to the rules, they are -- one (default), opt (zero or one), any (zero or many), some (many). If they don't match, they return an error. Any suggestions? Optimizations? http://www.ross-gill.com/r/match.r |
Ways of making it smaller??? | |
One of the desired effects is precedence, for example: match [http://rebol.com%image.png][ link: file! | url! image: file! | url! ] Returns: [link: http://rebol.comimage: %image.png] | |
Gabriele 4-Aug-2008 [296] | I do something like that, but text based, in QML. not sure if it can be of any help. |
Alan 14-Sep-2008 [297] | . |
older newer | first last |