
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:

Hello

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

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

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

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:

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

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

@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

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

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!

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

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

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

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

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

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

Also, like, the Docs are really nice.

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

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

@lexi.lambda almost definitely

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

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

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

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

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.

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

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?

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

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

ill have to see if it still does that

do you have a rule that is behaving unexpectedly?

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

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

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

all that is done in the turnstile macros

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

yes that is the idea

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

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

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

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

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

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

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

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

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

yeah, that sounds like something I would do ;)

@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

specifically, the “mlish” or “infer” langs

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

but it doesnt do anything fancy

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