Live data from Hacker News

Systems Programming with Racket

docs.racket-lang.org

1–10 of 24 posts

Re: Systems Programming with Racket

#4
I've been working on porting golang's net/http and gorilla/websocket libs to Racket for the past few months (I don't like the servelet model.) Does anyone have insight into how that model might not be optimal in a Scheme enviroment or how to better optimize it?

Re: Systems Programming with Racket

#5
post #4

I've been working on porting golang's net/http and gorilla/websocket libs to Racket for the past few months (I don't like the servelet model.) Does anyone have insight into how that model might not be optimal in a Scheme enviroment or how to better optimize it?

I'm using the Racket webserver, but each page is it own rkt file. I'm using no continuations, just storing and reading everything in the hard disk. (I'm not sure it's optimal, but I prefer that approach.)

Re: Systems Programming with Racket

#6
Instead of that `xml` library and format, many people use the SXML format defined by Oleg Kiselyov:

https://docs.racket-lang.org/sxml-intro/

SXML became the de facto standard in the Scheme community after Oleg and others developed some powerful libraries for it, starting with Oleg's SSAX parser. SXML is also better-suited to efficient manipulation of large HTML/XML when using immutable lists.

Also, if you're looking at code examples in TFA, and thinking that, even when composing HTML using lists rather than strings, it's still susceptible to injection programming errors, then one SXML-ish improvement is:

https://docs.racket-lang.org/html-template/

https://docs.racket-lang.org/rws-html-template/

Re: Systems Programming with Racket

#7
post #4

I've been working on porting golang's net/http and gorilla/websocket libs to Racket for the past few months (I don't like the servelet model.) Does anyone have insight into how that model might not be optimal in a Scheme enviroment or how to better optimize it?

Huh, I've actually been doing the same. Is your project public yet?

Are you stating with RFC 6455's implementation and just changing the API or trying to approximate the implementations?

Re: Systems Programming with Racket

#8
post #4

I've been working on porting golang's net/http and gorilla/websocket libs to Racket for the past few months (I don't like the servelet model.) Does anyone have insight into how that model might not be optimal in a Scheme enviroment or how to better optimize it?

I'm using the Racket webserver, but each page is it own rkt file. I'm using no continuations, just storing and reading everything in the hard disk. (I'm not sure it's optimal, but I prefer that approach.)

Interesting. Do you have a viewable page example?

Re: Systems Programming with Racket

#10
Realistically, how much data is it practical to stash inside these continuations? It seems like it could get out of hand quite quickly for non-toy examples.

If you were propagating e.g. game state, you'd still want to stick that in a db, so the continuation would just be a session id?

Post reply on HN