6 ms·
The best CS course I took was "Designing Functional Programs", an introductory course at Waterloo. Haskell is used as the pseudo-code for lectures while assign
by r0naa 11y ago
The best CS course I took was "Designing Functional Programs", an introductory course at Waterloo.
Haskell is used as the pseudo-code for lectures while assignments are written in Racket.
The course was great because the professor (PR) was:
1- Passionate
2- Knowledgeable
3- A kind person
I have found Racket to be a very effective way to make students (most of them have either no CS background or only have played around with imperative/OOP languages) more comfortable with functional programming.
The best memory I have was during the first lecture. After all the administrative fluff, the prof open his pdf and the first slide reads: "Induction"
I remember thinking "Is this a maths or a CS course?"
The second slide defined the set of natural numbers. As the prof start explaining the syntax and its meaning, I slowly start to realize the beauty of those few words:
Data Nat = Z | S Nat
where Z represent 0 and S the successor function.
We define the data type "Nat" to be either zero or the successor function applied to a "Nat".
It was my "ahah" moment. I was mind-blown by the language's clear syntax and immensely powerful semantics. (This is Haskell not Scheme/Racket).
We would later be introduced to lambda calculus (untyped vs typed), infinite data structures, interpreters etc... It was glorious... What a great professor.
The only "downside" to this is that Racket/Scheme isn't very much used outside of Academia. Which is clearly a shame given its incredible built-in features and elegant LISP-like syntax.
Should anyone have insights/opinions on why Racket/Scheme aren't more used, please feel free to share them with us!
- cpach 11y agoI think one thing is libraries. E.g. Python or Java has way more libraries for all kinds of stuff.
- r0naa 11y agoI imagine that at some point Python lacked libraries as well right? What motivated the first developers to make libraries for Python? I wonder what are the dynamics that makes a programming language popular over another, also what factors come into play?
- zorked 11y agoLanguage popularity generally follows adoption of some key library or framework from that language. Python is probably an exception there because it got popular despite the lack of a clear reason (I would argue it was there to fill the vacuum left by Perl). But Rails is what brought Ruby into the mainstream, and C was brought to the mainstream by Unix, and JavaScript was brought to the mainstream by Netscape, and so on. Lisp never became mainstream because nobody ever wrote a killer app/library/framework/OS in that language. The most popular flavor of Lisp today, Clojure, managed to carve a niche for itself because its community is so practical-minded and has been working on very practical stuff like Om, Storm, Reagent, etc. Hopefully they will find their own killer app one day.
- nostrademons 11y agoEmacs brought Lisp mainstream, and Emacs Lisp at its heyday was arguably more popular than Clojure is now. The problem is that Emacs was the dominant text editor c. 1990, when the software world was much smaller than it is now, and has since been eclipsed by IDEs, GUI editors, etc.
- nextos 11y agoThat's right. But I think it's going through a little renaissance. Emacs 21-24 has happened in a remarkably short time. With the Internet, many programmers are looking for better paradigms and find Lisp & functional programming.
- _delirium 11y agoThere was a period when Lisp was pretty large in industry as well, especially at places like BBN and NASA. Depends on how you measure, of course; those kinds of places don't do things that have a lot of end users, but the projects are large measured in dollar terms.
- kika 11y agoAutoCAD brought Lisp mainstream for mechanical engineers, architects, and so many other 'rocket scientists' that I believe Emacs pales in comparison. I was programming AutoLisp (automatic correction of trace and drill patterns for PCBs) on the machine which wasn't even able to build a decent Emacs in reasonable amount of time (PC AT/286 12Mhz with 2MB memory :-)). I was able to build myself an Emacs only after I got upgraded to 386SX 16Mhz with the whopping 4MB of RAM.
- jarcane 11y agoRacket has an enormous standard library. I'm not gonna dare wave numbers around compared to Python, and I'm sure Java beats the both of them, but it's not small.
- seanmcdirmid 11y agoNot only that, but much of the extended library is incredibly well designed and very innovated (like SlideShow).
- kaeluka 11y agojust checked this out, this is the tool I wanted to build. Thanks!
- keenerd 11y agoI packaged Racket 6.2 yesterday, I'll wave some numbers. * Python install: 89MB * Racket install: 417MB But 190MB of Racket is documentation, and a non-trivial amount goes to the DrRacket IDE.
- soegaard 11y agoNote that Racket now have several distributions. The minimal distribution intended for servers is less than 10MB (then install the libraries you need). http://download.racket-lang.org/ http://download.racket-lang.org/
- technomancy 11y ago"Not enough libraries" is usually not a complaint about the standard library but about "if I need to do $SLIGHTLY_WEIRD_PROTOCOL, will I have to write it from scratch?" Racket has made strides on this in recent years but still lags far behind Python or the JVM.
- jarcane 11y agoTrue. There are a fair few packages in raco, but I think Chicken's eggs[1] may be a better bet for 3rd-party support just yet. [1] http://wiki.call-cc.org/chicken-projects/egg-index-4.html http://wiki.call-cc.org/chicken-projects/egg-index-4.html
- codygman 11y agoRe: why racket isn't used more Last time I did some json parsing it was poetry slow. I've also heard the continuation based webserver was slow and uses a lot of memory. I'll have to benchmark again to be sure. I hope I'm wrong, racket was very enjoyable to use.
- drcode 11y agoGiven how passionately John Carmack posts about Racket development in his twitter feed, I suspect most of these performance issues can be overcome with more experience.
- truncate 11y agoJust wanted to add that you don't have to use continuations as such. I don't have any benchmarks on stateless web server, so can't say about its performance.
- soegaard 11y agoThere is a simple solution: Don't use continuation. Write your web-app in the same way you would in Python or similar. See "Low-level web programming in Racket + a wiki in 500 lines" by Matt Might: http://matt.might.net/articles/low-level-web-in-racket/ http://matt.might.net/articles/low-level-web-in-racket/
- codygman 11y agoI saw this and it made me very happy. I was going to mention it in my original comment but I couldn't remember the link. I'm going to put this in my "tutorial TODO" list, it looks like a lot of fun! Thanks :)
- e12e 11y ago> Should anyone have insights/opinions on why Racket/Scheme aren't more used, please feel free to share them with us! Well, I'm not sure what happened to Arc, but I thought that was based off of plt-scheme/racket -- but never ported to recent releases. Which is a shame because racket has certainly improved a lot (possibly not in ways that matter for Arc). Does anyone know why/what the status is there? Additionally, while some(?) older(?) versions of hn is open source[1], being based off a dead(?) dialect of an outdated(?) scheme didn't really help. Other than that, running a really popular niche web site/forum in production should make Arc interesting, which in turn should make racket interesting. But that apparently didn't happen. Anyone know what hn currently runs (the stack - is it essentially an updated version of[1] -- or something entirely different)? Other than that recent example of not becoming popular, I think that the focus on education has lead a lot of people to miss how good racket actually is, out of the box. It does seem to me to have some of the same challenges as other lisps when it comes to deployment -- it's not all that easy to see how to easily tag something for release, run it through CI and deploy it with some predictable success. Not really any technical limitation, more that it's just not obvious. And wasn't something that was highlighted by racket before, at least. [1] https://github.com/wting/hackernews https://github.com/wting/hackernews
- soegaard 11y agoThe community version of Arc is called Anarki. It runs on new versions of Racket. https://github.com/arclanguage/anarki https://github.com/arclanguage/anarki
- e12e 11y agoThank you for the reminder -- I had found that at some point, the forgot about it. For other's wondering, a version of hn lives in the lib-folder (news.arc).
- soegaard 11y ago> Should anyone have insights/opinions on why Racket/Scheme aren't more used, please feel free to share them with us! The Racket community has grown the last 5 years, so I would say that Racket is used more.
- norbornyl 11y agoHail Dave Tompkins.