louis77
2021-2-16 09:04:17

Anyone building plain old webservices with Racket?


anything
2021-2-16 12:11:59

What is a plain old webservice? :sun_with_face:


louis77
2021-2-16 12:16:00

http (not gemini), json, rest-like web apis :slightly_smiling_face:


telepopsound
2021-2-16 14:16:32

@telepopsound has joined the channel


anything
2021-2-16 14:17:17

Oh, I get it now. I had forgotten about those. So, not me. I do run a couple of web services, but they provide JSON strings.


samth
2021-2-16 14:18:49

Yes, there are people who do that (the racket pkg server is an example)


louis77
2021-2-16 15:40:12

As a Racket learning project I “re-created” a little Go web API (which is currently my main bread and butter language).

Go CLOC ~320 (libraries not included) Racket CLOC - first working version ~115, Racket CLOC – 2nd iteration ~70 (no libraries needed)

It was a little painful though. I’m a pragmatic programmer, don’t come from an academic background. I’m now assessing the readablility of my code for others.


samth
2021-2-16 15:41:37

can you share your code?


popa.bogdanp
2021-2-16 15:42:02


louis77
2021-2-16 15:43:27

But these are really my first baby-steps in Racket (or any Lisp-dialect), so please be forgiving :slightly_smiling_face:


louis77
2021-2-16 15:45:00

Good read, thanks! It’ll certainly help.


louis77
2021-2-16 15:49:47

Now I’m going to host that somewhere on a PaaS. Docker is the way to go I assume. Or does anyone have experiences with Heroku buildpacks?


popa.bogdanp
2021-2-16 15:51:39

Plugging another one of my articles: https://defn.io/2020/06/28/racket-deployment/


popa.bogdanp
2021-2-16 15:53:25

There are also official Docker images: https://hub.docker.com/r/racket/racket and, although I prefer the approach in the article, Docker’s probably going to be the quickest way to get it done


louis77
2021-2-16 15:53:57

You mean you prefer the put an executable on a host way?


popa.bogdanp
2021-2-16 15:54:02

Yeah


louis77
2021-2-16 15:54:25

Yes, it’s quick and easy to do that on a DO droplet


louis77
2021-2-16 15:54:41

Looks like you have quite some stuff running in Racket


louis77
2021-2-16 15:56:08

ah you are the author of koyo… I’ll have a look at that


popa.bogdanp
2021-2-16 15:56:09

Yup :smile:. I tend to build exes/distributions even when I use Docker. An example:

https://github.com/MarcKaufmann/congame/blob/694e5bbeb9e2e5b0fd3a58712aa6e887bcc06315/Dockerfile#L1-L41


louis77
2021-2-16 16:00:15

that dockerfile looks very straightforward


louis77
2021-2-16 16:00:23

i’ll give it a try


louis77
2021-2-16 16:01:14

for the next bigger project I’ll probably try koyo, looks like there is everything included I need, json, job queue, database etc.