62 ms·
The Racket Manifesto
- michaelsbradley 12y agoThe book How to Design Programs[1], with its "student languages", is an excellent example of how languages created with Racket can be used to achieve specific goals (or solve specific problems). In the book's case, the goal is to provide a programming environment for explaining and exploring a successively refined software design recipe. Also, the Manifesto and Racket's documentation (and HtDP) are written in Scribble[2], another language built with Racket. [1] http://www.ccs.neu.edu/home/matthias/HtDP2e/ http://www.ccs.neu.edu/home/matthias/HtDP2e/ [2] http://docs.racket-lang.org/scribble/ http://docs.racket-lang.org/scribble/
- 616c 12y agoAnd on that note, be sure to take a look at Pyret, another programming language designed by this group, to address some of these student-oriented programming issues. https://github.com/brownplt/pyret-lang/ https://github.com/brownplt/pyret-lang/ It is written all in JS (using Node) and can be completely run in a web browser apparently. I am not the first one here to mention it but it is very cool.
- klibertp 12y ago> It is written all in JS (using Node) and can be completely run in a web browser apparently. Wow, I didn't know this. I thought it's another "compiler frontend" for Racket - essentially just a parens-free syntax for people allergic to Lisps. Instead it's a standalone language with self-hosted compiler and JS based runtime, which is even more impressive. The features of Pyret make it the most advanced compile-to-JS language I know of. Built in unit testing and contracts, algebraic data types, pattern matching, optional typing, immutability by default - no other altjs language provides all of them at the same time (I think). It reminds me of Cobra (http://cobra-language.com/ http://cobra-language.com/) a bit. Does it support AST-based macros? That would go way beyond awesome :) It looks like Pyret is the result of some 20 years of work on PLT Scheme/Racket - most of the good and advanced parts of Racket but without any historic cruft. It's very impressive. I think it will need some time to mature, but I can totally see myself using it in production one day.
- 616c 12y ago> Wow, I didn't know this. I thought it's another "compiler frontend" for Racket - essentially just a parens-free syntax for people allergic to Lisps. Instead it's a standalone language with self-hosted compiler and JS based runtime, which is even more impressive. You know, I was really surprised too. I had just assumed it was another language compiled out with a Racket compiler like Arc or a specialized subset learning languages built into Racket, like one of the Schemes (I mean like the lang/rsr6 or lang/plai) that are a subset for study. Keep in mind though, after reading this article, I read the mailing list and it appears they just finishing up a functional CLI REPL. It could be fun, but they are still working on the basics of making it fun for neckbeards, who would prefer, by way of stereotype, their terminals and REPLs. At least that is what I am waiting for. https://groups.google.com/forum/?_escaped_fragment_=topic/pyret-discuss/dOLiVXtUdxQ#!topic/pyret-discuss/dOLiVXtUdxQ https://groups.google.com/forum/?_escaped_fragment_=topic/py...
- shriramkmurthi 12y agoThanks! Why don't you get on the announcement list (http://www.pyret.org/discuss/ http://www.pyret.org/discuss/) so you'll find out when the CLI is ready.
- jpolitz 12y ago(I'm a Pyret core designer/developer.) Pyret started its life as a #lang, which was delightful as a prototyping tool. The demands of running with reasonable performance in a browser led us to switch to a direct-to-JS approach, and we haven't looked back since. The original Pyret-to-JS compiler has been up and running for around a year now; we're still learning how to improve and tune its performance, but it's proven quite robust. No macros are planned, though it's not set in stone that they'll never happen. Just not a priority, and not something that Pyret's use in classrooms has caused huge demand for. Pyret does indeed have a number of Racket's good ideas in it (especially from the teaching languages, and especially with respect to testing), along with a few new ones. However, I'd like to temper the comment "most of the good and advanced parts of Racket..." A number of Racket's advanced features, for example #lang and powerful macros, the super-expressive class/mixin/trait system, and OS-level resource management, aren't things that Pyret handles right now, and won't come right away. Pyret's development will continue to be driven by classroom usage and curricular demands first, so it eschews, for example, the "everything should be in the language" part of Racket's manifesto. That's just a case of differing goals, which means that if you're, say, prototyping a new language from scratch, it will likely always be a safe bet to do it in Racket rather than in Pyret. (But if you're prototyping an algorithm over algebraic datatypes and want a web-based editor to try it out, just hop on over to https://code.pyret.org/editor https://code.pyret.org/editor and dive in.) As a note on where we're maturing to, Pyret will accommodate gradual typing to mix static and dynamic checking of annotations, which is an area of active development, and something that Typed Racket is pioneering. Another thing we're thinking hard about is native JavaScript interop, to bring the lovely libraries of the Web to Pyret programmers, without forcing beginners to grok the intricacies of JS and the browser's evaluation model.
- acjohnson55 12y agoI read about that a couple years ago when I saw it on the front page. It's a really beautiful language, and a lot of work seems to have gone into forgetting crufty patterns that don't serve newcomers to programming. It's a real breath of fresh air!
- muraiki 12y agoI can't praise HtDP enough (disclaimer: I've only done through chapter 4 of the first edition). Still, what I did was sufficient to fundamentally change me as a programmer. When I first began learning how to program I started off with Python using some courses on Udacity. But somehow I found HtDP (I think via HN) and it really taught me, well, how to design programs. It also made thinking functionally my default mode of thought. I remember hearing about FP and asking a friend experienced in FP "How do I think this way?" and he wasn't really sure how to answer. HtDP helped teach me that way and made it natural. The only criticism I can give of the first edition is that it was at times verbose, but it is clearly written as a textbook (and is definitely suitable for self-study). The second edition appears to be more streamlined. Something that might be more of a "dive into it" kind of book is "Realm of Racket," although it doesn't appear to go as deeply into Racket's language-making capabilities and lispy features like macros.
- shriramkmurthi 12y agoIndeed, the first edition is draggy at the beginning. The second edition is meant precisely to dive right in and get cracking, without sacrificing any principles. I recommend people read the second edition instead of the first one. [Why should you trust me? My name's on the cover. <-;]
- muraiki 12y agoThank you, that is good to know. Also, please know that I am sincerely grateful for all of your work. Without the software and materials that you and your team labored to create -- and which you provide freely -- I might not be a professional programmer today.
- shriramkmurthi 12y agoWow, thanks. I passed this remark on to the rest of the team. Totally made our day!
- xaritas 12y ago
- outworlder 12y agoThere's also Pollen: http://pkg-build.racket-lang.org/doc/pollen/ http://pkg-build.racket-lang.org/doc/pollen/
- shriramkmurthi 12y agoButterick is _awesome_. Thanks for calling this out!
- PaulRobinson 12y agoI sense the whole area of domain-specific languages is due for a belated renaissance. Everybody shirks away from it, but most languages are not very good for solving most problems and the standard libraries bloat out as more and more gets crammed in. I don't think in a commercial context we can all step back and say "to solve this problem, let's first design an appropriate language" but as a means to define the problem better, or to encapsulate learning we've made in building a prototype in a general language, it can be very powerful. If you aren't able to best describe the problem space, how do you intend to solve a problem within it?
- stcredzero 12y agoThe problem with Lisp-like DSL construction, is that the interface doesn't play well with many populations of domain experts. Even Smalltalk, with its syntax designed to be usable by children can fulfill the technical side of constructing DSLs easily, but still leaves something to be desired when it comes to domain expert use. (Various Smalltalks had their rough equivalent to #lang.) (I know there is at least one Ruby based DSL which made some inroads to mobile device software testing.) Basically, DSLs tend to only get used by experts who are already programmers or otherwise technically disposed. Maybe we're getting to the point where rudimentary coding is just going to be a new kind of literacy?
- shriramkmurthi 12y agoThis is a criticism of Lisp-based DSLs but not of Racket-based DSLs. Racket actively enables you to impose different, non-parenthetical surface syntaxes on the DSL. It is not a "this sort of works if you arrange it carefully _and nobody screws anything up_" thing like in Ruby, it really is an explicit language definition. The easiest way to understand this in action is to read about Danny Yoo's Brainfuck embedding in Racket: https://www.hashcollision.org/brainfudge/ https://www.hashcollision.org/brainfudge/
- muraiki 12y agoI really liked the following article, which creates a text adventure language in Racket that looks like this: ===PLACES=== ---desert--- "You're in a desert." [cactus, key] north start south desert http://queue.acm.org/detail.cfm?id=2068896 http://queue.acm.org/detail.cfm?id=2068896
- brudgers 12y agoA great podcast interview with Mathew Flatt, one of the core members of the Racket team. http://blog.cognitect.com/cognicast/061-matthew-flatt http://blog.cognitect.com/cognicast/061-matthew-flatt
- chiddysk 12y agoI agree with Page 1 alot. You can teach a kid to count in 1s and 0s, but that doesn't necessarily follow that you can teach him to code in machine language. Even the pros' have to use tools like hex representation to make machine language programming easier.
- peatmoss 12y agoFor some time, I've daydreamed about implementing R in Racket ("Arket"?) as a means of shining a flashlight in all the dark corners of my R knowledge. Then I realize this would take me a heap of time and it goes back to being a daydream.
- shriramkmurthi 12y agoLook at how we've structured the semantics of JavaScript, Python, etc. (E.g.: http://cs.brown.edu/~sk/Publications/Papers/Published/pclpk-s5-semantics/ http://cs.brown.edu/~sk/Publications/Papers/Published/pclpk-..., http://cs.brown.edu/~sk/Publications/Papers/Published/pmmwplck-python-full-monty/ http://cs.brown.edu/~sk/Publications/Papers/Published/pmmwpl..., http://cs.brown.edu/~sk/Publications/Papers/Published/gsk-essence-javascript/ http://cs.brown.edu/~sk/Publications/Papers/Published/gsk-es...). This is how you should go about creating a core of R, followed by an elaboration from the full language into the core. Steal an existing parser to get ASTs, then most of your time goes into desguaring.