Live data from Hacker News

Why Language-Oriented Programming? Why Racket?

beautifulracket.com

61–70 of 115 posts

Re: Why Language-Oriented Programming? Why Racket?

#61
As a Clojure programmer I find Racket's "#lang" feature fascinating, all the more so it seems to be doing exactly the opposite of what's recommended in Clojure: favor data over functions over macros.

Personally most of the DSLs I write in Clojure are "private" (i.e. I write them for myself to help me develop a library or an app) and thus they tend to be small. This is why I favor functions over data: it allows me to reuse common function combinators (e.g (fn or-fn [f g] (fn [& args] (or (apply f args) (apply g args))))) so that I do not have to reimplement them which is something you have to do if you approach the problem with a data-first mindset. Instead, if I really want to prettify such function-based DSLs by bringing forth the use of data to express the problem at hand, I write a DSL-as-data parser and implement it as one or multiple DSL-fns.

More @ https://gist.github.com/TristeFigure/20dd01b0d3415f34075cfc0...

How does this compare to Racket DSLs ?

Re: Why Language-Oriented Programming? Why Racket?

#62
post #57

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…

The problem is that people often create languages that are basically the same as existing languages; no new concepts. New languages are usually a grab-bag of features found in C, Java, Lisp and/or Haskell.

At the same time, even a language that is just a combination of features from those languages can strike a different balance between the concepts and it's the balance that defines the languages.

Re: Why Language-Oriented Programming? Why Racket?

#63
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.

Something like Dhall you mean? https://github.com/dhall-lang/dhall-lang

Re: Why Language-Oriented Programming? Why Racket?

#64
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.

I don't see it on that list, but there's apparently an implementation of Algol 60 baked into dr racket, so you need not limit yourself to lisps if you want to put in the work to do something more far-reaching.

https://docs.racket-lang.org/algol60/index.html

https://github.com/racket/algol60

Re: Why Language-Oriented Programming? Why Racket?

#65
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.

If the language uses S-exps, is it a Lisp? It’s convenient in racket to design a language with an S-exp based syntax, but the semantics of the language can be anything you want. Like prolog.

Re: Why Language-Oriented Programming? Why Racket?

#66
post #57

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…

The problem is that people often create languages that are basically the same as existing languages; no new concepts. New languages are usually a grab-bag of features found in C, Java, Lisp and/or Haskell.

There's a quote on the whiteboard in my lab that is (perhaps falsely) attributed to Larry Wall that says something like:

> Programming languages are distinguished not by what they make possible, but by what they make easy.

Practically all programming languages are computationally equivalent. The design of a new language simply seeks to answer the question: what should be easy for the programmer? Various languages are just different answers to this question.

Re: Why Language-Oriented Programming? Why Racket?

#67

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…

This is exactly why I got into programming, to make my own realities in then-current 8-bit games. I've since switched to this more abstract endeavour which gives the same satisfaction without realizing this being the reason. I'm also holding out for a VR title that can showcase this aspect rather than a horror in SciFi backdrop.

Some demos/press copies of Dreams VR recently showed off some compelling creative storytelling tools

- https://www.giantbomb.com/shows/dreams-01302019/2970-18741

- http://dreams.mediamolecule.com/

Re: Why Language-Oriented Programming? Why Racket?

#68
This is tangential to the article, but. Scheme was one of my first languages and I would love to pick it/Racket up again. But the Racket IDE (like DrScheme before it) is painful to use. Especially compared to a more "native" Mac editor.

Has anyone used Racket with success in another IDE or programmer's editor?

Re: Why Language-Oriented Programming? Why Racket?

#69
post #51

Earlier quoted context omitted.

Why wouldn't the author qualify as a self taught computer scientist though? To me your point more of a statement on the accessibility of computer science first, and I do completely agree that the accessibility is important, which the Racket/HtDP ecosystem does pretty well with. That said, there's many ways to write code and learn to code, and I think of the web programming bootcamp style or the cookie cutter college…

Ok, I think I read more into your first comment than you actually said. >many routes are just not focusing on the higher level design skills that I think are needed to make good libraries/frameworks/DSL's. I have observed that too. But I don't think this is about who is and isn't a computer scientist, whether self-taught or formally trained. I think it's more a change in the way people relate to programming languages…

He can view himself however he wants, but the man just wrote an article that competently covers Turing completeness, regular expressions, and Lindemeyer trees, among other things! He's definitely earned his comp sci merit badge, so to speak.

Re: Why Language-Oriented Programming? Why Racket?

#70
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…

Very much spot on. I'm also fascinated by Racket and LOP, but I find it hard to believe in those who claim being more productive than everyone else without proper evidence to back up their statement.

Of course, anyone would expect those proficient in Racket and LOP to have a better understanding of programming and software design in general, and to be generally more productive than many, but that's not necessarily because of LOP.

But regarding your comment on users preferring general tools - I notice this happening in my domain, where the trend is now to build absolutely everything with Python, regardless of whether this is a good choice or not. And it's impressive how libraries are built with embedded languages that feel completely non-pythonic, just for the purpose of using Python. Library writers could at least strive to make better use of the syntax of the general language (see Tensorflow vs. Pytorch).

It'd be interesting to see more studies on general languages vs DSLs, and reasonable heuristics to know when to prefer one over the other.

Now, not only end users prefer more general tools (see also: people writing a NES emulator in Emacs Lisp).

Post reply on HN