152 points · by nickmain · 11y ago · 49 comments
Also, the Manifesto and Racket's documentation (and HtDP) are written in Scribble[2], another language built with Racket.
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.
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.
Book has definitely improved my coding.
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.
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/) 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.
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 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.
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/py...
ClojureScript is pretty sophisticated since it is considered production ready for commercial work and leverages much of Clojure's ongoing library development directly.
https://github.com/clojure/clojurescript/wiki
Not to take anything away from Pyret.
Just to be clear, the flip side of Racket's 20 years of work is it is _very sophisticated_. Pyret has nowhere near the same sophistication.
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?
(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?
The easiest way to understand this in action is to read about Danny Yoo's Brainfuck embedding in Racket: https://www.hashcollision.org/brainfudge/
===PLACES===
---desert---
"You're in a desert."
[cactus, key]
north start
south desert
http://queue.acm.org/detail.cfm?id=2068896