4 ms·
His point still stands. The ruby parser has 10x the number of lines of code as the clojure parser. https://github.com/ruby/ruby/blob/trunk/parse.y https://git
by cellularmitosis 8y ago
His point still stands. The ruby parser has 10x the number of lines of code as the clojure parser.
https://github.com/ruby/ruby/blob/trunk/parse.y https://github.com/ruby/ruby/blob/trunk/parse.y
https://github.com/clojure/tools.reader/blob/master/src/main/clojure/clojure/tools/reader.clj https://github.com/clojure/tools.reader/blob/master/src/main...
- lispm 8y agoBecause one parses a data format and the other one an actual programming language...
- cellularmitosis 8y agoSorry, I linked to the wrong edn reader https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/EdnReader.java https://github.com/clojure/clojure/blob/master/src/jvm/cloju...
- lispm 8y agoThat's still only an s-expression reader, not a programming language parser.
- cellularmitosis 8y agoCan you help me understand the distinction you are making? My understanding is that this is the reader used by the repl, and at least for clojure, an edn parser is the same thing as a programming language parser, because clojure programs are written in edn.
- victorNicollet 8y agoIn most programming languages, a fact like "Foreach loops have a variable binding, a collection to iterate through, and a body" is guaranteed by the parser, and the rest of the language implementation can assume that the foreach loops are well-formed and concentrate on lexical and type checks. An S-Expression parser will accept (loop for in do), and the rest of the language implementation has to deal with detecting that there is no variable, no collection and no action.
- lispm 8y agoThey are written on top, but not in. It's like claiming Ruby programs are written in characters. S-expressions know nothing and represent nothing about concepts like functions, variables, argument lists, operators, bindings, type declarations, function defintions, variable defintions, class definitions, ... Even syntactic (3 4 +) is READ successfully, but it is not a valid Clojure form. Basically a READER is on the level of a TOKENIZER, but not a parser.