
@ben I think arrow
is a great name =) — this is sort of a silly bias I have, but when we were using arr
everywhere in Typed Racket (that used to be the name of the struct) in conversation and all over the code base you would see references to them as “arity” or similar. when I called them an “arity” Sam got annoyed and corrected me that it was “arrow” — I appreciated the correction, and wanted us to avoid the confusion in the future, so I’ve been trying to avoid arr
. This is probably just me being crazy and anal to some degree, TBH ¯_(ツ)_/¯

@notjack There’s no peek operation on normal channels (and I think adding one is probably not a good idea, since they’re intended for synchronous, atomic exchange). Asynch channels don’t currently provide a peek operation, but I see no particular obstacle to adding it.

There isn’t a separate TR version, though

David Christiansen (sadly not on slack) has been working on a tool for this recently


That’s something I’ve wanted for a long time. Thanks, @pnwamk

@jaz me too! happy to be the one to add it! (it was pretty easy, all the hooks for such a customization already existed in the framework, thankfully. thank you all who helped design it that way!)

@robby OMG Robby….best…email…ever. :smile:

(The one you sent about the v6.11 release.)

(regexp-replace*
#rx" now"
"DrRacket's Program Countour is now significantly more efficient;
using it now no longer hurts DrRacket's interactivity now"
"")

:slightly_smiling_face:

I have a lot of trouble removing the “now”s on my own……

edit: I’d like to see there’s a typed/pict
and “readable” versions of its types for pict functions

There should be a note that typed/pict
exists in the docs where it lists other libraries provided with Typed Racket

Hey All,
I’m a frontend web developer and somewhat new to computer programming. Wanted to see if I could get some recommendations as to a systematic approach. I recently started the HtDP book and planned moving to the SICP book after that.
If anyone has any recommendations for books or resources for learning programming through Racket, I’d love to hear about it. I also have the Realm of Racket book coming soon.
Thanks! Dustin

@ed has joined the channel

@dustin, I can give you an anti-recommendation: I believe SICP might be a good tenth book for a person somewhat new to computer programming, but not a second. The style of code in it is dated, and it talks about domains far removed from most people’s interests (for example, calculus). We have more accessible resources, including Realm of Racket and Beautiful Racket.

Has anyone else noticed that the latest version of the acmart template (the one @mflatt updated to a while back), has an ugly footnote on the first page?


I mean, it does appear to be part of the standard distribution (as shown from the sample), but it just looks gross.

Specifically:

I don’t see any footnotes there

@samth : > Authors’ addresses: Gang Zhou, College of William and Mary, 104 Jamestown Rd, Williamsburg, VA, 23185, USA, ; Valerie Béranger, Inria Paris-Rocquencourt, Rocquencourt, France, ; Aparna Patel, Rajiv GandhiUniversity, Rono-Hills, Doimukh, Arunachal Pradesh, India, ; Huifen Chan, Tsinghua University,30 Shuangqing Rd, Haidian Qu, Beijing Shi, China, ; Ting Yan, Eaton Innovation Center, Prague,Czech Republic, ; Tian He, University of Virginia, School of Engineering, Charlottesville, VA, 22903,USA, University of Minnesota, USA, ; Chengdu Huang; John A. Stankovic; Tarek F. Abdelzaher, Universityof Virginia, School of Engineering, Charlottesville, VA, 22903, USA.

Right above the copyright notice.

Not sure I would call that a footnote, but sure

and yes, that’s part of the template

Okay, what would you call it?

not sure (I would say that a footnote has a reference from the main text, like the footnote on p2 of that sample)

You could certainly complain to the PACM people about it

Fair

I just said footnote because (a) I didn’t have a better name for it and (b), I’ve seen people do that sort of thing accept just attached to the title.

Anyway, thanks.

@leafac I think you’re probably right on that, and I did wonder about it being a tad dated. I’ll instead move to Realm of Racket and at some point Beautiful Racket. I didn’t realize it taught programming is such a way, thanks!
My other thought (eventually) was Software Foundations:
http://softwarefoundations.cis.upenn.edu\|softwarefoundations.cis.upenn.edu

@dustin I would recommend against that.

(Using software foundations)

Its a great way to get into theorem provers (or at least coq)

But for generic programming, I suspect it won’t be as relevant.

But I could always be wrong. :slightly_smiling_face:

Okay, thanks! Perhaps I should instead do more hands-on exercises and explore the documentation. The thing I found most attractive about Racket was the documentation. Thanks again.

@dustin I’m not sure it’s a great second book, but The New Turing Omnibus will introduce you to a lot of concepts in Computing. It won’t teach you Racket though, if that’s your goal.

My goal is to explore Racket for a while (who knows where that might go) and possibly learn Rust and Haskell later on. I’ll check that out, thanks!

Is it possible to build a library that provides modules for both Racket and Typed Racket without writing the code twice? Any examples of this being done in the wild?

@royall It’s not clear to me what you’re asking. Typed Racket modules can be required in Racket code, and untyped Racket modules’ definitions can be used if an adaptor module (i.e. a module that declares the types for any desired definitions) is written. But I think you’re asking about something else — can you say more about what you’re trying to do?

@pnwamk @royall are you using contracts in the non-Typed Racket code?

I think the adapter module is exactly what I’m looking for

I just want to build a library that’s convenient for users of either #lang
without incurring any extra contract penalties

@royall i’m actually curious about this too — having not played around too much with Typed Racket

