Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
DmitrySoshnikov
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
“Building a Parser from scratch” full course
(dmitrysoshnikov.com)
2 points
by
DmitrySoshnikov
6y ago
|
0 comments
2.
▲
by
DmitrySoshnikov
6y ago
sbrk is emulated via mmap today on MacOS and others, this is an abstraction (for bump allocation), not just a function you may implement custom sbrk via mmap easily
3.
▲
by
DmitrySoshnikov
6y ago
Thanks for the feedback, and glad to see more engineers interested in deeper topics!
4.
▲
by
DmitrySoshnikov
6y ago
That's a great point and I have the https://github.com/DmitrySoshnikov/syntax/issues/99 to add support for IELR in Syntax.
5.
▲
by
DmitrySoshnikov
6y ago
Yes, in fact for building a language the parsing stage should be skipped altogether (start with interpreter or bytecode). We do this in the interpreters class. And once you have a fully working VM, _now_ it is a good time to shift to parsin
6.
▲
by
DmitrySoshnikov
6y ago
Yes, backtracking still might be an option although has its known limitations in terms of parallel paths. We describe backtracking in this class too. The LL in the the view of manual Recursive descent is the most used on practice along with
7.
▲
by
DmitrySoshnikov
6y ago
Yeah, this makes sense, thanks.
8.
▲
by
DmitrySoshnikov
6y ago
Professor Aiken is a great teacher and I love his compilers course. However as for the parsering stage, that course goes as maximum as to SLR(1) which is pretty "toy" parsing mode. That's the problem with a combined "com
9.
▲
by
DmitrySoshnikov
6y ago
Thank you for the feedback, glad you liked it, and glad to see more people interested in deeper CS topics!
10.
▲
by
DmitrySoshnikov
6y ago
Yes, I recommend "Parsing Techniques" book.
11.
▲
by
DmitrySoshnikov
6y ago
See this small summary doc on different techniques for error recovery: https://gist.github.com/DmitrySoshnikov/feee52cbfb03b7b69110...
12.
▲
by
DmitrySoshnikov
6y ago
Great details, thanks! > A benefit of a syntax with indentation-defined block structure is that you don't need to rely on balanced grouping tokens like { ... } In fact from the lexer perspective there is no big difference, the match
13.
▲
by
DmitrySoshnikov
6y ago
Yes, this is called "parse error recovery" and there are multiple techniques for this. In fact, most of the production parsers support this mode. E.g. when you try executing a C++ or Java file, it shows you all the errors at once
14.
▲
by
DmitrySoshnikov
6y ago
Absolutely! S-expression (used in Scheme, Lisp, etc) is a great AST-based syntax to start building an interpreter right away. But for fully ergonomic language you would need a parser for a more complex syntax.
15.
▲
by
DmitrySoshnikov
6y ago
Yes, in the "Essentials of Interpretation" class (aka "Building an Interpreter from scratch" we focus exactly on runtime semantics, and evaluating the language. The S-expression allows greatly simplifying, focus on runti
16.
▲
by
DmitrySoshnikov
6y ago
Should be up by now; seems auto-DDOS'ed, lol
17.
▲
by
DmitrySoshnikov
6y ago
Yes, if you need to parse that input string to generates an appropriate SQL query, you would need to have a small DSL (domain-specific language) for that "string", whatever it contains. If the string contains SQL-like syntax, e.g.
18.
▲
by
DmitrySoshnikov
6y ago
Yes, to some degree -- Syntax tool normally support lexer states, and the same "while" token may mean a keyword or the property/field name of a struct. You can find more details of the lexer states in the docs.
19.
▲
by
DmitrySoshnikov
6y ago
Yes, we use LALR(1) parsing mode to build the actual parser, and it exactly supports Left recursive grammars (which are much more elegant than LL). We also don't focus much on scanner (tokenizer) since this is a topic of Regular expres
20.
▲
by
DmitrySoshnikov
6y ago
Yeah, this class is specifically on parsing pipeline and syntactic analysis. For runtime semantics (Interpreters and Virtual Machines) you can address "Essentials of Interpretation" aka "Building an Interpreter from scratch&q
21.
▲
by
DmitrySoshnikov
6y ago
Yes, GLL is a good algorithm and I potentially going to publish it separately as a single public video.
22.
▲
by
DmitrySoshnikov
6y ago
Congrats, and hope this makes building of your parser easy and fun! This course covers a lot of parsing theory as well, and if you're interested in pure practical (manual) parser, there will be also "Building a Recursive descent p
23.
▲
by
DmitrySoshnikov
6y ago
Thanks for the feedback, glad you like it. For production I use combination of software: Keynote, Notability, Good notes, Camtasia, and live editing on iPad.
24.
▲
by
DmitrySoshnikov
6y ago
Great point on combinators, PEG, and GLL -- this potentially would be covered in 201 as suggested, since it's good having a foundation of the LL/LR, and then gradually moving to combinators if needed. LALR(1) covers a pretty wide
25.
▲
Parsing Algorithms
(dmitrysoshnikov.com)
407 points
by
DmitrySoshnikov
6y ago
|
86 comments
26.
▲
LL(1) parsing: First and Follow sets
(youtube.com)
1 points
by
DmitrySoshnikov
6y ago
|
0 comments
27.
▲
Backtracking Parser in JavaScript
(youtube.com)
1 points
by
DmitrySoshnikov
6y ago
|
0 comments
28.
▲
Writing Mark-Sweep Garbage Collector in C++
(dmitrysoshnikov.com)
3 points
by
DmitrySoshnikov
7y ago
|
0 comments
29.
▲
by
DmitrySoshnikov
7y ago
> the Voodoo magic is in the scheduling and code generation Yes, for the code generation one needs to well understand semantics of the target language. And when it's a low-level language (Assembly), the "voodoo magic" main
30.
▲
by
DmitrySoshnikov
7y ago
Indeed, TypeScript is also a good choice for this.
More ›