githree
2017-1-27 11:47:28

I just had DrRacket crash - with none of activity on my side, no file open - it was just running for few hours here was the console message:


nlightnfotis
2017-1-27 15:16:15

Hello


nlightnfotis
2017-1-27 15:16:56

Have you ever used racket in a computational science/data science project? If so, what did you like about Racket in such a role?


robby
2017-1-27 17:31:11

@githree that kind of error (one that involves #<bad-value> usually means some earlier memory corruption happened and the actual bug was sometime earlier. It may be in your own code if you’re doing something involving functions with the word unsafe in them. If not, then all I can offer is the suggestion to keep an eye on what you’re doing and see if you can make it happen on your command and then get back in touch.


githree
2017-1-27 17:34:19

Thanks @robby , after upgrading to 6.8 the only thing I did was to copy packages from previous version - one of the package installation must have caused the memory corruption


jerryj
2017-1-27 18:08:30

How do I tell a (process "cmd") call that I’m done sending data to it’s stdin? EOF doesn’t work in racket or the command line, but doing a cat data \| cmd works at the command line. I don’t know how to tell it that I’m done sending it data :confused:


jerryj
2017-1-27 18:09:49

(i’m trying to drive this code formatter using the hyphen option, i could also write the file to disk then call the formatter externally i guess https://github.com/google/google-java-format)


lexi.lambda
2017-1-27 18:16:43

@jerryj: Try using close-output-port on the port corresponding to stdin?


jerryj
2017-1-27 18:19:34

@lexi.lambda no dice, tried closing all the ports after writing some input and attempting to read the output — when runnin in the shell, ^D doesn’t end the stdin entry in the terminal like I’d expect it to either. i’m on windows so maybe that is the problem hehe


lexi.lambda
2017-1-27 18:20:30

if you closed all the ports then you obviously wouldn’t be able to read the output :p


jerryj
2017-1-27 18:22:17

OH haha I closed them all at the end of work, I need to write, close the input, THEN try to read. gotcha, I’ll try that, thanks!


jerryj
2017-1-27 18:26:55

@lexi.lambda yup that fixed it :slightly_smiling_face: thanks again!


asumu
2017-1-27 18:56:49

@nlightnfotis : you may be interested in this blog post https://khinsen.wordpress.com/2014/05/10/exploring-racket/


asumu
2017-1-27 18:57:13

(tl;dr is probably “Racket isn’t there yet” for computational science, but maybe it could with a few more libraries)


asumu
2017-1-27 18:57:59

(I think we’re missing, for example, good tools to read in and organize data in tables—like HDF5 facilities and a pandas/R style data tables library)


recon419
2017-1-27 19:06:27

@abmclin I am getting into procedural content generation research and CL doesn’t have the right libraries to support that (or so I am told by people who know more than I do). I was told by my research advisor that Racket might be the easiest transition for me because I love Lisp, and that it has a lot of better research libraries. Also, I then talked to the Racketeers here (Spencer, Vinsenz, and a bunch of others whose names I am still learning because I just met them like two days ago) and they have been making my head hurt in a good way since then, which is always a good sign. I’m still very new to Racket but it seems logical so far.


recon419
2017-1-27 19:07:57

I have decided it is a big plus to be able to hollar down the hall, “Hey, how does ______ work?” and get the authoritative answer XD


recon419
2017-1-27 19:08:31

Also, like, the Docs are really nice.


githree
2017-1-27 19:21:54

@nlightnfotis @asumu With regards to R dataframe like library - there is https://pkgn.racket-lang.org/package/munger which is the closest I can think of, unfortunately there is no documentation available for the package.


lexi.lambda
2017-1-27 19:28:53

@stchang: I’ve been curious about asking this for a little while now… could turnstile use syntax-local-expand-expression instead of local-expand to improve performance due to the excessive uses of recursive expansion?


stchang
2017-1-27 19:32:23

@lexi.lambda almost definitely


stchang
2017-1-27 19:33:16

we have not spent much time on performance because it’s mostly been “good enough” for our purposes


stchang
2017-1-27 19:33:52

but it is something I’ve recently begun to look at


lexi.lambda
2017-1-27 19:35:03

yeah, that makes sense. I haven’t really encountered performance issues for stuff I’ve tried so far (as long as the language definition is compiled, of course), but I was wondering if that would help


stchang
2017-1-27 19:35:49

yes, syntax-local-expand-expression is a great suggestion actually. ive experimented with my own “caching” but forgot that s-l-e-e existed


lexi.lambda
2017-1-27 19:36:46

also, as a quick question, how does turnstile implement ⇐ in non-DSL syntax? specifically, how does it emulate switching from synthesis mode to typechecking mode? the paper mentions that it attaches a syntax property before calling local-expand, but I was peeking at the code and couldn’t trace exactly how that property got added and was subsequently used.


stchang
2017-1-27 19:38:06

by default, it implements ⇐ by synthesizing the type and calling current-typecheck-relation


lexi.lambda
2017-1-27 19:39:20

it seems to be more magical than that, though? since it seems to “propagate” that annotation into child expressions. does infer make use of properties attached to the syntax prior to expansion in some way?


lexi.lambda
2017-1-27 19:40:03

that is, using ⇐ in some parent macro prevents ⇒ from complaining about needing more annotations in a child expression.


stchang
2017-1-27 19:43:14

at some point the implementation did something somewhat weird in that it attached a type before expanding, possibly overwrote it, and then checked if the two matched


stchang
2017-1-27 19:43:52

ill have to see if it still does that


stchang
2017-1-27 19:44:02

do you have a rule that is behaving unexpectedly?


lexi.lambda
2017-1-27 19:44:57

no, my rule is working well! I’m just not sure why ;)


lexi.lambda
2017-1-27 19:45:53

let me come up with a tiny example to demonstrate the behavior I’m talking about


stchang
2017-1-27 19:46:25

ok :slightly_smiling_face: infer should not look at the expected type


stchang
2017-1-27 19:46:38

all that is done in the turnstile macros


lexi.lambda
2017-1-27 19:48:07

oh, I think I see… having a clause with a before the just looks at that property attached by ?


stchang
2017-1-27 19:48:45

yes that is the idea


lexi.lambda
2017-1-27 19:49:46

ok, that makes sense, and it’s much less magical than it feels :)