my (not so informed) understanding was that contracts provide most of the bridge necessary — but maybe that’s not accurate enough

My take on this is that “ideally” you simply write your thing using Typed Racket. That is automatically usable by dynamic typed plain Racket, because it generates contracts. If you find the performance is fine, this is the simplest way to go.

There was also some discussion on the mailing list

I watched this a few days ago and found it pretty enlightening https://www.youtube.com/watch?v=mtR3NupaRAQ


That was about using submodules to expose alternate interfaces

(I have the full thread in Gmail but can’t figure out how to link you to it in GGroups) ¯_(ツ)_/¯

there’s usually a “link” button somewhere. the interface to google groups is …. not very usable.

but, awesome! I think I got it backwards. Write Typed Racket, get contracts for free for untyped Racket

Yep. I mean, you might find it too slow. But maybe not. If you like “make it correct, then make it fast” approach, that’s probably the way to go?

Yeah, I think that’s the right way to do things

Oh, circa May 2015 is when it switched to using Google Groups instead of the old list server. That explains why GGroups didn’t have the start of that thread. :grin:


I’m trying to just read
in the contents of a Racket file using (read (open-input-file "Desktop/foo/foo.rkt"))

getting error read: #lang not enabled in the current context
— am I doing something silly here?

(I was hoping to just get the datum, e.g. '#lang
(the keyword))

(parameterize ([read-accept-lang #t]) ...)
, maybe?

hm, that didn’t seem to work.

read-accept-reader
did, but you don’t get a '#lang
datum; instead, you get a (module ...)
for the whole file.

I’m not wanting to do anything fancy (I don’t think) — just read over the file’s sexps as lists

@pnwamk #lang
isn’t a keyword like #:lang
, so you can’t read
just #lang

try with-module-reading-parameterization
? http://docs.racket-lang.org/syntax/module-helpers.html#%28def._%28%28lib._syntax%2Fmodread..rkt%29._with-module-reading-parameterization%29%29

aaaah, duh — thanks @mflatt. that’s unfortunate for my simple, silly approach to skimming the file contents as a bunch of lists =(

I haven’t tried it, but you might be able to use read-language
to discard the #lang
line and then read the rest of the content (on the assumption that the rest is in S-expression form).

yeah, that works

there’s not a one-liner that will clone/download all the source code from pkgs.racket-lang.org… is there?

raco pkg catalog-archive
I think

or at least I’m pretty sure theres a raco pkg catalog-*
command that does it

thanks, @notjack! raco pkg catalog-archive
was the trick!

I’m mainly using Racket to learn how to program, but does anyone know if there are many jobs using Racket? I realize it was renamed from Scheme, but it seems difficult to judge based on that. Thanks.

@dustin There are more academic users of Racket than there are industrial ones, but I would say Racket has more industrial users than most other schemes and lisps. Only other lispy langs I know of with comparable industry use are common lisp and clojure (both of which have vastly more industry use than racket as far as I know)

That’s sort of what I was thinking. Thanks!

what sort of domain were you looking to use racket in?

(I ask because I want to make racket better for use in backend web dev myself)

I’m trying to stick with the web side of things as well. Came across this book which was interesting: http://serverracket.com/

Only a month and a half (I think) until it comes out :D

I don’t know why, but I really enjoy the syntax and feel of Racket and Haskell over other C-like languages or JS.

if you like both Racket and Haskell, you might be interested in the Hackett language / project

Oh, for sure! I’m already checking that one out. Seems like the two make for an outstanding pair.

I think it essentially brings Racket’s macros and keeps most of the syntax of Haskell?

it uses Racket syntax and is built on Racket’s VM, macro system, and module system via #lang

but the semantics are pretty much haskell 98

the exception is it has define-syntax
and you can make macros that interact with type information

Sounds very cool.

it is indeed incredibly cool

I spent a ton of time last night figuring out how to put Racket’s location in my $PATH
on a Mac. Turns out there’s more than one way to do it. I think my mistake was relying on a command instead if simply restarting Terminal. Felt like a success even though it was a small achievement!

$PATH
frustrates me in general

Thought it was only me..

something I really like about racket (and other langs that do this) is that after you add racket’s location to $PATH
, packages can put stuff in there so you can install packages that give you command line tools without messing around with $PATH

Right, that was another reason I looked at Racket; things seem to just work.


I’ve heard good things :)

I’m trying to read through a large number of files with this script:


I used 30GB of swap space doing so…

I’m calling close-input-port
at the end of processing each file…

each file is relatively small I assume?

yah

well… all the racket files from the package server…

ah gotcha

but they’re racket source files — I imagine none are too big


if you don’t call search-sexp!
do you still get huge memory consumption?

let me try…

okay yah that seemed to fix it — I bet I’ve got an embarrassing infinite loop in that function

thanks again @notjack! :smiley:

glad to help :D although I have no idea why your sexp function would be consuming tons of memory

me neither… more digging! :smiley:

testing this with custodian-limit-memory
might be interesting

I prefer to live on the edge of my seat — wondering if OS X will just freeze up and die

XD

that works too

@pnwamk try changing with-handlers
to with-handlers*

@jaz if the try-read
call isn’t recursive, would the tail call benefits of with-handlers*
matter?

oh, yeah, I ~think I~ definitely misread that. sorry!

I added a sleep to the for loop (a tenth of a second) and things are okay so far… =)

hah! it’s because one of the files has a cyclic data structure in it that my code just keeps diving into XD

didn’t think I’d have to add cycle detection when reading source code contents, hahaha