carl.morris.world
2019-5-27 11:11:37

Thanks! That looks like it should do the trick.


jimmysnielsen
2019-5-27 13:03:06

does Racket have any packages for project planning? Like MS Project - just better :wink:


greg
2019-5-27 13:56:00

Maybe at RacketCon someone could say a word or two about this: https://github.com/racket/racket/issues/1570


greg
2019-5-27 13:57:53

It occurred to me yesterday, oh, I wonder if this is discouraged by the Software Freedom Conservancy? But I don’t know enough to know if that even makes sense.


greg
2019-5-27 13:58:28

(I don’t have any urgent use-case for a new license. Just wondering.)


carl.morris.world
2019-5-27 17:46:00

I couldn’t figure out how to make local-expand work. Here’s a pared down use case:

#lang racket/base

;; Library Code
(module minimal racket/base
  (define times-2? (make-parameter #f))
  (define-namespace-anchor ns)
  (define-syntax data
    (syntax-rules ()
      [(data x ...) (if (times-2?)
                        (list (* 2 x) ...)
                        (list x ...))]))
  (define (read-data my-data #:times-2? [t2? #f])
    (parameterize ([times-2? t2?])
      (eval my-data (namespace-anchor->namespace ns))))
  (provide read-data))

;; User Code
(require 'minimal)
(read-data '(data 1 2 3))

carl.morris.world
2019-5-27 17:47:37

In the end, the eval approach with parameterize seems like an okay pattern.


carl.morris.world
2019-5-27 23:50:46

That sounds like a cool idea. I’d wondered whether such a thing might be possible, but I don’t know any JavaScript. Would the idea be to transpile to JavaScript kinda like ClojureScript?


todo
2019-5-27 23:59:39

What’s the current state of the art for Racket on AWS Lambda? I’ve managed to do Kotlin/Clojure/Rust on AWS Lambda and am seriously considering trying Racket as well. Can DrRacket provide a musl-libc binary?


greg
2019-5-28 00:30:29

@todo Although I haven’t tried it myself I know about https://github.com/lambrospetrou/aws-lambda-binary described in https://www.lambrospetrou.com/articles/aws-lambda-meets-racket/ If you know another or better way to do it based on your experience with other langs, I’m sure folks would be interested to learn more.


todo
2019-5-28 00:38:17

My understanding of AWS is a bit out dated (so what AWS supports should be a super set of what I write here). There used to be support for Python, NodeJS, JVM, Go. The “Go support” was just some binary + an RPC — and some managed to get Rust supported unofficially by mimicking the Go RPC.

Currently, there’s ‘official’ support via https://aws.amazon.com/blogs/opensource/rust-runtime-for-aws-lambda/ (which has worked great for me), but requires special compilation to link via musl libc instead of glibc for some reason.

The question is — what is the ‘runtime’ requirement of racket?It’s not JS, it’s not JVM … it’s chez scheme?


greg
2019-5-28 00:50:29

It’s not chez. It’s Racket’s own VM.


greg
2019-5-28 00:50:53

This older/simpler post post by someone else (referenced in the later one) explains it more simply: http://www.dbrunner.net/2015/08/27/running-racket-on-aws-lambda/


greg
2019-5-28 00:51:38

IIUC TL;DR you raco exe your Racket program, put that and some shim js in a zip file, and upload it to aws lambda.


greg
2019-5-28 00:51:43

@todo ^


todo
2019-5-28 01:07:41

lol, looks like they are using the NodeJS FFI to call racket


greg
2019-5-28 02:25:35

The latter post talks about using node to start a racket process — then simply pipes to/from it. IIUC one could use python instead of node. I agree both are sort of weird. Ask Amazon why they don’t provide a way to pipe directly to a proc in any lang that can use stdin and stdout.

But if they did… they’d probably implement it in one of {node python java}, so… I think the important system design principle here is the usual one: Computers suck and programming in the real world is usually stupid. ¯_(ツ)_/¯


joelmccracken
2019-5-28 02:32:16

Does anyone have any advice on how to process an xexpr doc? I’m thinking of recursively calling a function and using match to decompose it, but idk i feel like there should be a better way


sorawee
2019-5-28 02:55:36

In Pollen, there’re decoders that traverse the xexpr tree for you



todo
2019-5-28 05:57:44

Is there a way to get https://docs.racket-lang.org/guide/ as a pdf? Sometimes, for deep reading, I prefer paper so I can scribble in the margins.


todo
2019-5-28 05:58:29

Whereas ipad reading = clicking on links = somehow watching funny cats on youtube