[HN Gopher] Racket 8.1
___________________________________________________________________
Racket 8.1
Author : lycopodiopsida
Score : 151 points
Date : 2021-05-07 09:00 UTC (14 hours ago)
(HTM) web link (blog.racket-lang.org)
(TXT) w3m dump (blog.racket-lang.org)
| tym0 wrote:
| Is there good library support for typed-racket?
| rscho wrote:
| You can use any Racket lib, with the caveat that importing from
| an untyped lib requires the user to state the type.
| tym0 wrote:
| So it doesn't infer types for libraries not marked as `#lang
| typed/racket`? You need to write your own types like you
| would using a Javascript library from Typescript?
|
| Edit: Found the relevant part of the docs[1], I like the
| automatic contract enforcement, although I guess it would be
| kinda hard to guess the perf impact...
|
| [1] https://docs.racket-lang.org/ts-guide/typed-untyped-
| interact...
| xfer wrote:
| Yes typed racket works the same as typescript. But it's an
| earlier work. Typescript probably took inspirations from it
| along with others.
|
| Typed-racket has some form of refinement types now as well.
| bjoli wrote:
| With the caveat that typed racket does not have any
| unsound corners of the type system, not even for comfort.
| Decabytes wrote:
| While I don't work with Racket much now, I will be eternally
| grateful for the concepts it taught, functional programming,
| recursion through the little schemer, how to design programs and
| break them up into small chunks, and writing tests. Gradual
| typing allowed me to make my programs more robust, and the type
| checking built into typed Racket helped catch errors without
| having to run a separate utility like mypy.
|
| The community isn't the largest, but you can still get an answer
| to the questions that you have, and having a GUI built in the
| standard library (which is rare amongst Schemes) allowed me to do
| some pretty cool things like implement Conways game of life
| https://gitlab.com/diegocrespo/conways-game-of-life/-/tree/m....
| imiric wrote:
| I've been keeping an eye on Racket for a few years now, and
| recently gave their documentation tool Scribble[1] a try, as an
| alternative to writing LaTeX directly. But honestly I found the
| experience difficult if you need some custom behavior, and
| falling back to Racket was very confusing as a relative newcomer
| to Lisp (with mostly Elisp experience). It doesn't help that
| their documentation, while detailed, is not very beginner
| friendly. So I went back to org-mode for exporting to PDF via
| LaTeX.
|
| Congrats on the release!
|
| [1]: https://docs.racket-lang.org/scribble/
| zelphirkalt wrote:
| I gave up creating anything with scribble or pollen, not sure
| which one it was, when I had the nagging urge to change the
| font and could not figure out how to do that. Composing
| different parts of the document was OK, but I simply could not
| find anything about changing the font. I am sure, if I had
| asked, I would have gotten an answer, but in that moment, it
| killed my motivation to get into it further.
| velcrovan wrote:
| Probably Scribble, which is pretty opinionated. Pollen
| basically gives you tools to design your own markup and makes
| no assumptions about the published result.
| retzkek wrote:
| Pollen [1] is pretty neat, it's amazing what Matthew Butterick
| has done with it to create his books. _Beautiful Racket_ [2]
| truly is beautiful and inspiring.
|
| [1] https://docs.racket-lang.org/pollen/
|
| [2]: https://beautifulracket.com/
| imiric wrote:
| You're not kidding, that's probably the most beautiful book
| in HTML I've ever seen. The typography is gorgeous, the
| navigation is intuitive and easy to use, downloadable code
| samples, links for every paragraph with a feedback form (!),
| and the writing style is clear and approachable.
|
| It's definitely on my to-read list. Thanks for sharing!
| afranchuk wrote:
| I did the exact same thing, trying for a better LaTeX. But my
| experience was different: I found it very easy to customize and
| programmatically generate content. However, I have used Racket
| and lisps/schemes before, so that is likely the difference. I
| encourage you to try programming with Racket outside of
| Scribble to get a better handle on it!
| smnrchrds wrote:
| For me, Racket will always be the language used to create the
| best programming pun of all times:
|
| > Write your next Ethereum Contract in Pyramid Scheme
|
| > I create Pyramid: A dialect of the Scheme programming language
| that targets the Ethereum Virtual Machine(EVM). Pyramid Scheme is
| implemented using the appropriately-named Racket.
|
| http://www.michaelburge.us/2017/11/28/write-your-next-ethere...
| captaincaveman wrote:
| Nicely done sir!
| smnrchrds wrote:
| Just to clarify, it's not my project.
| yewenjie wrote:
| I think Racket is the only modern lisp which has a sufficiently
| large community. What, if any, do you think should be the
| flagship project for introducing Racket?
| forgotpwd16 wrote:
| Interestingly you're writing this on a forum which runs on (or
| used to run?) on Racket. HN was written in Arc[0] which was
| implemented atop Racket[1]. And that's a good example case of
| using Racket as it is proponent of _language-oriented
| programming_ [2].
|
| [0]: http://arclanguage.org
|
| [1]: http://arclanguage.org/install
|
| [2]: https://beautifulracket.com/appendix/why-lop-why-
| racket.html
| dermal wrote:
| Yes, this forum was implemented in Arc, atop of Racket. But
| the reason for that is because _Arc_ is great, not Racket.
| baldfat wrote:
| I don't think HN News uses Arc anymore. Also Arc is just a
| language written with racket. Racket is a language for
| making languages.
| dang wrote:
| https://news.ycombinator.com/item?id=23483715
| gus_massa wrote:
| Arc has many design decisions that are different than
| Racket, so Arc reimplements a lot of parts.
| forgotpwd16 wrote:
| Writing a domain-specific language on Racket is kinda
| Racket's main selling point. If you don't trust me, you can
| trust the people who made Arc and HN. Afterall back in 2007
| you had other options. Some of them vastly popular even now
| (Rails, Django, PHP, Scala, ...).
| rataata_jr wrote:
| I really like Guile
| bjoli wrote:
| So do I. However, whenever I think of changes I would like to
| do to guile I end up with a language a lot closer to
| racket... Immutable pairs, immutable hash tables, immutable
| strings (which racket has not), user extensible pattern
| matching and a proper looping facility (preferrablymore
| powerful than rackets).
|
| Add to that some better facilities for mixing languages and
| it is a very nice language that is very close to racket. Yet
| for some reason I find guile more fun.
| gus_massa wrote:
| Nitpicking:
|
| > _immutable strings (which racket has not)_
|
| The reader makes strings in the sour code immutable by
| default. And if you have a mutable string you can use
| string->immutable-string https://docs.racket-
| lang.org/reference/strings.html#%28def._...
| Decabytes wrote:
| Christopher Lemmer Webber has some really great talks about
| Racket and Guile. Guile certainly does a lot better on the
| interactive programming front
| spdegabrielle wrote:
| So many things have been made in Racket you would have specify
| the sort of thing you were after.
|
| Maybe web services? https://youtu.be/ZvwE6_MMJjM
| wa1987 wrote:
| There's Clojure too.
| polytely wrote:
| I'm not really a racket user (more of an admirer) but every
| time I see an online book created in Pollen it looks amazing.
|
| https://docs.racket-lang.org/pollen/
| alessivs wrote:
| Pollen is just a very extensible and composable slate for you
| to compose content. Under the hood, Pollen may be equivalent
| to the Scribble language without the fixed export structures
| and styles.
|
| That the outputs look very good may be correlated with the
| author and other prominent users caring for typography and
| web delivery.
|
| As-is, my impression is that generation of multiple pages
| seems slower than scribble/manual, but the community has been
| exploring use of databases to speed up caches. In this
| respect, I've been eyeing the work of this member in
| particular: https://github.com/otherjoel
|
| All this speaks very good of the seemingly limitless
| flexibility of the Racket ecosystem.
| dermal wrote:
| There are some very valid reasons [1] why we should stay away
| from Racket: toxic community, toxic people... And come on: no
| one has ever really used Racket to write some decent nontrivial
| web application, documentation is awful (and, please, don't
| count HN here, cause HN is written in Arc).
|
| [1] https://www.youtube.com/watch?v=_wY7FBtr7_c
| tdsamardzhiev wrote:
| I remember a time when people could take being called a
| "doofus" without starting a smear campaign.
| notriskfree wrote:
| You doofus.
| GavinMcG wrote:
| Racket's documentation isn't something I've _ever_ heard
| criticized. It 's extensive, well-written, and even has
| various formats for users at different levels of familiarity.
| I don't think I've run into another language whose
| documentation gave me as much confidence.
| borodi wrote:
| I would say that racket has one of the best tutorials ever
| made for any language. Specially with the reduced versions
| inside DrRacket. Also some books like How to Design
| Programs.
| baldfat wrote:
| How to Design Programs is maybe my all time favorite
| programming book. BUT it is incredibly dense and you
| can't go to it for your first book. Realms of Racket is a
| good one though.
| dermal wrote:
| Ok, GavinMcG, just try to write web application in racket,
| based on official documentation. I assure you that nothing
| will be clear to you, huge questions will just fly over
| your head, and if you then ask for help on the Racket
| group, the people there will make fun of you. Been there,
| done that! Believe me.
| dang wrote:
| Could you please stop creating accounts to post like this? I
| realize you have some strong opinions about Racket. I have no
| doubt that there is some truth in there. But what you're
| doing here is absolutely not what this forum is supposed to
| be for, and you're hurting it. If you would please stop, we'd
| be grateful.
|
| https://news.ycombinator.com/newsguidelines.html
| rscho wrote:
| Hey, you're improving! You actually modified your spiel
| instead of only copy/pasting the last iteration of your smear
| campaign like last time. Way to go :D
|
| PS : what happened to the "you can't make a web app in
| Racket" part?
| ashton314 wrote:
| Lol. Who is this person you're replying to, and can we get
| them banned for being a troll?
|
| I really don't know what this guy's talking about in other
| comments. Web apps seem super easy to put together in
| Racket. For those curious, see:
|
| https://docs.racket-lang.org/web-server/index.html
|
| https://docs.racket-lang.org/continue/index.html
|
| (The troll also acknowledges that Arc is a neat language--
| apparently, they think that racket is a terrible language
| to write bad applications, but I guess it's good enough to
| write a language to write good web applications in!)
|
| (I have heard a Racket described as the "second best
| programming language, the best programming language is the
| one you use Racket to build!)
| nickpeterson wrote:
| I watched this video (skimmed), it seems like the creator had
| a few incidents involving people in the racket community. I'm
| not a racket community participant or racket user, but every
| community has these issues. Honestly this feels like a really
| weird ax to grind against racket?
| lukego wrote:
| He's talking in measured terms about his own personal
| experience on his own personal vlog. It was probably
| cathartic for him (and for other people too.) No big deal.
| GavinMcG wrote:
| I watched the whole video.
|
| He acknowledged that Racket has excellent documentation, a
| wide-ranging toolset, etc. All the good stuff you've heard
| elsewhere.
|
| He criticizes the language-oriented model (in comparison to
| languages that people are familiar with but that allow
| embedded Deals, like Lua or Ruby) because creating a new DSL
| is antithetical to code that communicates with other
| programmers. This is fair, and a common criticism of Lisps:
| the complete freedom of the macro system means that
| individual programmers can create their own dialects quite
| easily, and other users of that code have a harder time
| working with it than in languages where there's not as much
| metaprogramming.
|
| On the "toxic" front, one of the core team apparently asked a
| waitress a cringy question about higher education, referred
| to some other educators (at the creator's institution) as
| doofuses and the like, and was arrogant.
|
| And at the end of it all, though he doesn't see a use for
| Racket's language-oriented model, he recommends learning and
| using it.
| protomyth wrote:
| _because creating a new DSL is antithetical to code that
| communicates with other programmers._
|
| DSLs communicate wonderfully with the business users paying
| for the program. It also allows a programmer to match the
| jargon / industry speak used by the users.
| Bootvis wrote:
| Do you have an example of such a DSL? I like the idea but
| I myself can't come up with a tool that implements it
| well.
| blacktriangle wrote:
| Not Racked based, but I'd say Cucumber/Gherkin. Yes it is
| absolutely overkill for small teams, but if you have a
| dedicated person who is not really a programmer but who
| is managing requirements between the developers and the
| stakeholders, Cucumber is amazing in that scenario.
| protomyth wrote:
| The ones I know of are locked in corporate IT
| departments, but Zed Shaw in his "The ACL is Dead"
| talk[1] from 2008 describes the use of one in relation to
| permissions on documents with rules specified in the DSL.
|
| 1) https://vimeo.com/2723800
| hashkb wrote:
| Rails routes. ActiveRecord. RSpec
| lukego wrote:
| Design rules in CAD software?
|
| I know that Cadence's ASIC design tools are based on a
| custom Lisp dialect. I've seen a presentation at a Lisp
| conference from an architect who was representing myriad
| building regulations as Lisp expressions e.g. minimum
| clearance between toilet and bathroom door. There was
| another presentation about Lisp software for simulating
| aircraft engine performance based on various input
| parameters.
|
| I don't know how close these applications are to Racket's
| ideal but I imagine they're somewhere on that spectrum.
| dagw wrote:
| _I 've seen a presentation at a Lisp conference from an
| architect_
|
| If you start talking to older architects and civil
| engineers who where active in the early to mid 90s,
| you'll be surprised how many of them know (or at least
| knew) Lisp.
| alessivs wrote:
| > On the "toxic" front, one of the core team apparently ...
| was arrogant.
|
| An ingredient that may contribute to judgment of this video
| testimony, is that the same person that describes this
| toxic environment accuses someone providing a different
| personal impression of the community of engaging in "micro-
| agression" in the video comments.
| [deleted]
| barrenko wrote:
| Got a couple of questions - what's that IDE like, and how's
| Racket compared to Clojure?
|
| I'm a newb to the paradigm, but fiding it useful to understand
| Javascript better.
|
| Thanks.
| gus_massa wrote:
| Here is an screenshot of the IDE and more info
| https://docs.racket-lang.org/drracket/interface-essentials.h...
| It includes syntax highlight (that is difficult because you can
| add your own syntax), online help, debugging, debugging of
| macros (that are the way to add your own syntax).
| forgotpwd16 wrote:
| If anyone missed it, Racket has finally (it has been planned and
| worked for few years now) moved by default to Chez Scheme (ie
| Racket CS) on v8.0 (Feb 2021) which has improved in most cases
| performance.
| dermal wrote:
| Yes, and now, after three year and countless hour spent the new
| version (RacketCS) is running slower than the old one!
| Congratulations to Racket development team - well done! :)
| forgotpwd16 wrote:
| Benchmarks beg to differ: https://blog.racket-
| lang.org/2021/01/racket-status.html. But those may be (being
| the official ones) biased, so a third-party running them will
| be nice. Also performance wasn't the only reason.
| Maintainability and easier development were as well, which
| for language like Racket, I believe, are more important.
| gus_massa wrote:
| I agree.
|
| IIRC the benchmarks is the union of few benchmarks sets
| that were floating around, like some usual benchmarks for
| Scheme implementations [1] and old versions of the The
| Computer Language Benchmarks Game [2]
|
| In particular you can see the comparison of "Racket" (aka
| Racket CS) and "Racket BC" with the current version of the
| The Computer Language Benchmarks Game in
| https://benchmarksgame-
| team.pages.debian.net/benchmarksgame/...
|
| (The set of problems and measurements of runtime are made
| by someone that is not in the Racket team.)
|
| [1] That are somewhat bad for Racket because some of them
| use mutable pairs/cons.
|
| [2] They are frozen to test backward compatibility and to
| ensure any progress is due to improvements in the compiler.
| notriskfree wrote:
| I think the aim was more for supportability. I assume if you
| enjoy Scheme; you would like to write more of your language in
| Scheme and less of it in C. Although that is somewhat
| contradicted by the plans to create a new syntax for Racket
| going forward. Chez Scheme by itself seems to be extremely
| fast.
| stewbrew wrote:
| Is there a demo for a racket app on Android?
| vascocosta wrote:
| As an imperative, stateful and even sometimes OOP developer,
| always finding functional programming very elegant but never
| really using it for real, Racket was the Lisp dialect that
| finally hooked me in.
|
| I think the reason was because it came with batteries included
| and I could create complex applications using only the standard
| library or very few packages.
| dermal wrote:
| Yes, you (potentialy) _can_ create complex applications in
| Racket. Bud did you? Of course, not. Nobody ever did. :)
| baldfat wrote:
| "Batteries Included" means it is super easy to turn it into an
| executable. This was why I switched from Python for my personal
| projects.
| hoppyhoppy2 wrote:
| Python has described itself as a "batteries included"
| language for many years -- Python was the language that
| popularized that term for describing programming languages.
| So I don't think your personal definition of that term (easy
| executables) is universal. Everything I can find online
| indicates that it refers to the wide capabilities of the
| language's standard library.
| neutronicus wrote:
| I don't think parent's definition of "batteries included"
| is as narrow as you're suggesting, and I also think yours
| is too narrow.
|
| It's a claim that the standard language distribution is
| sufficient to accomplish common goals of new users, without
| hunting down additional libraries or tools.
|
| As you say, the Python community coined the term, but their
| notion of its meaning perhaps slants a little too far
| towards their language distribution's strengths (standard
| library) and maybe suffers from lacunae towards their
| language distribution's weaknesses (a clearly-articulated
| way to create a GUI executable using the standard language
| distribution).
| vascocosta wrote:
| Python is still the language I use the most. Have you tried
| using the pyinstaller package to create executables? It's
| super easy.
| baldfat wrote:
| I had three worksites and I also had a few pet projects
| that would go on 100 computers. Python failed at every
| level (So did Haskell). I learned Racket just to improve my
| programming (It did) I then was like let's see how Racket
| works and it worked perfectly. I was able to deploy my
| programs and I never had an issue.
| Syzygies wrote:
| I scripted in C for the longest time, after thousands of
| lines it was in muscle memory, and I could reuse
| boilerplate. I was profoundly embarrassed to then discover
| Perl; I felt late to the party, like I'd thawed out of a
| glacier.
|
| Then Python, which stuck. I tried various lisps, Haskell,
| Ruby, Lua for scripting, and kept returning to Python.
|
| I realized Python was truly boring, and I needed scripting
| to be fun, to keep my interest up. I relearned Ruby. Ruby
| is fun.
|
| http://www.randomhacks.net/2005/12/03/why-ruby-is-an-
| accepta...
| beforeolives wrote:
| That's not what batteries included means.
|
| > The Python source distribution has long maintained the
| philosophy of "batteries included" -- having a rich and
| versatile standard library which is immediately available,
| without making the user download separate packages. This
| gives the Python language a head start in many projects.
|
| https://www.python.org/dev/peps/pep-0206/
| baldfat wrote:
| But compared to Racket Python is so much less of a tool
| when limited to standard library.
| nurspouse wrote:
| I know some Lisp/Scheme, but never really did any projects in
| it. What did you use to learn Racket (both the language and the
| ecosystem)? If I had to read a _single_ book /tutorial, what
| will give me the most bang for my time?
|
| I tried reading the official docs, but while they're great for
| reference, probably not the best in terms of
| tutorials/learning.
| hiq wrote:
| What do you use it for?
| gus_massa wrote:
| My latest project was: Get some emails using IMAP, login to
| my site, find and scrap some data related to the sender of
| the email, and send a reply using SMTP. The logic is not very
| complicated, it uses 4 or 5 of the standard libraries and I
| avoid writing a hundred emails per day.
| vascocosta wrote:
| Complex applications was probably an overstatement but I've
| created featureful IRC and Discord bots, a database
| management application and right now I'm creating a graphical
| browser for the Gemini protocol.
|
| All my other previous attempts at using functional languages,
| like for instance Haskell, ended up in trivial applications,
| usually based in numerical analysis.
| Y_Y wrote:
| I'd be interested to see this Gemini browser in Racket. Do
| you have a public repo?
| vascocosta wrote:
| It's in a very early stage, because I'm porting it from a
| previous Python code base, so it's not yet available.
| That said, I'll leave here two links for Racket software
| that inspire me.
|
| 1. Gemini server with tons of features, that I use
| personally:
|
| https://sr.ht/~rwv/dezhemini/
|
| 2. Graphical Gopher browser:
|
| https://github.com/erkin/gophwr
___________________________________________________________________
(page generated 2021-05-07 23:01 UTC)