lexi.lambda
2017-1-27 19:50:06

I’m mostly just trying to completely understand what every piece of the Turnstile DSL translates to


lexi.lambda
2017-1-27 19:50:15

and I think I have a pretty good grasp at this point


stchang
2017-1-27 19:53:32

great. the easiest way to think about it might be to view <= as corresponding to type information that is known and attached before expansion, and is propagated downwards into subterms


stchang
2017-1-27 19:53:51

and => as type information that is computed, and is known after expansion, and gets propagated upwards


lexi.lambda
2017-1-27 19:54:27

yeah, I understood that in an intuitive sense (and in the bidirectional typechecking sense), but I just didn’t know exactly what that corresponded to in a macroexpansion sense


stchang
2017-1-27 19:55:04

and turnstile does some some consistency checking after expanding to make sure the pre and post expansion type information dont conflict


lexi.lambda
2017-1-27 19:55:40

yeah, I saw that when inspecting the turnstile source, and I think I’ve experienced that error at some point myself, though I don’t remember exactly how


stchang
2017-1-27 19:56:29

you would have to be manipulating the stx objs at the racket level


lexi.lambda
2017-1-27 19:57:18

yeah, that sounds like something I would do ;)


stchang
2017-1-27 20:05:44

@lexi.lambda if you want to see use of the “expected types” without the turnstile abstractions, you can take a look at examples in the macrotypes collection in our repository


stchang
2017-1-27 20:06:12

specifically, the “mlish” or “infer” langs


lexi.lambda
2017-1-27 20:06:35

is it just doing something effectively equivalent to #:fail-unless (syntax-property this-syntax ':) "no expected type"?


stchang
2017-1-27 20:06:55

but it doesnt do anything fancy


stchang
2017-1-27 20:07:13

yes, typically, there’s a case that’s exactly that