Re:The naked truth about writing a programming language (2014)
by pbiggar on Sunday May 03, 2020 @01:39AM
(#23057093)
I had to look up whether you were technically accurate (I've a PhD in compilers but parsing's not really my thing), and I think the answer is "it depends, maybe?"
To get to the root of the issue though, there is not a parser.
Well, one could consider the function that takes each keystroke to be a parser - though I don't know if that's technically correct either. So perhaps the more accurate thing to say is there is not a step that takes a textual source file and parses it.
Re:The naked truth about writing a programming language (2014)
by GreedCtrl on Sunday May 03, 2020 @03:45AM
(#23057539)
What would happen if you paste a complete program in all at once?
Re:The naked truth about writing a programming language (2014)
by pbiggar on Sunday May 03, 2020 @12:02PM
(#23059812)
That's not really how Dark works. You're not manipulating text in your editor - you use our editor, and our editor only uses ASTs. So when cutting and pasting, you're cutting and pasting AST, not text. So to answer your question, you can paste an entire handler or function at once, but it will be one you copied from another place in DArk and it will be structured.
We've looked at allowing people to paste text (eg from Stackoverflow) into Dark. We think we can do it by just inserting each character one at a time (though there's a technical flaw with that at the moment, which could be addressed). In that sense, Dark is sort-of a parser (I don't know if it technically counts).
let x = 5
"hi " ++ name
DB::set{}
Are you saying these lines from the video are not consistent throughout? Like in one part I'll type "x = 5" to assign 5 to x, but somewhere else I'll have to type "5 # x" to do the same? Like just random syntax everywhere?
If not, then you have a grammar. You should document it and treat it as such.