pnwamk
2017-10-18 11:19:57

@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 ¯_(ツ)_/¯


mflatt
2017-10-18 13:00:00

@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.


samth
2017-10-18 13:13:01

There isn’t a separate TR version, though


samth
2017-10-18 13:13:51

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



jaz
2017-10-18 14:20:55

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


pnwamk
2017-10-18 14:21:43

@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!)


leif
2017-10-18 14:40:55

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


leif
2017-10-18 14:41:08

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


leif
2017-10-18 14:41:22
(regexp-replace*
 #rx" now"
 "DrRacket's Program Countour is now significantly more efficient;
using it now no longer hurts DrRacket's interactivity now"
 "")

robby
2017-10-18 14:43:28

:slightly_smiling_face:


robby
2017-10-18 14:43:39

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


ben
2017-10-18 15:08:48

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


samth
2017-10-18 15:12:24

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


dustin
2017-10-18 15:38:05

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
2017-10-18 15:58:37

@ed has joined the channel


leafac
2017-10-18 16:41:52

@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.


leif
2017-10-18 16:52:38

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?


leif
2017-10-18 16:52:57

leif
2017-10-18 16:53:27

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


leif
2017-10-18 16:53:41

Specifically:


samth
2017-10-18 16:54:46

I don’t see any footnotes there


leif
2017-10-18 16:55:52

@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.


leif
2017-10-18 16:56:04

Right above the copyright notice.


samth
2017-10-18 16:56:28

Not sure I would call that a footnote, but sure


samth
2017-10-18 16:56:32

and yes, that’s part of the template


leif
2017-10-18 16:56:43

Okay, what would you call it?


samth
2017-10-18 16:57:37

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


samth
2017-10-18 16:57:56

You could certainly complain to the PACM people about it


leif
2017-10-18 16:58:34

Fair


leif
2017-10-18 16:58:57

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.


leif
2017-10-18 16:59:04

Anyway, thanks.


dustin
2017-10-18 17:03:34

@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


leif
2017-10-18 17:05:15

@dustin I would recommend against that.


leif
2017-10-18 17:05:21

(Using software foundations)


leif
2017-10-18 17:06:05

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


leif
2017-10-18 17:06:49

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


leif
2017-10-18 17:06:52

But I could always be wrong. :slightly_smiling_face:


dustin
2017-10-18 17:10:10

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.


apg
2017-10-18 17:16:22

@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.


dustin
2017-10-18 17:17:54

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!


royall
2017-10-18 20:11:19

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?


pnwamk
2017-10-18 21:01:35

@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?


apg
2017-10-18 21:32:31

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


royall
2017-10-18 21:34:54

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


royall
2017-10-18 21:35:43

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


apg
2017-10-18 21:38:51

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


apg
2017-10-18 21:39:22

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


greg
2017-10-18 21:40:55

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.


greg
2017-10-18 21:41:02

There was also some discussion on the mailing list


royall
2017-10-18 21:41:04

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



greg
2017-10-18 21:41:42

That was about using submodules to expose alternate interfaces


greg
2017-10-18 21:42:12

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


apg
2017-10-18 21:42:47

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


apg
2017-10-18 21:43:22

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


greg
2017-10-18 21:44:18

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?


royall
2017-10-18 21:44:54

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


greg
2017-10-18 21:51:43

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:



pnwamk
2017-10-18 23:21:51

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


pnwamk
2017-10-18 23:22:06

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


pnwamk
2017-10-18 23:23:01

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


jaz
2017-10-18 23:26:42

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


jaz
2017-10-18 23:29:32

hm, that didn’t seem to work.


jaz
2017-10-18 23:30:34

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


pnwamk
2017-10-18 23:31:28

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


mflatt
2017-10-18 23:31:48

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



pnwamk
2017-10-18 23:32:55

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


mflatt
2017-10-18 23:34:18

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).


jaz
2017-10-18 23:36:25

yeah, that works


pnwamk
2017-10-19 00:08:24

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


notjack
2017-10-19 00:09:09

raco pkg catalog-archive I think


notjack
2017-10-19 00:09:38

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


pnwamk
2017-10-19 00:14:28

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


dustin
2017-10-19 00:27:19

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.


notjack
2017-10-19 00:30:24

@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)


dustin
2017-10-19 00:31:38

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


notjack
2017-10-19 00:32:40

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


notjack
2017-10-19 00:33:02

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


dustin
2017-10-19 00:37:46

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


notjack
2017-10-19 00:39:31

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


dustin
2017-10-19 00:44:00

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


notjack
2017-10-19 00:44:22

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


dustin
2017-10-19 00:46:10

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


dustin
2017-10-19 00:47:56

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


notjack
2017-10-19 00:48:35

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


notjack
2017-10-19 00:48:41

but the semantics are pretty much haskell 98


notjack
2017-10-19 00:48:59

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


dustin
2017-10-19 00:50:14

Sounds very cool.


notjack
2017-10-19 00:50:50

it is indeed incredibly cool


dustin
2017-10-19 00:54:26

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!


notjack
2017-10-19 00:55:13

$PATH frustrates me in general


dustin
2017-10-19 00:55:48

Thought it was only me..


notjack
2017-10-19 00:56:54

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


dustin
2017-10-19 00:59:56

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


dustin
2017-10-19 01:05:33

https://i.imgur.com/wQAR8Y0.jpg

Was excited to get this today.


notjack
2017-10-19 01:09:39

I’ve heard good things :)


pnwamk
2017-10-19 01:28:14

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



pnwamk
2017-10-19 01:28:31

I used 30GB of swap space doing so…


pnwamk
2017-10-19 01:29:10

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


notjack
2017-10-19 01:30:51

each file is relatively small I assume?


pnwamk
2017-10-19 01:30:59

yah


pnwamk
2017-10-19 01:31:17

well… all the racket files from the package server…


notjack
2017-10-19 01:31:24

ah gotcha


pnwamk
2017-10-19 01:31:43

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


pnwamk
2017-10-19 01:32:29
I wasn’t expecting my code to win any races… but I’m a little puzzled why it’s bringing my OS to a halt =

notjack
2017-10-19 01:32:59

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


pnwamk
2017-10-19 01:33:09

let me try…


pnwamk
2017-10-19 01:34:26

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


pnwamk
2017-10-19 01:34:32

thanks again @notjack! :smiley:


notjack
2017-10-19 01:35:02

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


pnwamk
2017-10-19 01:35:18

me neither… more digging! :smiley:


notjack
2017-10-19 01:35:39

testing this with custodian-limit-memory might be interesting


pnwamk
2017-10-19 01:36:03

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


pnwamk
2017-10-19 01:36:08

XD


notjack
2017-10-19 01:36:11

that works too


jaz
2017-10-19 01:47:27

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


notjack
2017-10-19 01:48:30

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


jaz
2017-10-19 01:49:22

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


pnwamk
2017-10-19 01:51:16

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


pnwamk
2017-10-19 02:03:42

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


pnwamk
2017-10-19 02:05:00

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