Live data from Hacker News

Why Language-Oriented Programming? Why Racket?

beautifulracket.com

31–40 of 115 posts

Re: Why Language-Oriented Programming? Why Racket?

#31
I'm currently browsing the list of languages made with racket (here http://docs.racket-lang.org/search/index.html?q=H%3A) and it seems like most languages are just lisp variants. I suppose they were made for educational or fun purposes, but i wonder if i haven't missed something more deep as to why someone would want to reimplement a lisp in a lisp language.

Re: Why Language-Oriented Programming? Why Racket?

#32
post #3

About a decade ago, I would have agreed with this 100%, and I still am fascinated and, quite frankly, awed by Racket and LOP (and looking forward to Racket Fest 2019 here in Berlin[1]). But. (You knew there was a "but"). While I don't quite agree with the assertion that with the right tooling (so: this tooling), creating a language is as easy as creating a library, I don't think it would solve our problems even if it…

I largely agree but then I enter the modern ops stack where templated yaml is the lingua franca. It’s incomprehensible and for each system you are operating you have to learn some arcane yaml incantations that have dramatic impact on your production systems. It’s a world crying out for a set of well factored dsl.

Better than a dsl would just be a mature general purpose programming language with tooling etc.

https://news.ycombinator.com/item?id=19108787

Re: Why Language-Oriented Programming? Why Racket?

#33
post #31

I'm currently browsing the list of languages made with racket (here http://docs.racket-lang.org/search/index.html?q=H%3A ) and it seems like most languages are just lisp variants. I suppose they were made for educational or fun purposes, but i wonder if i haven't missed something more deep as to why someone would want to reimplement a lisp in a lisp language.

Isn't it also done in SICP? So lisp users probably have that in mind when trying it out in racket.

Re: Why Language-Oriented Programming? Why Racket?

#34
post #31

I'm currently browsing the list of languages made with racket (here http://docs.racket-lang.org/search/index.html?q=H%3A ) and it seems like most languages are just lisp variants. I suppose they were made for educational or fun purposes, but i wonder if i haven't missed something more deep as to why someone would want to reimplement a lisp in a lisp language.

Racket tends to be geared to writing lispy things because of the heavy reliance of the syntax parsing and macro transformation on s-expressions, so most/all being variants of lisp makes sense. Writing non-sexp languages in Racket tends to take a lot more work that's not batteries included.

It also has an incredibly powerful inheritance system. In 3-5 lines I can inherit all the functionality from Racket and then add, modify, or delete any part I like. Reminder, I can do all this from the compile time level, not the runtime level. I can change something as basic as how you define functions with just a few lines of code while still getting everything else.

Basically, I can easily write Racket+X or Racket with modified Y or Racket without Z and make it it's own entire language with very minimal effort.

A lot of this occurs because of Racket's insanely good macro system. You can also use these tools in libraries/packages and still get the compile time control while the language is still officially Racket.

Re: Why Language-Oriented Programming? Why Racket?

#35
post #31

I'm currently browsing the list of languages made with racket (here http://docs.racket-lang.org/search/index.html?q=H%3A ) and it seems like most languages are just lisp variants. I suppose they were made for educational or fun purposes, but i wonder if i haven't missed something more deep as to why someone would want to reimplement a lisp in a lisp language.

That was my impression as well: you can have any language, as long as it's LISP.

Some of the more specialised languages are different, though.

Re: Why Language-Oriented Programming? Why Racket?

#36
post #31

I'm currently browsing the list of languages made with racket (here http://docs.racket-lang.org/search/index.html?q=H%3A ) and it seems like most languages are just lisp variants. I suppose they were made for educational or fun purposes, but i wonder if i haven't missed something more deep as to why someone would want to reimplement a lisp in a lisp language.

That was my impression as well: you can have any language, as long as it's LISP. Some of the more specialised languages are different, though.

> you can have any language, as long as it's LISP.

Let's be fair, many lisp programmers would be perfectly fine with that.

Re: Why Language-Oriented Programming? Why Racket?

#37
post #28
post #19

Earlier quoted context omitted.

In LISP-like languages like Racket, the code is a list. That is, a program is just a list of tokens (a b c), the same data structure one would use for storing any other kind of data (the equivalent of Python’s [a b c]). When programs are themselves just lists, they are easy to manipulate with code. So, in LISP-like languages, it is easy to write code that writes code. That makes them especially suitable for domain-sp…

> In LISP-like languages like Racket, the code is a list. This is nothing special. In all languages, code is a list: a list of characters, that is. Just saying.

A list of characters (a string) and a list of tokens are drastically different to work with. If you haven't worked with both and want to write programming languages, I would recommend filling the gap of the one you haven't to see/feel the difference.

Beyond the code being a list, Racket's macro system and syntax parse / creation tools are incredibly powerful and come built in where you could spend years in another language just getting the tooling to write a language, let alone writing it.

Re: Why Language-Oriented Programming? Why Racket?

#38
post #28
post #19

Earlier quoted context omitted.

In LISP-like languages like Racket, the code is a list. That is, a program is just a list of tokens (a b c), the same data structure one would use for storing any other kind of data (the equivalent of Python’s [a b c]). When programs are themselves just lists, they are easy to manipulate with code. So, in LISP-like languages, it is easy to write code that writes code. That makes them especially suitable for domain-sp…

> In LISP-like languages like Racket, the code is a list. This is nothing special. In all languages, code is a list: a list of characters, that is. Just saying.

What the parent likely means is that Lisps, structurally, are akin to the AST many other languages generate as an intermediate step to compilation.

Re: Why Language-Oriented Programming? Why Racket?

#39

I find it a pretty amazing feat that the author has created a programming language (Racket), then used it to create another language called Pollen[1] for book publishing, then went ahead and used Pollen to publish three books. Oh and the fonts are designed by him too[2]. [1] https://docs.racket-lang.org/pollen/ [2] https://mbtype.com/

As the comment below points out the author did not create Racket. However there is an author (Donald Knuth or DEK as he is known) who did just that: create a new language (two of them: TeX and METAFONT) for typesetting and making fonts, created new fonts (Computer Modern), published a series of books about the languages and the fonts, AND the programs that implement these languages. Then he used his creations to typeset his 'The Art of Computer Programming' (or TAOCP) books.

Re: Why Language-Oriented Programming? Why Racket?

#40

I was thinking recently about why I find programming languages so interesting. The answer I came up with was that programming languages allow you to create your own reality. You get to define how things work in this reality. Want functions to be values that can be arguments and return values? Sure! Want a lot of crazy symbols to do complicated math? Go for it! Want everything to be dynamic? Why not. The caveat that c…

I think the ability to conjure up things out of nothing, that have no constraints derived from the physical world, is a lot of the appeal of computer-based activites such as programming or 3d graphics in the first place.
Post reply on HN