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…
Why Language-Oriented Programming? Why Racket?
91–100 of 115 posts
Re: Why Language-Oriented Programming? Why Racket?
#92I'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?
#93Earlier quoted context omitted.
> you can have any language, as long as it's LISP. Let's be fair, many lisp programmers would be perfectly fine with that.
ok but then since lisp already has an extremely small syntax, why not simply define functions in the language rather than using the macro system ? Unless your goal is to be source compatible with another lisp variant, of course.
Modifying control flow, for one. A classic example is anaphoric if. If you want to implement that, you can't do it just as a straight forward function. It needs to be a function that modifies syntax, aka a macro.
Re: Why Language-Oriented Programming? Why Racket?
#94Re: Why Language-Oriented Programming? Why Racket?
#95As 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…
Re: Why Language-Oriented Programming? Why Racket?
#96Earlier quoted context omitted.
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…
This seems unsatisfying. Most of the modern languages are choosing pretty much the same sets of features. I've been using them for years (decades?), and I couldn't tell you significant differences between most of these languages. There's maybe 3 major islands of languages today. Within each island, they make essentially the same things easy. The answer to a question like "Python or Ruby?", "C# or Java?", or "Rust or…
>"Rust or Go or C++?"
Does one of these make memory problems easier to avoid?
>"Python or Ruby?"
One of these prioritises having a single way to do most tasks, while the other prioritises programmer expressiveness (simple example: "unless" is absent in Python). Thus one is easier to onboard newbies with and have them relatively quickly be able to read the code in their ecosystem, while the other allows skilled programmers to convey semantics more efficiently.
I'll admit being mostly ignorant about the differences between Java and C#, but at least in general the languages you contrasted do make different things easier.
Edit: grammar.
Re: Why Language-Oriented Programming? Why Racket?
#97I'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,…
No more work than any other language - Racket has reclusive descent, lex/yacc and PEG parsers generators. There is a whole section on parsers at http://docs.racket-lang.org/ including ‘Megaparsack’ based on higher-order parser combinators (like parsec for Haskell)
Racket can also read ‘C’ yacc/bison grammars.
It’s worth noting that a variety of non-Lisp-parenthesis-languages have been done in Racket including Java and Python.
Re: Why Language-Oriented Programming? Why Racket?
#98I'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?
#99I'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.
1. Lispers often find s-expression syntax easier to edit for many applications. So it's not surprising that a lot of the folks who design languages in Racket also might choose an s-expression syntax for their language design.
2. By using the same (or similar, in the case of Pollen/Scribble/...) syntax as the main racket language, it's easy to give access to the full power of racket in a DSL.
Re: Why Language-Oriented Programming? Why Racket?
#100Earlier quoted context omitted.
This seems unsatisfying. Most of the modern languages are choosing pretty much the same sets of features. I've been using them for years (decades?), and I couldn't tell you significant differences between most of these languages. There's maybe 3 major islands of languages today. Within each island, they make essentially the same things easy. The answer to a question like "Python or Ruby?", "C# or Java?", or "Rust or…
I'd add some caveats to GP's comment, but I think it's mostly spot on. >"Rust or Go or C++?" Does one of these make memory problems easier to avoid? >"Python or Ruby?" One of these prioritises having a single way to do most tasks, while the other prioritises programmer expressiveness (simple example: "unless" is absent in Python). Thus one is easier to onboard newbies with and have them relatively quickly be able to…
Not much.