00:00:00 --- log: started retro/13.02.27 02:05:58 --- join: impomatic (~digital_w@146.90.165.144) joined #retro 03:45:35 --- quit: tangentsomething (Read error: Operation timed out) 03:46:18 --- join: tangentsomething (~michal@108-218-151-22.lightspeed.rcsntx.sbcglobal.net) joined #retro 05:01:18 --- quit: tangentsomething (Ping timeout: 244 seconds) 05:15:21 --- join: tangentsomething (~michal@108-218-151-22.lightspeed.rcsntx.sbcglobal.net) joined #retro 05:47:43 --- quit: tangentsomething (Ping timeout: 264 seconds) 05:50:35 --- join: tangentsomething (~michal@108-218-151-22.lightspeed.rcsntx.sbcglobal.net) joined #retro 06:24:19 --- nick: tangentsomething -> tangentstorm 09:19:38 --- join: kumul (~mool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 09:55:59 --- join: harrison (~quassel@li89-226.members.linode.com) joined #retro 10:09:51 --- join: kumool (~mool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 10:12:55 --- quit: kumul (Ping timeout: 264 seconds) 10:14:57 --- join: kumul (~mool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 10:17:43 --- quit: kumool (Ping timeout: 264 seconds) 10:17:54 --- join: kumool (~mool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 10:20:02 --- quit: kumul (Ping timeout: 246 seconds) 10:21:25 --- join: kumul (~mool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 10:22:31 --- quit: kumool (Ping timeout: 264 seconds) 10:51:24 --- join: Mat2 (~claude@91-65-144-133-dynip.superkabel.de) joined #retro 10:51:32 hello 10:52:51 hey Mat2 :) 10:52:59 hi tangentstorm 10:53:24 I'm rewriting the whole parser for Saiwa at current 10:53:37 i too am writing parsers today 10:53:47 because the current code is to unstructured at current 10:54:00 I hope to be finished tomorrow with that 10:54:19 and after that I will upload the sources in its current state 10:54:31 i've been thinking about your 3n stuff. i've decided i like it :D 10:54:38 awesome 10:54:53 how long ago did you start this project? 10:55:08 hmm 2 months ago 10:55:39 (except the time for AVM) 10:57:02 yeah, i guess i meant since you first decided to make a language. i had the impression you've been working up to this for a few years 10:57:25 that must be around two years 10:57:46 it all began with these extended nagro vm 10:58:04 from my git repro 10:58:13 :) 10:58:25 must be nice to be at the end then 10:58:40 yes 10:59:40 for the future I will try hard to choose another implementation-language because C sucks 11:01:27 (inclusive its libraries) 11:03:07 :) 11:03:17 I think you can program with the same grade of platform independence creating a simple HAL based on macro assembler 11:03:40 (but without the syntactical quirks and these useless type system) 11:03:59 ^on a macro assembler 11:04:04 i'm working on re-building retro's main loop from assembler 11:04:13 ngaro assembler i mean 11:04:49 nice :D What assembler have you choosen ? 11:04:55 i just made one 11:05:19 it's basically the same thing that is used in the test suite i wrote, but i ported it from python to javascript 11:05:20 I will look forward to study the sources 11:05:39 https://github.com/sabren/b4/blob/master/b4a/b4a.js 11:05:48 that's just the assembler 11:06:16 i'm probably going to add a few features to it for things like building data structures 11:06:29 probably I can help you with some assembler internals 11:07:28 i don't know what i need help with yet, but i wouldn't mind a code review once it's ready 11:07:47 ok, I will take a look 11:07:48 or if you have suggestions already i'm all ears 11:08:24 implement some macro functionality 11:10:11 that's what i'm working on now... it's not organized yet... let me post what i have somewhere though 11:10:58 * Mat2 recoding the parser from scratch (I'm loving it) 11:17:35 https://gist.github.com/tangentstorm/5050753 11:19:37 looks a bit as dashed gas syntax 11:21:09 but I like to see your parser in action :D 11:23:05 https://gist.github.com/tangentstorm/5050753 (refresh) i added some explanation in version 3 11:25:12 hmm, ok, using the stack state of the vm is a simple solution but if you want to check it in between parsing I would define a variable for holding the stack-depth 11:25:29 this way, you can check up the stack bounds 11:26:02 good point. 11:26:22 the "push" and "pop" in there don't actually do anything yet... 11:26:33 invalid javascript 11:26:52 huh, sadly I do not know Javascript well 11:27:04 i'm thinking maybe each token in the language will be implemented as a list 11:27:34 you are a schemer ;) 11:27:43 so to do whatever ".end" means now, three'd be a list like macro["end"]=[fn1, fn2, fn3]... 11:28:13 so it would always run the last one... and if the list is empty, it would do nothing 11:28:19 or it would raise a syntax error in the assembler i guess. 11:28:46 in lisp or scheme that would be the prefered method to do for sure 11:28:52 this way the assembler itself can never loop like forth... it always handles the next token and never backtracks or goes into a loop, so it always terminates 11:29:23 good idea 11:29:25 it means your grammar doesn't have to be context-free either. 11:29:38 at least I *think* so.. not 100% sure yet. 11:30:26 the next step up would be to do it all in forth so of course it could go into a loop, which means it could parse any language, but may not terminate 11:31:21 you will need a decent list word-set 11:31:29 i wish i was better at expressing this stuff formally or even looking up the ideas in the literature. 11:32:05 yeah, i'm not trying to actually do it right now, just trying to make a tool that allows extending the grammar in a language 11:32:20 one orthodox way for implementing a parser is to build a tree of tokens 11:33:13 but I think that complicating parsing a lot for some languages 11:33:36 what kind of tree? 11:34:12 i was also fiddling with a sort of token-parsing tree.. really a "nondeterministic finite automaton" i think 11:34:28 no.. a deterministic one 11:34:34 metroMsgWelcome 11:34:39 ups sorry, 11:34:48 https://en.wikipedia.org/wiki/Abstract_syntax_tree 11:34:52 ^look here 11:35:26 it is basical an unbalanced tree of nodes 11:35:54 oh. yeah. right :) 11:36:24 my plan was to kind of build a normal system backwards 11:36:30 start with the code emitters (what these are) 11:36:44 then add the code that modify the macros on the fly 11:37:17 now any code you write will compile, but it won't find your errors and you might get away with dirty tricks 11:38:07 I think you can create a Javascript macro-function which create a sequence of assembler statements as string and let the interpreter execute it though some eval function 11:38:09 then write a grammar that can build the ast 11:38:35 yeah the idea is that "asm()" is going to recursively invoke the interpreter 11:39:03 so running asm(".foo") is going to look up foo in the macro list, and that might call asm(".bar") or whatever 11:39:25 hrm 11:39:34 i guess that means it can loop after all 11:39:54 i may do the forth "smudge" trick then to prevent recursive macros 11:41:48 or i may throw all this out and find a simpler way. right now i just want to compile some pascal and explore this idea 11:42:16 this is what i'm going to use for my tokenizer.. it's what i thought you meant about a tree of tokens: 11:42:19 https://gist.github.com/tangentstorm/5050941 11:45:29 --- join: kumool (~mool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 11:46:43 yes, that is an AST 11:48:19 --- quit: kumul (Ping timeout: 264 seconds) 11:49:56 nah, an AST is like when you turn "while true do if x > 5 then whatever" into "(while true (if (> x 5) (whatever)))" 11:50:25 AST = Abstract Syntax Tree 11:50:28 --- join: kumul (~mool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 11:50:28 this is just a giant regular expression that's been optimized 11:50:36 yeah 11:50:54 lisp s-expressions are basically just a way to write ASTs 11:51:13 it's the result of parsing 11:51:52 what i'm trying to show here is the instructions for how to parse all the keywords in pascal 11:51:55 ok, that was my impression study the file 11:52:09 it's one long regular expression 11:53:00 hmm, ok this was a misinterpretation of me 11:53:28 instead of /(program|procedure)/ which requires backtracking if it's not optimized, this is /pro(gram|cedure)/ 11:53:48 really a regexp engine would optimize that for you... i just want to present what it's doing 11:53:55 --- quit: kumool (Ping timeout: 272 seconds) 11:54:35 so that file representing the syntax 11:58:50 yeah 11:59:37 i think you can do the same for the whole grammar but i'm not sure yet, because grammars are recursive 11:59:50 rather: i think you can do it on the fly as you're parsing 12:00:11 which as far as i know, no real parsers actually do this 12:00:41 probably because you need two stacks like in forth so it would be cumbersome to implement in other languages 12:02:09 --- quit: kumul (Ping timeout: 272 seconds) 12:02:30 my paser work this way, interpreting on the fly as parsing 12:03:09 it's also an analog idea to colorforth 12:03:55 so you can still change the syntax like in forth? 12:03:59 yes 12:04:07 cool :) 12:04:32 i think saiwa's going to be pretty fun 12:04:41 it is indeed 12:04:54 (I hope so) 12:05:31 do you say it like "sai WAH" ? 12:05:49 SAI wah? or something completely different? :D 12:07:13 start the google translator and translate the word 'salewah' from islandic to english 12:08:00 sorry, 'salewa' 12:09:24 sounds like "sahlly wah" to me 12:09:52 * tangentstorm hates trying to write anything phonetically in english :( 12:10:34 in german it just means 'See' 12:10:46 which translate to lake in english 12:10:58 or deep see 12:11:00 i mean how to pronource it 12:11:04 pronounce 12:11:19 is it three syllables? 12:11:24 sah - ee -- wah ? 12:11:43 cewa 12:12:10 like "SEE wah" 12:12:38 yes, but with 'c' instead of 's' and short 'e' 12:12:55 in english c and s make the same sound 12:13:02 ??? 12:13:04 or c and k but i don't think you mean that 12:13:27 c makes a "sss" or a "k" sound 12:13:59 you mean like italian "c" ? 12:14:06 ahm, yes 12:14:08 "chapter" 12:14:13 right 12:14:34 so "saiwa" is pronounced "chew ah" 12:14:50 no 12:15:01 "cheh wah" 12:15:21 I think that the first example is correct 12:16:07 chew rhymes with "you" and "flew" and "blue" and "new" 12:16:11 "who" 12:16:19 * tangentstorm punches the english alphabet ;D 12:16:55 how much consonants exist in english ? I think it must be around 16 12:17:06 point is i don't think americans will say it right unless you upload how to say it. 12:17:24 someone made a phonetic alphabet for english. it has about 40 letters... mostly extra vowels. 12:17:43 http://www.omniglot.com/writing/quikscript.htm 12:17:48 good point, I take it on the list for the homepage 12:18:40 but we only have 26 letters aeou bcdefghjklmnpqrstvwxz y can be either a consonant or a vowel 12:18:54 whoops.. put e twice out of habit 12:21:16 english speakers will have big difficulties speaking nordic languages I think 12:22:47 probably I shoud rename the language 12:22:53 ^should 12:27:33 sadly 'metro' is a copyrighted label 12:42:00 tangentstorm: Do you thing the word chewah is hard to pronounce for english speakers ? 12:51:31 hmm, what about PL (for programming language) as name ? 13:06:22 Mat2: i don't think it's hard to pronounce, it's just that the letters "saiwa" look like "SIGH wah" 13:07:31 actually not sure why it looks like a long I to me because "daisy" "maid" "raid" are all long A's 13:07:39 sa maybe "SAY wah" 13:07:47 which is actually kind of funny 13:08:08 because it sounds like "say what?!" which is what people are going to say when they see it :D 13:11:41 oh, then I left the name of course ! :D 13:24:06 by rewriting the parser, I have now added a new feature: The parser interrupts in case of errors but do not discard compilation so errors can be corrected beside parsing 13:25:20 like interactive compile? 13:25:45 yes (as an side effect only valid function definations can be defined. You will rest in the parser loop until the defination is correct) 13:26:44 the Sinclair basic is one example for this approach 13:27:03 huh. i've never seen it. but that's something like what i'm doing with b4 too. 13:27:15 but i didn't think of it as error-correcting. 13:27:34 i want to be able to type something like: 13:27:47 : plan step1 step2 step3 step4 ; 13:27:55 before any of the steps are defined 13:28:05 like top down, stepwise refinement 13:28:22 so the idea was to make the compiler recursive 13:28:43 it does one pass when you hit ";" and uses that to figure out which words it doesn't know yet 13:28:49 then that becomes your to-do list 13:29:05 on a stack 13:29:15 so if : step1 a b c d ; 13:29:24 the stack is now a b c d step2 step3 step4 13:29:34 and this would be part of the UI 13:29:54 and it would nudge you to define 'a' so things can continue 13:30:00 ah, that is similar to the label concept of my ealier parser 13:31:01 it's actually a little stricter... if you try to define "b" first, it'll let you do that, but it'll queue it 13:31:24 sort of like how in pascal, you can't use something intil it's declared, here you can't declare something until it's used. :) 13:49:46 I think of these concept more like in Basic where you declare something as you use it 13:54:23 --- join: kumul (~mool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 14:17:55 --- join: kumool (~mool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 14:18:57 --- quit: kumul (Ping timeout: 272 seconds) 14:20:36 --- quit: impomatic (Quit: impomatic) 14:33:15 i am realizing as i write this code how screwed up my brain is :D 14:34:38 but this is how i read source code in my head. I see a "repeat", then I look ahead for the "until", and then i read what's in between 14:36:00 i don't like that to do this i have to introduce recursion so early, but i do like that the "repeat" rule isn't attached to anything else in the language 14:36:51 whereas with a normal parser, i would have to implement a parser for everything that could be between repeat...until 14:38:01 same thing with the stepwise refinement thing. i want to be able to parse words i don't know yet, and even run them... as long as the compiler reminds me to go back and fill them in later. 14:38:20 (they would just be temporarily compiled as no-ops) 15:16:35 --- quit: kumool (Ping timeout: 272 seconds) 15:40:34 it is an interesting concept 15:45:15 I get some sleep, see you 15:45:20 --- join: kumul (~mool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 15:45:37 --- quit: Mat2 (Quit: Verlassend) 16:00:38 initial garbage collector for parable is now functional. after a bootstrap, it recovers about 38K of space 16:00:56 cool :) 16:03:59 It's pretty simplistic at present (two extra functions added to the memory.coffee file): https://gist.github.com/crcx/5052006 16:09:03 never used underscore. that looks handy. 16:14:15 if a slice just happens to contain the number 4, it's going to treat that as if it were a pointer to slice #4? 16:18:01 --- quit: kumul (Ping timeout: 272 seconds) 16:18:26 yes 16:18:41 this is wasteful, but safe 16:19:06 makes sense. otherwise you'd need type codes on each cell to mark which ones are pointers. 16:19:08 cool. 16:19:21 (IIRC, golang does something similar, or at least did when I last used it) 16:25:13 --- join: kumul (~mool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 17:55:35 --- join: kumool (~mool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 17:57:53 --- quit: kumul (Ping timeout: 248 seconds) 18:00:34 --- join: kumul (~mool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 18:02:31 --- quit: kumool (Ping timeout: 272 seconds) 18:27:50 --- quit: kumul (Read error: Connection reset by peer) 18:28:19 --- join: kumul (~mool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 18:58:12 --- quit: tangentstorm (Ping timeout: 255 seconds) 18:58:56 --- join: tangentstorm (~michal@108-218-151-22.lightspeed.rcsntx.sbcglobal.net) joined #retro 19:10:05 --- quit: tangentstorm (Ping timeout: 240 seconds) 19:37:56 --- join: tangentstorm (~michal@108-218-151-22.lightspeed.rcsntx.sbcglobal.net) joined #retro 20:10:33 --- join: kumool (~mool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 20:13:31 --- quit: kumul (Ping timeout: 264 seconds) 20:42:23 --- join: kumul (~mool@c-76-26-237-95.hsd1.fl.comcast.net) joined #retro 20:44:43 --- quit: kumool (Ping timeout: 264 seconds) 20:57:29 --- quit: kumul (Read error: Connection reset by peer) 23:59:59 --- log: ended retro/13.02.27