
| # | User | Message | Date |
| 292 | eFishAnt | As Robert de Niro said in one of my favorite movies of all time, "Analyze This" "...hey, you...you're good!" | 24-Jun 3:00 |
| 291 | Chris | rule: use [table row][ row: [<tr> </tr>] table: [<table> any [table | row] </table>] [table] ] | 24-Jun 2:54 |
| 290 | eFishAnt | ...and so forth. | 24-Jun 2:50 |
| 289 | eFishAnt | Table: ["<table>" Content "</table>"] | 24-Jun 2:50 |
| 288 | eFishAnt | like Tables: [Table Tables | Table] | 24-Jun 2:50 |
| 287 | eFishAnt | (using recursion) | 24-Jun 2:49 |
| 286 | eFishAnt | parse rules that will give a true if parse/all {<table><table></table><tr></tr></table>} RULES | 24-Jun 2:49 |
| 285 | Chris | What's the goal? | 24-Jun 2:48 |
| 284 | eFishAnt | for some reason, using recursion...I just can't seem to put my finger on the right combo. | 24-Jun 2:47 |
| 283 | eFishAnt | It is a table with an empty table inside, and also a Table-Cell | 24-Jun 2:46 |
| 282 | eFishAnt | {<table><table></table><tr></tr></table>} | 24-Jun 2:46 |
| 281 | eFishAnt | anyone know how to parse this: | 24-Jun 2:45 |
| 280 | BrianH | If this is typing in real time, space would be the best seperator, | 13-Jun 12:57 |
| 279 | Brock | 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. | 13-Jun 7:30 |
| 278 | Brock | 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. | 13-Jun 7:29 |
| 277 | Brock | 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 | 13-Jun 7:24 |
| 276 | Henrik | 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. | 13-Jun 7:13 |
| 275 | Brock | 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. | 13-Jun 7:11 |
| 274 | Brock | 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. | 13-Jun 7:11 |
| 273 | Brock | Yes, I was thinking parse would likely be the way to go. | 13-Jun 7:08 |
| 272 | Brock | The sport I am most interested in doing this for is Volleyball as I have experience coaching this sport. | 13-Jun 7:08 |
| 271 | Henrik | It looks pretty parse friendly. | 13-Jun 7:07 |
| 270 | Brock | 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. | 13-Jun 7:06 |
| 269 | Henrik | what would the dialect do? | 13-Jun 7:04 |
| 268 | Brock | 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 | 13-Jun 7:03 |
| 267 | Gregg | 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. | 24-Sep-07 14:35 |
| 266 | Terry | 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 | 24-Sep-07 5:55 |
| 265 | RobertS | 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 ;-) | 23-Sep-07 21:46 |
| 264 | btiffin | Learn something new here everyday. :) | 23-Sep-07 21:19 |
| 263 | Ladislav | another reliable implementation not using closure: foo: func [n] [use [m] [m: n func [i] [m: m + i]]] | 23-Sep-07 18:27 |
| 262 | Ladislav | example: f1: foo 1 f2: foo 2 f1 1 should yield 2, not 3! | 23-Sep-07 18:22 |
| 261 | Ladislav | foo: closure [n] [func [i] [n: n + i]] is necessary for this to work reliably | 23-Sep-07 18:19 |
| 260 | Ladislav | hmm, but foo: func [n] [func [i] [n: n + i]] is wrong | 23-Sep-07 18:18 |
| 259 | btiffin | 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? :) | 21-Sep-07 22:34 |
| 258 | Gregg | 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? | 21-Sep-07 16:06 |
| 257 | Gregg | I'm going to try to make time to respond on the ML later today. It's a good topic. | 21-Sep-07 16:03 |
| 256 | Terry | 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?" | 21-Sep-07 7:20 |
| 255 | btiffin | 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. | 20-Sep-07 22:33 |
| 254 | Brock | 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?" ? | 20-Sep-07 19:18 |
| 253 | Brock | Interesting article Richard. | 20-Sep-07 19:15 |
| 252 | Richard Boyd | [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.” | 20-Sep-07 4:47 |
| 251 | Geomol | 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. | 1-Aug-07 18:10 |
| 250 | Geomol | :-) | 1-Aug-07 18:09 |
| 249 | btiffin | 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. :) | 1-Aug-07 17:47 |
| 248 | Gregg | 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. | 1-Aug-07 17:37 |
| 247 | btiffin | Never mind the link so much. just a dup of one of Greggs. | 1-Aug-07 17:36 |
| 246 | btiffin | You beat me to it Gregg. Starting Forth by Leo Brodie. It includes the old school (and really the only reason to use Forth) block editor. Without the block editor Forth is pretty much just another language, with it (and after getting used to EDLIN style editing), you get the immersive holy grail. Thinking Forth is quite a bit more cerebral, but I know it's been made available in PDF, but I found this... http://home.iae.nl/users/mhx/sf.html so far. | 1-Aug-07 17:33 |
| 245 | Gregg | Leo Brodie's books, Starting Forth and Thinking Forth, are the seminal works on the language. | 1-Aug-07 16:45 |
| 244 | Gregg | I have a lot more links here as well, but the best reference may be Brian, since he was a real live Forth user. I also have a couple books on my shelf, but... | 1-Aug-07 16:45 |
| 243 | Gregg | http://www.retroforth.org/
http://www.colorforth.com/cf.html
http://www.xs4all.nl/~thebeez/4tH/4thide.htm
http://maschenwerk.de/foerthchen/ http://www.fig-uk.org/byof.htm http://www.complang.tuwien.ac.at/forth/threaded-code.html http://www.amresearch.com/starting_forth/ http://thinking-forth.sourceforge.net/ http://www.ultratechnology.com/1xforth.htm http://c2.com/cgi/wiki?ForthLanguage | 1-Aug-07 16:43 |
| 242 | Geomol | What is a good Forth version as a reference system? ANS Forth? I also need a place to look, where the language is explained in a clear and short form. | 1-Aug-07 14:50 |
| 241 | Gregg | John, it sounds great. I'm just totally strapped for time, or I'd be in there baning on it and learning from what you've done. | 31-Jul-07 2:30 |
| 240 | btiffin | Forth has a very (untouchable actually) immersive feel to it. As long as you avoid working with the sad sad current trend of text file forth, everything you do in Forth is Forth. Editor commands...Forth, disk management Forth, debugger Forth, locate and cross reference, Forth. Anyway I'm still questing for a REBOL enviroment that allows that immersive feel. No brain switching to Editor, back to console command brain, then another brain switch to file manager, bobloblaw. Mondo powerful when you can keep your brain in one mode for a full eight hours. Even building Forth was Forth. I do kinda miss it, but only for semimental reasons. REBOL is just too cool to think about going back. | 30-Jul-07 23:36 |
| 239 | Geomol | Thanks for the input! I thought about something similar, having a sub-pointer as you speak of. It could work. But I got the feeling, it'll be a better design, if it's done like the original, using an internal format with byte-code for the keywords. I have to judge, how much work it is. I'm interested in Greggs original ideas, which got me going with this, to implement different languages. I'll consider Forth as the next one. | 30-Jul-07 23:23 |
| 238 | btiffin | Comments, hmmm. You've done an awesome job John. I learned Z-80 assembler back on my TRS-80 before I did much BASIC. When they finally got a computer class in my high school for ninth graders, I was already in grade 12 and laughed at the BASIC. So, instead of having me whining and whinging all class, I got to write a student database program in assembler for my electronics teacher on the Commodore PET. Never been a fan of BASIC, but what you've done can only attract a larger REBOL audience so well done. If you can make it compatible enough to run old DOS frogger.bas you may have a demo that gains worldwide attention. Technically, back to your point, (having sadly only glossed over your codebase), what if you tricked the "line" internals say with pair! or decimal! keeping your own sub-lines invisible to the user? And if you start up a Forth dialect...I'm in. Or at least will show a keener interest watching a guru at work :) | 30-Jul-07 23:07 |
| 237 | Geomol | Comments!? | 30-Jul-07 19:12 |
| 236 | Geomol | It's rather difficult to implement functions (user functions, which the BBC BASIC language support), with the implementing method, I've choosed. Problem is, that the return point need to be saved, while the function code is running. The problem is the same with statements like GOSUB and PROC (procedures), but so far, I've just put some restrictions on those. In this basic, more than one statement can be on each line, if they're separated by colons, ':'. The way it's implemented, this example give a syntax error:
GOSUB 100:PRINT "I'm back"
My implementation require, that the return point is the next line. That isn't good enough with functions, because they're used in the middle of other statements. Examples: PRINT FNone_function, FNanother_function IF FNmyfunc=42 THEN PRINT "It's 42!" The return point for those need to be in the middle of a statement, in the middle of a line. So I'm at a point, where I consider another implementation of all the statements (more like a real emulation of the BBC computer) or if I just should say "the heck with it" and move on to some other language or another version of a new BASIC language. | 30-Jul-07 19:12 |
| 235 | Geomol | This *is* ... | 29-Jul-07 11:09 |
| 234 | Geomol | This probably the same reason, words are separated by space in REBOL. | 29-Jul-07 11:08 |
| 233 | Geomol | So far, I've allowed keywords to be either UPPER- or lower-case. I think, I have to restrict them to UPPER-case like in traditional BASIC. Problem is with variable names being assigned by the LET statement. If I define a variable "length": LET length=10 and then use it in some expression, the first part of the variable name is being recognized as the LEN function. In the original BBC BASIC, the above LET statement is ok, while you can't write: LET LENGTH=10 , which will give a syntax error. I conclude, I have to restrict keywords to UPPER-case and then check, when the variables are being defined, so their names don't collide with keywords. | 29-Jul-07 11:04 |
| 232 | Geomol | There still need to be work done on formatted output (PRINT and INPUT statements). | 27-Jul-07 12:18 |
| 231 | Geomol | Ups, the line >50end after the program shouldn't have been there, so forget that (even if it works with it included). | 27-Jul-07 12:16 |
| 230 | Geomol | Example use of local variables. In line 70, 'a' is local, because it's a parameter to the procedure, 'b' is still global. After line 80, 'b' also become local to the procedure. After returning from the procedure, both 'a' and 'b' are set back to their global values. In 'proctest', 'a' could have been called anything without changing the global 'a'. >> do http://www.fys.ku.dk/~niclasen/rebol/bbcbasic.html Script: "BBC BASIC" (27-Jul-2007) BASIC v. 0.4.0 >auto 10 a=42 20 b=1 30 proctest(a) 40 print "line 40 : a=";a " b=";b 50 end 60 def proctest(a) 70 print "line 70 : a=";a " b=";b 80 local b 90 a=2:b=2 100 print "line 100: a=";a " b=";b 110 endproc 120 0 >50end >run line 70 : a= 42 b= 1 line 100: a= 2 b= 2 line 40 : a= 42 b= 1 | 27-Jul-07 12:14 |
| 229 | Geomol | It's now almost 1400 lines of REBOL source. But still only 4922 bytes compressed. | 27-Jul-07 11:34 |
| 228 | Geomol | BBC BASIC v. 0.4.0 uploaded. Added procedures and local variables (DEF PROC, ENDPROC and LOCAL). Added TIME, RND and EVAL. Added better error handling. Next thing will be functions, but I'll test procedures some more first. The implementation is based on this user guide: http://www.nvg.ntnu.no/bbc/doc/BBCUserGuide-1.00.pdf | 27-Jul-07 11:29 |
| 227 | Geomol | Arrays are indexed from zero. Arrays can also be used to index other arrays. Example: >dim name$(4) >dim a(1,1) >name$(3)="Joe" >a(1,0)=3 >print name$(a(1,0)) Joe | 24-Jul-07 19:24 |
| 226 | Geomol | Version 0.3.0 of BBC BASIC uploaded. Added the rest of the string handling: LEFT$, MID$, RIGHT$, STRING$ and INSTR. Added ON, that can change the order of execution. Added DIM, which implement arrays. Both for integers, reals and strings. To run: >> do http://www.fys.ku.dk/~niclasen/rebol/bbcbasic.r List of keywords: http://www.fys.ku.dk/~niclasen/rebol/bbcbasic.html | 24-Jul-07 19:21 |
| 225 | ? | Somthing that translates to all languages, and ages... | 23-Jul-07 11:36 |
| 224 | ? | (http://news.yahoo.com/s/nm/20070720/od_nm/nigeria_pornography_dc;_ylt=A0WTUfF176FG8XwBExgZ.3QA) | 23-Jul-07 11:36 |
| 223 | Gabriele | i think, time would better be invested in an OS (both for geeks, and non-geeks). then you can make cheap computers for the OS to run, once it has been recognized, so parents could buy a $100 computer to childs (one each) instead of one big $1000 pc for the family. | 23-Jul-07 5:51 |
| 222 | Gabriele | Geomol, the problem with such a computer is that it would only appeal to geeks, and geeks already have a pc anyway. for developing countries, there's the OLPC eventually. | 23-Jul-07 5:50 |
| 221 | Geomol | :-) I have a feeling, that dialects is a good way to go, because so many problems become much easier to solve. | 22-Jul-07 12:42 |
| 220 | Gregg | Wow John! I haven't even had a chance to look at it since the original release and you're already on v2, well, 0.2, but still. :-) And, yes, I think it would be very cool to have a BASIC that supports REBOL's datatypes. Part of my, perhaps not so hidden, agenda for these things--in addition to being great for teaching language design and construction--is to show how REBOL can work *inside* the idioms other languages use. | 22-Jul-07 12:39 |
| 219 | Geomol | Pekr, is it strong enough? As datatypes, it support different kinds of integers, floating-point and strings. BASIC as a REBOL dialect would be able to have much more, wouldn't it? | 22-Jul-07 10:05 |
| 218 | Pekr | Geomol - there is one strong and modern Basic implementation - Free Basic? | 22-Jul-07 10:00 |
| 217 | Henrik | the problem is that people expect to do everything on a PC, whereas in the 80's, people expected to do everything on a C64. | 22-Jul-07 9:53 |
| 216 | Henrik | I think also we need a new age of exploratory computing (meaning, people exploring other than porn sites and youtube), and it requires its own hardware. | 22-Jul-07 9:51 |
| 215 | Henrik | geomol, I think you'd have to price it like a midsized calculator | 22-Jul-07 9:50 |
| 214 | Geomol | Oh, and it should have a low-energy CPU to run the scripts, something as the G3, I think IBM made to only use 1-2 Watt. Then it could be sold all over the World. | 22-Jul-07 9:47 |
| 213 | Geomol | In the early 80'ies, before the era of PCs, the Amiga, Mac and Linux, there were a whole range of home computers more or less expensive (the BBC Micro were in the high price range back then). They all came with some version of the BASIC language. It was also possible to program in assembler (the BBC had a 6502 CPU). Imagine a new homecomputer with REBOL and rebcode. And many other languages supported as REBOL dialects. It should just have a keyboard, network, some RAM and maybe a memory stick instead of a harddisk. And connection to a monitor. That shouldn't be too costly to produce. Would it sell if the price was right? | 22-Jul-07 9:41 |
| 212 | Geomol | The BBC BASIC interpreter is now more than 800 lines of REBOL source (or 20278 bytes). It's 4568 bytes compressed. | 22-Jul-07 9:30 |
| 211 | Geomol | One thing is to implement old languages, it could also be interesting to make a modern BASIC using block parsing in REBOL. That way, it would be possible to easily implement many of the datatypes found in REBOL. Also imagine to be able to have BASIC (or other language) code in the middle of a REBOL script, doing something like: ... (some REBOL code) ... BASIC [ ... (some BASIC code) ... ] ... (more REBOL code) ... | 22-Jul-07 9:21 |
| 210 | Geomol | This is meant as an implementation of BBC BASIC originally found on the BBC Micro from british Acorn. It's not an emulator of that computer. For emulation of the BBC Micro, I recommend BeebEm. | 22-Jul-07 9:16 |
| 209 | Geomol | Version 0.2.0 of BBC BASIC uploaded. Added DATA, READ and RESTORE. Added GOSUB and RETURN. Added hex notation, made some changes and fixed bugs. | 22-Jul-07 9:14 |
| 208 | Geomol | New version 0.1.1 of BBC BASIC. Added many keywords, mostly functions. To run: >> do http://www.fys.ku.dk/~niclasen/rebol/bbcbasic.r List of keywords: http://www.fys.ku.dk/~niclasen/rebol/bbcbasic.html | 19-Jul-07 22:15 |
| 207 | Louis | http://www.programatium.com/en/programming4/qbasic.htm http://www.qbasic.com/wbb/filebase_entry.php?entryid=50& | 19-Jul-07 13:08 |
| 206 | Geomol | Or maybe the problem is only with variables!? Hmm | 19-Jul-07 9:22 |
| 205 | Geomol | A modern BASIC should maybe be able to recognize both lower an UPPER case, like in my examples. The original BBC BASIC distinguish between upper and lower case. I should change my interpreter to work this way, so already written programs will work. | 19-Jul-07 9:19 |
| 204 | ? | Cute. | 19-Jul-07 3:10 |
| 203 | Geomol | New version 0.1.0 of BBC BASIC. Added FOR ... NEXT loop. Example: >> do http://www.fys.ku.dk/~niclasen/rebol/bbcbasic.r connecting to: www.fys.ku.dk Script: "BBC BASIC" (19-Jul-2007) BASIC v. 0.1.0 >auto 10 for a=10 to pi step -2.3 20 for n%=1 to 3 step 2 30 print a n% 40 next 50 next 60 0 >run 10 1 10 3 7.7 1 7.7 3 5.4 1 5.4 3 | 18-Jul-07 22:54 |
| 202 | Geomol | Use a zero (0) to leave AUTO. Pressing <Esc> will end the BASIC intepreter. | 18-Jul-07 19:42 |
| 201 | Geomol | *are implemented* | 18-Jul-07 19:40 |
| 200 | Geomol | 3 datatypes is implemented. Examples: a$ is a string a% is an integer a is a real. | 18-Jul-07 19:40 |
| 199 | Geomol | It's possible to add strings together and strings can also be tested in conditions. | 18-Jul-07 19:39 |
| 198 | Geomol | So far this is implemented: Keywords: AUTO, DELETE, LIST, NEW, OLD, GOTO, RUN, END, IF, INPUT, LET, PRINT, REM, STOP Functions: COS, SIN Expressions can beside unary +, - use: +, -, *, /, ^, (, ) Conditions can use: or, eor, and, =, <>, <=, >=, <, > | 18-Jul-07 19:38 |
| 197 | Geomol | Uploaded new version of BBC BASIC intepreter. Added expressions and conditions. Added IF and INPUT. Example: >> do http://www.fys.ku.dk/~niclasen/rebol/bbcbasic.r connecting to: www.fys.ku.dk Script: "BBC BASIC" (18-Jul-2007) BASIC v. 0.0.2 >auto 10 input "Name",name$ 20 if name$="Carl" then print "Hi " name$ else print "Hello " name$ 30 0 >run Name?John Hello John | 18-Jul-07 19:31 |
| 196 | Geomol | Gregg, first I'm making a simple 'engine' or 'template' for BASIC. Today I implemented expressions, some simple string handling and a little more. I'll make conditions (IF) and loops (FOR), then that should be a good start to build on. | 18-Jul-07 17:23 |
| 195 | Gregg | Not sure if the various sites for lex/yacc tools and such might have one/ | 18-Jul-07 17:16 |
| 194 | Gregg | I started on a VB grammar once, which is similar, and I still have most of my manuals here somewhere. :-) | 18-Jul-07 17:15 |
| 193 | Gregg | Oddly, I don't seem to have a QBASIC grammar. :-\ | 18-Jul-07 17:14 |
| 192 | Gregg | Nice John! I'm not sure how best to get rolling. I'm totally buried at the moment, but I can provide web space for the project if we need that. I also a number of grammars and things here, if we need references. | 18-Jul-07 17:14 |
| 191 | btiffin | Very nice... As for the other questions...can't say...but well done sir. And a nice reading code space to boot. | 17-Jul-07 21:47 |
| 190 | Geomol | How do we best get this rolling? I'm interested in making some language interpreters in REBOL, because I see future potential. Reichart and Gregg talked about QBASIC, which I don't know. Where are the specifications for that language? BASIC is a start, and along the line, I would like to dig into other languages as well. Is it best keeping it all public, or should we make new groups for teams interested in this? | 17-Jul-07 19:49 |
| 189 | Geomol | The start of a BBC BASIC interpreter using string parsing: http://www.fys.ku.dk/~niclasen/rebol/bbcbasic.r | 17-Jul-07 19:42 |
| 188 | Graham | http://maschenwerk.de/foerthchen/ This guy has written a forth in javascript ... guess it's doable in Rebol | 30-Jun-07 8:20 |
| 187 | Sunanda | Thanks......I've changed the designation to [web-public]: http://www.rebol.org/cgi-bin/cgiwrap/rebol/aga-display-posts.r?post=r3wp248x150 | 25-Jun-07 22:20 |
| 186 | Allen | A z-machine interpreter could be fun - plenty of infocom games to play. ... http://en.wikipedia.org/wiki/Z-machine | 25-Jun-07 22:04 |
| 185 | Volker | Web public. Yes | 25-Jun-07 14:44 |
| 184 | Geomol | I also haven't got any problem with this group going web-public. I guess, it's just to change it. | 25-Jun-07 13:01 |
| 183 | Volker | If you want basic, why not take one and use r3-dll? :) | 25-Jun-07 9:39 |
| 182 | ? | Gregg, yes, you se my point....Sunanda, agreed. | 25-Jun-07 4:45 |
| 181 | Gregg | Web public. Yes
Gress = Gregg. NP :-) QBASIC - Ahhh, now we get to have some fun. QBASIC is not your old fashioned, line-numbered BASIC. I think it would be cool to do both, but the Q(Quick)BASIC language is much better for writing programs that actually do something. I've been tempted to do something like that myself. To actually run exisiting QB code, screen access would pretty much be a must-have feature. Nothing like those old character mode interfaces you know. | 24-Jun-07 23:28 |
| 180 | Sunanda | Could this group we [web-public]? It's an interesting discussion of techiqyes that deserve a wider appreciation. | 24-Jun-07 21:49 |
| 179 | Geomol | Read before you post! Read before you post! Read before you post! (Does that help? ;-) Well, we sometimes get a laugh, when people don't do that.) | 24-Jun-07 21:28 |
| 178 | Geomol | LOL (I can't spell your name, sorry!) *To Gregg's post* | 24-Jun-07 21:26 |
| 177 | Geomol | To Gress's post: 1) Yes, it's interesting to find out, how much we get for free using e.g. blocks in REBOL to simulate lists in other languages. Maybe using hash! will benefit in some situations!? 2) Using rebcode is also a way to write lower level code. But it should also be possible to define REBOL functions, that work like (or simulate) the lower level commands in other languages. 3) Yes, it would be interesting to find out, how languages differ in their cores. | 24-Jun-07 21:26 |
| 176 | Geomol | I choosed that one, because I once owned a BBC Micro. I have no idea, how far that is from QBasic. But I guess Basic is Basic. They probably differ in stuff like graphics and sound. | 24-Jun-07 21:18 |
| 175 | Geomol | I use this guide as a base for the BASIC interpreter: http://www.nvg.ntnu.no/bbc/doc/BBCUserGuide-1.00.pdf I found it on this site: http://www.nvg.ntnu.no/bbc/docs.php3 | 24-Jun-07 21:15 |
| 174 | ? | Yes, I was not suggesting YOU do this, but rather than it be a goal of the Rebol community... | 24-Jun-07 18:57 |
| 173 | Geomol | I added a few new things to the BASIC:
added DELETE command, added arguments to LIST, added STOP statement and some more (see source). Example of use: >> do http://www.fys.ku.dk/~niclasen/rebol/basic.r connecting to: www.fys.ku.dk Script: "BASIC" (24-Jun-2007) BASIC >auto 5 5 5 print "Line 5" 10 rem goto 20 15 blab 20 print "Line 20" 25 stop 30 0 >run Line 5 Mistake at line 15 >10 goto 20 >run Line 5 Line 20 STOP at line 25 > | 24-Jun-07 17:34 |
| 172 | Geomol | This Basic dialect parse in block mode, and this set some restrictions on the syntax, but it's probably faster and easier to program the parse rules. To make a QBasic would require, I used string parsing. Probably the same for most other languages. Unfortunately I don't have much time for this project atm., because I have 3 examins in the coming week, and after that I'm on vacation for 2 weeks. But I would like ot do more of this. Maybe we could make a real project with some goals!? | 24-Jun-07 17:31 |
| 171 | ? | What may happen, is people (kids for example) would begin hacking old Basic applications rewritten in Rebol, to show off. 100 lines of Basic becoming 7 lines of Rebol for example. There is a group of people hacking Nintendo emulators with a program that emulates the joystick, and attempt to play games in the shortest time possible. It is very interesting, but why these types of things take off is that people can have fun, and without too much knowledge, show off their talents. | 24-Jun-07 17:11 |
| 170 | ? | I think that making a Basic interpreter in Rebol is more useful, powerful, and educational than almost any other endeavour I have heard regarding Rebol (ever!). - People like the idea of Basic. - Almost all programmers know some Basic - Although "basic" it tells programmers this is simple to do. - It is a great way to learn a dialect. - It has "news worthiness" would be good to write a compete dialect, and post on SlashDot. - If you can run QBasic - it would me instantly thousands if not millions of applications that could run instantly on any platform. Probably all would be faster even with graphics. | 24-Jun-07 17:06 |
| 169 | Gregg | Very cool John. Now, let me throw another thought into the mix, just for fun. If you were to write a language interpreter long ago, you would do it in a low level language like ASM or, later, C. In those languages you didn't have high level constructs like we have in REBOL. Certain languages have very specific models; consider Lisp and Forth, each has a few core definitions and the rest of the language it built on those. Lisp has lists, Forth has blocks, etc. With REBOL, we can do things in many ways. 1) Leverage all REBOL has to offer. For example, how hard would it be to write a simple Lisp system if you (basically) use blocks for lists and supply a few standard Lisp functions? Is eval'ing a Lisp paren/list different than DOing a REBOL block? 2) Write lower level code, simulating how you would have to write a language using something like C or ASM. You could go as far as writing a simple virtual machine with its own set of ops. 3) Write dialects that are designed for building specific kinds of languages, showing the core concepts of languages, where they're similar, and where they differ; tools for teaching language design. I think all of those approaches have something to offer. | 24-Jun-07 16:58 |
| 168 | Geomol | Example of use:
BASIC >auto 10 print "Hello World!" 20 0 >run Hello World! >list 10 print "Hello World!" > | 23-Jun-07 18:14 |
| 167 | Geomol | Gregg wrote (in group Rebol vs Scheme):
"I would *love* to see mini-primers on language design for Lisp, Forth, Logo, etc. in REBOL." I've taken the first step for a BASIC dialect: do http://www.fys.ku.dk/~niclasen/rebol/basic.r It only knows a few commands so far: auto list new old And these statements: end goto print rem run And these functions: cos sin | 23-Jun-07 18:12 |
| 166 | Gregg | It will definitely be faster (about 8x here), but either one is so fast, that the difference is insignificant, unless you're doing it 10,000 times, then you'll save .2 seconds or so. | 12-Jun-07 16:45 |
| 165 | Chris | Albeit, I'm not a master at measuring such things... | 12-Jun-07 4:58 |
| 164 | Chris | I assumed the literal was faster to start... | 12-Jun-07 4:45 |
| 163 | Gregg | I mean you have:
comment {[
chars-n: charset [#"0" - #"9"] ; numeric
.... But then the code actually uses: chars-n: #[bitset! 64#{AAAAAAAA/wMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=}] Why have the second one, the #[bitset!] syntax, at all? | 12-Jun-07 4:33 |
| 162 | Chris | You mean 'digit vs 'chars-n? I've been using the latter for some time, mainly for consistency. I'm going to migrate to more common names where there is a precedent. | 12-Jun-07 3:26 |
| 161 | Gregg | Nice Chris. If you can nest named and unnamed value blocks, what you say seems logical, that the parent block is given as the error location. Why do you use literal bitset values, and have the human-friendly format of charsets just as a comment in the code? | 11-Jun-07 15:30 |
| 160 | Chris | But this target is achievable, there are some clear patterns. And means that 'Filtered Import' can process more complex Rebol data (though not objects), basically Json class data. | 10-Jun-07 16:10 |
| 159 | Chris | I'm not quite sure how to pan this out. Also, the 'name rule doesn't have any set words, it is operating on an unnamed series. I think I want this type of rule to match the content. In that if [string! string!] does not exactly describe the content, 'name throws a bad-format error. | 10-Jun-07 16:07 |
| 158 | Chris | import [
name ["Chris" "RG"]
address [
street "19th Terrace"
town "Birmingham"
zip 35205
]
][
name: block! [string! length is more-than 2 string!]
address: block! [
street: string!
apt: opt string!
town: string!
zip: issue! [5 digit opt "-" 4 digit] else "Must have a valid US zip code"
]
] == [ name ["Chris" "RG"] address [ street "19th Terrace" apt none town "Birmingham" zip #35205 ] ] | 10-Jun-07 16:04 |
| 157 | Chris | The next requirement for 'Filtered Import' <http://www.rebol.org/cgi-bin/cgiwrap/rebol/documentation.r?script=filtered-import.r> is support of depth: | 10-Jun-07 16:03 |
| 156 | xavier | . | 13-Jan-07 11:43 |
| 155 | Geomol | *terms of works and symbols* = terms of words and symbols | 31-Oct-06 22:10 |
| 154 | Geomol | As mentioned, you can parse in two different ways in REBOL: string parsing and block parsing. Recently (after using REBOL for years!!! Yes, you always keep discovering new things in REBOL.), I start to think about the two different ways of parsing, before I make a dialect. It's rather crucial, which way you choose, creating a dialect. String parsing is good for dialects, where you allow the user to type almost anything ... where you give lots of freedom. Block parsing is good, when you want the rules to be more narrow ... when you want the user to think in terms of works and symbols. Latest I made the math dialect for NicomDoc. I choose string parsing giving lots of freedom. The dialect ended up specifying presentation more than semantic. The dielect is good to produce the formulas, just like you want them visualized. If (when?) I would make a math dialect, where I would put weight on the semantic (the meaning of the mathematical symbols), I would choose block parsing. | 31-Oct-06 22:08 |
| 153 | Gabriele | yes | 31-Oct-06 8:21 |
| 152 | Jerry | Thank Gregg. It's very helpful. DSL stands for Domain-Specific Language, right? http://en.wikipedia.org/wiki/Domain-specific_language | 31-Oct-06 7:53 |
| 151 | Gregg | What makes a good dialect? That's a hard question to answer. What makes a good GPL (General Purpose Language)? There is no formula I know of, but I would say it should be: * Focused. *Domain* specific is the key. If you don't know the domain, it will be hard to get it right. * Well thought out and refined. Don't just take the first pass and call it good. Like a writer, think about the words you choose and how they're put together. * Small. Think about how the language will grow, but don't try to put too much in it. | 31-Oct-06 7:29 |
| 150 | Gregg | A "true" dialect in REBOL follows REBOL lexical form--i.e. you use block parsing--which is what would be called an embedded DSL in other languages. The concept is often associated with Lisp and its descendants. REBOL takes it furhter, and makes it easier (IMHO). | 31-Oct-06 7:23 |
| 149 | Graham | DSLs have been around for a long time. | 31-Oct-06 7:18 |
| 148 | Jerry | What makes a good dialect? Does anyone have any rules to share with us? | 31-Oct-06 7:06 |
| 147 | Jerry | Is the dialect conecpt original in REBOL? Or is it from another language? Does any other language have this concept too? | 31-Oct-06 7:03 |
| 146 | Ladislav | just an alternative form: >> form #[issue! "aaaaa aaa"] == "aaaaa aaa" | 22-Sep-06 15:46 |
| 145 | Maxim | to = too | 22-Sep-06 12:45 |
| 144 | Maxim | well, that holds for words to btw ;-) | 22-Sep-06 12:45 |
| 143 | Gregg | Issues can actually contain spaces, but they don't parse or mold that way. i.e. the datatype can hold them, but the lexical form doesn't allow it. Meaning you can get bitten, but do tricky things. :-) >> a: #This issue has spaces in it ** Script Error: issue has no value ** Near: issue has spaces in it >> a: to issue! "This issue has spaces in it" == #This >> probe a #This == #This >> b: to string! a == "This issue has spaces in it" | 22-Sep-06 12:09 |
| 142 | btiffin | Yep, that's what turned me all evangelical. | 22-Sep-06 1:05 |
| 141 | Maxim | I feel its the most productive language out there. not in how powerfull it CAN get but in how productive it IS from the onset of the very first time you use it. | 22-Sep-06 0:44 |
| 140 | Maxim | hehe even if the cup has a few crack ;-) | 22-Sep-06 0:43 |
| 139 | btiffin | I can't say I've been 'using' Rebol for long, but I've been playing for quite a while now. I discover something new every time I open up the system. It's too cool how RT has put something as wide and deep as the ocean into a cup, a cup with blinking lights no less. | 22-Sep-06 0:42 |
| 138 | Maxim | you just have to be carefull not to mix up other # using REBOL notation like char! (#"^/" ) or the serialized data format (#[none] ) | 22-Sep-06 0:42 |
| 137 | Maxim | funny... I had been using rebol for 9 years and didn't know about that datatype... yet its extremely usefull | 22-Sep-06 0:40 |
| 136 | Maxim | using string as a temporary data holder is ok too, as long as you can be sure the dataset will not get mixed up in a temporary value or actual string data. either by its structure or content. | 22-Sep-06 0:39 |
| 135 | btiffin | Ahh, just add a #. Nice. | 22-Sep-06 0:38 |
| 134 | Maxim | (almost anything) | 22-Sep-06 0:38 |
| 133 | Maxim | its like a power word, which accepts anything but a space. | 22-Sep-06 0:38 |
| 132 | Maxim | and use it for many in-between values. | 22-Sep-06 0:37 |
| 131 | Maxim | I have recently discovered the Issue! datatype. | 22-Sep-06 0:37 |
| 130 | Maxim | that's how I handle XML for example, a modified version of xml2rebxml.r . I convert the tags into native rebol blocks, then handle the blocks within the application which expects the data... this way, you can more easily re-use code. | 22-Sep-06 0:36 |
| 129 | btiffin | What would be the implications of LOAD converting unmatchable types to string! behind the scene? Or perhaps a new unstring! type to keep other dialecting more concise? | 22-Sep-06 0:36 |
| 128 | btiffin | So the pros don't seem to mind a string parse followed by a block parse? | 22-Sep-06 0:33 |
| 127 | Maxim | the hybrid model is much easier to "Get things done" | 21-Sep-06 23:45 |
| 126 | Maxim | exactly. | 21-Sep-06 23:45 |
| 125 | Gregg | Agreed. What I often do is "parse" the data, using standard string manipulation, not really thinking as a dialect, and then writing a dialect against the loaded data. | 21-Sep-06 23:45 |
| 124 | Maxim | funny, in experience, I find it easier in many cases to do a hybrid model. one where you load the string into some block you can then more easily parse. There are many kinds of real-world data which is not easily loadable in REBOL and in cases where you must make a dialect over some outside data... blocks are rarely useable. | 21-Sep-06 23:44 |
| 123 | Gregg | My preference is to use block parsing whenever possible, and trap errors so you can warn if something isn't valid. Block parsing is just so much more powerful than string parsing, it's hard to give it up. Of course, there are improvements I would like to see, so more "normal" text can load successfully; things like 50%, or 33MPH. Maybe R3 and custom datatypes will offer something in the area of expanded lexical forms. In any case, we should identify the most important things that don't load today and see if RT can do something about them. :-) | 21-Sep-06 23:11 |
| 122 | Anton | Brian, I think you would have to write your own load-parser, that can, first of all, match brackets [] {} "", including escaping strings, "^"", load well-formed rebol values etc.. as well as be able to handle non-matching brackets and ill-formed rebol values. This is a tough job. The essence of the problem is that if the file is not fully loadable, then you can't be sure that *any* part of it that you might be looking at is a properly formed value. For example, if there is one extra unmatched } at the end of the file, does that imply that the whole lot was supposed to be a string ? Would that mean that all the prior text shouldn't be treated as individual values then ? | 20-Sep-06 15:29 |
| 121 | btiffin | Sorry Volker, missed the lineno arg to the p command. Nice. | 20-Sep-06 0:36 |
| 120 | btiffin | Hey, thanks for the interest Volker. And Gregg thanks for the comments. But I'm still kinda stuck on an editor dialect that could handle random text in a parse block. Even the nifty fed above will break on "p $10,000,000" as rebol can't quite form a money value out of $10,000,000. So the basic question exists. Is there a way to block parse random potentially unloadable text? | 20-Sep-06 0:22 |
| 119 | Gregg | Clever as ususal Volker! I think that's the right idea as well; just use the console with the expected commands built in, including block I/O. LOADability is important for REBOL dialects, but that doesn't mean you can't write an interpreter that parses strings if that's what you want and need. Personally, I greatly prefer true dialects for the power they provide. Ultimately, Brian, a dialect should be what you want it to be, and the more interactive things are, the better (IMO). I'd love to see more interactive dialects like this. | 18-Sep-06 21:30 |
| 118 | Volker | rebol [ Title: "Immersive" Usage: { >> fed fed> p 3 This is a demo line, its not loadable :) p with 3 " This is a demo line, its not loadable :)" fed> print "This is pure rebol" This is pure rebol fed> "this too" == "this too" fed> } ] ctx-fed: context [ arg-lens: [p 2] line: cmd: none last-err: none p: func [lineno line] [print ["p with" lineno mold line] exit] t: func [lineno] [print ["t with" lineno] exit] e: func ["format err"] [throw last-err] do-line: func [line /local arg-len-pos res] [ set [val rest] load/next line either arg-len-pos: find/skip arg-lens val 2 [ cmd: reduce [val] loop arg-len-pos/2 - 1 [ set [val rest] load/next rest append cmd val ] append cmd rest ] [ cmd: load/all line ] bind cmd self case [ error? set/any 'res try [do cmd] [ probe disarm last-err: res ] value? 'res [print ["==" mold :res]] ] ] rebol/words/fed: func [] [ forever [ do-line ask "fed> " ] ] ] fed | 16-Sep-06 8:47 |
| 117 | btiffin | Sorry Technically Inaccurate Typo. newword: DUP . ; would not compile in forth. : newword DUP . ; is correct. Long Live Rebol. | 15-Sep-06 18:36 |
| 116 | btiffin | Sorry for the confusion here. A forth "block" editor, uses a 1K chunk of disk as 16 lines of 64 characters. There are forth words for the editor e.g. 9 LIST ( list block 9) 3 T ( Highlight line 3) P newword: ( n - n) DUP . ; ( place the text "newword: ..." to end of command line onto line 3. What you get is an editor that uses the same language that you are programming in. Immersive. | 15-Sep-06 17:10 |
| 115 | Volker | I am not sure where your focus is. Editor-dialect: put the edited code in strings, like [ #1 {io-code} #2 {gui}] Patch the inbuild editor to load and store there, instead iof storing to files. And from the console a simple "ed #2" would edit it. but still in a seperate window. Console: Or is it about that seperate window, do you want inside that rebol-console-window? More work, but rem-edit does that, maybe its author would help with fixing. | 15-Sep-06 9:26 |
| 114 | btiffin | Rebolek; Cool, thanks. | 15-Sep-06 6:03 |
| 113 | Rebolek | btfiffin: I'm not sure how it works with latest REBOL, I had some problems. If it does not work, contact me privately, I have patched version | 15-Sep-06 5:58 |
| 112 | btiffin | Thanks Rebolek, I'll take a second look at this app. I've let the discussion move a little too far from Dialecting, so thanks everybody. Just needed to talk a little bit about it. | 15-Sep-06 5:55 |
| 111 | Rebolek | http://www.rebol.org/cgi-bin/cgiwrap/rebol/view-script.r?script=rem-ext42.r&sid=mkjym6ig | 15-Sep-06 5:51 |
| 110 | Rebolek | there is REBOL console editor in library. | 15-Sep-06 5:51 |
| 109 | btiffin | Graham; Yep. Things are close. I'll get over it someday. But can you imagine the nirvana of a Rebol console/editor? | 15-Sep-06 5:49 |
| 108 | Graham | you can execute inside the editor | 15-Sep-06 5:44 |
| 107 | btiffin | Thanks Henrik I'll take a look. | 15-Sep-06 5:40 |
| 106 | btiffin | Yep. A small annoyance...Rebol is more than worth it. I probably just give in to the current state of editor/language being two different planes of existence. | 15-Sep-06 5:39 |
| 105 | Henrik | this is not entirely related, I think (I'm only a bit above beginner's level, so I may not be understanding your problem right) but I wrote a tool some time ago called Tester. It allows you to write code and test it directly without leaving the environment. This is not an editor per se, but a rigid workflow tool to write and test code. You can read about it in the !Tester group. | 15-Sep-06 5:39 |
| 104 | Anton | So the mental switch is between the editor and the rebol console, being separate applications. | 15-Sep-06 5:37 |
| 103 | btiffin | I have Crimson and Rebol/View as Quick Launch buttons on the windows taskbar. But still...that mental switch. | 15-Sep-06 5:35 |
| 102 | Anton | I'm actually not using Ctrl-E in Crimson Editor. It's just not as simple as launching it yourself, and every editor does it differently. | 15-Sep-06 5:34 |
| 101 | Anton | How do you launch rebol otherwise ? I've set up my start menu so it's a few key presses away. The sequence is: Ctrl-Esc (to open the menu), down right down enter. (Actually now I think about it, I can reduce this a little bit.) | 15-Sep-06 5:32 |
| 100 | btiffin | The Ctrl-E execute trick in Crimson is close but it is still a mental context switch. Editor -> Rebol -> editor -> etc... My old mantra was "Compile Link Go...Away, Go Go Go is much better" | 15-Sep-06 5:28 |
| 99 | Anton | Well, I've never gone Forth, and I'm not sure what a block editor is, but maybe you can benefit from some console commands. I almost always use Crimson Editor. I have an EDIT command which launches Crimson Editor, and I navigate the filesystem in the rebol console using dir-utils.r, which supplies unix-like filesystem commands; CD, LS, MV etc. http://anton.wildit.net.au/rebol/os/windows/edit.r http://anton.wildit.net.au/rebol/library/dir-utils.r | 15-Sep-06 5:25 |
| 98 | btiffin | yeah exactly. The unRebol way is to just string parse and then take the first token as a command...seems unworthy. But I am willing to put up with a mirage for that immersive looky feely. | 15-Sep-06 5:25 |
| 97 | Graham | some tricky things as it tries to identify datatypes | 15-Sep-06 5:18 |
| 96 | Graham | block parsing ... | 15-Sep-06 5:18 |
| 95 | btiffin | Not really, just emulate the immersiveness. I dealt with 16 lines of 64 characters for so many years that my little utility (in menta-space) uses a 32 by 80 character screen but all the output is normal text (with those confounded carriage returns). We used shadows blocks extensively and I got so used to the technical docs being single letter command away...Just pineing. Aside from that, is there a way to feed the string $1,000,000 into block parsing? | 15-Sep-06 5:16 |
| 94 | Graham | forth editors used to access the hard drive sectors directly. You want to do that? | 15-Sep-06 5:07 |
| 93 | btiffin | Requesting Opinions. Being a crusty old forther, I really really miss the immersive nature of the block editor environment. Coding in forth meant never leaving forth. Editor, debugger, disk drivers etc... all forth commands. No need to ever have the brain exit forth mode. Now that Rebol is my language of the future, I kinda pine for the past. The wonder and beauty of Rebol keeps being interrupted by decisions on what to use to edit that last little bit of script. Notepad, Crimson Editor, Rebol editor? A small annoyance but it still disrupts the brain from getting to streaming mode. So now to the question. My first crack at a forth block editor dialect failed miserably. Dialects need to be LOADable for parse to function. Editing source code makes for unloadable situations. Do I just give up on it and learn to live in the third millenium? Write a utility that doesn't use dialects (which seems to unRebol the solution)? I thought I'd ask you guys, just in case there is a light shining in front of me that I can't see. Thanks in advance. | 15-Sep-06 4:30 |
| 92 | Thør | . | 26-May-06 16:56 |
| 91 | Thør | initial sync... | 3-Apr-06 1:56 |
| 90 | Gregg | Visual Studio is getting DSL support, along the lines of what JetBrains has done I think. There's a team blogging about it inside MS, so I think Bill and Co. *do* think we need them (they're just doing it wrong ;-). | 24-Mar-06 18:47 |
| 89 | Allen | Well nothing stopping us from doing the same thing. Just do a like for like conversion as they did, but do it into rebol format instead of xml or xhtml | 23-Mar-06 3:03 |
| 88 | Maxim | just keep "R" for us... we should patent the letter "R" ;-) | 23-Mar-06 2:09 |
| 87 | Allen | vCard --> iCard --> hCard ... plenty of alphabet to go for future formats ;-) | 22-Mar-06 22:22 |
| 86 | Maxim | IMO nothing to do with dialect... AFAICT they are simply structured xml definitions... | 22-Mar-06 16:41 |
| 85 | DideC | Hum, not sure it's dialect equivalent. It looks like some "XML samples" to replace existing text format (ie iCal => hCalendar) | 22-Mar-06 9:47 |
| 84 | Sunanda | Bill Gates says "We need dialects" http://microformats.org (Actually he said "microformats" -- but I can't see any real difference in intent) | 21-Mar-06 21:33 |
| 83 | JaimeVargas | I wish build was part of rebol. I find it a lot easier to use than compose. Only that slower. | 2-Nov-05 17:39 |
| 82 | Volker | Good idea IMHO. Sadly i managed to crash it in my first try. | 2-Nov-05 17:37 |
| 81 | JaimeVargas | Ah. Interesting. I think I needed this in the past I didn't know it existed. | 2-Nov-05 17:37 |
| 80 | Volker | Maybe we need both reduce? AFAIK currently it is to have a reduce which allows keywords. | 2-Nov-05 17:37 |
| 79 | Ladislav | >> reduce/only [a b c d] [b c d] == [1 b c d] | 2-Nov-05 17:35 |
| 78 | Volker | example: !> reduce/only[green blue][green] == [green 0.0.255] | 2-Nov-05 17:35 |
| 77 | Ladislav | Reduce/only example: | 2-Nov-05 17:35 |
| 76 | Ladislav | tests: substitute [ generate-test [ set variable value eq variable 1 ] [value] [1 2] return "OK" label fail do discard [print ["test:" mold testing "failed"] halt] ] [generate-test] | 2-Nov-05 17:34 |
| 75 | JaimeVargas | Do you have an example where reduce/only works. I only get errors. | 2-Nov-05 17:34 |
| 74 | Ladislav | or my SUBSTITUTE dialect: | 2-Nov-05 17:33 |
| 73 | Ladislav | build/with [let's see what] build/with [what: [the rise of the (y)]] [ y: 'sun ] ; == [let's see the rise of the (sun)] | 2-Nov-05 17:33 |
| 72 | Ladislav | Examples are my BUILD dialect: | 2-Nov-05 17:32 |
| 71 | Ladislav | I, OTOH, found an "opposite" approach specifying which words *are* evaluated very fruitful. | 2-Nov-05 17:32 |
| 70 | Ladislav | An "Internal dialecting" discussion. Currently REDUCE has got a REDUCE/ONLY option to specify, which words are *not* evaluated | 2-Nov-05 17:30 |
| 69 | Andrew | And it's all in one function. | 26-Jan-05 0:22 |
| 68 | Andrew | In ML /tag -> <tag/> tag [] -> <tag> (stuff in block) </tag> tag/attribute value [] -> <tag attribute="value"> (stuff in block) </tag> <tag attribute="value"> [] -> <tag attribute="value"> (stuff in block) </tag> | 26-Jan-05 0:21 |
| 67 | Andrew | In ML | 26-Jan-05 0:17 |
| 66 | Andrew | Geomol, you might want to look at my ML dialect which has something very similar to what you're doing. ML is my Rebol dialect for writing XML. | 26-Jan-05 0:15 |
| 65 | Geomol | :) | 25-Jan-05 13:13 |
| 64 | Terry | Notice that °Sunnylane° and °Person° are themselves °7°s? This means that more information is available regarding them.. ie: °Sunnylane: last time paved?° or °Sunnylane: set last time paved -=24-Oct-2001=-° Because °Mr. Smith° is a °Person°, we could make a query like.. °Mr. Smith: requires food to survive?° and have the system respond "Yes." | 25-Jan-05 13:08 |
| 63 | Terry | I like this.. °Mr. Smith° (main °7°) has the following.. °Class?° °Person° °Alive Dead Status° "Alive" °Address 1° "44" °Address 2° °Sunnylane° | 25-Jan-05 13:05 |
| 62 | Geomol | Correction! This XML example: <person alive="yes"><name>Mr. Smith</name><male/><address><street>Sunnylane</street><number>44</number></address></person> | 25-Jan-05 13:02 |
| 61 | Geomol | I've defined a new format, which is a REBOL version of XML. I already have scripts, that can convert between this format and XML. So far, I've called the functions "xml2rebol" and "rebol2xml", but maybe "rebol" isn't a good name for the new format. I've thought about "rebxml" as a name. Any ideas or suggestions? This is a quick explanation of the foremat: tag (optional attributes) string or block If the string is empty, it's an empty element tag. In XML: <tag/> If attributes are present, they are one or more pairs of a word and a string. A block can hold strings and new tags. This XML example: <person alive="yes"><name>Mr. Smith</name><male/><address><street>Sunnylane</street><number>44</number></address><person> will look like this in the new format: [ person alive "yes" [ name "Mr. Smith" male "" address [ street "Sunnylane" number "44" ] ] Other examples: <tag></tag> = tag [ "" ] <tag>content</tag> = tag "content" or tag [ "content" ] Both are valid. | 25-Jan-05 12:56 |
| 60 | Robert | Yes, right that's what I'm going to do. Thanks for the CSS tipp, I take a look at. | 15-Jan-05 15:05 |
| 59 | Sunanda | I suspect a mixed positonal + keyword approach may be the best. Positional for for common attrbutes. Keyword for the more esoteric ones. Maybe read up on CSS shorthand methods for inspiration. | 14-Jan-05 19:27 |
| 58 | Robert | No, I'm doing a dialect to create HTML forms with CGI etc. | 14-Jan-05 9:17 |
| 57 | Graham | Are you trying to parse html to see if it is valid or not? | 14-Jan-05 9:03 |
| 56 | Robert | As said, my goal is to reduce the number of keywords as much as possible and make it easy to use. | 14-Jan-05 8:56 |
| 55 | Graham | I had this problem a couple of weeks ago when trying to write a function to repopulate a web page from the posted cgi object. | 14-Jan-05 8:48 |
| 54 | Robert | About mixing: I'm thinking of something like this: (keyword: none) any [ opt ['maxlength (keyword: 'maxlength) | 'default (keyword: 'default)]] any [set p integer! (repend integers [keyword p]) ... I think you get the idea. | 14-Jan-05 8:36 |
| 53 | Robert | Dide, yes I have found the side effect of empty/1 == none! as well. | 14-Jan-05 8:31 |
| 52 | DideC | rule: [
'keyword (clear strings clear integers)
any [set p integer! (append integers p) | set p string! (append strings p)]
(size: integers/1 maxlength: integers/2 caption: strings/1 default: strings/2)
any ['maxlength set p integer! (maxlength: p) | 'default set p string! (default: p)]
] tests: [ [] [keyword] [keyword 10 20 "Blue" "Orange"] [keyword 10 "Blue"] [keyword 10 20] [keyword "Blue" "Orange"] [keyword 10 "Blue" 20 "Orange"] [keyword "Blue" 10 20 "Orange"] [keyword "Blue" "Orange" 10 20] [keyword "Blue" maxlength 20] [keyword 10 default "Orange"] [keyword maxlength 20] [keyword default "Orange"] [keyword maxlength 20 default "Orange"] [keyword default "Orange" maxlength 20] ] strings: copy [] integers: copy [] size: maxlength: caption: default: -1 foreach t tests [ parse t rule print [mold t "==>" size maxlength caption default] ] | 13-Jan-05 21:37 |
| 51 | DideC | So, mix the both : the 'maxlength and 'default keywords : | 13-Jan-05 21:22 |
| 50 | DideC | Ups, it's even not needed : if Integers is empty, then "size: empty/1 --> none!" | 13-Jan-05 21:21 |
| 49 | DideC | then, none! is default unless you specify Size and, maybe, Maxlength. | 13-Jan-05 21:15 |
| 48 | DideC | strings: copy [] integers: copy [] rule: ['keyword (clear strings clear integers size: maxlength: caption: default: none ) some [set p integer! (append integers p) | set p string! (append strings p)] (size: integers/1 maxlength integers/2 caption: strings/1 default: strings/2)] | 13-Jan-05 21:14 |
| 47 | DideC | Robert: Why not settings the words to none! just when you clear the block : | 13-Jan-05 21:14 |
| 46 | Ladislav | e.g. I am not implementing all my dialects using PARSE | 13-Jan-05 19:25 |
| 45 | Ladislav | Robert: you don't need to have any knowledge of PARSE to design a dialect. The only thing you need is to know how the dialect should look and work. | 13-Jan-05 19:24 |
| 44 | Robert | My goal is to create the dialect in a way that it's easy to use for non-techies. Yes, it's hard but hey, otherwise it would be no challange. | 13-Jan-05 17:12 |
| 43 | Geomol | :-D | 13-Jan-05 12:53 |
| 42 | Maarten | Nah, it took Carl merely twenty years to come up with REBOL | 13-Jan-05 12:23 |
| 41 | Gregg | And remember, LANGUAGE DESIGN IS HARD. | 13-Jan-05 9:07 |
| 40 | Gregg | Look at your dialect from the top down too, as a user will. Write example code in it and think about how you expect it to behave. | 13-Jan-05 9:06 |
| 39 | Gregg | Something to consider, when you have cases like Chris's href examples above, is the separation of syntax and semantics. Also, for Robert's examples, remember that most languages have very strict rules and a lot of "markers" to make parsing easier (at the expense of making things harder to write). VID is a great example of a language that works hard to be flexible. | 13-Jan-05 9:04 |
| 38 | Andrew | For other applications, I use different dialects, like eText for simple text -> HTML layout. | 13-Jan-05 1:59 |
| 37 | Andrew | That's because it's designed for experts to use. And the experts aren't going to be making simple errors. | 13-Jan-05 1:56 |
| 36 | Andrew | For my ML dialect (for easily creating HTML and XML), I didn't bother with error processing. | 13-Jan-05 1:55 |
| 35 | Robert | I could use STRING! and INTEGER! as empty values. | 12-Jan-05 15:33 |
| 34 | Robert | Dide, how to handle the "can't pass 'maxlength without 'size" problem best? I mean how to specify no-maxlength? Providing a 0 or a -1? I would like to use 'none for all those values, but 'none can't be destinquished if it's a none-integer or none-string. | 12-Jan-05 15:31 |
| 33 | Volker | you parse a block, get 'none and want to handle it as none! ? Use it as word and [ if word = 'none [..] ] . Or use [ get word ] | 12-Jan-05 14:39 |
| 32 | Geomol | Sometimes do'ing the result work: >> a: 'none == none >> type? a == word! >> a: do a == none >> type? a == none! | 12-Jan-05 13:58 |
| 31 | Robert | Dide, ok thanks. How can I specify the "empty" parameters? I would like to use NONE so that the variables can be tested with NONE? | 12-Jan-05 13:21 |
| 30 | DideC | It's the principle used by VID but by a function, not with 'parse (see grow-facets func in SVV) But it can't solve the datatype order : you can't passed Maxlength without Size ! But you can add another keyword to handle this case, like : ['maxlength set p integer! (maxlength: p)] It's what VID does : tuple! can be color or font color (depends the style you use). To be sure it's font color, you have the 'font-color keyword. | 12-Jan-05 13:04 |
| 29 | DideC | Robert: to remove parameters order, you can act like this : strings: copy [] integers: copy [] rule: ['keyword (clear strings clear integers) some [set p integer! (append integers p) | set p string! (append strings p)] (size: integers/1 maxlength integers/2 caption: strings/1 default: strings/2)] | 12-Jan-05 12:57 |
| 28 | Volker | Look at %vt-index.r in the desktop-source. its only drawback is, the last value counts, instead of insisting on a 'once. | 12-Jan-05 12:57 |
| 27 | Pekr | Well, otoh Carl is open to changes to Core imo, as he wants to concentrate upon Language ... so - why not suggest him any enhancement? | 12-Jan-05 11:32 |
| 26 | Pekr | I am not sure I am able to easily write nested rules, nor beginners, while something like to/thru [a | b |c ] would be really easy to use, wouldn't it? | 12-Jan-05 11:32 |
| 25 | Robert | This can be done with some [...] and nested rules. But as said, if you want to handle it only ONCE you need to keep track of it yourself. | 12-Jan-05 11:31 |
| 24 | Pekr | it would really make my life easier sometimes to be able to find first occurance of A or B or C ...I know it can be done by using proper grammar rules, but - not by me ... so we are letting parse to work in some cases only for gurus, which are good at hacking such solution. But I thought rebol should made simple things simple .... and I find mixture of "to first occurance of any value" as usefull .... | 12-Jan-05 11:29 |
| 23 | Pekr | long requested feature imo some of us regard as not needed ... | 12-Jan-05 11:26 |
| 22 | Robert | Chris, multiplying out the permutations isn't a solution. To much combinations. The idea of Geomol is right. You need to keep track. The thing is that parse doesn't has a backtracking (or parallel checking of rules). If we would have this feature you could write something like: once [any [... | ... | ...]] | 12-Jan-05 11:18 |
| 21 | Robert | The next question is: How do I provide only the second integer!? I would like to use NONE for skipped paramters. How can I handle this. I tried to add word! and than provide none but this will be parsed into a word! but NONE? returns FALSE... | 12-Jan-05 11:14 |
| 20 | Robert | But I have an other problem with the non-keyword approach: 'keyword set name string! opt [set caption [string!]] opt [set size integer!] opt [set maxlength integer!] opt [set default string!] In the above example the only order I can specify is: string! integer! integer! string! Right? I can leave out some parts but I can't shuffel them. This isn't possible: string! string! integer! integer! Because PARSE walks through the rule once from left to right. So by passing the second string! the integer! rules have been already "eaten". | 12-Jan-05 11:12 |
| 19 | Robert | I like Vincent's approach to collect the things and than assign them in the order. | 12-Jan-05 11:07 |
| 18 | Robert | Using keywords for parameters of course works but bloats the dialect, it's than mostly like HTML, XML only the opening/closing tags can be obmitted. | 12-Jan-05 11:06 |
| 17 | Chris | Ah, I see. Still, it doesn't seem most elegant. Another option would be to generate the permutations dynamically, but again, not so elegant... | 12-Jan-05 4:24 |
| 16 | Geomol | One way to solve the problem with required parameters is to use on/off flags. The rule for an anchor <a> will then be something like: anchor: [#"a" (href: off) space some ["href=" (either href [print "HREF already found!"] [href: on]) set arg chars | "title=" .....]] (if href = off [print "HREF required in anchor!"]) You can find this technique in the html32 dialect (I mentioned) for the src and alt parameters of the image tag <img>. | 11-Jan-05 21:11 |
| 15 | Chris | Invalid examples: [a] [a href "foo" title "Foobar" href "foo"] [a title "Foobar"] | 11-Jan-05 18:28 |
| 14 | Chris | In terms of a Rebol dialect, valid forms of <a> are: [a href "foo"] [a href "foo" title "Foobar"] [a title "Foobar" href "foo"] | 11-Jan-05 18:27 |
| 13 | Chris | I know this isn't a Rebol dialect, but the same issue is encountered... | 11-Jan-05 18:23 |
| 12 | Chris | Geomol: this is going the other way -- I'd like to establish that -- <a href="foo"> is valid and <a href="foo" href="foo"> is not. Scaling up, how else to know that both <img src="foo" alt="Foobar" width="10" height="20" class="icon" /> and <img class="icon" src="foo" width="10" height="20" alt="Foobar" /> are valid and effectively the same tag without providing every permutation? | 11-Jan-05 18:23 |
| 11 | Geomol | @Chris, I made a HTML3.2 dialect in REBOL at one point. It uses keywords for the optional parameters, and the order or parameters is irrelevant. You can find it, if you start REBOL/View desktop and goto http://home9.inet.tele.dk/johnn/index.r Not much documentation there, I'm afraid, but you can see a small example in the text file at the site. The good thing with the html32 dialect is, that it'll always produce 100% correct html code. If the input has error, you'll see a message. | 11-Jan-05 18:15 |
| 10 | Vincent | Without keywords: (integers: copy [] strings: copy []) 'keyword set name string! any [ set string string! (append strings string) | set integer integer! (append integers integer) ] (set [size maxlength] integers set [caption default] strings) but less readable. | 11-Jan-05 17:54 |
| 9 | Sunanda | Not sure there is a good solution other than to require optional parameters to have keywords to identify them.
Then you need to take only one pass at the input, and use defaults (or ignore) parameters that are not present. At the end of the pass, you can then see if the collection you have makes sense (maybe some optional parameters are needed if others are also present). Basically, its raw data validation....Boring, but necessary. | 11-Jan-05 17:39 |
| 8 | Chris | Not the same problem, though still a challenge for dialects... | 11-Jan-05 17:14 |
| 7 | Chris | Robert: This is a problem I'd love to see an answer to -- I encountered it last parsing tags, eg. <a> can have href= and title= in no specific order, and with no certainty of title=, resulting in (psuedo) ['a [href opt title | opt title href]]. Naturally, this exponentially multiplies: ['img [src alt opt width opt height opt title opt id opt class | ... ad infinitum ...]] -- I can't help but feel that I'm missing something... | 11-Jan-05 16:32 |
| 6 | Geomol | Or you could put your parameters in a block: 'keyword set name string! opt into [any ['caption set caption string! | 'size set size integer! | 'maxlength set maxlength integer! | 'default set default string!]] | 11-Jan-05 11:33 |
| 5 | Geomol | The problem seem to be, that there are no keywords for your optional parameters, and therefore the order of parameters paly a role. There are 2 string! and 2 integer! parameters, and if order didn't play a role, there is no way, the parser can figure out, which one is which. You may wanna go something like this: 'keyword set name string! any ['caption set caption string! | 'size set size integer! | 'maxlength set maxlength integer! | 'default set default string!] | 11-Jan-05 11:28 |
| 4 | Pekr | is this typical to/thru first [a | b | c] problem? | 11-Jan-05 11:13 |
| 3 | Robert | How to handle this "dillema" best? | 11-Jan-05 11:07 |
| 2 | Robert | Ok, here is my first question: I'm constantly facing the problem of optional parameters. 'keyword set name string! opt [set caption [string!]] opt [set size integer!] opt [set maxlength integer!] opt [set default string!] As parse walks from left to right through this line the order of parameters play a role. After giving the first INTEGER value you can't specify the 'caption part anymore. On the other hand, if you don't want to specify the 'caption but the 'default you have to provide an "" for 'caption because otherwise the second string! will be used as 'caption instead of 'default. | 11-Jan-05 11:07 |
| 1 | Robert | Created this group to discuss over dialect programming / how to create them best. | 11-Jan-05 11:02 |