I hear this alot about Racket as if this is the value proposition and Racket stands alone with these features. Languages like Ruby are routinely used to build DSLs (RSpec, Rails, ServerSpec, Chef...etc). I would like to hear somebody address why Racket is superior to languages like Ruby for creating DSLs, because it for sure doesn't stand alone. Metaprogramming is a feature in a LOT of languages. I'm not arguing for…
Why Language-Oriented Programming? Why Racket?
111–115 of 115 posts
Re: Why Language-Oriented Programming? Why Racket?
#112I'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.
https://docs.racket-lang.org/scribble/getting-started.html
But there's also stuff like:
http://docs.racket-lang.org/sweet/index.html
And after a quick Google I found:
https://github.com/soegaard/minipascal
And there are of course things like:
https://docs.racket-lang.org/datalog/datalog.html
But I suppose that qualifiés as "lisp like"...
[ed: and the article mentions "brag" which I think would be odd to call "lisp like" : https://docs.racket-lang.org/datalog/datalog.html ]
Re: Why Language-Oriented Programming? Why Racket?
#113Earlier quoted context omitted.
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.
>why not simply define functions in the language rather than using the macro system? I don't know. Most examples I've seen from people extolling the virtues of lisp macros and metaprogramming wind up just generating more lisp code in the same language with the same syntax and semantics, so I don't know why you couldn't just use functions in that case. To be fair, I only have a surface understanding of one lisp varian…
So given an and() function, you can't safely do "and(False, fire_missiles())", because the language will evaluate both arguments.
But an and!() macro could: macro expansion is essentially "lazy", in that it happens prior to the evaluation phase, so it can avoid evaluating any pieces of code it wants to, such that "and!(False, fire_missiles());" is perfectly safe, because our macro can stop expanding after "False" and thus fire_missiles() is never evaluated.
Incidentally, this is why at least some macro patterns are unnecessary in lazy languages like Haskell: you can write short-circuiting and() as a function there, because a function in Haskell only evaluates as much as is necessary (provided it's been written properly). Yet even there, Haskell still has support for macros and things like TemplateHaskell and so forth, because there's just some things you can't do solely with functions, like arbitrary syntax, language extensions, etc.
Re: Why Language-Oriented Programming? Why Racket?
#114I hear this alot about Racket as if this is the value proposition and Racket stands alone with these features. Languages like Ruby are routinely used to build DSLs (RSpec, Rails, ServerSpec, Chef...etc). I would like to hear somebody address why Racket is superior to languages like Ruby for creating DSLs, because it for sure doesn't stand alone. Metaprogramming is a feature in a LOT of languages. I'm not arguing for…
To address the examples you gave, RSpec, Chef, etc., those literally ARE just using Ruby, no new syntax, no new semantics.
[0] https://www.quora.com/What-is-an-embedded-domain-specific-la...
Re: Why Language-Oriented Programming? Why Racket?
#115Earlier quoted context omitted.
My guess is that you’re seeing popularity based selection bias at work: languages with more common features are easier to understand and gain popularity faster than truly bizarre and unique languages which are confusing to newcomers. These popular languages end up being the ones you see every day. I bet a true random sample of programming languages would be a lot weirder.
I'd love to see some examples.
50 programming languages of the last 50 years, illustrated in 50 minutes. It includes all the popular languages, but also covers some truly weird ones.