News for hackers. Stuff that matters.
Re:A meta approach to implementing programming languages (2018) by DyslexicAtheist on Sunday February 24, 2019 @01:25PM (#19239790)
could I get something like this with Racket[1]? why would I chose this over Racket?

[1] https://news.ycombinator.com/item?id=19232068

Re:A meta approach to implementing programming languages (2018) by jimmy_ruska on Sunday February 24, 2019 @03:27PM (#19240432)
From my understanding this library takes a grammar and generates a run time interpreter for that grammar. Antlr is much more similar as it takes in a grammar, and generates code you can hook into at any part of the grammar parsing.

Racket on the other hand gives you the ability to hook into the new language, convert it to racket syntax and then compile it. As far as I know racket doesn't give you a simple parsing grammar, and you're targeting outputting racket code if you make a language. Though you could always take racket as your AST and target something like C or LLVM if you want it to live outside of racket.

Racket is not necessarily unique in that aspect, it just focuses on making it easier with tooling. Scala, Kotlin, Elixir are examples of some of the most successful languages https://www.youtube.com/watch?v=du6qWa8lWZA

Re:A meta approach to implementing programming languages (2018) by jarcane on Sunday February 24, 2019 @05:53PM (#19241188)
Racket had parser generators available. See for instance ragg, or is fork, the brag parser used in the Beautiful Racket book: https://docs.racket-lang.org/brag/index.html

The technique used in the book is to use brag to describe the grammar and generate a parser/tokenizer to s-expressions, and then you can either interpret it compile them directly, or use the Racket macro system itself to expand them into Racket.

And of course, Racket's macro system itself can do quite much without even a parser generator. The standard library even includes an example ALGOL 60 implementation done as Racket macros, and examples of C and Java can be found on the package server.

Re:A meta approach to implementing programming languages (2018) by optevo on Sunday February 24, 2019 @07:19PM (#19241618)
Indeed. I don't want to sound flippant as obviously a lot of hard work has gone into this but I would have thought that a lisp and a parser should be able to achieve the same no?

Some even come with Turing Complete type systems and prolog subsystems. http://www.shenlanguage.org/